-WCF.Conversation={},WCF.Conversation.EditorHandler=Class.extend({_attributes:{},_conversations:{},_permissions:{},init:function(availableLabels){this._conversations={};var self=this;$(".conversation").each((function(index,conversation){var $labelIDs,$conversation=$(conversation),$conversationID=$conversation.data("conversationID");self._conversations[$conversationID]||(self._conversations[$conversationID]=$conversation,$labelIDs=eval($conversation.data("labelIDs")),self._attributes[$conversationID]={isClosed:!!$conversation.data("isClosed"),labelIDs:$labelIDs},self._permissions[$conversationID]={canAddParticipants:!!$conversation.data("canAddParticipants"),canCloseConversation:!!$conversation.data("canCloseConversation")})}))},getPermission:function(e,a){return void 0!==this._permissions[e][a]&&!!this._permissions[e][a]},getValue:function(e,a){switch(a){case"labelIDs":return void 0===this._attributes[e].labelIDs&&(this._attributes[e].labelIDs=[]),this._attributes[e].labelIDs;case"isClosed":return!!this._attributes[e].isClosed}},countAvailableLabels:function(){return this.getAvailableLabels().length},getAvailableLabels:function(){var e=[];return WCF.Dropdown.getDropdownMenu("conversationLabelFilter").children(".scrollableDropdownMenu").children("li").each((function(a,t){var n,s=$(t);if(s.hasClass("dropdownDivider"))return!1;n=s.find("span"),e.push({cssClassName:n.data("cssClassName"),labelID:n.data("labelID"),label:n.text()})})),e},update:function(e,a,t){var n,s,i,o,l,r;if(this._conversations[e]){switch(n=this._conversations[e],a){case"close":$('<li><span class="icon icon16 fa-lock jsTooltip jsIconLock" title="'+WCF.Language.get("wcf.global.state.closed")+'" /></li>').prependTo(n.find(".statusIcons")),this._attributes[e].isClosed=1;break;case"labelIDs":if(s={},WCF.Dropdown.getDropdownMenu("conversationLabelFilter").find("li > a > span").each((function(e,a){var t=$(a);s[t.data("labelID")]={cssClassName:t.data("cssClassName"),label:t.text(),url:t.parent().attr("href")}})),i=n.find(".columnSubject > .labelList"),t.length)for(i.length||(i=$('<ul class="labelList" />').prependTo(n.find(".columnSubject"))),i.empty(),o=0,l=t.length;o<l;o++)r=s[t[o]],$('<li><a href="'+r.url+'" class="badge label'+(r.cssClassName?" "+r.cssClassName:"")+'">'+WCF.String.escapeHTML(r.label)+"</a></li>").appendTo(i);else i.length&&i.remove();break;case"open":n.find(".statusIcons li").each((function(e,a){var t=$(a);if(t.children("span.jsIconLock").length)return t.remove(),!1})),this._attributes[e].isClosed=0}WCF.Clipboard.reload()}else console.debug("[WCF.Conversation.EditorHandler] Unknown conversation id '"+e+"'")}}),WCF.Conversation.EditorHandlerConversation=WCF.Conversation.EditorHandler.extend({_availableLabels:null,init:function(e){this._availableLabels=e||[],this._super()},getAvailableLabels:function(){return this._availableLabels},update:function(e,a,t){var n,s,i,o;if(this._conversations[e])switch(n=$(".contentHeaderTitle > .contentHeaderMetaData"),a){case"close":$('<li><span class="icon icon16 fa-lock jsIconLock" /> '+WCF.Language.get("wcf.global.state.closed")+"</li>").appendTo(n),this._attributes[e].isClosed=1;break;case"labelIDs":s=n.find(".labelList"),t.length?(i=this.getAvailableLabels(),s.length||(s=(s=$('<li><span class="icon icon16 fa-tags"></span> <ul class="labelList"></ul></li>').prependTo(n)).children("ul")),o="",t.forEach((function(e){i.forEach((function(a){a.labelID==e&&(o+='<li><span class="label badge'+(a.cssClassName?" "+a.cssClassName:"")+'">'+a.label+"</span></li>")}))})),s[0].innerHTML=o):s.parent().remove();break;case"open":n.find(".jsIconLock").parent().remove(),this._attributes[e].isClosed=0}else console.debug("[WCF.Conversation.EditorHandler] Unknown conversation id '"+e+"'")}}),WCF.Conversation.Clipboard=Class.extend({_editorHandler:null,init:function(e){this._editorHandler=e,WCF.System.Event.addListener("com.woltlab.wcf.clipboard","com.woltlab.wcf.conversation.conversation",function(e){null===e.responseData?this._execute(e.data.actionName,e.data.parameters):this._evaluateResponse(e.data.actionName,e.responseData)}.bind(this))},_execute:function(e,a){"com.woltlab.wcf.conversation.conversation.assignLabel"===e&&new WCF.Conversation.Label.Editor(this._editorHandler,null,a.objectIDs)},_evaluateResponse:function(e,a){var t,n;switch(e){case"com.woltlab.wcf.conversation.conversation.leave":case"com.woltlab.wcf.conversation.conversation.leavePermanently":case"com.woltlab.wcf.conversation.conversation.markAsRead":case"com.woltlab.wcf.conversation.conversation.restore":window.location.reload();break;case"com.woltlab.wcf.conversation.conversation.close":case"com.woltlab.wcf.conversation.conversation.open":for(t in a.returnValues.conversationData)a.returnValues.conversationData.hasOwnProperty(t)&&(n=a.returnValues.conversationData[t],this._editorHandler.update(t,n.isClosed?"close":"open",n))}}}),WCF.Conversation.InlineEditor=WCF.InlineEditor.extend({_editorHandler:null,_environment:"conversation",_setOptions:function(){this._options=[{label:WCF.Language.get("wcf.conversation.edit.subject"),optionName:"editSubject"},{label:WCF.Language.get("wcf.conversation.edit.close"),optionName:"close"},{label:WCF.Language.get("wcf.conversation.edit.open"),optionName:"open"},{label:WCF.Language.get("wcf.conversation.edit.assignLabel"),optionName:"assignLabel"},{optionName:"divider"},{label:WCF.Language.get("wcf.conversation.edit.addParticipants"),optionName:"addParticipants"},{label:WCF.Language.get("wcf.conversation.edit.leave"),optionName:"leave"},{label:WCF.Language.get("wcf.global.button.edit"),optionName:"edit",isQuickOption:!0}]},setEditorHandler:function(e,a){this._editorHandler=e,this._environment="list"==a?"list":"conversation"},_getTriggerElement:function(e){return e.find(".jsConversationInlineEditor")},_validate:function(e,a){var t=$("#"+e).data("conversationID");switch(a){case"addParticipants":return this._editorHandler.getPermission(t,"canAddParticipants");case"assignLabel":return!!this._editorHandler.countAvailableLabels();case"editSubject":return!!this._editorHandler.getPermission(t,"canCloseConversation");case"close":case"open":return!!this._editorHandler.getPermission(t,"canCloseConversation")&&("close"===a?!this._editorHandler.getValue(t,"isClosed"):this._editorHandler.getValue(t,"isClosed"));case"leave":return!0;case"edit":return!!$("#"+e).data("isDraft")}return!1},_execute:function(e,a){if(!this._validate(e,a))return!1;switch(a){case"addParticipants":require(["WoltLabSuite/Core/Conversation/Ui/Participant/Add"],(function(a){new a(elData(elById(e),"conversation-id"))}));break;case"assignLabel":new WCF.Conversation.Label.Editor(this._editorHandler,e);break;case"editSubject":require(["WoltLabSuite/Core/Conversation/Ui/Subject/Editor"],(function(a){a.beginEdit(elData(elById(e),"conversation-id"))}));break;case"close":case"open":this._updateConversation(e,a,{isClosed:"close"===a?1:0});break;case"leave":new WCF.Conversation.Leave([$("#"+e).data("conversationID")],this._environment);break;case"edit":window.location=this._getTriggerElement($("#"+e)).prop("href")}},_updateConversation:function(e,a,t){var n=this._elements[e].data("conversationID");switch(a){case"close":case"editSubject":case"open":this._updateData.push({elementID:e,optionName:a,data:t}),this._proxy.setOption("data",{actionName:a,className:"wcf\\data\\conversation\\ConversationAction",objectIDs:[n]}),this._proxy.sendRequest()}},_updateState:function(){var e,a,t,n;for(e=0,a=this._updateData.length;e<a;e++)switch(t=this._updateData[e],n=this._elements[t.elementID].data("conversationID"),t.optionName){case"close":case"editSubject":case"open":this._editorHandler.update(n,t.optionName,t.data)}}}),WCF.Conversation.Leave=Class.extend({_conversationIDs:[],_dialog:null,_environment:"",_proxy:null,init:function(e,a){this._conversationIDs=e,this._dialog=null,this._environment=a,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._loadDialog()},_loadDialog:function(){this._proxy.setOption("data",{actionName:"getLeaveForm",className:"wcf\\data\\conversation\\ConversationAction",objectIDs:this._conversationIDs}),this._proxy.sendRequest()},_success:function(e,a,t){switch(e.returnValues.actionName){case"getLeaveForm":this._showDialog(e);break;case"hideConversation":"conversation"===this._environment?window.location=e.returnValues.redirectURL:window.location.reload()}},_showDialog:function(e){null===this._dialog&&(this._dialog=$("#leaveDialog"),this._dialog.length||(this._dialog=$('<div id="leaveDialog" />').hide().appendTo(document.body))),this._dialog.html(e.returnValues.template),this._dialog.wcfDialog({title:WCF.Language.get("wcf.conversation.leave.title")}),this._dialog.wcfDialog("render"),this._dialog.find("#hideConversation").click($.proxy(this._click,this))},_click:function(){var e=this._dialog.find("input[type=radio]:checked");1===e.length&&(this._proxy.setOption("data",{actionName:"hideConversation",className:"wcf\\data\\conversation\\ConversationAction",objectIDs:this._conversationIDs,parameters:{hideConversation:e.val()}}),this._proxy.sendRequest())}}),WCF.Conversation.RemoveParticipant=WCF.Action.Delete.extend({_conversationID:0,init:function(e){this._conversationID=e,this._super("wcf\\data\\conversation\\ConversationAction",".jsParticipant")},_sendRequest:function(e){this.proxy.setOption("data",{actionName:"removeParticipant",className:this._className,objectIDs:[this._conversationID],parameters:{userID:$(e).data("objectID")}}),this.proxy.sendRequest()},_success:function(e,a,t){var n,s,i=e.returnValues.userID;for(n in this._containers)(s=$("#"+this._containers[n])).find(".jsDeleteButton").data("objectID")==i&&(s.find(".userLink").addClass("conversationLeft"),s.find(".jsDeleteButton").remove())}}),WCF.Conversation.Label={},WCF.Conversation.Label.Editor=Class.extend({_conversationIDs:0,_dialog:null,_editorHandler:null,_notification:null,_proxy:null,init:function(e,a,t){this._conversationIDs=a?[$("#"+a).data("conversationID")]:t,this._dialog=null,this._editorHandler=e,this._notification=new WCF.System.Notification(WCF.Language.get("wcf.global.success.edit")),this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._loadDialog()},_loadDialog:function(){this._proxy.setOption("data",{actionName:"getLabelForm",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",parameters:{conversationIDs:this._conversationIDs}}),this._proxy.sendRequest()},_success:function(e,a,t){switch(e.returnValues.actionName){case"assignLabel":this._assignLabels(e);break;case"getLabelForm":this._renderDialog(e)}},_renderDialog:function(e){null===this._dialog&&(this._dialog=$("#conversationLabelForm"),this._dialog.length||(this._dialog=$('<div id="conversationLabelForm" />').hide().appendTo(document.body))),this._dialog.html(e.returnValues.template),this._dialog.wcfDialog({title:WCF.Language.get("wcf.conversation.label.assignLabels")}),this._dialog.wcfDialog("render"),$("#assignLabels").click($.proxy(this._save,this))},_save:function(){var e=[];this._dialog.find("input").each((function(a,t){var n=$(t);n.is(":checked")&&e.push(n.data("labelID"))})),this._proxy.setOption("data",{actionName:"assignLabel",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",parameters:{conversationIDs:this._conversationIDs,labelIDs:e}}),this._proxy.sendRequest()},_assignLabels:function(e){for(var a=0,t=this._conversationIDs.length;a<t;a++)this._editorHandler.update(this._conversationIDs[a],"labelIDs",e.returnValues.labelIDs);this._dialog.wcfDialog("close"),this._notification.show()}}),WCF.Conversation.Label.Manager=Class.extend({_deletedLabelID:0,_dialog:null,_labels:null,_link:"",_notification:"",_proxy:null,_maxLabels:0,_labelCount:0,init:function(e){this._deletedLabelID=0,this._maxLabels=0,this._labelCount=0,this._link=e,this._labels=WCF.Dropdown.getDropdownMenu("conversationLabelFilter").children(".scrollableDropdownMenu"),$("#manageLabel").click($.proxy(this._click,this)),this._notification=new WCF.System.Notification(WCF.Language.get("wcf.conversation.label.management.addLabel.success")),this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)})},_click:function(){this._proxy.setOption("data",{actionName:"getLabelManagement",className:"wcf\\data\\conversation\\ConversationAction"}),this._proxy.sendRequest()},_success:function(e,a,t){if(null===this._dialog&&(this._dialog=$('<div id="labelManagement" />').hide().appendTo(document.body)),e.returnValues&&e.returnValues.actionName)switch(e.returnValues.actionName){case"add":this._insertLabel(e);break;case"getLabelManagement":this._maxLabels=parseInt(e.returnValues.maxLabels),this._labelCount=parseInt(e.returnValues.labelCount),this._dialog.empty().html(e.returnValues.template),this._dialog.wcfDialog({title:WCF.Language.get("wcf.conversation.label.management")}),this._dialog.wcfDialog("render"),this._bindListener()}else if(this._deletedLabelID){var n=new RegExp("(\\?|&)labelID="+this._deletedLabelID);window.location=window.location.toString().replace(n,"")}else window.location.reload()},_insertLabel:function(e){var a=$('<li><a href="'+this._link+"&labelID="+e.returnValues.labelID+'"><span class="badge label'+(e.returnValues.cssClassName?" "+e.returnValues.cssClassName:"")+'">'+e.returnValues.label+"</span></a></li>");a.find("a > span").data("labelID",e.returnValues.labelID).data("cssClassName",e.returnValues.cssClassName),this._labels.append(a),this._notification.show(),this._labelCount++,this._labelCount>=this._maxLabels&&$("#conversationLabelManagementForm").hide()},_bindListener:function(){$("#labelName").on("keyup keydown keypress",$.proxy(this._updateLabels,this)),$.browser.mozilla&&$.browser.touch&&$("#labelName").on("input",$.proxy(this._updateLabels,this)),this._labelCount>=this._maxLabels&&($("#conversationLabelManagementForm").hide(),this._dialog.wcfDialog("render")),$("#addLabel").disable().click($.proxy(this._addLabel,this)),$("#editLabel").disable(),this._dialog.find(".conversationLabelList a.label").click($.proxy(this._edit,this))},_edit:function(e){var a,t,n;this._labelCount>=this._maxLabels&&($("#conversationLabelManagementForm").show(),this._dialog.wcfDialog("render")),a=$(e.currentTarget),t=WCF.Language.get("wcf.conversation.label.management.editLabel").replace(/#labelName#/,WCF.String.escapeHTML(a.text())),$("#conversationLabelManagementForm").data("labelID",a.data("labelID")).children(".sectionTitle").html(t),$("#labelName").val(a.text()).trigger("keyup"),n=a.data("cssClassName"),$("#labelManagementList input").each((function(e,a){var t=$(a);t.val()==n&&t.attr("checked","checked")})),$("#addLabel").hide(),$("#editLabel").show().click($.proxy(this._editLabel,this)),$("#deleteLabel").show().click($.proxy(this._deleteLabel,this))},_editLabel:function(){this._proxy.setOption("data",{actionName:"update",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",objectIDs:[$("#conversationLabelManagementForm").data("labelID")],parameters:{data:{cssClassName:$("#labelManagementList input:checked").val(),label:$("#labelName").val()}}}),this._proxy.sendRequest()},_deleteLabel:function(){var e=WCF.Language.get("wcf.conversation.label.management.deleteLabel.confirmMessage").replace(/#labelName#/,$("#labelName").val());WCF.System.Confirmation.show(e,$.proxy((function(e){"confirm"===e&&(this._proxy.setOption("data",{actionName:"delete",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",objectIDs:[$("#conversationLabelManagementForm").data("labelID")]}),this._proxy.sendRequest(),this._deletedLabelID=$("#conversationLabelManagementForm").data("labelID"))}),this),void 0,void 0,!0)},_updateLabels:function(){var e=$.trim($("#labelName").val());e?$("#addLabel, #editLabel").enable():($("#addLabel, #editLabel").disable(),e=WCF.Language.get("wcf.conversation.label.placeholder")),$("#labelManagementList").find("span.label").text(e)},_addLabel:function(){var e=$("#labelName").val(),a=$("#labelManagementList input:checked").val();this._proxy.setOption("data",{actionName:"add",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",parameters:{data:{cssClassName:a,labelName:e}}}),this._proxy.sendRequest(),this._dialog.wcfDialog("close")}}),WCF.Conversation.Preview=WCF.Popover.extend({_proxy:null,init:function(){this._super(".conversationLink"),this._proxy=new WCF.Action.Proxy({showLoadingOverlay:!1}),WCF.DOMNodeInsertedHandler.addCallback("WCF.Conversation.Preview",$.proxy(this._initContainers,this))},_loadContent:function(){var e,a,t=$("#"+this._activeElementID);this._proxy.setOption("data",{actionName:"getMessagePreview",className:"wcf\\data\\conversation\\ConversationAction",objectIDs:[t.data("conversationID")]}),e=this._activeElementID,a=this,this._proxy.setOption("success",(function(t,n,s){a._insertContent(e,t.returnValues.template,!0)})),this._proxy.sendRequest()}}),WCF.Conversation.MarkAsRead=Class.extend({_proxy:null,init:function(){this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),$(document).on("dblclick",".conversationList .new .columnAvatar",$.proxy(this._dblclick,this))},_dblclick:function(e){this._proxy.setOption("data",{actionName:"markAsRead",className:"wcf\\data\\conversation\\ConversationAction",objectIDs:[$(e.currentTarget).parents("ol:eq(0)").data("conversationID")]}),this._proxy.sendRequest()},_success:function(e,a,t){$(".conversationList .new").each((function(a,t){var n=$(t);WCF.inArray(n.data("conversationID"),e.objectIDs)&&(n.removeClass("new"),n.find(".firstNewPost").parent().remove(),n.find(".columnAvatar").off("dblclick"))}))}}),WCF.Conversation.MarkAllAsRead=Class.extend({_proxy:null,init:function(){this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),$(".markAllAsReadButton").click($.proxy(this._click,this))},_click:function(e){e.preventDefault(),this._proxy.setOption("data",{actionName:"markAllAsRead",className:"wcf\\data\\conversation\\ConversationAction"}),this._proxy.sendRequest()},_success:function(e,a,t){WCF.System.Event.fireEvent("com.woltlab.wcf.conversation.userPanel","reset");var n=$(".conversationList");n.find(".new").removeClass("new"),n.find(".columnAvatar").off("dblclick"),(new WCF.System.Notification).show()}}),WCF.Conversation.Message={},WCF.Conversation.Message.InlineEditor=WCF.Message.InlineEditor.extend({init:function(e,a){this._super(e,!0,a)},_getClassName:function(){return"wcf\\data\\conversation\\message\\ConversationMessageAction"}}),WCF.Conversation.Message.QuoteHandler=WCF.Message.Quote.Handler.extend({init:function(e){require(["WoltLabSuite/Core/Conversation/Ui/Message/Quote"],(({UiConversationMessageQuote:a})=>{new a(e)}))}});
\ No newline at end of file
+WCF.Conversation={},WCF.Conversation.EditorHandler=Class.extend({_attributes:{},_conversations:{},_permissions:{},init:function(availableLabels){this._conversations={};var self=this;$(".conversation").each((function(index,conversation){var $labelIDs,$conversation=$(conversation),$conversationID=$conversation.data("conversationID");self._conversations[$conversationID]||(self._conversations[$conversationID]=$conversation,$labelIDs=eval($conversation.data("labelIDs")),self._attributes[$conversationID]={isClosed:!!$conversation.data("isClosed"),labelIDs:$labelIDs},self._permissions[$conversationID]={canAddParticipants:!!$conversation.data("canAddParticipants"),canCloseConversation:!!$conversation.data("canCloseConversation")})}))},getPermission:function(e,a){return void 0!==this._permissions[e][a]&&!!this._permissions[e][a]},getValue:function(e,a){switch(a){case"labelIDs":return void 0===this._attributes[e].labelIDs&&(this._attributes[e].labelIDs=[]),this._attributes[e].labelIDs;case"isClosed":return!!this._attributes[e].isClosed}},countAvailableLabels:function(){return this.getAvailableLabels().length},getAvailableLabels:function(){var e=[];return WCF.Dropdown.getDropdownMenu("conversationLabelFilter").children(".scrollableDropdownMenu").children("li").each((function(a,t){var n,s=$(t);if(s.hasClass("dropdownDivider"))return!1;n=s.find("span"),e.push({cssClassName:n.data("cssClassName"),labelID:n.data("labelID"),label:n.text()})})),e},update:function(e,a,t){var n,s,i,o,l,r;if(this._conversations[e]){switch(n=this._conversations[e],a){case"close":$(`<li>\n\t\t\t\t\t<span class="jsTooltip jsIconLock" title="${WCF.Language.get("wcf.global.state.closed")}">\n\t\t\t\t\t\t<fa-icon size="16" name="lock"></fa-icon>\n\t\t\t\t\t</span>\n\t\t\t\t</li>`).prependTo(n.find(".statusIcons")),this._attributes[e].isClosed=1;break;case"labelIDs":if(s={},WCF.Dropdown.getDropdownMenu("conversationLabelFilter").find("li > a > span").each((function(e,a){var t=$(a);s[t.data("labelID")]={cssClassName:t.data("cssClassName"),label:t.text(),url:t.parent().attr("href")}})),i=n.find(".columnSubject > .labelList"),t.length)for(i.length||(i=$('<ul class="labelList" />').prependTo(n.find(".columnSubject"))),i.empty(),o=0,l=t.length;o<l;o++)r=s[t[o]],$('<li><a href="'+r.url+'" class="badge label'+(r.cssClassName?" "+r.cssClassName:"")+'">'+WCF.String.escapeHTML(r.label)+"</a></li>").appendTo(i);else i.length&&i.remove();break;case"open":n.find(".statusIcons li").each((function(e,a){var t=$(a);if(t.children("span.jsIconLock").length)return t.remove(),!1})),this._attributes[e].isClosed=0}WCF.Clipboard.reload()}else console.debug("[WCF.Conversation.EditorHandler] Unknown conversation id '"+e+"'")}}),WCF.Conversation.EditorHandlerConversation=WCF.Conversation.EditorHandler.extend({_availableLabels:null,init:function(e){this._availableLabels=e||[],this._super()},getAvailableLabels:function(){return this._availableLabels},update:function(e,a,t){var n,s,i,o;if(this._conversations[e])switch(n=$(".contentHeaderTitle > .contentHeaderMetaData"),a){case"close":$(`<li>\n\t\t\t\t\t<fa-icon size="16" name="lock"></fa-icon>\n\t\t\t\t\t${WCF.Language.get("wcf.global.state.closed")}\n\t\t\t\t</li>`).appendTo(n),this._attributes[e].isClosed=1;break;case"labelIDs":s=n.find(".labelList"),t.length?(i=this.getAvailableLabels(),s.length||(s=(s=$('<li>\n\t\t\t\t\t\t\t<fa-icon size="16" name="tags"></fa-icon>\n\t\t\t\t\t\t\t<ul class="labelList"></ul>\n\t\t\t\t\t\t</li>').prependTo(n)).children("ul")),o="",t.forEach((function(e){i.forEach((function(a){a.labelID==e&&(o+='<li><span class="label badge'+(a.cssClassName?" "+a.cssClassName:"")+'">'+a.label+"</span></li>")}))})),s[0].innerHTML=o):s.parent().remove();break;case"open":n.find(".jsIconLock").parent().remove(),this._attributes[e].isClosed=0}else console.debug("[WCF.Conversation.EditorHandler] Unknown conversation id '"+e+"'")}}),WCF.Conversation.Clipboard=Class.extend({_editorHandler:null,init:function(e){this._editorHandler=e,WCF.System.Event.addListener("com.woltlab.wcf.clipboard","com.woltlab.wcf.conversation.conversation",function(e){null===e.responseData?this._execute(e.data.actionName,e.data.parameters):this._evaluateResponse(e.data.actionName,e.responseData)}.bind(this))},_execute:function(e,a){"com.woltlab.wcf.conversation.conversation.assignLabel"===e&&new WCF.Conversation.Label.Editor(this._editorHandler,null,a.objectIDs)},_evaluateResponse:function(e,a){var t,n;switch(e){case"com.woltlab.wcf.conversation.conversation.leave":case"com.woltlab.wcf.conversation.conversation.leavePermanently":case"com.woltlab.wcf.conversation.conversation.markAsRead":case"com.woltlab.wcf.conversation.conversation.restore":window.location.reload();break;case"com.woltlab.wcf.conversation.conversation.close":case"com.woltlab.wcf.conversation.conversation.open":for(t in a.returnValues.conversationData)a.returnValues.conversationData.hasOwnProperty(t)&&(n=a.returnValues.conversationData[t],this._editorHandler.update(t,n.isClosed?"close":"open",n))}}}),WCF.Conversation.InlineEditor=WCF.InlineEditor.extend({_editorHandler:null,_environment:"conversation",_setOptions:function(){this._options=[{label:WCF.Language.get("wcf.conversation.edit.subject"),optionName:"editSubject"},{label:WCF.Language.get("wcf.conversation.edit.close"),optionName:"close"},{label:WCF.Language.get("wcf.conversation.edit.open"),optionName:"open"},{label:WCF.Language.get("wcf.conversation.edit.assignLabel"),optionName:"assignLabel"},{optionName:"divider"},{label:WCF.Language.get("wcf.conversation.edit.addParticipants"),optionName:"addParticipants"},{label:WCF.Language.get("wcf.conversation.edit.leave"),optionName:"leave"},{label:WCF.Language.get("wcf.global.button.edit"),optionName:"edit",isQuickOption:!0}]},setEditorHandler:function(e,a){this._editorHandler=e,this._environment="list"==a?"list":"conversation"},_getTriggerElement:function(e){return e.find(".jsConversationInlineEditor")},_validate:function(e,a){var t=$("#"+e).data("conversationID");switch(a){case"addParticipants":return this._editorHandler.getPermission(t,"canAddParticipants");case"assignLabel":return!!this._editorHandler.countAvailableLabels();case"editSubject":return!!this._editorHandler.getPermission(t,"canCloseConversation");case"close":case"open":return!!this._editorHandler.getPermission(t,"canCloseConversation")&&("close"===a?!this._editorHandler.getValue(t,"isClosed"):this._editorHandler.getValue(t,"isClosed"));case"leave":return!0;case"edit":return!!$("#"+e).data("isDraft")}return!1},_execute:function(e,a){if(!this._validate(e,a))return!1;switch(a){case"addParticipants":require(["WoltLabSuite/Core/Conversation/Ui/Participant/Add"],(function(a){new a(elData(elById(e),"conversation-id"))}));break;case"assignLabel":new WCF.Conversation.Label.Editor(this._editorHandler,e);break;case"editSubject":require(["WoltLabSuite/Core/Conversation/Ui/Subject/Editor"],(function(a){a.beginEdit(elData(elById(e),"conversation-id"))}));break;case"close":case"open":this._updateConversation(e,a,{isClosed:"close"===a?1:0});break;case"leave":new WCF.Conversation.Leave([$("#"+e).data("conversationID")],this._environment);break;case"edit":window.location=this._getTriggerElement($("#"+e)).prop("href")}},_updateConversation:function(e,a,t){var n=this._elements[e].data("conversationID");switch(a){case"close":case"editSubject":case"open":this._updateData.push({elementID:e,optionName:a,data:t}),this._proxy.setOption("data",{actionName:a,className:"wcf\\data\\conversation\\ConversationAction",objectIDs:[n]}),this._proxy.sendRequest()}},_updateState:function(){var e,a,t,n;for(e=0,a=this._updateData.length;e<a;e++)switch(t=this._updateData[e],n=this._elements[t.elementID].data("conversationID"),t.optionName){case"close":case"editSubject":case"open":this._editorHandler.update(n,t.optionName,t.data)}}}),WCF.Conversation.Leave=Class.extend({_conversationIDs:[],_dialog:null,_environment:"",_proxy:null,init:function(e,a){this._conversationIDs=e,this._dialog=null,this._environment=a,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._loadDialog()},_loadDialog:function(){this._proxy.setOption("data",{actionName:"getLeaveForm",className:"wcf\\data\\conversation\\ConversationAction",objectIDs:this._conversationIDs}),this._proxy.sendRequest()},_success:function(e,a,t){switch(e.returnValues.actionName){case"getLeaveForm":this._showDialog(e);break;case"hideConversation":"conversation"===this._environment?window.location=e.returnValues.redirectURL:window.location.reload()}},_showDialog:function(e){null===this._dialog&&(this._dialog=$("#leaveDialog"),this._dialog.length||(this._dialog=$('<div id="leaveDialog" />').hide().appendTo(document.body))),this._dialog.html(e.returnValues.template),this._dialog.wcfDialog({title:WCF.Language.get("wcf.conversation.leave.title")}),this._dialog.wcfDialog("render"),this._dialog.find("#hideConversation").click($.proxy(this._click,this))},_click:function(){var e=this._dialog.find("input[type=radio]:checked");1===e.length&&(this._proxy.setOption("data",{actionName:"hideConversation",className:"wcf\\data\\conversation\\ConversationAction",objectIDs:this._conversationIDs,parameters:{hideConversation:e.val()}}),this._proxy.sendRequest())}}),WCF.Conversation.Label={},WCF.Conversation.Label.Editor=Class.extend({_conversationIDs:0,_dialog:null,_editorHandler:null,_notification:null,_proxy:null,init:function(e,a,t){this._conversationIDs=a?[$("#"+a).data("conversationID")]:t,this._dialog=null,this._editorHandler=e,this._notification=new WCF.System.Notification(WCF.Language.get("wcf.global.success.edit")),this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._loadDialog()},_loadDialog:function(){this._proxy.setOption("data",{actionName:"getLabelForm",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",parameters:{conversationIDs:this._conversationIDs}}),this._proxy.sendRequest()},_success:function(e,a,t){switch(e.returnValues.actionName){case"assignLabel":this._assignLabels(e);break;case"getLabelForm":this._renderDialog(e)}},_renderDialog:function(e){null===this._dialog&&(this._dialog=$("#conversationLabelForm"),this._dialog.length||(this._dialog=$('<div id="conversationLabelForm" />').hide().appendTo(document.body))),this._dialog.html(e.returnValues.template),this._dialog.wcfDialog({title:WCF.Language.get("wcf.conversation.label.assignLabels")}),this._dialog.wcfDialog("render"),$("#assignLabels").click($.proxy(this._save,this))},_save:function(){var e=[];this._dialog.find("input").each((function(a,t){var n=$(t);n.is(":checked")&&e.push(n.data("labelID"))})),this._proxy.setOption("data",{actionName:"assignLabel",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",parameters:{conversationIDs:this._conversationIDs,labelIDs:e}}),this._proxy.sendRequest()},_assignLabels:function(e){for(var a=0,t=this._conversationIDs.length;a<t;a++)this._editorHandler.update(this._conversationIDs[a],"labelIDs",e.returnValues.labelIDs);this._dialog.wcfDialog("close"),this._notification.show()}}),WCF.Conversation.Label.Manager=Class.extend({_deletedLabelID:0,_dialog:null,_labels:null,_link:"",_notification:"",_proxy:null,_maxLabels:0,_labelCount:0,init:function(e){this._deletedLabelID=0,this._maxLabels=0,this._labelCount=0,this._link=e,this._labels=WCF.Dropdown.getDropdownMenu("conversationLabelFilter").children(".scrollableDropdownMenu"),$("#manageLabel").click($.proxy(this._click,this)),this._notification=new WCF.System.Notification(WCF.Language.get("wcf.conversation.label.management.addLabel.success")),this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)})},_click:function(){this._proxy.setOption("data",{actionName:"getLabelManagement",className:"wcf\\data\\conversation\\ConversationAction"}),this._proxy.sendRequest()},_success:function(e,a,t){if(null===this._dialog&&(this._dialog=$('<div id="labelManagement" />').hide().appendTo(document.body)),e.returnValues&&e.returnValues.actionName)switch(e.returnValues.actionName){case"add":this._insertLabel(e);break;case"getLabelManagement":this._maxLabels=parseInt(e.returnValues.maxLabels),this._labelCount=parseInt(e.returnValues.labelCount),this._dialog.empty().html(e.returnValues.template),this._dialog.wcfDialog({title:WCF.Language.get("wcf.conversation.label.management")}),this._dialog.wcfDialog("render"),this._bindListener()}else if(this._deletedLabelID){var n=new RegExp("(\\?|&)labelID="+this._deletedLabelID);window.location=window.location.toString().replace(n,"")}else window.location.reload()},_insertLabel:function(e){var a=$('<li><a href="'+this._link+"&labelID="+e.returnValues.labelID+'"><span class="badge label'+(e.returnValues.cssClassName?" "+e.returnValues.cssClassName:"")+'">'+e.returnValues.label+"</span></a></li>");a.find("a > span").data("labelID",e.returnValues.labelID).data("cssClassName",e.returnValues.cssClassName),this._labels.append(a),this._notification.show(),this._labelCount++,this._labelCount>=this._maxLabels&&$("#conversationLabelManagementForm").hide()},_bindListener:function(){$("#labelName").on("keyup keydown keypress",$.proxy(this._updateLabels,this)),$.browser.mozilla&&$.browser.touch&&$("#labelName").on("input",$.proxy(this._updateLabels,this)),this._labelCount>=this._maxLabels&&($("#conversationLabelManagementForm").hide(),this._dialog.wcfDialog("render")),$("#addLabel").disable().click($.proxy(this._addLabel,this)),$("#editLabel").disable(),this._dialog.find(".conversationLabelList a.label").click($.proxy(this._edit,this))},_edit:function(e){var a,t,n;this._labelCount>=this._maxLabels&&($("#conversationLabelManagementForm").show(),this._dialog.wcfDialog("render")),a=$(e.currentTarget),t=WCF.Language.get("wcf.conversation.label.management.editLabel").replace(/#labelName#/,WCF.String.escapeHTML(a.text())),$("#conversationLabelManagementForm").data("labelID",a.data("labelID")).children(".sectionTitle").html(t),$("#labelName").val(a.text()).trigger("keyup"),n=a.data("cssClassName"),$("#labelManagementList input").each((function(e,a){var t=$(a);t.val()==n&&t.attr("checked","checked")})),$("#addLabel").hide(),$("#editLabel").show().click($.proxy(this._editLabel,this)),$("#deleteLabel").show().click($.proxy(this._deleteLabel,this))},_editLabel:function(){this._proxy.setOption("data",{actionName:"update",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",objectIDs:[$("#conversationLabelManagementForm").data("labelID")],parameters:{data:{cssClassName:$("#labelManagementList input:checked").val(),label:$("#labelName").val()}}}),this._proxy.sendRequest()},_deleteLabel:function(){var e=WCF.Language.get("wcf.conversation.label.management.deleteLabel.confirmMessage").replace(/#labelName#/,$("#labelName").val());WCF.System.Confirmation.show(e,$.proxy((function(e){"confirm"===e&&(this._proxy.setOption("data",{actionName:"delete",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",objectIDs:[$("#conversationLabelManagementForm").data("labelID")]}),this._proxy.sendRequest(),this._deletedLabelID=$("#conversationLabelManagementForm").data("labelID"))}),this),void 0,void 0,!0)},_updateLabels:function(){var e=$.trim($("#labelName").val());e?$("#addLabel, #editLabel").enable():($("#addLabel, #editLabel").disable(),e=WCF.Language.get("wcf.conversation.label.placeholder")),$("#labelManagementList").find("span.label").text(e)},_addLabel:function(){var e=$("#labelName").val(),a=$("#labelManagementList input:checked").val();this._proxy.setOption("data",{actionName:"add",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",parameters:{data:{cssClassName:a,labelName:e}}}),this._proxy.sendRequest(),this._dialog.wcfDialog("close")}}),WCF.Conversation.Message={},WCF.Conversation.Message.InlineEditor=WCF.Message.InlineEditor.extend({init:function(e,a){this._super(e,!0,a)},_getClassName:function(){return"wcf\\data\\conversation\\message\\ConversationMessageAction"}});
\ No newline at end of file
-WCF.Conversation={},WCF.Conversation.EditorHandler=Class.extend({_attributes:{},_conversations:{},_permissions:{},init:function(availableLabels){this._conversations={};var self=this;$(".conversation").each((function(index,conversation){var $labelIDs,$conversation=$(conversation),$conversationID=$conversation.data("conversationID");self._conversations[$conversationID]||(self._conversations[$conversationID]=$conversation,$labelIDs=eval($conversation.data("labelIDs")),self._attributes[$conversationID]={isClosed:!!$conversation.data("isClosed"),labelIDs:$labelIDs},self._permissions[$conversationID]={canAddParticipants:!!$conversation.data("canAddParticipants"),canCloseConversation:!!$conversation.data("canCloseConversation")})}))},getPermission:function(e,a){return void 0!==this._permissions[e][a]&&!!this._permissions[e][a]},getValue:function(e,a){switch(a){case"labelIDs":return void 0===this._attributes[e].labelIDs&&(this._attributes[e].labelIDs=[]),this._attributes[e].labelIDs;case"isClosed":return!!this._attributes[e].isClosed}},countAvailableLabels:function(){return this.getAvailableLabels().length},getAvailableLabels:function(){var e=[];return WCF.Dropdown.getDropdownMenu("conversationLabelFilter").children(".scrollableDropdownMenu").children("li").each((function(a,t){var n,s=$(t);if(s.hasClass("dropdownDivider"))return!1;n=s.find("span"),e.push({cssClassName:n.data("cssClassName"),labelID:n.data("labelID"),label:n.text()})})),e},update:function(e,a,t){var n,s,i,o,l,r;if(this._conversations[e]){switch(n=this._conversations[e],a){case"close":$('<li><span class="icon icon16 fa-lock jsTooltip jsIconLock" title="'+WCF.Language.get("wcf.global.state.closed")+'" /></li>').prependTo(n.find(".statusIcons")),this._attributes[e].isClosed=1;break;case"labelIDs":if(s={},WCF.Dropdown.getDropdownMenu("conversationLabelFilter").find("li > a > span").each((function(e,a){var t=$(a);s[t.data("labelID")]={cssClassName:t.data("cssClassName"),label:t.text(),url:t.parent().attr("href")}})),i=n.find(".columnSubject > .labelList"),t.length)for(i.length||(i=$('<ul class="labelList" />').prependTo(n.find(".columnSubject"))),i.empty(),o=0,l=t.length;o<l;o++)r=s[t[o]],$('<li><a href="'+r.url+'" class="badge label'+(r.cssClassName?" "+r.cssClassName:"")+'">'+WCF.String.escapeHTML(r.label)+"</a></li>").appendTo(i);else i.length&&i.remove();break;case"open":n.find(".statusIcons li").each((function(e,a){var t=$(a);if(t.children("span.jsIconLock").length)return t.remove(),!1})),this._attributes[e].isClosed=0}WCF.Clipboard.reload()}else console.debug("[WCF.Conversation.EditorHandler] Unknown conversation id '"+e+"'")}}),WCF.Conversation.EditorHandlerConversation=WCF.Conversation.EditorHandler.extend({_availableLabels:null,init:function(e){this._availableLabels=e||[],this._super()},getAvailableLabels:function(){return this._availableLabels},update:function(e,a,t){var n,s,i,o;if(this._conversations[e])switch(n=$(".contentHeaderTitle > .contentHeaderMetaData"),a){case"close":$('<li><span class="icon icon16 fa-lock jsIconLock" /> '+WCF.Language.get("wcf.global.state.closed")+"</li>").appendTo(n),this._attributes[e].isClosed=1;break;case"labelIDs":s=n.find(".labelList"),t.length?(i=this.getAvailableLabels(),s.length||(s=(s=$('<li><span class="icon icon16 fa-tags"></span> <ul class="labelList"></ul></li>').prependTo(n)).children("ul")),o="",t.forEach((function(e){i.forEach((function(a){a.labelID==e&&(o+='<li><span class="label badge'+(a.cssClassName?" "+a.cssClassName:"")+'">'+a.label+"</span></li>")}))})),s[0].innerHTML=o):s.parent().remove();break;case"open":n.find(".jsIconLock").parent().remove(),this._attributes[e].isClosed=0}else console.debug("[WCF.Conversation.EditorHandler] Unknown conversation id '"+e+"'")}}),WCF.Conversation.Clipboard=Class.extend({_editorHandler:null,init:function(e){this._editorHandler=e,WCF.System.Event.addListener("com.woltlab.wcf.clipboard","com.woltlab.wcf.conversation.conversation",function(e){null===e.responseData?this._execute(e.data.actionName,e.data.parameters):this._evaluateResponse(e.data.actionName,e.responseData)}.bind(this))},_execute:function(e,a){"com.woltlab.wcf.conversation.conversation.assignLabel"===e&&new WCF.Conversation.Label.Editor(this._editorHandler,null,a.objectIDs)},_evaluateResponse:function(e,a){var t,n;switch(e){case"com.woltlab.wcf.conversation.conversation.leave":case"com.woltlab.wcf.conversation.conversation.leavePermanently":case"com.woltlab.wcf.conversation.conversation.markAsRead":case"com.woltlab.wcf.conversation.conversation.restore":window.location.reload();break;case"com.woltlab.wcf.conversation.conversation.close":case"com.woltlab.wcf.conversation.conversation.open":for(t in a.returnValues.conversationData)a.returnValues.conversationData.hasOwnProperty(t)&&(n=a.returnValues.conversationData[t],this._editorHandler.update(t,n.isClosed?"close":"open",n))}}}),WCF.Conversation.InlineEditor=WCF.InlineEditor.extend({_editorHandler:null,_environment:"conversation",_setOptions:function(){this._options=[{label:WCF.Language.get("wcf.conversation.edit.subject"),optionName:"editSubject"},{label:WCF.Language.get("wcf.conversation.edit.close"),optionName:"close"},{label:WCF.Language.get("wcf.conversation.edit.open"),optionName:"open"},{label:WCF.Language.get("wcf.conversation.edit.assignLabel"),optionName:"assignLabel"},{optionName:"divider"},{label:WCF.Language.get("wcf.conversation.edit.addParticipants"),optionName:"addParticipants"},{label:WCF.Language.get("wcf.conversation.edit.leave"),optionName:"leave"},{label:WCF.Language.get("wcf.global.button.edit"),optionName:"edit",isQuickOption:!0}]},setEditorHandler:function(e,a){this._editorHandler=e,this._environment="list"==a?"list":"conversation"},_getTriggerElement:function(e){return e.find(".jsConversationInlineEditor")},_validate:function(e,a){var t=$("#"+e).data("conversationID");switch(a){case"addParticipants":return this._editorHandler.getPermission(t,"canAddParticipants");case"assignLabel":return!!this._editorHandler.countAvailableLabels();case"editSubject":return!!this._editorHandler.getPermission(t,"canCloseConversation");case"close":case"open":return!!this._editorHandler.getPermission(t,"canCloseConversation")&&("close"===a?!this._editorHandler.getValue(t,"isClosed"):this._editorHandler.getValue(t,"isClosed"));case"leave":return!0;case"edit":return!!$("#"+e).data("isDraft")}return!1},_execute:function(e,a){if(!this._validate(e,a))return!1;switch(a){case"addParticipants":require(["WoltLabSuite/Core/Conversation/Ui/Participant/Add"],(function(a){new a(elData(elById(e),"conversation-id"))}));break;case"assignLabel":new WCF.Conversation.Label.Editor(this._editorHandler,e);break;case"editSubject":require(["WoltLabSuite/Core/Conversation/Ui/Subject/Editor"],(function(a){a.beginEdit(elData(elById(e),"conversation-id"))}));break;case"close":case"open":this._updateConversation(e,a,{isClosed:"close"===a?1:0});break;case"leave":new WCF.Conversation.Leave([$("#"+e).data("conversationID")],this._environment);break;case"edit":window.location=this._getTriggerElement($("#"+e)).prop("href")}},_updateConversation:function(e,a,t){var n=this._elements[e].data("conversationID");switch(a){case"close":case"editSubject":case"open":this._updateData.push({elementID:e,optionName:a,data:t}),this._proxy.setOption("data",{actionName:a,className:"wcf\\data\\conversation\\ConversationAction",objectIDs:[n]}),this._proxy.sendRequest()}},_updateState:function(){var e,a,t,n;for(e=0,a=this._updateData.length;e<a;e++)switch(t=this._updateData[e],n=this._elements[t.elementID].data("conversationID"),t.optionName){case"close":case"editSubject":case"open":this._editorHandler.update(n,t.optionName,t.data)}}}),WCF.Conversation.Leave=Class.extend({_conversationIDs:[],_dialog:null,_environment:"",_proxy:null,init:function(e,a){this._conversationIDs=e,this._dialog=null,this._environment=a,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._loadDialog()},_loadDialog:function(){this._proxy.setOption("data",{actionName:"getLeaveForm",className:"wcf\\data\\conversation\\ConversationAction",objectIDs:this._conversationIDs}),this._proxy.sendRequest()},_success:function(e,a,t){switch(e.returnValues.actionName){case"getLeaveForm":this._showDialog(e);break;case"hideConversation":"conversation"===this._environment?window.location=e.returnValues.redirectURL:window.location.reload()}},_showDialog:function(e){null===this._dialog&&(this._dialog=$("#leaveDialog"),this._dialog.length||(this._dialog=$('<div id="leaveDialog" />').hide().appendTo(document.body))),this._dialog.html(e.returnValues.template),this._dialog.wcfDialog({title:WCF.Language.get("wcf.conversation.leave.title")}),this._dialog.wcfDialog("render"),this._dialog.find("#hideConversation").click($.proxy(this._click,this))},_click:function(){var e=this._dialog.find("input[type=radio]:checked");1===e.length&&(this._proxy.setOption("data",{actionName:"hideConversation",className:"wcf\\data\\conversation\\ConversationAction",objectIDs:this._conversationIDs,parameters:{hideConversation:e.val()}}),this._proxy.sendRequest())}}),WCF.Conversation.RemoveParticipant=WCF.Action.Delete.extend({_conversationID:0,init:function(e){this._conversationID=e,this._super("wcf\\data\\conversation\\ConversationAction",".jsParticipant")},_sendRequest:function(e){this.proxy.setOption("data",{actionName:"removeParticipant",className:this._className,objectIDs:[this._conversationID],parameters:{userID:$(e).data("objectID")}}),this.proxy.sendRequest()},_success:function(e,a,t){var n,s,i=e.returnValues.userID;for(n in this._containers)(s=$("#"+this._containers[n])).find(".jsDeleteButton").data("objectID")==i&&(s.find(".userLink").addClass("conversationLeft"),s.find(".jsDeleteButton").remove())}}),WCF.Conversation.Label={},WCF.Conversation.Label.Editor=Class.extend({_conversationIDs:0,_dialog:null,_editorHandler:null,_notification:null,_proxy:null,init:function(e,a,t){this._conversationIDs=a?[$("#"+a).data("conversationID")]:t,this._dialog=null,this._editorHandler=e,this._notification=new WCF.System.Notification(WCF.Language.get("wcf.global.success.edit")),this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._loadDialog()},_loadDialog:function(){this._proxy.setOption("data",{actionName:"getLabelForm",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",parameters:{conversationIDs:this._conversationIDs}}),this._proxy.sendRequest()},_success:function(e,a,t){switch(e.returnValues.actionName){case"assignLabel":this._assignLabels(e);break;case"getLabelForm":this._renderDialog(e)}},_renderDialog:function(e){null===this._dialog&&(this._dialog=$("#conversationLabelForm"),this._dialog.length||(this._dialog=$('<div id="conversationLabelForm" />').hide().appendTo(document.body))),this._dialog.html(e.returnValues.template),this._dialog.wcfDialog({title:WCF.Language.get("wcf.conversation.label.assignLabels")}),this._dialog.wcfDialog("render"),$("#assignLabels").click($.proxy(this._save,this))},_save:function(){var e=[];this._dialog.find("input").each((function(a,t){var n=$(t);n.is(":checked")&&e.push(n.data("labelID"))})),this._proxy.setOption("data",{actionName:"assignLabel",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",parameters:{conversationIDs:this._conversationIDs,labelIDs:e}}),this._proxy.sendRequest()},_assignLabels:function(e){for(var a=0,t=this._conversationIDs.length;a<t;a++)this._editorHandler.update(this._conversationIDs[a],"labelIDs",e.returnValues.labelIDs);this._dialog.wcfDialog("close"),this._notification.show()}}),WCF.Conversation.Label.Manager=Class.extend({_deletedLabelID:0,_dialog:null,_labels:null,_link:"",_notification:"",_proxy:null,_maxLabels:0,_labelCount:0,init:function(e){this._deletedLabelID=0,this._maxLabels=0,this._labelCount=0,this._link=e,this._labels=WCF.Dropdown.getDropdownMenu("conversationLabelFilter").children(".scrollableDropdownMenu"),$("#manageLabel").click($.proxy(this._click,this)),this._notification=new WCF.System.Notification(WCF.Language.get("wcf.conversation.label.management.addLabel.success")),this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)})},_click:function(){this._proxy.setOption("data",{actionName:"getLabelManagement",className:"wcf\\data\\conversation\\ConversationAction"}),this._proxy.sendRequest()},_success:function(e,a,t){if(null===this._dialog&&(this._dialog=$('<div id="labelManagement" />').hide().appendTo(document.body)),e.returnValues&&e.returnValues.actionName)switch(e.returnValues.actionName){case"add":this._insertLabel(e);break;case"getLabelManagement":this._maxLabels=parseInt(e.returnValues.maxLabels),this._labelCount=parseInt(e.returnValues.labelCount),this._dialog.empty().html(e.returnValues.template),this._dialog.wcfDialog({title:WCF.Language.get("wcf.conversation.label.management")}),this._dialog.wcfDialog("render"),this._bindListener()}else if(this._deletedLabelID){var n=new RegExp("(\\?|&)labelID="+this._deletedLabelID);window.location=window.location.toString().replace(n,"")}else window.location.reload()},_insertLabel:function(e){var a=$('<li><a href="'+this._link+"&labelID="+e.returnValues.labelID+'"><span class="badge label'+(e.returnValues.cssClassName?" "+e.returnValues.cssClassName:"")+'">'+e.returnValues.label+"</span></a></li>");a.find("a > span").data("labelID",e.returnValues.labelID).data("cssClassName",e.returnValues.cssClassName),this._labels.append(a),this._notification.show(),this._labelCount++,this._labelCount>=this._maxLabels&&$("#conversationLabelManagementForm").hide()},_bindListener:function(){$("#labelName").on("keyup keydown keypress",$.proxy(this._updateLabels,this)),$.browser.mozilla&&$.browser.touch&&$("#labelName").on("input",$.proxy(this._updateLabels,this)),this._labelCount>=this._maxLabels&&($("#conversationLabelManagementForm").hide(),this._dialog.wcfDialog("render")),$("#addLabel").disable().click($.proxy(this._addLabel,this)),$("#editLabel").disable(),this._dialog.find(".conversationLabelList a.label").click($.proxy(this._edit,this))},_edit:function(e){var a,t,n;this._labelCount>=this._maxLabels&&($("#conversationLabelManagementForm").show(),this._dialog.wcfDialog("render")),a=$(e.currentTarget),t=WCF.Language.get("wcf.conversation.label.management.editLabel").replace(/#labelName#/,WCF.String.escapeHTML(a.text())),$("#conversationLabelManagementForm").data("labelID",a.data("labelID")).children(".sectionTitle").html(t),$("#labelName").val(a.text()).trigger("keyup"),n=a.data("cssClassName"),$("#labelManagementList input").each((function(e,a){var t=$(a);t.val()==n&&t.attr("checked","checked")})),$("#addLabel").hide(),$("#editLabel").show().click($.proxy(this._editLabel,this)),$("#deleteLabel").show().click($.proxy(this._deleteLabel,this))},_editLabel:function(){this._proxy.setOption("data",{actionName:"update",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",objectIDs:[$("#conversationLabelManagementForm").data("labelID")],parameters:{data:{cssClassName:$("#labelManagementList input:checked").val(),label:$("#labelName").val()}}}),this._proxy.sendRequest()},_deleteLabel:function(){var e=WCF.Language.get("wcf.conversation.label.management.deleteLabel.confirmMessage").replace(/#labelName#/,$("#labelName").val());WCF.System.Confirmation.show(e,$.proxy((function(e){"confirm"===e&&(this._proxy.setOption("data",{actionName:"delete",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",objectIDs:[$("#conversationLabelManagementForm").data("labelID")]}),this._proxy.sendRequest(),this._deletedLabelID=$("#conversationLabelManagementForm").data("labelID"))}),this),void 0,void 0,!0)},_updateLabels:function(){var e=$.trim($("#labelName").val());e?$("#addLabel, #editLabel").enable():($("#addLabel, #editLabel").disable(),e=WCF.Language.get("wcf.conversation.label.placeholder")),$("#labelManagementList").find("span.label").text(e)},_addLabel:function(){var e=$("#labelName").val(),a=$("#labelManagementList input:checked").val();this._proxy.setOption("data",{actionName:"add",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",parameters:{data:{cssClassName:a,labelName:e}}}),this._proxy.sendRequest(),this._dialog.wcfDialog("close")}}),WCF.Conversation.Preview=WCF.Popover.extend({_proxy:null,init:function(){this._super(".conversationLink"),this._proxy=new WCF.Action.Proxy({showLoadingOverlay:!1}),WCF.DOMNodeInsertedHandler.addCallback("WCF.Conversation.Preview",$.proxy(this._initContainers,this))},_loadContent:function(){var e,a,t=$("#"+this._activeElementID);this._proxy.setOption("data",{actionName:"getMessagePreview",className:"wcf\\data\\conversation\\ConversationAction",objectIDs:[t.data("conversationID")]}),e=this._activeElementID,a=this,this._proxy.setOption("success",(function(t,n,s){a._insertContent(e,t.returnValues.template,!0)})),this._proxy.sendRequest()}}),WCF.Conversation.MarkAsRead=Class.extend({_proxy:null,init:function(){this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),$(document).on("dblclick",".conversationList .new .columnAvatar",$.proxy(this._dblclick,this))},_dblclick:function(e){this._proxy.setOption("data",{actionName:"markAsRead",className:"wcf\\data\\conversation\\ConversationAction",objectIDs:[$(e.currentTarget).parents("ol:eq(0)").data("conversationID")]}),this._proxy.sendRequest()},_success:function(e,a,t){$(".conversationList .new").each((function(a,t){var n=$(t);WCF.inArray(n.data("conversationID"),e.objectIDs)&&(n.removeClass("new"),n.find(".firstNewPost").parent().remove(),n.find(".columnAvatar").off("dblclick"))}))}}),WCF.Conversation.MarkAllAsRead=Class.extend({_proxy:null,init:function(){this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),$(".markAllAsReadButton").click($.proxy(this._click,this))},_click:function(e){e.preventDefault(),this._proxy.setOption("data",{actionName:"markAllAsRead",className:"wcf\\data\\conversation\\ConversationAction"}),this._proxy.sendRequest()},_success:function(e,a,t){WCF.System.Event.fireEvent("com.woltlab.wcf.conversation.userPanel","reset");var n=$(".conversationList");n.find(".new").removeClass("new"),n.find(".columnAvatar").off("dblclick"),(new WCF.System.Notification).show()}}),WCF.Conversation.Message={},WCF.Conversation.Message.InlineEditor=WCF.Message.InlineEditor.extend({init:function(e,a){this._super(e,!0,a)},_getClassName:function(){return"wcf\\data\\conversation\\message\\ConversationMessageAction"}}),WCF.Conversation.Message.QuoteHandler=WCF.Message.Quote.Handler.extend({init:function(e){require(["WoltLabSuite/Core/Conversation/Ui/Message/Quote"],(({UiConversationMessageQuote:a})=>{new a(e)}))}});
\ No newline at end of file
+WCF.Conversation={},WCF.Conversation.EditorHandler=Class.extend({_attributes:{},_conversations:{},_permissions:{},init:function(availableLabels){this._conversations={};var self=this;$(".conversation").each((function(index,conversation){var $labelIDs,$conversation=$(conversation),$conversationID=$conversation.data("conversationID");self._conversations[$conversationID]||(self._conversations[$conversationID]=$conversation,$labelIDs=eval($conversation.data("labelIDs")),self._attributes[$conversationID]={isClosed:!!$conversation.data("isClosed"),labelIDs:$labelIDs},self._permissions[$conversationID]={canAddParticipants:!!$conversation.data("canAddParticipants"),canCloseConversation:!!$conversation.data("canCloseConversation")})}))},getPermission:function(e,a){return void 0!==this._permissions[e][a]&&!!this._permissions[e][a]},getValue:function(e,a){switch(a){case"labelIDs":return void 0===this._attributes[e].labelIDs&&(this._attributes[e].labelIDs=[]),this._attributes[e].labelIDs;case"isClosed":return!!this._attributes[e].isClosed}},countAvailableLabels:function(){return this.getAvailableLabels().length},getAvailableLabels:function(){var e=[];return WCF.Dropdown.getDropdownMenu("conversationLabelFilter").children(".scrollableDropdownMenu").children("li").each((function(a,t){var n,s=$(t);if(s.hasClass("dropdownDivider"))return!1;n=s.find("span"),e.push({cssClassName:n.data("cssClassName"),labelID:n.data("labelID"),label:n.text()})})),e},update:function(e,a,t){var n,s,i,o,l,r;if(this._conversations[e]){switch(n=this._conversations[e],a){case"close":$(`<li>\n\t\t\t\t\t<span class="jsTooltip jsIconLock" title="${WCF.Language.get("wcf.global.state.closed")}">\n\t\t\t\t\t\t<fa-icon size="16" name="lock"></fa-icon>\n\t\t\t\t\t</span>\n\t\t\t\t</li>`).prependTo(n.find(".statusIcons")),this._attributes[e].isClosed=1;break;case"labelIDs":if(s={},WCF.Dropdown.getDropdownMenu("conversationLabelFilter").find("li > a > span").each((function(e,a){var t=$(a);s[t.data("labelID")]={cssClassName:t.data("cssClassName"),label:t.text(),url:t.parent().attr("href")}})),i=n.find(".columnSubject > .labelList"),t.length)for(i.length||(i=$('<ul class="labelList" />').prependTo(n.find(".columnSubject"))),i.empty(),o=0,l=t.length;o<l;o++)r=s[t[o]],$('<li><a href="'+r.url+'" class="badge label'+(r.cssClassName?" "+r.cssClassName:"")+'">'+WCF.String.escapeHTML(r.label)+"</a></li>").appendTo(i);else i.length&&i.remove();break;case"open":n.find(".statusIcons li").each((function(e,a){var t=$(a);if(t.children("span.jsIconLock").length)return t.remove(),!1})),this._attributes[e].isClosed=0}WCF.Clipboard.reload()}else console.debug("[WCF.Conversation.EditorHandler] Unknown conversation id '"+e+"'")}}),WCF.Conversation.EditorHandlerConversation=WCF.Conversation.EditorHandler.extend({_availableLabels:null,init:function(e){this._availableLabels=e||[],this._super()},getAvailableLabels:function(){return this._availableLabels},update:function(e,a,t){var n,s,i,o;if(this._conversations[e])switch(n=$(".contentHeaderTitle > .contentHeaderMetaData"),a){case"close":$(`<li>\n\t\t\t\t\t<fa-icon size="16" name="lock"></fa-icon>\n\t\t\t\t\t${WCF.Language.get("wcf.global.state.closed")}\n\t\t\t\t</li>`).appendTo(n),this._attributes[e].isClosed=1;break;case"labelIDs":s=n.find(".labelList"),t.length?(i=this.getAvailableLabels(),s.length||(s=(s=$('<li>\n\t\t\t\t\t\t\t<fa-icon size="16" name="tags"></fa-icon>\n\t\t\t\t\t\t\t<ul class="labelList"></ul>\n\t\t\t\t\t\t</li>').prependTo(n)).children("ul")),o="",t.forEach((function(e){i.forEach((function(a){a.labelID==e&&(o+='<li><span class="label badge'+(a.cssClassName?" "+a.cssClassName:"")+'">'+a.label+"</span></li>")}))})),s[0].innerHTML=o):s.parent().remove();break;case"open":n.find(".jsIconLock").parent().remove(),this._attributes[e].isClosed=0}else console.debug("[WCF.Conversation.EditorHandler] Unknown conversation id '"+e+"'")}}),WCF.Conversation.Clipboard=Class.extend({_editorHandler:null,init:function(e){this._editorHandler=e,WCF.System.Event.addListener("com.woltlab.wcf.clipboard","com.woltlab.wcf.conversation.conversation",function(e){null===e.responseData?this._execute(e.data.actionName,e.data.parameters):this._evaluateResponse(e.data.actionName,e.responseData)}.bind(this))},_execute:function(e,a){"com.woltlab.wcf.conversation.conversation.assignLabel"===e&&new WCF.Conversation.Label.Editor(this._editorHandler,null,a.objectIDs)},_evaluateResponse:function(e,a){var t,n;switch(e){case"com.woltlab.wcf.conversation.conversation.leave":case"com.woltlab.wcf.conversation.conversation.leavePermanently":case"com.woltlab.wcf.conversation.conversation.markAsRead":case"com.woltlab.wcf.conversation.conversation.restore":window.location.reload();break;case"com.woltlab.wcf.conversation.conversation.close":case"com.woltlab.wcf.conversation.conversation.open":for(t in a.returnValues.conversationData)a.returnValues.conversationData.hasOwnProperty(t)&&(n=a.returnValues.conversationData[t],this._editorHandler.update(t,n.isClosed?"close":"open",n))}}}),WCF.Conversation.InlineEditor=WCF.InlineEditor.extend({_editorHandler:null,_environment:"conversation",_setOptions:function(){this._options=[{label:WCF.Language.get("wcf.conversation.edit.subject"),optionName:"editSubject"},{label:WCF.Language.get("wcf.conversation.edit.close"),optionName:"close"},{label:WCF.Language.get("wcf.conversation.edit.open"),optionName:"open"},{label:WCF.Language.get("wcf.conversation.edit.assignLabel"),optionName:"assignLabel"},{optionName:"divider"},{label:WCF.Language.get("wcf.conversation.edit.addParticipants"),optionName:"addParticipants"},{label:WCF.Language.get("wcf.conversation.edit.leave"),optionName:"leave"},{label:WCF.Language.get("wcf.global.button.edit"),optionName:"edit",isQuickOption:!0}]},setEditorHandler:function(e,a){this._editorHandler=e,this._environment="list"==a?"list":"conversation"},_getTriggerElement:function(e){return e.find(".jsConversationInlineEditor")},_validate:function(e,a){var t=$("#"+e).data("conversationID");switch(a){case"addParticipants":return this._editorHandler.getPermission(t,"canAddParticipants");case"assignLabel":return!!this._editorHandler.countAvailableLabels();case"editSubject":return!!this._editorHandler.getPermission(t,"canCloseConversation");case"close":case"open":return!!this._editorHandler.getPermission(t,"canCloseConversation")&&("close"===a?!this._editorHandler.getValue(t,"isClosed"):this._editorHandler.getValue(t,"isClosed"));case"leave":return!0;case"edit":return!!$("#"+e).data("isDraft")}return!1},_execute:function(e,a){if(!this._validate(e,a))return!1;switch(a){case"addParticipants":require(["WoltLabSuite/Core/Conversation/Ui/Participant/Add"],(function(a){new a(elData(elById(e),"conversation-id"))}));break;case"assignLabel":new WCF.Conversation.Label.Editor(this._editorHandler,e);break;case"editSubject":require(["WoltLabSuite/Core/Conversation/Ui/Subject/Editor"],(function(a){a.beginEdit(elData(elById(e),"conversation-id"))}));break;case"close":case"open":this._updateConversation(e,a,{isClosed:"close"===a?1:0});break;case"leave":new WCF.Conversation.Leave([$("#"+e).data("conversationID")],this._environment);break;case"edit":window.location=this._getTriggerElement($("#"+e)).prop("href")}},_updateConversation:function(e,a,t){var n=this._elements[e].data("conversationID");switch(a){case"close":case"editSubject":case"open":this._updateData.push({elementID:e,optionName:a,data:t}),this._proxy.setOption("data",{actionName:a,className:"wcf\\data\\conversation\\ConversationAction",objectIDs:[n]}),this._proxy.sendRequest()}},_updateState:function(){var e,a,t,n;for(e=0,a=this._updateData.length;e<a;e++)switch(t=this._updateData[e],n=this._elements[t.elementID].data("conversationID"),t.optionName){case"close":case"editSubject":case"open":this._editorHandler.update(n,t.optionName,t.data)}}}),WCF.Conversation.Leave=Class.extend({_conversationIDs:[],_dialog:null,_environment:"",_proxy:null,init:function(e,a){this._conversationIDs=e,this._dialog=null,this._environment=a,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._loadDialog()},_loadDialog:function(){this._proxy.setOption("data",{actionName:"getLeaveForm",className:"wcf\\data\\conversation\\ConversationAction",objectIDs:this._conversationIDs}),this._proxy.sendRequest()},_success:function(e,a,t){switch(e.returnValues.actionName){case"getLeaveForm":this._showDialog(e);break;case"hideConversation":"conversation"===this._environment?window.location=e.returnValues.redirectURL:window.location.reload()}},_showDialog:function(e){null===this._dialog&&(this._dialog=$("#leaveDialog"),this._dialog.length||(this._dialog=$('<div id="leaveDialog" />').hide().appendTo(document.body))),this._dialog.html(e.returnValues.template),this._dialog.wcfDialog({title:WCF.Language.get("wcf.conversation.leave.title")}),this._dialog.wcfDialog("render"),this._dialog.find("#hideConversation").click($.proxy(this._click,this))},_click:function(){var e=this._dialog.find("input[type=radio]:checked");1===e.length&&(this._proxy.setOption("data",{actionName:"hideConversation",className:"wcf\\data\\conversation\\ConversationAction",objectIDs:this._conversationIDs,parameters:{hideConversation:e.val()}}),this._proxy.sendRequest())}}),WCF.Conversation.Label={},WCF.Conversation.Label.Editor=Class.extend({_conversationIDs:0,_dialog:null,_editorHandler:null,_notification:null,_proxy:null,init:function(e,a,t){this._conversationIDs=a?[$("#"+a).data("conversationID")]:t,this._dialog=null,this._editorHandler=e,this._notification=new WCF.System.Notification(WCF.Language.get("wcf.global.success.edit")),this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._loadDialog()},_loadDialog:function(){this._proxy.setOption("data",{actionName:"getLabelForm",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",parameters:{conversationIDs:this._conversationIDs}}),this._proxy.sendRequest()},_success:function(e,a,t){switch(e.returnValues.actionName){case"assignLabel":this._assignLabels(e);break;case"getLabelForm":this._renderDialog(e)}},_renderDialog:function(e){null===this._dialog&&(this._dialog=$("#conversationLabelForm"),this._dialog.length||(this._dialog=$('<div id="conversationLabelForm" />').hide().appendTo(document.body))),this._dialog.html(e.returnValues.template),this._dialog.wcfDialog({title:WCF.Language.get("wcf.conversation.label.assignLabels")}),this._dialog.wcfDialog("render"),$("#assignLabels").click($.proxy(this._save,this))},_save:function(){var e=[];this._dialog.find("input").each((function(a,t){var n=$(t);n.is(":checked")&&e.push(n.data("labelID"))})),this._proxy.setOption("data",{actionName:"assignLabel",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",parameters:{conversationIDs:this._conversationIDs,labelIDs:e}}),this._proxy.sendRequest()},_assignLabels:function(e){for(var a=0,t=this._conversationIDs.length;a<t;a++)this._editorHandler.update(this._conversationIDs[a],"labelIDs",e.returnValues.labelIDs);this._dialog.wcfDialog("close"),this._notification.show()}}),WCF.Conversation.Label.Manager=Class.extend({_deletedLabelID:0,_dialog:null,_labels:null,_link:"",_notification:"",_proxy:null,_maxLabels:0,_labelCount:0,init:function(e){this._deletedLabelID=0,this._maxLabels=0,this._labelCount=0,this._link=e,this._labels=WCF.Dropdown.getDropdownMenu("conversationLabelFilter").children(".scrollableDropdownMenu"),$("#manageLabel").click($.proxy(this._click,this)),this._notification=new WCF.System.Notification(WCF.Language.get("wcf.conversation.label.management.addLabel.success")),this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)})},_click:function(){this._proxy.setOption("data",{actionName:"getLabelManagement",className:"wcf\\data\\conversation\\ConversationAction"}),this._proxy.sendRequest()},_success:function(e,a,t){if(null===this._dialog&&(this._dialog=$('<div id="labelManagement" />').hide().appendTo(document.body)),e.returnValues&&e.returnValues.actionName)switch(e.returnValues.actionName){case"add":this._insertLabel(e);break;case"getLabelManagement":this._maxLabels=parseInt(e.returnValues.maxLabels),this._labelCount=parseInt(e.returnValues.labelCount),this._dialog.empty().html(e.returnValues.template),this._dialog.wcfDialog({title:WCF.Language.get("wcf.conversation.label.management")}),this._dialog.wcfDialog("render"),this._bindListener()}else if(this._deletedLabelID){var n=new RegExp("(\\?|&)labelID="+this._deletedLabelID);window.location=window.location.toString().replace(n,"")}else window.location.reload()},_insertLabel:function(e){var a=$('<li><a href="'+this._link+"&labelID="+e.returnValues.labelID+'"><span class="badge label'+(e.returnValues.cssClassName?" "+e.returnValues.cssClassName:"")+'">'+e.returnValues.label+"</span></a></li>");a.find("a > span").data("labelID",e.returnValues.labelID).data("cssClassName",e.returnValues.cssClassName),this._labels.append(a),this._notification.show(),this._labelCount++,this._labelCount>=this._maxLabels&&$("#conversationLabelManagementForm").hide()},_bindListener:function(){$("#labelName").on("keyup keydown keypress",$.proxy(this._updateLabels,this)),$.browser.mozilla&&$.browser.touch&&$("#labelName").on("input",$.proxy(this._updateLabels,this)),this._labelCount>=this._maxLabels&&($("#conversationLabelManagementForm").hide(),this._dialog.wcfDialog("render")),$("#addLabel").disable().click($.proxy(this._addLabel,this)),$("#editLabel").disable(),this._dialog.find(".conversationLabelList a.label").click($.proxy(this._edit,this))},_edit:function(e){var a,t,n;this._labelCount>=this._maxLabels&&($("#conversationLabelManagementForm").show(),this._dialog.wcfDialog("render")),a=$(e.currentTarget),t=WCF.Language.get("wcf.conversation.label.management.editLabel").replace(/#labelName#/,WCF.String.escapeHTML(a.text())),$("#conversationLabelManagementForm").data("labelID",a.data("labelID")).children(".sectionTitle").html(t),$("#labelName").val(a.text()).trigger("keyup"),n=a.data("cssClassName"),$("#labelManagementList input").each((function(e,a){var t=$(a);t.val()==n&&t.attr("checked","checked")})),$("#addLabel").hide(),$("#editLabel").show().click($.proxy(this._editLabel,this)),$("#deleteLabel").show().click($.proxy(this._deleteLabel,this))},_editLabel:function(){this._proxy.setOption("data",{actionName:"update",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",objectIDs:[$("#conversationLabelManagementForm").data("labelID")],parameters:{data:{cssClassName:$("#labelManagementList input:checked").val(),label:$("#labelName").val()}}}),this._proxy.sendRequest()},_deleteLabel:function(){var e=WCF.Language.get("wcf.conversation.label.management.deleteLabel.confirmMessage").replace(/#labelName#/,$("#labelName").val());WCF.System.Confirmation.show(e,$.proxy((function(e){"confirm"===e&&(this._proxy.setOption("data",{actionName:"delete",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",objectIDs:[$("#conversationLabelManagementForm").data("labelID")]}),this._proxy.sendRequest(),this._deletedLabelID=$("#conversationLabelManagementForm").data("labelID"))}),this),void 0,void 0,!0)},_updateLabels:function(){var e=$.trim($("#labelName").val());e?$("#addLabel, #editLabel").enable():($("#addLabel, #editLabel").disable(),e=WCF.Language.get("wcf.conversation.label.placeholder")),$("#labelManagementList").find("span.label").text(e)},_addLabel:function(){var e=$("#labelName").val(),a=$("#labelManagementList input:checked").val();this._proxy.setOption("data",{actionName:"add",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",parameters:{data:{cssClassName:a,labelName:e}}}),this._proxy.sendRequest(),this._dialog.wcfDialog("close")}}),WCF.Conversation.Message={},WCF.Conversation.Message.InlineEditor=WCF.Message.InlineEditor.extend({init:function(e,a){this._super(e,!0,a)},_getClassName:function(){return"wcf\\data\\conversation\\message\\ConversationMessageAction"}});
\ No newline at end of file
-define("WoltLabSuite/Core/Conversation/Ui/Message/Quote",["require","exports","WoltLabSuite/Core/Ui/Message/Quote"],(function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UiConversationMessageQuote=void 0;class o extends i.UiMessageQuote{constructor(t){super(t,"wcf\\data\\conversation\\message\\ConversationMessageAction","com.woltlab.wcf.conversation.message",".message",".messageBody",".messageBody > div > div.messageText",!0)}}e.UiConversationMessageQuote=o,e.default=o})),define("WoltLabSuite/Core/Conversation/Ui/Participant/Add",["require","exports","tslib","WoltLabSuite/Core/Ajax","WoltLabSuite/Core/Dom/Util","WoltLabSuite/Core/Ui/Dialog","WoltLabSuite/Core/Ui/Notification","WoltLabSuite/Core/Ui/ItemList/User","WoltLabSuite/Core/Language"],(function(t,e,i,o,n,s,a,r,u){"use strict";o=i.__importStar(o),n=i.__importDefault(n),s=i.__importDefault(s),a=i.__importStar(a),r=i.__importStar(r),u=i.__importStar(u);return class{constructor(t){this.conversationId=t,o.api(this,{actionName:"getAddParticipantsForm"})}_ajaxSetup(){return{data:{className:"wcf\\data\\conversation\\ConversationAction",objectIDs:[this.conversationId]}}}_ajaxSuccess(t){switch(t.actionName){case"addParticipants":this.handleResponse(t);break;case"getAddParticipantsForm":this.render(t)}}handleResponse(t){t.returnValues.errorMessage?n.default.innerError(document.getElementById("participantsInput").closest(".inputItemList"),t.returnValues.errorMessage):(t.returnValues.count&&a.show(t.returnValues.successMessage,(()=>window.location.reload())),s.default.close(this))}render(t){s.default.open(this,t.returnValues.template);const e=document.getElementById("addParticipants");e.disabled=!0,r.init("participantsInput",{callbackChange:(t,i)=>{e.disabled=0===i.length},excludedSearchValues:t.returnValues.excludedSearchValues,maxItems:t.returnValues.maxItems,includeUserGroups:t.returnValues.canAddGroupParticipants&&t.returnValues.restrictUserGroupIDs.length>0,restrictUserGroupIDs:t.returnValues.restrictUserGroupIDs,csvPerType:!0}),e.addEventListener("click",(()=>this.submit()))}submit(){const t=[],e=[];r.getValues("participantsInput").forEach((i=>{"group"===i.type?e.push(i.objectId):t.push(i.value)}));const i={participants:t,participantsGroupIDs:e,visibility:null},n=s.default.getDialog(this).content.querySelector('input[name="messageVisibility"]:checked, input[name="messageVisibility"][type="hidden"]');n&&(i.visibility=n.value),o.api(this,{actionName:"addParticipants",parameters:i})}_dialogSetup(){return{id:"conversationAddParticipants",options:{title:u.get("wcf.conversation.edit.addParticipants")},source:null}}}})),define("WoltLabSuite/Core/Conversation/Ui/Subject/Editor",["require","exports","tslib","WoltLabSuite/Core/Ui/Dialog","WoltLabSuite/Core/Dom/Util","WoltLabSuite/Core/Ajax","WoltLabSuite/Core/Language","WoltLabSuite/Core/Ui/Notification"],(function(t,e,i,o,n,s,a,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.beginEdit=void 0,o=i.__importDefault(o),n=i.__importDefault(n),s=i.__importStar(s),a=i.__importStar(a),r=i.__importStar(r);class u{constructor(t){this.objectId=t}show(){o.default.open(this)}saveEdit(t){t.preventDefault();const e=this.subject.value.trim();""===e?n.default.innerError(this.subject,a.get("wcf.global.form.error.empty")):(n.default.innerError(this.subject,""),s.api(this,{parameters:{subject:e},objectIDs:[this.objectId]}))}getCurrentValue(){return Array.from(document.querySelectorAll(`.jsConversationSubject[data-conversation-id="${this.objectId}"], .conversationLink[data-object-id="${this.objectId}"]`)).map((t=>t.textContent)).slice(-1)[0]}_ajaxSuccess(t){o.default.close(this),document.querySelectorAll(`.jsConversationSubject[data-conversation-id="${this.objectId}"], .conversationLink[data-object-id="${this.objectId}"]`).forEach((e=>{e.textContent=t.returnValues.subject})),r.show()}_dialogSetup(){return{id:"dialogConversationSubjectEditor",options:{onSetup:t=>{this.subject=document.getElementById("jsConversationSubject"),this.subject.addEventListener("keyup",(t=>{"Enter"===t.key&&this.saveEdit(t)})),t.querySelector(".jsButtonSave").addEventListener("click",(t=>this.saveEdit(t)))},onShow:()=>{this.subject.value=this.getCurrentValue()},title:a.get("wcf.conversation.edit.subject")},source:`\n <dl>\n <dt>\n <label for="jsConversationSubject">${a.get("wcf.global.subject")}</label>\n </dt>\n <dd>\n <input type="text" id="jsConversationSubject" class="long" maxlength="255">\n </dd>\n </dl>\n <div class="formSubmit">\n <button class="buttonPrimary jsButtonSave">${a.get("wcf.global.button.save")}</button>\n </div>\n `}}_ajaxSetup(){return{data:{actionName:"editSubject",className:"wcf\\data\\conversation\\ConversationAction"}}}}let c;e.beginEdit=function(t){c=new u(t),c.show()}})),define("WoltLabSuite/Core/Conversation/Ui/Object/Action/RemoveParticipant",["require","exports","tslib","WoltLabSuite/Core/Ui/Object/Action/Handler"],(function(t,e,i,o){"use strict";function n(t){t.objectElement.querySelector(".userLink").classList.add("conversationLeft"),t.objectElement.querySelector(".jsObjectAction[data-object-action='removeParticipant']").remove()}Object.defineProperty(e,"__esModule",{value:!0}),e.setup=void 0,o=i.__importDefault(o),e.setup=function(){new o.default("removeParticipant",[],n)}})),define("WoltLabSuite/Core/Conversation/Ui/User/Menu/Data/Conversation",["require","exports","tslib","WoltLabSuite/Core/Ajax","WoltLabSuite/Core/Ui/User/Menu/View","WoltLabSuite/Core/Ui/User/Menu/Manager"],(function(t,e,i,o,n,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setup=void 0,n=i.__importDefault(n);class a{constructor(t,e){this.counter=0,this.stale=!0,this.view=void 0,this.button=t,this.options=e;const i=t.querySelector(".badge");if(i){const t=parseInt(i.textContent.trim());t&&(this.counter=t)}}getPanelButton(){return this.button}getMenuButtons(){const t=[];return this.options.canStartConversation&&t.push({icon:'<span class="icon icon24 fa-plus"></span>',link:this.options.newConversationLink,name:"newConversation",title:this.options.newConversationTitle}),t}getIdentifier(){return"com.woltlab.wcf.conversation.conversations"}async getData(){const t=await(0,o.dboAction)("getConversations","wcf\\data\\conversation\\ConversationAction").disableLoadingIndicator().dispatch();return this.updateCounter(t.totalCount),this.stale=!1,t.items}getFooter(){return{link:this.options.showAllLink,title:this.options.showAllTitle}}getTitle(){return this.options.title}getView(){return void 0===this.view&&(this.view=new n.default(this)),this.view}getEmptyViewMessage(){return this.options.noItems}hasPlainTitle(){return!0}hasUnreadContent(){return this.counter>0}isStale(){if(this.stale)return!0;const t=this.getView().getItems().filter((t=>"true"===t.dataset.isUnread));return this.counter!==t.length}async markAsRead(t){const e=await(0,o.dboAction)("markAsRead","wcf\\data\\conversation\\ConversationAction").objectIds([t]).dispatch();this.updateCounter(e.totalCount)}async markAllAsRead(){await(0,o.dboAction)("markAllAsRead","wcf\\data\\conversation\\ConversationAction").dispatch(),this.updateCounter(0)}updateCounter(t){let e=this.button.querySelector(".badge");null===e&&t>0&&(e=document.createElement("span"),e.classList.add("badge","badgeUpdate"),this.button.querySelector("a").append(e)),e&&(0===t?e.remove():e.textContent=t.toString()),this.counter=t}}let r=!1;e.setup=function(t){if(!r){const e=document.getElementById("unreadConversations");if(null!==e){const i=new a(e,t);(0,s.registerProvider)(i)}r=!0}}}));
\ No newline at end of file
+define("WoltLabSuite/Core/Conversation/Ui/MarkAllAsRead",["require","exports","tslib","WoltLabSuite/Core/Ajax","WoltLabSuite/Core/Ui/Notification"],(function(t,e,o,i,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setup=void 0,n=o.__importStar(n),e.setup=function(){document.querySelectorAll(".markAllAsReadButton").forEach((t=>{t.addEventListener("click",(t=>{t.preventDefault(),async function(){await(0,i.dboAction)("markAllAsRead","wcf\\data\\conversation\\ConversationAction").dispatch(),document.querySelectorAll(".conversationList .new").forEach((t=>{t.classList.remove("new")})),document.querySelector("#unreadConversations .badgeUpdate")?.remove(),n.show()}()}))}))}})),define("WoltLabSuite/Core/Conversation/Ui/MarkAsRead",["require","exports","WoltLabSuite/Core/Ajax"],(function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setup=void 0;const i=new WeakSet;e.setup=function(){document.querySelectorAll(".conversationList .new .columnAvatar").forEach((t=>{i.has(t)||(i.add(t),t.addEventListener("dblclick",(e=>{e.preventDefault();const i=t.closest(".conversation");i.classList.contains("new")&&async function(t){const e=parseInt(t.dataset.conversationId,10);await(0,o.dboAction)("markAsRead","wcf\\data\\conversation\\ConversationAction").objectIds([e]).dispatch(),t.classList.remove("new"),t.querySelector(".columnAvatar p")?.removeAttribute("title")}(i)}),{once:!0}))}))}})),define("WoltLabSuite/Core/Conversation/Ui/Message/Quote",["require","exports","WoltLabSuite/Core/Ui/Message/Quote"],(function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UiConversationMessageQuote=void 0;class i extends o.UiMessageQuote{constructor(t){super(t,"wcf\\data\\conversation\\message\\ConversationMessageAction","com.woltlab.wcf.conversation.message",".message",".messageBody",".messageBody > div > div.messageText",!0)}}e.UiConversationMessageQuote=i,e.default=i})),define("WoltLabSuite/Core/Conversation/Ui/Participant/Add",["require","exports","tslib","WoltLabSuite/Core/Ajax","WoltLabSuite/Core/Dom/Util","WoltLabSuite/Core/Ui/Dialog","WoltLabSuite/Core/Ui/Notification","WoltLabSuite/Core/Ui/ItemList/User","WoltLabSuite/Core/Language"],(function(t,e,o,i,n,a,s,r,c){"use strict";return i=o.__importStar(i),n=o.__importDefault(n),a=o.__importDefault(a),s=o.__importStar(s),r=o.__importStar(r),c=o.__importStar(c),class{conversationId;constructor(t){this.conversationId=t,i.api(this,{actionName:"getAddParticipantsForm"})}_ajaxSetup(){return{data:{className:"wcf\\data\\conversation\\ConversationAction",objectIDs:[this.conversationId]}}}_ajaxSuccess(t){switch(t.actionName){case"addParticipants":this.handleResponse(t);break;case"getAddParticipantsForm":this.render(t)}}handleResponse(t){t.returnValues.errorMessage?n.default.innerError(document.getElementById("participantsInput").closest(".inputItemList"),t.returnValues.errorMessage):(t.returnValues.count&&s.show(t.returnValues.successMessage,(()=>window.location.reload())),a.default.close(this))}render(t){a.default.open(this,t.returnValues.template);const e=document.getElementById("addParticipants");e.disabled=!0,r.init("participantsInput",{callbackChange:(t,o)=>{e.disabled=0===o.length},excludedSearchValues:t.returnValues.excludedSearchValues,maxItems:t.returnValues.maxItems,includeUserGroups:t.returnValues.canAddGroupParticipants&&t.returnValues.restrictUserGroupIDs.length>0,restrictUserGroupIDs:t.returnValues.restrictUserGroupIDs,csvPerType:!0}),e.addEventListener("click",(()=>this.submit()))}submit(){const t=[],e=[];r.getValues("participantsInput").forEach((o=>{"group"===o.type?e.push(o.objectId):t.push(o.value)}));const o={participants:t,participantsGroupIDs:e,visibility:null},n=a.default.getDialog(this).content.querySelector('input[name="messageVisibility"]:checked, input[name="messageVisibility"][type="hidden"]');n&&(o.visibility=n.value),i.api(this,{actionName:"addParticipants",parameters:o})}_dialogSetup(){return{id:"conversationAddParticipants",options:{title:c.get("wcf.conversation.edit.addParticipants")},source:null}}}})),define("WoltLabSuite/Core/Conversation/Ui/Subject/Editor",["require","exports","tslib","WoltLabSuite/Core/Ui/Dialog","WoltLabSuite/Core/Dom/Util","WoltLabSuite/Core/Ajax","WoltLabSuite/Core/Language","WoltLabSuite/Core/Ui/Notification"],(function(t,e,o,i,n,a,s,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.beginEdit=void 0,i=o.__importDefault(i),n=o.__importDefault(n),a=o.__importStar(a),s=o.__importStar(s),r=o.__importStar(r);class c{objectId;subject;constructor(t){this.objectId=t}show(){i.default.open(this)}saveEdit(t){t.preventDefault();const e=this.subject.value.trim();""===e?n.default.innerError(this.subject,s.get("wcf.global.form.error.empty")):(n.default.innerError(this.subject,""),a.api(this,{parameters:{subject:e},objectIDs:[this.objectId]}))}getCurrentValue(){return Array.from(document.querySelectorAll(`.jsConversationSubject[data-conversation-id="${this.objectId}"], .conversationLink[data-object-id="${this.objectId}"]`)).map((t=>t.textContent)).slice(-1)[0]}_ajaxSuccess(t){i.default.close(this),document.querySelectorAll(`.jsConversationSubject[data-conversation-id="${this.objectId}"], .conversationLink[data-object-id="${this.objectId}"]`).forEach((e=>{e.textContent=t.returnValues.subject})),r.show()}_dialogSetup(){return{id:"dialogConversationSubjectEditor",options:{onSetup:t=>{this.subject=document.getElementById("jsConversationSubject"),this.subject.addEventListener("keyup",(t=>{"Enter"===t.key&&this.saveEdit(t)})),t.querySelector(".jsButtonSave").addEventListener("click",(t=>this.saveEdit(t)))},onShow:()=>{this.subject.value=this.getCurrentValue()},title:s.get("wcf.conversation.edit.subject")},source:`\n <dl>\n <dt>\n <label for="jsConversationSubject">${s.get("wcf.global.subject")}</label>\n </dt>\n <dd>\n <input type="text" id="jsConversationSubject" class="long" maxlength="255">\n </dd>\n </dl>\n <div class="formSubmit">\n <button type="button" class="button buttonPrimary jsButtonSave">${s.get("wcf.global.button.save")}</button>\n </div>\n `}}_ajaxSetup(){return{data:{actionName:"editSubject",className:"wcf\\data\\conversation\\ConversationAction"}}}}let u;e.beginEdit=function(t){u=new c(t),u.show()}})),define("WoltLabSuite/Core/Conversation/Ui/Object/Action/RemoveParticipant",["require","exports","tslib","WoltLabSuite/Core/Ui/Object/Action/Handler"],(function(t,e,o,i){"use strict";function n(t){t.objectElement.querySelector(".userLink").classList.add("conversationLeft"),t.objectElement.querySelector(".jsObjectAction[data-object-action='removeParticipant']").remove()}Object.defineProperty(e,"__esModule",{value:!0}),e.setup=void 0,i=o.__importDefault(i),e.setup=function(){new i.default("removeParticipant",[],n)}})),define("WoltLabSuite/Core/Conversation/Ui/User/Menu/Data/Conversation",["require","exports","tslib","WoltLabSuite/Core/Ajax","WoltLabSuite/Core/Ui/User/Menu/View","WoltLabSuite/Core/Ui/User/Menu/Manager"],(function(t,e,o,i,n,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setup=void 0,n=o.__importDefault(n);class s{button;counter=0;options;stale=!0;view=void 0;constructor(t,e){this.button=t,this.options=e;const o=t.querySelector(".badge");if(o){const t=parseInt(o.textContent.trim());t&&(this.counter=t)}}getPanelButton(){return this.button}getMenuButtons(){const t=[];return this.options.canStartConversation&&t.push({icon:'<fa-icon size="24" name="plus"></fa-icon>',link:this.options.newConversationLink,name:"newConversation",title:this.options.newConversationTitle}),t}getIdentifier(){return"com.woltlab.wcf.conversation.conversations"}async getData(){const t=await(0,i.dboAction)("getConversations","wcf\\data\\conversation\\ConversationAction").disableLoadingIndicator().dispatch();return this.updateCounter(t.totalCount),this.stale=!1,t.items}getFooter(){return{link:this.options.showAllLink,title:this.options.showAllTitle}}getTitle(){return this.options.title}getView(){return void 0===this.view&&(this.view=new n.default(this)),this.view}getEmptyViewMessage(){return this.options.noItems}hasPlainTitle(){return!0}hasUnreadContent(){return this.counter>0}isStale(){if(this.stale)return!0;const t=this.getView().getItems().filter((t=>"true"===t.dataset.isUnread));return this.counter!==t.length}async markAsRead(t){const e=await(0,i.dboAction)("markAsRead","wcf\\data\\conversation\\ConversationAction").objectIds([t]).dispatch();this.updateCounter(e.totalCount)}async markAllAsRead(){await(0,i.dboAction)("markAllAsRead","wcf\\data\\conversation\\ConversationAction").dispatch(),this.updateCounter(0)}updateCounter(t){let e=this.button.querySelector(".badge");null===e&&t>0&&(e=document.createElement("span"),e.classList.add("badge","badgeUpdate"),this.button.querySelector("a").append(e)),e&&(0===t?e.remove():e.textContent=t.toString()),this.counter=t}}let r=!1;e.setup=function(t){if(!r){const e=document.getElementById("unreadConversations");if(null!==e){const o=new s(e,t);(0,a.registerProvider)(o)}r=!0}}}));
\ No newline at end of file
-define("WoltLabSuite/Core/Conversation/Ui/Message/Quote",["require","exports","WoltLabSuite/Core/Ui/Message/Quote"],(function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UiConversationMessageQuote=void 0;class o extends i.UiMessageQuote{constructor(t){super(t,"wcf\\data\\conversation\\message\\ConversationMessageAction","com.woltlab.wcf.conversation.message",".message",".messageBody",".messageBody > div > div.messageText",!0)}}e.UiConversationMessageQuote=o,e.default=o})),define("WoltLabSuite/Core/Conversation/Ui/Participant/Add",["require","exports","tslib","WoltLabSuite/Core/Ajax","WoltLabSuite/Core/Dom/Util","WoltLabSuite/Core/Ui/Dialog","WoltLabSuite/Core/Ui/Notification","WoltLabSuite/Core/Ui/ItemList/User","WoltLabSuite/Core/Language"],(function(t,e,i,o,n,s,a,r,u){"use strict";o=i.__importStar(o),n=i.__importDefault(n),s=i.__importDefault(s),a=i.__importStar(a),r=i.__importStar(r),u=i.__importStar(u);return class{constructor(t){this.conversationId=t,o.api(this,{actionName:"getAddParticipantsForm"})}_ajaxSetup(){return{data:{className:"wcf\\data\\conversation\\ConversationAction",objectIDs:[this.conversationId]}}}_ajaxSuccess(t){switch(t.actionName){case"addParticipants":this.handleResponse(t);break;case"getAddParticipantsForm":this.render(t)}}handleResponse(t){t.returnValues.errorMessage?n.default.innerError(document.getElementById("participantsInput").closest(".inputItemList"),t.returnValues.errorMessage):(t.returnValues.count&&a.show(t.returnValues.successMessage,(()=>window.location.reload())),s.default.close(this))}render(t){s.default.open(this,t.returnValues.template);const e=document.getElementById("addParticipants");e.disabled=!0,r.init("participantsInput",{callbackChange:(t,i)=>{e.disabled=0===i.length},excludedSearchValues:t.returnValues.excludedSearchValues,maxItems:t.returnValues.maxItems,includeUserGroups:t.returnValues.canAddGroupParticipants&&t.returnValues.restrictUserGroupIDs.length>0,restrictUserGroupIDs:t.returnValues.restrictUserGroupIDs,csvPerType:!0}),e.addEventListener("click",(()=>this.submit()))}submit(){const t=[],e=[];r.getValues("participantsInput").forEach((i=>{"group"===i.type?e.push(i.objectId):t.push(i.value)}));const i={participants:t,participantsGroupIDs:e,visibility:null},n=s.default.getDialog(this).content.querySelector('input[name="messageVisibility"]:checked, input[name="messageVisibility"][type="hidden"]');n&&(i.visibility=n.value),o.api(this,{actionName:"addParticipants",parameters:i})}_dialogSetup(){return{id:"conversationAddParticipants",options:{title:u.get("wcf.conversation.edit.addParticipants")},source:null}}}})),define("WoltLabSuite/Core/Conversation/Ui/Subject/Editor",["require","exports","tslib","WoltLabSuite/Core/Ui/Dialog","WoltLabSuite/Core/Dom/Util","WoltLabSuite/Core/Ajax","WoltLabSuite/Core/Language","WoltLabSuite/Core/Ui/Notification"],(function(t,e,i,o,n,s,a,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.beginEdit=void 0,o=i.__importDefault(o),n=i.__importDefault(n),s=i.__importStar(s),a=i.__importStar(a),r=i.__importStar(r);class u{constructor(t){this.objectId=t}show(){o.default.open(this)}saveEdit(t){t.preventDefault();const e=this.subject.value.trim();""===e?n.default.innerError(this.subject,a.get("wcf.global.form.error.empty")):(n.default.innerError(this.subject,""),s.api(this,{parameters:{subject:e},objectIDs:[this.objectId]}))}getCurrentValue(){return Array.from(document.querySelectorAll(`.jsConversationSubject[data-conversation-id="${this.objectId}"], .conversationLink[data-object-id="${this.objectId}"]`)).map((t=>t.textContent)).slice(-1)[0]}_ajaxSuccess(t){o.default.close(this),document.querySelectorAll(`.jsConversationSubject[data-conversation-id="${this.objectId}"], .conversationLink[data-object-id="${this.objectId}"]`).forEach((e=>{e.textContent=t.returnValues.subject})),r.show()}_dialogSetup(){return{id:"dialogConversationSubjectEditor",options:{onSetup:t=>{this.subject=document.getElementById("jsConversationSubject"),this.subject.addEventListener("keyup",(t=>{"Enter"===t.key&&this.saveEdit(t)})),t.querySelector(".jsButtonSave").addEventListener("click",(t=>this.saveEdit(t)))},onShow:()=>{this.subject.value=this.getCurrentValue()},title:a.get("wcf.conversation.edit.subject")},source:`\n <dl>\n <dt>\n <label for="jsConversationSubject">${a.get("wcf.global.subject")}</label>\n </dt>\n <dd>\n <input type="text" id="jsConversationSubject" class="long" maxlength="255">\n </dd>\n </dl>\n <div class="formSubmit">\n <button class="buttonPrimary jsButtonSave">${a.get("wcf.global.button.save")}</button>\n </div>\n `}}_ajaxSetup(){return{data:{actionName:"editSubject",className:"wcf\\data\\conversation\\ConversationAction"}}}}let c;e.beginEdit=function(t){c=new u(t),c.show()}})),define("WoltLabSuite/Core/Conversation/Ui/Object/Action/RemoveParticipant",["require","exports","tslib","WoltLabSuite/Core/Ui/Object/Action/Handler"],(function(t,e,i,o){"use strict";function n(t){t.objectElement.querySelector(".userLink").classList.add("conversationLeft"),t.objectElement.querySelector(".jsObjectAction[data-object-action='removeParticipant']").remove()}Object.defineProperty(e,"__esModule",{value:!0}),e.setup=void 0,o=i.__importDefault(o),e.setup=function(){new o.default("removeParticipant",[],n)}})),define("WoltLabSuite/Core/Conversation/Ui/User/Menu/Data/Conversation",["require","exports","tslib","WoltLabSuite/Core/Ajax","WoltLabSuite/Core/Ui/User/Menu/View","WoltLabSuite/Core/Ui/User/Menu/Manager"],(function(t,e,i,o,n,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setup=void 0,n=i.__importDefault(n);class a{constructor(t,e){this.counter=0,this.stale=!0,this.view=void 0,this.button=t,this.options=e;const i=t.querySelector(".badge");if(i){const t=parseInt(i.textContent.trim());t&&(this.counter=t)}}getPanelButton(){return this.button}getMenuButtons(){const t=[];return this.options.canStartConversation&&t.push({icon:'<span class="icon icon24 fa-plus"></span>',link:this.options.newConversationLink,name:"newConversation",title:this.options.newConversationTitle}),t}getIdentifier(){return"com.woltlab.wcf.conversation.conversations"}async getData(){const t=await(0,o.dboAction)("getConversations","wcf\\data\\conversation\\ConversationAction").disableLoadingIndicator().dispatch();return this.updateCounter(t.totalCount),this.stale=!1,t.items}getFooter(){return{link:this.options.showAllLink,title:this.options.showAllTitle}}getTitle(){return this.options.title}getView(){return void 0===this.view&&(this.view=new n.default(this)),this.view}getEmptyViewMessage(){return this.options.noItems}hasPlainTitle(){return!0}hasUnreadContent(){return this.counter>0}isStale(){if(this.stale)return!0;const t=this.getView().getItems().filter((t=>"true"===t.dataset.isUnread));return this.counter!==t.length}async markAsRead(t){const e=await(0,o.dboAction)("markAsRead","wcf\\data\\conversation\\ConversationAction").objectIds([t]).dispatch();this.updateCounter(e.totalCount)}async markAllAsRead(){await(0,o.dboAction)("markAllAsRead","wcf\\data\\conversation\\ConversationAction").dispatch(),this.updateCounter(0)}updateCounter(t){let e=this.button.querySelector(".badge");null===e&&t>0&&(e=document.createElement("span"),e.classList.add("badge","badgeUpdate"),this.button.querySelector("a").append(e)),e&&(0===t?e.remove():e.textContent=t.toString()),this.counter=t}}let r=!1;e.setup=function(t){if(!r){const e=document.getElementById("unreadConversations");if(null!==e){const i=new a(e,t);(0,s.registerProvider)(i)}r=!0}}}));
\ No newline at end of file
+define("WoltLabSuite/Core/Conversation/Ui/MarkAllAsRead",["require","exports","tslib","WoltLabSuite/Core/Ajax","WoltLabSuite/Core/Ui/Notification"],(function(t,e,o,i,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setup=void 0,n=o.__importStar(n),e.setup=function(){document.querySelectorAll(".markAllAsReadButton").forEach((t=>{t.addEventListener("click",(t=>{t.preventDefault(),async function(){await(0,i.dboAction)("markAllAsRead","wcf\\data\\conversation\\ConversationAction").dispatch(),document.querySelectorAll(".conversationList .new").forEach((t=>{t.classList.remove("new")})),document.querySelector("#unreadConversations .badgeUpdate")?.remove(),n.show()}()}))}))}})),define("WoltLabSuite/Core/Conversation/Ui/MarkAsRead",["require","exports","WoltLabSuite/Core/Ajax"],(function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setup=void 0;const i=new WeakSet;e.setup=function(){document.querySelectorAll(".conversationList .new .columnAvatar").forEach((t=>{i.has(t)||(i.add(t),t.addEventListener("dblclick",(e=>{e.preventDefault();const i=t.closest(".conversation");i.classList.contains("new")&&async function(t){const e=parseInt(t.dataset.conversationId,10);await(0,o.dboAction)("markAsRead","wcf\\data\\conversation\\ConversationAction").objectIds([e]).dispatch(),t.classList.remove("new"),t.querySelector(".columnAvatar p")?.removeAttribute("title")}(i)}),{once:!0}))}))}})),define("WoltLabSuite/Core/Conversation/Ui/Message/Quote",["require","exports","WoltLabSuite/Core/Ui/Message/Quote"],(function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UiConversationMessageQuote=void 0;class i extends o.UiMessageQuote{constructor(t){super(t,"wcf\\data\\conversation\\message\\ConversationMessageAction","com.woltlab.wcf.conversation.message",".message",".messageBody",".messageBody > div > div.messageText",!0)}}e.UiConversationMessageQuote=i,e.default=i})),define("WoltLabSuite/Core/Conversation/Ui/Participant/Add",["require","exports","tslib","WoltLabSuite/Core/Ajax","WoltLabSuite/Core/Dom/Util","WoltLabSuite/Core/Ui/Dialog","WoltLabSuite/Core/Ui/Notification","WoltLabSuite/Core/Ui/ItemList/User","WoltLabSuite/Core/Language"],(function(t,e,o,i,n,a,s,r,c){"use strict";return i=o.__importStar(i),n=o.__importDefault(n),a=o.__importDefault(a),s=o.__importStar(s),r=o.__importStar(r),c=o.__importStar(c),class{conversationId;constructor(t){this.conversationId=t,i.api(this,{actionName:"getAddParticipantsForm"})}_ajaxSetup(){return{data:{className:"wcf\\data\\conversation\\ConversationAction",objectIDs:[this.conversationId]}}}_ajaxSuccess(t){switch(t.actionName){case"addParticipants":this.handleResponse(t);break;case"getAddParticipantsForm":this.render(t)}}handleResponse(t){t.returnValues.errorMessage?n.default.innerError(document.getElementById("participantsInput").closest(".inputItemList"),t.returnValues.errorMessage):(t.returnValues.count&&s.show(t.returnValues.successMessage,(()=>window.location.reload())),a.default.close(this))}render(t){a.default.open(this,t.returnValues.template);const e=document.getElementById("addParticipants");e.disabled=!0,r.init("participantsInput",{callbackChange:(t,o)=>{e.disabled=0===o.length},excludedSearchValues:t.returnValues.excludedSearchValues,maxItems:t.returnValues.maxItems,includeUserGroups:t.returnValues.canAddGroupParticipants&&t.returnValues.restrictUserGroupIDs.length>0,restrictUserGroupIDs:t.returnValues.restrictUserGroupIDs,csvPerType:!0}),e.addEventListener("click",(()=>this.submit()))}submit(){const t=[],e=[];r.getValues("participantsInput").forEach((o=>{"group"===o.type?e.push(o.objectId):t.push(o.value)}));const o={participants:t,participantsGroupIDs:e,visibility:null},n=a.default.getDialog(this).content.querySelector('input[name="messageVisibility"]:checked, input[name="messageVisibility"][type="hidden"]');n&&(o.visibility=n.value),i.api(this,{actionName:"addParticipants",parameters:o})}_dialogSetup(){return{id:"conversationAddParticipants",options:{title:c.get("wcf.conversation.edit.addParticipants")},source:null}}}})),define("WoltLabSuite/Core/Conversation/Ui/Subject/Editor",["require","exports","tslib","WoltLabSuite/Core/Ui/Dialog","WoltLabSuite/Core/Dom/Util","WoltLabSuite/Core/Ajax","WoltLabSuite/Core/Language","WoltLabSuite/Core/Ui/Notification"],(function(t,e,o,i,n,a,s,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.beginEdit=void 0,i=o.__importDefault(i),n=o.__importDefault(n),a=o.__importStar(a),s=o.__importStar(s),r=o.__importStar(r);class c{objectId;subject;constructor(t){this.objectId=t}show(){i.default.open(this)}saveEdit(t){t.preventDefault();const e=this.subject.value.trim();""===e?n.default.innerError(this.subject,s.get("wcf.global.form.error.empty")):(n.default.innerError(this.subject,""),a.api(this,{parameters:{subject:e},objectIDs:[this.objectId]}))}getCurrentValue(){return Array.from(document.querySelectorAll(`.jsConversationSubject[data-conversation-id="${this.objectId}"], .conversationLink[data-object-id="${this.objectId}"]`)).map((t=>t.textContent)).slice(-1)[0]}_ajaxSuccess(t){i.default.close(this),document.querySelectorAll(`.jsConversationSubject[data-conversation-id="${this.objectId}"], .conversationLink[data-object-id="${this.objectId}"]`).forEach((e=>{e.textContent=t.returnValues.subject})),r.show()}_dialogSetup(){return{id:"dialogConversationSubjectEditor",options:{onSetup:t=>{this.subject=document.getElementById("jsConversationSubject"),this.subject.addEventListener("keyup",(t=>{"Enter"===t.key&&this.saveEdit(t)})),t.querySelector(".jsButtonSave").addEventListener("click",(t=>this.saveEdit(t)))},onShow:()=>{this.subject.value=this.getCurrentValue()},title:s.get("wcf.conversation.edit.subject")},source:`\n <dl>\n <dt>\n <label for="jsConversationSubject">${s.get("wcf.global.subject")}</label>\n </dt>\n <dd>\n <input type="text" id="jsConversationSubject" class="long" maxlength="255">\n </dd>\n </dl>\n <div class="formSubmit">\n <button type="button" class="button buttonPrimary jsButtonSave">${s.get("wcf.global.button.save")}</button>\n </div>\n `}}_ajaxSetup(){return{data:{actionName:"editSubject",className:"wcf\\data\\conversation\\ConversationAction"}}}}let u;e.beginEdit=function(t){u=new c(t),u.show()}})),define("WoltLabSuite/Core/Conversation/Ui/Object/Action/RemoveParticipant",["require","exports","tslib","WoltLabSuite/Core/Ui/Object/Action/Handler"],(function(t,e,o,i){"use strict";function n(t){t.objectElement.querySelector(".userLink").classList.add("conversationLeft"),t.objectElement.querySelector(".jsObjectAction[data-object-action='removeParticipant']").remove()}Object.defineProperty(e,"__esModule",{value:!0}),e.setup=void 0,i=o.__importDefault(i),e.setup=function(){new i.default("removeParticipant",[],n)}})),define("WoltLabSuite/Core/Conversation/Ui/User/Menu/Data/Conversation",["require","exports","tslib","WoltLabSuite/Core/Ajax","WoltLabSuite/Core/Ui/User/Menu/View","WoltLabSuite/Core/Ui/User/Menu/Manager"],(function(t,e,o,i,n,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setup=void 0,n=o.__importDefault(n);class s{button;counter=0;options;stale=!0;view=void 0;constructor(t,e){this.button=t,this.options=e;const o=t.querySelector(".badge");if(o){const t=parseInt(o.textContent.trim());t&&(this.counter=t)}}getPanelButton(){return this.button}getMenuButtons(){const t=[];return this.options.canStartConversation&&t.push({icon:'<fa-icon size="24" name="plus"></fa-icon>',link:this.options.newConversationLink,name:"newConversation",title:this.options.newConversationTitle}),t}getIdentifier(){return"com.woltlab.wcf.conversation.conversations"}async getData(){const t=await(0,i.dboAction)("getConversations","wcf\\data\\conversation\\ConversationAction").disableLoadingIndicator().dispatch();return this.updateCounter(t.totalCount),this.stale=!1,t.items}getFooter(){return{link:this.options.showAllLink,title:this.options.showAllTitle}}getTitle(){return this.options.title}getView(){return void 0===this.view&&(this.view=new n.default(this)),this.view}getEmptyViewMessage(){return this.options.noItems}hasPlainTitle(){return!0}hasUnreadContent(){return this.counter>0}isStale(){if(this.stale)return!0;const t=this.getView().getItems().filter((t=>"true"===t.dataset.isUnread));return this.counter!==t.length}async markAsRead(t){const e=await(0,i.dboAction)("markAsRead","wcf\\data\\conversation\\ConversationAction").objectIds([t]).dispatch();this.updateCounter(e.totalCount)}async markAllAsRead(){await(0,i.dboAction)("markAllAsRead","wcf\\data\\conversation\\ConversationAction").dispatch(),this.updateCounter(0)}updateCounter(t){let e=this.button.querySelector(".badge");null===e&&t>0&&(e=document.createElement("span"),e.classList.add("badge","badgeUpdate"),this.button.querySelector("a").append(e)),e&&(0===t?e.remove():e.textContent=t.toString()),this.counter=t}}let r=!1;e.setup=function(t){if(!r){const e=document.getElementById("unreadConversations");if(null!==e){const o=new s(e,t);(0,a.registerProvider)(o)}r=!0}}}));
\ No newline at end of file