Updating minified JavaScript files
authorwoltlab.com <woltlab@woltlab.com>
Sun, 5 Jun 2016 11:01:16 +0000 (13:01 +0200)
committerwoltlab.com <woltlab@woltlab.com>
Sun, 5 Jun 2016 11:01:16 +0000 (13:01 +0200)
wcfsetup/install/files/js/WCF.Combined.min.js
wcfsetup/install/files/js/WCF.Core.min.js

index 475d56ad5ba58ae10ea6c178bdc5b74096562b65..50b9735695ccc5bf1720cf7de4d68c730111b947 100755 (executable)
@@ -95,10 +95,10 @@ i&&i.element!==s.element[0]&&("touch"===n.tolerance?l=!(i.left>r||a>i.right||i.t
 
 // WCF.Message.js
 (function (window, undefined) {"use strict";WCF.Message={},WCF.Message.BBCode={},WCF.Message.BBCode.CodeViewer=Class.extend({_dialog:null,init:function(){this._dialog=null,this._initCodeBoxes(),WCF.DOMNodeInsertedHandler.addCallback("WCF.Message.BBCode.CodeViewer",$.proxy(this._initCodeBoxes,this)),WCF.DOMNodeInsertedHandler.execute()},_initCodeBoxes:function(){$(".codeBox:not(.jsCodeViewer)").each($.proxy(function(e,t){var i=$(t).addClass("jsCodeViewer");$('<span class="icon icon16 fa-files-o pointer jsTooltip" title="'+WCF.Language.get("wcf.message.bbcode.code.copy")+'" />').appendTo(i.find("div > h3")).click($.proxy(this._click,this))},this))},_click:function(e){var t="";$(e.currentTarget).parents("div").next("ol").children("li").each(function(e,i){t&&(t+="\n"),t+=$(i).text().replace(/\n+$/,"")}),null===this._dialog?(this._dialog=$('<div><textarea cols="60" rows="12" readonly="readonly" /></div>').hide().appendTo(document.body),this._dialog.children("textarea").val(t),this._dialog.wcfDialog({title:WCF.Language.get("wcf.message.bbcode.code.copy")})):(this._dialog.children("textarea").val(t),this._dialog.wcfDialog("open")),this._dialog.children("textarea").select()}}),WCF.Message.EditHistory=Class.extend({_oldIDInputs:null,_newIDInputs:null,_containerSelector:"",_buttonSelector:".jsRevertButton",init:function(e,t,i,s){this._oldIDInputs=e,this._newIDInputs=t,this._containerSelector=i,this._buttonSelector=s?s:".jsRevertButton",this.proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._initInputs(),this._initElements()},_initInputs:function(){var e=this;this._newIDInputs.change(function(){var t=parseInt($(this).val());"current"===$(this).val()&&(t=1/0),e._oldIDInputs.each(function(){var e=parseInt($(this).val());"current"===$(this).val()&&(e=1/0),e>=t?$(this).disable():$(this).enable()})}),this._oldIDInputs.change(function(){var t=parseInt($(this).val());"current"===$(this).val()&&(t=1/0),e._newIDInputs.each(function(){var e=parseInt($(this).val());"current"===$(this).val()&&(e=1/0),t>=e?$(this).disable():$(this).enable()})}),this._oldIDInputs.filter(":checked").change(),this._newIDInputs.filter(":checked").change()},_initElements:function(){var e=this;$(this._containerSelector).each(function(t,i){var s=$(i);s.find(e._buttonSelector).click($.proxy(e._click,e))})},_click:function(e){var t=$(e.currentTarget);if(e.preventDefault(),t.data("confirmMessage")){var i=this;WCF.System.Confirmation.show(t.data("confirmMessage"),function(e){"cancel"!==e&&i._sendRequest(t)},void 0,void 0,!0)}else this._sendRequest(t)},_sendRequest:function(e){this.proxy.setOption("data",{actionName:"revert",className:"wcf\\data\\edit\\history\\entry\\EditHistoryEntryAction",objectIDs:[$(e).data("objectID")]}),this.proxy.sendRequest()},_success:function(){window.location.reload(!0)}}),WCF.Message.FormGuard=Class.extend({init:function(){var e=$("form.jsFormGuard").removeClass("jsFormGuard").submit(function(){$(this).find(".formSubmit input[type=submit]").disable()});$(window).unload(function(){e.find(".formSubmit input[type=submit]").enable()})}}),WCF.Message.Preview=Class.extend({_className:"",_messageFieldID:"",_messageField:null,_proxy:null,_previewButton:null,_previewButtonLabel:"",init:function(e,t,i){return this._className=e,this._messageFieldID=$.wcfEscapeID(t),this._textarea=$("#"+this._messageFieldID),this._textarea.length?(i=$.wcfEscapeID(i),this._previewButton=$("#"+i),this._previewButton.length?(this._previewButton.click($.proxy(this._click,this)),void(this._proxy=new WCF.Action.Proxy({failure:$.proxy(this._failure,this),success:$.proxy(this._success,this)}))):void console.debug("[WCF.Message.Preview] Unable to find preview button identified by '"+i+"'")):void console.debug("[WCF.Message.Preview] Unable to find message field identified by '"+this._messageFieldID+"'")},_click:function(e){var t=this._getMessage();return null===t?void console.debug("[WCF.Message.Preview] Unable to access Redactor instance of '"+this._messageFieldID+"'"):(this._proxy.setOption("data",{actionName:"getMessagePreview",className:this._className,parameters:this._getParameters(t)}),this._proxy.sendRequest(),this._previewButtonLabel=this._previewButton.html(),this._previewButton.html(WCF.Language.get("wcf.global.loading")).disable(),e.stopPropagation(),!1)},_getParameters:function(e){var t={};return $("#settings_"+this._messageFieldID).find("input[type=checkbox]").each(function(e,i){var s=$(i);s.is(":checked")&&(t[s.prop("name")]=s.prop("value"))}),{data:{message:e},options:t}},_getMessage:function(){return $.browser.redactor?this._textarea.data("redactor")?this._textarea.redactor("wutil.getText"):null:$.trim(this._textarea.val())},_success:function(e){this._previewButton.html(this._previewButtonLabel).enable(),this._textarea.parent().children("small.innerError").remove(),this._handleResponse(e)},_handleResponse:function(){},_failure:function(e){if(null===e||void 0===e.returnValues||void 0===e.returnValues.errorType)return!0;this._previewButton.html(this._previewButtonLabel).enable();var t=this._textarea.next("small.innerError").empty();return t.length||(t=$('<small class="innerError" />').appendTo(this._textarea.parent())),t.html(e.returnValues.errorType),!1}}),WCF.Message.DefaultPreview=WCF.Message.Preview.extend({_attachmentObjectType:null,_attachmentObjectID:null,_tmpHash:null,init:function(e,t,i){this._super("wcf\\data\\bbcode\\MessagePreviewAction","text","previewButton"),this._attachmentObjectType=e||null,this._attachmentObjectID=t||null,this._tmpHash=i||null},_handleResponse:function(e){var t=$("#previewContainer");t.length||(t=$('<section class="section" id="previewContainer"><h2 class="sectionTitle">'+WCF.Language.get("wcf.global.preview")+'</h2><div class="messageTextPreview"></div></section>').prependTo($("#messageContainer")).wcfFadeIn()),t.find("div:eq(0)").html(e.returnValues.message),(new WCF.Effect.Scroll).scrollTo(t)},_getParameters:function(e){var t=this._super(e);return null!=this._attachmentObjectType&&(t.attachmentObjectType=this._attachmentObjectType,t.attachmentObjectID=this._attachmentObjectID,t.tmpHash=this._tmpHash),t}}),WCF.Message.Multilingualism=Class.extend({_availableLanguages:{},_languageID:0,_languageInput:null,init:function(e,t,i){if(this._availableLanguages=t,this._languageID=e||0,this._languageInput=$("#languageID"),this._updateLabel(),this._languageInput.find(".dropdownMenu > li").click($.proxy(this._click,this)),!i){var s=this._languageInput.find(".dropdownMenu");$('<li class="dropdownDivider" />').appendTo(s),$('<li><span><span class="badge">'+this._availableLanguages[0]+"</span></span></li>").click($.proxy(this._disable,this)).appendTo(s)}this._languageInput.parents("form").submit($.proxy(this._submit,this))},_click:function(e){this._languageID=$(e.currentTarget).data("languageID"),this._updateLabel()},_disable:function(){this._languageID=0,this._updateLabel()},_updateLabel:function(){this._languageInput.find(".dropdownToggle > span").text(this._availableLanguages[this._languageID])},_submit:function(){this._languageInput.next("input[name=languageID]").prop("value",this._languageID)}}),WCF.Message.SmileyCategories=Class.extend({_cache:[],_proxy:null,_wysiwygSelector:"",init:function(e){this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._wysiwygSelector=e,$("#smilies-"+this._wysiwygSelector).on("messagetabmenushow",$.proxy(this._click,this))},_click:function(e,t){e.preventDefault();var i=parseInt(t.activeTab.tab.data("smileyCategoryID"));if(i&&!t.activeTab.container.children("ul.smileyList").length){if(void 0!==this._cache[i])return void t.activeTab.container.html(this._cache[i]);this._proxy.setOption("data",{actionName:"getSmilies",className:"wcf\\data\\smiley\\category\\SmileyCategoryAction",objectIDs:[i]}),this._proxy.sendRequest()}},_success:function(e){var t=parseInt(e.returnValues.smileyCategoryID);this._cache[t]=e.returnValues.template,$("#smilies-"+this._wysiwygSelector+"-"+t).html(e.returnValues.template)}}),WCF.Message.Smilies=Class.extend({_editorId:"",init:function(e){this._editorId=e,$(".messageTabMenu[data-wysiwyg-container-id="+this._editorId+"]").on("click",".jsSmiley",this._smileyClick.bind(this))},_smileyClick:function(e){e.preventDefault(),require(["EventHandler"],function(t){t.fire("com.woltlab.wcf.redactor2","insertSmiley_"+this._editorId,{code:elData(e.currentTarget,"smiley-code"),path:elData(e.currentTarget,"smiley-path")})}.bind(this))}}),WCF.Message.InlineEditor=Class.extend({_container:{},_containerID:0,_dropdowns:{},_messageContainerSelector:".jsMessage",_messageEditorIDPrefix:"messageEditor",init:function(e){require(["WoltLab/WCF/Ui/Message/InlineEditor"],function(t){new t({className:this._getClassName(),containerId:e,editorPrefix:this._messageEditorIDPrefix,messageSelector:this._messageContainerSelector,callbackDropdownInit:this._callbackDropdownInit.bind(this)})}.bind(this))},_click:function(e,t){t=null===e?~~t:~~elData(e.currentTarget,"container-id"),require(["WoltLab/WCF/Ui/Message/InlineEditor"],function(e){e.legacyEdit(t)}.bind(this)),e&&e.preventDefault()},_initDropdownMenu:function(){},_callbackDropdownInit:function(e,t){return this._initDropdownMenu($(e).wcfIdentify(),$(t)),null},_getClassName:function(){return""}}),WCF.Message.Submit={_buttons:{},registerButton:function(e,t){WCF.Browser.isChrome()&&(this._buttons[e]=$(t))},execute:function(e){this._buttons[e]&&this._buttons[e].trigger("click")}},WCF.Message.Quote={},WCF.Message.Quote.Handler=Class.extend({_activeContainerID:"",_className:"",_containers:{},_containerSelector:"",_copyQuote:null,_message:"",_messageBodySelector:"",_objectID:0,_objectType:"",_proxy:null,_quoteManager:null,init:function(e,t,i,s,n,a,o){return this._className=t,""==this._className?void console.debug("[WCF.Message.QuoteManager] Empty class name given, aborting."):(this._objectType=i,""==this._objectType?void console.debug("[WCF.Message.QuoteManager] Empty object type name given, aborting."):(this._containerSelector=s,this._message="",this._messageBodySelector=n,this._messageContentSelector=a,this._objectID=0,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._initContainers(),o=o&&e.supportPaste()?!0:!1,this._initCopyQuote(o),$(document).mouseup($.proxy(this._mouseUp,this)),this._quoteManager=e,this._quoteManager.register(this._objectType,this),void WCF.DOMNodeInsertedHandler.addCallback("WCF.Message.Quote.Handler"+i.hashCode(),$.proxy(this._initContainers,this))))},_initContainers:function(){var e=this;$(this._containerSelector).each(function(t,i){var s=$(i),n=s.wcfIdentify();if(!e._containers[n]){if(e._containers[n]=s,s.hasClass("jsInvalidQuoteTarget"))return!0;null!==e._messageBodySelector&&(s=s.find(e._messageBodySelector).data("containerID",n)),s.mousedown($.proxy(e._mouseDown,e)),e._containers[n].find(".jsQuoteMessage").click($.proxy(e._saveFullQuote,e))}})},_mouseDown:function(e){this._copyQuote.hide();var t=$(e.currentTarget);if(this._messageBodySelector&&(t=this._containers[t.data("containerID")]),t.hasClass("jsInvalidQuoteTarget"))return void(this._activeContainerID="");for(var i=e.target;i!==t[0];){if("BLOCKQUOTE"===i.tagName)return void(this._activeContainerID="");i=i.parentElement}this._activeContainerID=t.wcfIdentify(),$.browser.mozilla&&t.find("img").each(function(){var e=$(this);e.data("__alt",e.attr("alt")).removeAttr("alt")})},_getNodeText:function(e){var t=function(e){switch(e.tagName){case"BLOCKQUOTE":case"H3":case"SCRIPT":return NodeFilter.FILTER_REJECT;default:return NodeFilter.FILTER_ACCEPT}};t.acceptNode=t;for(var i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,t,!0),s="";i.nextNode();){var n=i.currentNode;if(n.nodeType===Node.ELEMENT_NODE)switch(n.tagName){case"BR":case"LI":case"UL":s+="\n";break;case"TD":$.browser.msie||(s+="\n")}else s+=n.nodeValue.replace(/\n/g,"")}return s},_mouseUp:function(e){if(""==this._activeContainerID)return void this._copyQuote.hide();var t=this._containers[this._activeContainerID],i=this._getSelectedText(),s=$.trim(i);if(""==s)return void this._copyQuote.hide();for(var n=this._messageBodySelector?t.find(this._messageContentSelector)[0]:t[0],a=e.target;a!==t[0];){if(null===a||"BLOCKQUOTE"===a.tagName)return void this._copyQuote.hide();a=a.parentElement}var o=window.getSelection().getRangeAt(0);if(!this._elementInsideContainer(o.startContainer,n)||!this._elementInsideContainer(o.endContainer,n))return void this._copyQuote.hide();var r=this._getNodeText(n);if(-1!==this._normalize(r).indexOf(this._normalize(s))){this._copyQuote.show();var l=this._getBoundingRectangle(t,window.getSelection()),c=this._copyQuote.getDimensions("outer"),u=(l.right-l.left)/2-c.width/2+l.left;this._copyQuote.css({top:l.top-c.height-7+"px",left:u+"px"}),this._copyQuote.hide(),this._activeContainerID="";var h=this;new WCF.PeriodicalExecuter(function(e){e.stop();var i=$.trim(h._getSelectedText());""!=i&&(h._copyQuote.show(),h._message=i,h._objectID=t.data("objectID"),$.browser.mozilla&&t.find("img").each(function(){var e=$(this);e.attr("alt",e.data("__alt"))}))},10)}},_elementInsideContainer:function(e,t){for(e.nodeType===Node.TEXT_NODE&&(e=e.parentNode);e;){if(e===t)return!0;e=e.parentNode}return!1},_normalize:function(e){return e.replace(/\r?\n|\r/g,"\n").replace(/\s/g," ").replace(/\s{2,}/g," ")},_getOffset:function(e,t){e.collapse(t);var i=WCF.getRandomID(),s=document.createElement("span");s.innerHTML='<span id="'+i+'"></span>';for(var n,a=document.createDocumentFragment();n=s.firstChild;)a.appendChild(n);e.insertNode(a),s=$("#"+i);var o=s.offset();return o.top=o.top-$(window).scrollTop(),s.remove(),o},_getBoundingRectangle:function(e,t){var i=null;if(document.createRange&&"undefined"!=typeof document.createRange().getBoundingClientRect){if(t.rangeCount>0){var s=t.getRangeAt(0).getBoundingClientRect();i={left:s.left,right:s.right,top:s.top+$(document).scrollTop()}}}else if(document.selection&&"Control"!=document.selection.type){var n=document.selection.createRange();i={left:n.boundingLeft,right:n.boundingRight,top:n.boundingTop}}return i},_saveSelection:function(e){if(window.getSelection&&document.createRange){var t=window.getSelection().getRangeAt(0),i=t.cloneRange();i.selectNodeContents(e),i.setEnd(t.startContainer,t.startOffset);var s=i.toString().length;return{start:s,end:s+t.toString().length}}var n=document.selection.createRange(),a=document.body.createTextRange();a.moveToElementText(e),a.setEndPoint("EndToStart",n);var s=a.text.length;return{start:s,end:s+n.text.length}},_restoreSelection:function(e,t){if(window.getSelection&&document.createRange){var i=0,s=document.createRange();s.setStart(e,0),s.collapse(!0);for(var n,a=[e],o=!1,r=!1;!r&&(n=a.pop());)if(n.nodeType==Node.TEXT_NODE){var l=i+n.length;!o&&t.start>=i&&t.start<=l&&(s.setStart(n,t.start-i),o=!0),o&&t.end>=i&&t.end<=l&&(s.setEnd(n,t.end-i),r=!0),i=l}else for(var c=n.childNodes.length;c--;)a.push(n.childNodes[c]);var u=window.getSelection();u.removeAllRanges(),u.addRange(s)}else{var h=document.body.createTextRange();h.moveToElementText(e),h.collapse(!0),h.moveEnd("character",t.end),h.moveStart("character",t.start),h.select()}},_initCopyQuote:function(e){if(this._copyQuote=$("#quoteManagerCopy"),!this._copyQuote.length){this._copyQuote=$('<div id="quoteManagerCopy" class="balloonTooltip"><span class="jsQuoteManagerStore">'+WCF.Language.get("wcf.message.quote.quoteSelected")+'</span><span class="pointer"><span></span></span></div>').hide().appendTo(document.body);var t=this._copyQuote.children("span.jsQuoteManagerStore").click($.proxy(this._saveQuote,this));e&&$('<span class="jsQuoteManagerQuoteAndInsert">'+WCF.Language.get("wcf.message.quote.quoteAndReply")+"</span>").click($.proxy(this._saveAndInsertQuote,this)).insertAfter(t)}},_getSelectedText:function(){var e=window.getSelection();return e.rangeCount?this._getNodeText(e.getRangeAt(0).cloneContents()):""},_saveFullQuote:function(e){var t=$(e.currentTarget);this._proxy.setOption("data",{actionName:"saveFullQuote",className:this._className,interfaceName:"wcf\\data\\IMessageQuoteAction",objectIDs:[t.data("objectID")]}),this._proxy.sendRequest(),t.data("isQuoted")?t.data("isQuoted",!1).children("a").removeClass("active"):t.data("isQuoted",!0).children("a").addClass("active");var i=t.parents(".buttonGroupNavigation");return i.hasClass("jsMobileButtonGroupNavigation")&&i.children(".dropdownLabel").trigger("click"),e.stopPropagation(),!1},_saveQuote:function(e){e=e===!0?!0:!1,this._proxy.setOption("data",{actionName:"saveQuote",className:this._className,interfaceName:"wcf\\data\\IMessageQuoteAction",objectIDs:[this._objectID],parameters:{message:this._message,renderQuote:e}}),this._proxy.sendRequest()},_saveAndInsertQuote:function(){this._saveQuote(!0)},_success:function(e){if(void 0!==e.returnValues.count){void 0!==e.returnValues.fullQuoteMessageIDs&&(e.returnValues.fullQuoteObjectIDs=e.returnValues.fullQuoteMessageIDs);var t=void 0!==e.returnValues.fullQuoteObjectIDs?e.returnValues.fullQuoteObjectIDs:{};this._quoteManager.updateCount(e.returnValues.count,t)}switch(e.actionName){case"saveQuote":case"saveFullQuote":e.returnValues.renderedQuote&&WCF.System.Event.fireEvent("com.woltlab.wcf.message.quote","insert",{forceInsert:"saveQuote"===e.actionName?!0:!1,quote:e.returnValues.renderedQuote})}},updateFullQuoteObjectIDs:function(e){for(var t in this._containers)this._containers[t].find(".jsQuoteMessage").each(function(t,i){var s=$(i).data("isQuoted",0);s.children("a").removeClass("active"),WCF.inArray(s.data("objectID"),e)&&s.data("isQuoted",1).children("a").addClass("active")})}}),WCF.Message.Quote.Manager=Class.extend({_buttons:{},_count:0,_dialog:null,_editorElement:null,_editorElementAlternative:null,_form:null,_handlers:{},_hasTemplate:!1,_insertQuotes:!0,_proxy:null,_removeOnSubmit:[],_showQuotes:null,_supportPaste:!1,init:function(e,t,i,s){this._buttons={insert:null,remove:null},this._count=parseInt(e)||0,this._dialog=null,this._editorElement=null,this._editorElementAlternative=null,this._form=null,this._handlers={},this._hasTemplate=!1,this._insertQuotes=!0,this._removeOnSubmit=[],this._showQuotes=null,this._supportPaste=!1,t&&(this._editorElement=$("#"+t),this._editorElement.length&&(this._supportPaste=!0,this._form=this._editorElement.parents("form:eq(0)"),this._form.length?(this._form.submit($.proxy(this._submit,this)),this._removeOnSubmit=s||[]):(this._form=null,this._supportPaste=i===!0?!0:!1))),this._proxy=new WCF.Action.Proxy({showLoadingOverlay:!1,success:$.proxy(this._success,this),url:"index.php/MessageQuote/?t="+SECURITY_TOKEN}),this._toggleShowQuotes(),WCF.System.Event.addListener("com.woltlab.wcf.message.quote","insert",function(e){this._insertQuote(null,void 0,e)}.bind(this))},setAlternativeEditor:function(e){this._editorElementAlternative=e},clearAlternativeEditor:function(){this._editorElementAlternative=null},register:function(e,t){this._handlers[e]=t},updateCount:function(e,t){this._count=parseInt(e)||0,this._toggleShowQuotes();for(var i in this._handlers){var s=t[i]||[];this._handlers[i].updateFullQuoteObjectIDs(s)}},insertQuotes:function(e,t,i){return this._insertQuotes?void new WCF.Action.Proxy({autoSend:!0,data:{actionName:"getRenderedQuotes",className:e,interfaceName:"wcf\\data\\IMessageQuoteAction",parameters:{parentObjectID:t}},success:i}):void(this._insertQuotes=!0)},_toggleShowQuotes:function(){if(this._count){null===this._showQuotes&&(this._showQuotes=$("#showQuotes"),this._showQuotes.length||(this._showQuotes=$('<div id="showQuotes" class="balloonTooltip" />').click($.proxy(this._click,this)).appendTo(document.body)));var e=WCF.Language.get("wcf.message.quote.showQuotes").replace(/#count#/,this._count);this._showQuotes.text(e).show()}else null!==this._showQuotes&&this._showQuotes.hide();this._hasTemplate=!1},_click:function(){this._hasTemplate?this._dialog.wcfDialog("open"):(this._proxy.showLoadingOverlayOnce(),this._proxy.setOption("data",{actionName:"getQuotes",supportPaste:this._supportPaste}),this._proxy.sendRequest())},renderDialog:function(e){null===this._dialog&&(this._dialog=$("#messageQuoteList"),this._dialog.length||(this._dialog=$('<div id="messageQuoteList" />').hide().appendTo(document.body))),this._dialog.html(e);var t=$('<div class="formSubmit" />').appendTo(this._dialog);this._supportPaste&&(this._buttons.insert=$('<button class="buttonPrimary">'+WCF.Language.get("wcf.message.quote.insertAllQuotes")+"</button>").click($.proxy(this._insertSelected,this)).appendTo(t)),this._buttons.remove=$("<button>"+WCF.Language.get("wcf.message.quote.removeAllQuotes")+"</button>").click($.proxy(this._removeSelected,this)).appendTo(t),this._dialog.wcfDialog({title:WCF.Language.get("wcf.message.quote.manageQuotes")}),this._dialog.wcfDialog("render"),this._hasTemplate=!0;var i=this._dialog.find(".jsInsertQuote");if(this._supportPaste?i.click($.proxy(this._insertQuote,this)):i.hide(),this._dialog.find("input.jsCheckbox").change($.proxy(this._changeButtons,this)),this._removeOnSubmit.length){var s=this;this._dialog.find("input.jsRemoveQuote").each(function(e,t){var i=$(t).change($.proxy(this._change,this));WCF.inArray(i.parent("li").attr("data-quote-id"),s._removeOnSubmit)&&i.attr("checked","checked")})}},_changeButtons:function(){this._dialog.find("input.jsCheckbox:checked").length?(this._supportPaste&&this._buttons.insert.html(WCF.Language.get("wcf.message.quote.insertSelectedQuotes")),this._buttons.remove.html(WCF.Language.get("wcf.message.quote.removeSelectedQuotes"))):(this._supportPaste&&this._buttons.insert.html(WCF.Language.get("wcf.message.quote.insertAllQuotes")),this._buttons.remove.html(WCF.Language.get("wcf.message.quote.removeAllQuotes")))},_change:function(e){var t=$(e.currentTarget),i=t.parent("li").attr("data-quote-id");if(t.prop("checked"))this._removeOnSubmit.push(i);else for(var s in this._removeOnSubmit)if(this._removeOnSubmit[s]==i){delete this._removeOnSubmit[s];break}},_insertSelected:function(){if(null===this._editorElementAlternative){var e=$(".jsQuickReply:eq(0)").data("__api");e&&!e.getContainer().is(":visible")&&(this._insertQuotes=!1,e.click(null))}this._dialog.find("input.jsCheckbox:checked").length||this._dialog.find("input.jsCheckbox").prop("checked","checked"),this._dialog.find("input.jsCheckbox:checked").each($.proxy(function(e,t){this._insertQuote(null,t)},this)),this._dialog.wcfDialog("close")},_insertQuote:function(e,t,i){var s,n,a,o=null;if(void 0===i){o=null===e?$(t).parents("li"):$(e.currentTarget).parents("li"),s=$.trim(o.children("div.jsFullQuote").text());var r=o.parents("article.message");n=r.attr("data-username"),a=r.data("link"),i={forceInsert:!0}}else s=i.quote.text,n=i.quote.username,a=i.quote.link;if($.browser.redactor)if(null===this._editorElementAlternative){var l=!0;if(null!==e||null!==i){var c=$(".jsQuickReply:eq(0)").data("__api");c&&!c.getContainer().is(":visible")&&(i.forceInsert?(this._insertQuotes=!1,c.click(null)):l=!1)}l&&this._editorElement.length&&this._editorElement.redactor("wbbcode.insertQuoteBBCode",n,a,s,s)}else this._editorElementAlternative.redactor("wbbcode.insertQuoteBBCode",n,a,s,s);else{s="[quote='"+n+"','"+a+"']"+s+"[/quote]";var u=null===this._editorElementAlternative?this._editorElement:this._editorElementAlternative,h=u.val();if(s+="\n\n",0==h.length)u.val(s);else{var d=u.getCaret();u.val(h.substr(0,d)+s+h.substr(d))}}null!==o&&this._removeOnSubmit.push(o.attr("data-quote-id")),null!==e&&this._dialog.wcfDialog("close")},_removeSelected:function(){this._dialog.find("input.jsCheckbox:checked").length||this._dialog.find("input.jsCheckbox").prop("checked","checked");var e=[];if(this._dialog.find("input.jsCheckbox:checked").each(function(t,i){e.push($(i).parents("li").attr("data-quote-id"))}),e.length){var t=[];for(var i in this._handlers)t.push(i);this._proxy.setOption("data",{actionName:"remove",getFullQuoteObjectIDs:this._handlers.length>0,objectTypes:t,quoteIDs:e}),this._proxy.sendRequest(),this._dialog.wcfDialog("close")}},_submit:function(){if(this._supportPaste&&this._removeOnSubmit.length>0){var e=this._form.find(".formSubmit");for(var t in this._removeOnSubmit)$('<input type="hidden" name="__removeQuoteIDs[]" value="'+this._removeOnSubmit[t]+'" />').appendTo(e)}},getQuotesMarkedForRemoval:function(){return this._removeOnSubmit},markQuotesForRemoval:function(){this._removeOnSubmit.length&&(this._proxy.setOption("data",{actionName:"markForRemoval",quoteIDs:this._removeOnSubmit}),this._proxy.suppressErrors(),this._proxy.sendRequest())},removeMarkedQuotes:function(){this._removeOnSubmit.length&&(this._proxy.setOption("data",{actionName:"removeMarkedQuotes",getFullQuoteObjectIDs:this._handlers.length>0}),this._proxy.sendRequest())},countQuotes:function(){var e=[];for(var t in this._handlers)e.push(t);this._proxy.setOption("data",{actionName:"count",getFullQuoteObjectIDs:e.length>0,objectTypes:e}),this._proxy.sendRequest()},_success:function(e){if(null!==e){if(void 0!==e.count){var t=void 0!==e.fullQuoteObjectIDs?e.fullQuoteObjectIDs:{};this.updateCount(e.count,t)}void 0!==e.template&&(""==$.trim(e.template)?this.updateCount(0,{}):this.renderDialog(e.template))}},supportPaste:function(){return this._supportPaste}}),WCF.Message.Share={},WCF.Message.Share.Content=Class.extend({_cache:{},_dialog:null,init:function(){this._cache={},this._dialog=null,this._initLinks(),WCF.DOMNodeInsertedHandler.addCallback("WCF.Message.Share.Content",$.proxy(this._initLinks,this))},_initLinks:function(){$("a.jsButtonShare").removeClass("jsButtonShare").click($.proxy(this._click,this))},_click:function(e){e.preventDefault();var t=$(e.currentTarget),i=t.prop("href"),s=t.data("linkTitle")?t.data("linkTitle"):i,n=i.hashCode();if(void 0===this._cache[n]){var a=!1;null===this._dialog?(this._dialog=$("<div />").hide().appendTo(document.body),a=!0):this._dialog.empty();var o=$('<section class="section"><h2 class="sectionTitle"><label for="__sharePermalink">'+WCF.Language.get("wcf.message.share.permalink")+"</label></h2></section>").appendTo(this._dialog);$('<input type="text" id="__sharePermalink" class="long" readonly="readonly" />').attr("value",i).appendTo(o);var o=$('<section class="section"><h2 class="sectionTitle"><label for="__sharePermalinkBBCode">'+WCF.Language.get("wcf.message.share.permalink.bbcode")+"</label></h2></section>").appendTo(this._dialog);$('<input type="text" id="__sharePermalinkBBCode" class="long" readonly="readonly" />').attr("value","[url='"+i+"']"+s+"[/url]").appendTo(o);var o=$('<section class="section"><h2 class="sectionTitle"><label for="__sharePermalinkHTML">'+WCF.Language.get("wcf.message.share.permalink.html")+"</label></h2></section>").appendTo(this._dialog);$('<input type="text" id="__sharePermalinkHTML" class="long" readonly="readonly" />').attr("value",'<a href="'+i+'">'+WCF.String.escapeHTML(s)+"</a>").appendTo(o),this._cache[n]=this._dialog.html(),this._dialog.wcfDialog(a?{title:WCF.Language.get("wcf.message.share")}:"open")}else this._dialog.html(this._cache[n]).wcfDialog("open");this._enableSelection()},_enableSelection:function(){var e=this._dialog.find("input").click(function(){$(this).select()});navigator.userAgent.match(/iP(ad|hone|od)/)&&e.keydown(function(){return!1}).removeAttr("readonly").click(function(){this.setSelectionRange(0,9999)})}}),WCF.Message.Share.Page=Class.extend({_dialog:null,_fetchObjectCount:!1,_pageDescription:"",_pageURL:"",_privacySettings:{},_provider:{},_proxy:null,init:function(e,t){this._dialog=null,this._fetchObjectCount=e===!0?!0:!1,this._pageDescription=encodeURIComponent($('meta[property="og:title"]').prop("content")),this._pageURL=encodeURIComponent($('meta[property="og:url"]').prop("content")),this._privacySettings=$.extend({facebook:!1,google:!1,twitter:!1,reddit:!1},t||{}),this._proxy=null,this._initProvider()},_initProvider:function(){var e=$(".messageShareButtons"),t=this;if(this._provider={facebook:{fetch:function(){t._fetchFacebook()},link:e.find(".jsShareFacebook"),share:function(){t._share("facebook","https://www.facebook.com/sharer.php?u={pageURL}&t={text}",!0)}},google:{fetch:void 0,link:e.find(".jsShareGoogle"),share:function(){t._share("google","https://plus.google.com/share?url={pageURL}",!0)}},reddit:{fetch:function(){t._fetchReddit()},link:e.find(".jsShareReddit"),share:function(){t._share("reddit","https://ssl.reddit.com/submit?url={pageURL}",!0)}},twitter:{fetch:void 0,link:e.find(".jsShareTwitter"),share:function(){t._share("twitter","https://twitter.com/share?url={pageURL}&text={text}",!1)}}},$.each(this._provider,function(e,i){t._privacySettings[e]?t._fetchObjectCount&&i.fetch&&i.fetch():i.link.addClass("disabled"),i.link.data("provider",e).click($.proxy(t._click,t))}),WCF.User.userID&&!e.find(".jsShowPrivacySettings").length){var i=$('<li class="jsShowPrivacySettings"><a><span class="icon icon32 fa-gear jsTooltip" title="'+WCF.Language.get("wcf.message.share.privacy")+'" /></a></li>');i.appendTo(e.children("ul")).children("a").click($.proxy(this._openPrivacySettings,this))}},_click:function(e){var t=$(e.currentTarget),i=t.data("provider");t.hasClass("disabled")?WCF.User.userID?this._openPrivacySettings():t.removeClass("disabled"):this._provider[i].share()},_openPrivacySettings:function(){null===this._proxy&&(this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)})),this._proxy.setOption("data",{actionName:"getSocialNetworkPrivacySettings",className:"wcf\\data\\user\\UserAction"}),this._proxy.sendRequest()},_success:function(e){switch(e.actionName){case"getSocialNetworkPrivacySettings":this._renderDialog(e);break;case"saveSocialNetworkPrivacySettings":this._updatePrivacySettings(e)}},_renderDialog:function(e){null===this._dialog?(this._dialog=$("<div />").hide().appendTo(document.body),this._dialog.html(e.returnValues.template),this._dialog.wcfDialog({title:WCF.Language.get("wcf.message.share.privacy")})):(this._dialog.html(e.returnValues.template),this._dialog.wcfDialog("open")),this._dialog.find("input[type=submit]").click($.proxy(this._save,this))},_save:function(){this._proxy.setOption("data",{actionName:"saveSocialNetworkPrivacySettings",className:"wcf\\data\\user\\UserAction",parameters:{facebook:this._dialog.find("input[name=facebook]").is(":checked"),google:this._dialog.find("input[name=google]").is(":checked"),reddit:this._dialog.find("input[name=reddit]").is(":checked"),twitter:this._dialog.find("input[name=twitter]").is(":checked")}}),this._proxy.sendRequest(),this._dialog.wcfDialog("close")},_updatePrivacySettings:function(e){this._privacySettings=$.extend(this._privacySettings,e.returnValues.settings);var t=this;$.each(e.returnValues.settings,function(e,i){t._privacySettings[e]=i?!0:!1,i?(t._provider[e].link.removeClass("disabled"),t._fetchObjectCount&&t._provider[e].fetch&&t._provider[e].fetch()):t._provider[e].link.addClass("disabled")}),(new WCF.System.Notification).show()},_share:function(e,t,i){window.open(t.replace(/{pageURL}/,this._pageURL).replace(/{text}/,this._pageDescription+(i?" "+this._pageURL:"")),e,"height=600,width=600")},_fetchCount:function(e,t,i){var s={autoSend:!0,dataType:"jsonp",showLoadingOverlay:!1,success:t,suppressErrors:!0,type:"GET",url:e.replace(/{pageURL}/,this._pageURL)};i&&(s.jsonp=i),new WCF.Action.Proxy(s)},_fetchFacebook:function(){this._fetchCount("https://graph.facebook.com/?id={pageURL}",$.proxy(function(e){e.shares&&this._provider.facebook.link.children("span.badge").show().text(e.shares)},this))},_fetchReddit:function(){window.location.protocol.match(/^https/)||this._fetchCount("http://www.reddit.com/api/info.json?url={pageURL}",$.proxy(function(e){e.data.children.length&&this._provider.reddit.link.children("span.badge").show().text(e.data.children[0].data.score)},this),"jsonp")}}),WCF.Message.UserMention=Class.extend({init:function(){throw new Error("Support for mentions in Redactor are now enabled by adding the attribute 'data-support-mention=\"true\"' to the textarea element.")}}),$.widget("wcf.messageTabMenu",{_span:null,_tabs:[],_tabsByName:{},options:{collapsible:!0},_create:function(){
-var e=this.element.find("> nav"),t=e.find("> ul > li:not(.jsFlexibleMenuDropdown)"),i=this.element.find("> div, > fieldset");if(t.length!=i.length)return void console.debug("[wcf.messageTabMenu] Amount of tabs does not equal amount of tab containers, aborting.");this._span=$("<span />").appendTo(e);var s=this.element.data("preselect");this._tabs=[],this._tabsByName={};for(var n=0;n<t.length;n++){var a=$(t[n]),o=$(i[n]),r=a.data("name");if(void 0===r){var l=a.children("a").prop("href");void 0!==l&&l.match(/#([a-zA-Z_-]+)$/)&&(r=RegExp.$1),void 0===r&&(r=a.wcfIdentify(),console.debug("[wcf.messageTabMenu] Missing name attribute, assuming generic ID '"+r+"'"))}this._tabs.push({container:o,name:r,tab:a}),this._tabsByName[r]=n;var c=a.children("a").data("index",n).click($.proxy(this._showTab,this));s==r&&c.trigger("click")}s===!0&&this._tabs.length&&this._tabs[0].tab.children("a").trigger("click");var u=this.element.data("collapsible");void 0!==u&&(this.options.collapsible=u)},destroy:function(){$.Widget.prototype.destroy.apply(this,arguments),this.element.remove()},_showTab:function(e,t,i){var s=null===e?t:$(e.currentTarget).data("index");i=this.options.collapsible&&i!==!0?!1:!0;for(var n=null,a=0;a<this._tabs.length;a++){var o=this._tabs[a];if(a==s){if(!o.tab.hasClass("active")){o.tab.addClass("active"),o.container.addClass("active"),n=o;continue}if(i===!0)continue}o.tab.removeClass("active"),o.container.removeClass("active")}null!==e&&(e.preventDefault(),e.stopPropagation()),null!==n&&this._trigger("show",{},{activeTab:n}),this._span.css({transform:"translateX("+n.tab[0].offsetLeft+"px)",width:n.tab[0].clientWidth+"px"}),$(window).trigger("resize")},showTab:function(e,t){return $.isNumeric(e)||void 0!==this._tabsByName[e]&&(e=this._tabsByName[e]),void 0===this._tabs[e]?void console.debug("[wcf.messageTabMenu] Cannot locate tab identified by '"+e+"'"):void this._showTab(null,e,t)},getTab:function(e){return void 0!==this._tabsByName[e]?this._tabs[this._tabsByName[e]].tab:null},getContainer:function(e){return void 0!==this._tabsByName[e]?this._tabs[this._tabsByName[e]].container:null}}); })(this);
+var e=this.element.find("> nav"),t=e.find("> ul > li:not(.jsFlexibleMenuDropdown)"),i=this.element.find("> div, > fieldset");if(t.length!=i.length)return void console.debug("[wcf.messageTabMenu] Amount of tabs does not equal amount of tab containers, aborting.");this._span=$("<span />").appendTo(e);var s=this.element.data("preselect");i.each(function(e,i){return null!==elBySel(".innerError",i)?(s=$(t[e]).data("name"),!1):void 0}),this._tabs=[],this._tabsByName={};for(var n=0;n<t.length;n++){var a=$(t[n]),o=$(i[n]),r=a.data("name");if(void 0===r){var l=a.children("a").prop("href");void 0!==l&&l.match(/#([a-zA-Z_-]+)$/)&&(r=RegExp.$1),void 0===r&&(r=a.wcfIdentify(),console.debug("[wcf.messageTabMenu] Missing name attribute, assuming generic ID '"+r+"'"))}this._tabs.push({container:o,name:r,tab:a}),this._tabsByName[r]=n;var c=a.children("a").data("index",n).click($.proxy(this._showTab,this));s==r&&c.trigger("click")}s===!0&&this._tabs.length&&this._tabs[0].tab.children("a").trigger("click");var u=this.element.data("collapsible");void 0!==u&&(this.options.collapsible=u)},destroy:function(){$.Widget.prototype.destroy.apply(this,arguments),this.element.remove()},_showTab:function(e,t,i){var s=null===e?t:$(e.currentTarget).data("index");i=this.options.collapsible&&i!==!0?!1:!0;for(var n=null,a=0;a<this._tabs.length;a++){var o=this._tabs[a];if(a==s){if(!o.tab.hasClass("active")){o.tab.addClass("active"),o.container.addClass("active"),n=o;continue}if(i===!0)continue}o.tab.removeClass("active"),o.container.removeClass("active")}null!==e&&(e.preventDefault(),e.stopPropagation()),null!==n&&this._trigger("show",{},{activeTab:n}),this._span.css({transform:"translateX("+n.tab[0].offsetLeft+"px)",width:n.tab[0].clientWidth+"px"}),$(window).trigger("resize")},showTab:function(e,t){return $.isNumeric(e)||void 0!==this._tabsByName[e]&&(e=this._tabsByName[e]),void 0===this._tabs[e]?void console.debug("[wcf.messageTabMenu] Cannot locate tab identified by '"+e+"'"):void this._showTab(null,e,t)},getTab:function(e){return void 0!==this._tabsByName[e]?this._tabs[this._tabsByName[e]].tab:null},getContainer:function(e){return void 0!==this._tabsByName[e]?this._tabs[this._tabsByName[e]].container:null}}); })(this);
 
 // WCF.Poll.js
-(function (window, undefined) {"use strict";WCF.Poll={},WCF.Poll.Management=Class.extend({_container:null,_count:0,_editorId:"",_maxOptions:0,init:function(t,e,n,i){return this._count=0,this._maxOptions=n||-1,this._container=$("#"+t).children("ol:eq(0)"),this._container.length?(e=e||[],this._createOptionList(e),i?(this._editorId=i,WCF.System.Event.addListener("com.woltlab.wcf.redactor2","reset_"+i,this._reset.bind(this)),WCF.System.Event.addListener("com.woltlab.wcf.redactor2","submit_"+i,this._submit.bind(this))):this._container.parents("form").submit($.proxy(this._submit,this)),void new WCF.Sortable.List(t,"",void 0,{toleranceElement:"> div"},!0)):void console.debug("[WCF.Poll.Management] Invalid container id given, aborting.")},_createOptionList:function(t){for(var e=0,n=t.length;n>e;e++){var i=t[e];this._createOption(i.optionValue,i.optionID)}this._createOption()},_createOption:function(t,e,n){t=t||"",e=parseInt(e)||0,n=n||null;var i=$('<li class="sortableNode" />').data("optionID",e);null===n?i.appendTo(this._container):i.insertAfter(n);var o=$('<div class="pollOptionInput" />').appendTo(i);$('<span class="icon icon16 fa-plus jsTooltip jsAddOption pointer" title="'+WCF.Language.get("wcf.poll.button.addOption")+'" />').click($.proxy(this._addOption,this)).appendTo(o),$('<span class="icon icon16 fa-times jsTooltip jsDeleteOption pointer" title="'+WCF.Language.get("wcf.poll.button.removeOption")+'" />').click($.proxy(this._removeOption,this)).appendTo(o);var s=$('<input type="text" value="'+t+'" maxlength="255" />').keydown($.proxy(this._keyDown,this)).appendTo(o);s.click(function(){document.activeElement!==this&&this.focus()}),null!==n&&s.focus(),WCF.DOMNodeInsertedHandler.execute(),this._count++,this._count===this._maxOptions&&this._container.find("span.jsAddOption").removeClass("pointer").addClass("disabled")},_keyDown:function(t){return 13!==t.which?!0:($(t.currentTarget).prev(".sortableButtonContainer").children(".jsAddOption").trigger("click"),t.preventDefault(),t.stopPropagation(),!1)},_addOption:function(t){if(this._count===this._maxOptions)return!1;var e=$(t.currentTarget).closest("li",this._container[0]);this._createOption(void 0,void 0,e)},_removeOption:function(t){$(t.currentTarget).closest("li",this._container[0]).remove(),this._count--,this._container.find("span.jsAddOption").addClass("pointer").removeClass("disabled"),0==this._container.children("li").length&&this._createOption()},_submit:function(t){var e=[];if(this._container.children("li").each(function(t,n){var i=$(n),o=$.trim(i.find("input").val());""!=o&&e.push(i.data("optionID")+"_"+o)}),t instanceof Event){if(e.length)for(var n=this._container.parents("form").find(".formSubmit"),i=0,o=e.length;o>i;i++)$('<input type="hidden" name="pollOptions['+i+']">').val(e[i]).appendTo(n)}else{t.poll={pollOptions:e};var s=this._container.parents(".messageTabMenuContent:eq(0)");s.find("input").each(function(e,n){n.name&&("checkbox"!==n.type||n.checked)&&(t.poll[n.name]=n.value)})}},_reset:function(){for(var t=this._container[0];t.childElementCount>1;)t.removeChild(t.children[1]);elBySel("input",t.children[0]).value="";var e=this._container.parents(".messageTabMenuContent:eq(0)");e.find("input").each(function(t,e){e.name&&("checkbox"===e.type?e.checked=!1:"text"===e.type?e.value="":"number"===e.type&&(e.value=e.min))}),require(["WoltLab/WCF/Date/Picker"],function(t){t.clear("pollEndTime_"+this._editorId)}.bind(this))}}),WCF.Poll.Manager=Class.extend({_cache:{},_canViewParticipants:{},_canViewResult:{},_canVote:{},_inputElements:{},_participants:{},_polls:{},_proxy:null,init:function(t){var e=$(t);if(!e.length)return void console.debug("[WCF.Poll.Manager] Given selector '"+t+"' does not match, aborting.");this._cache={},this._canViewParticipants={},this._canViewResult={},this._inputElements={},this._participants={},this._polls={},this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this),url:"index.php/Poll/?t="+SECURITY_TOKEN});var n=this;e.each(function(t,e){var i=$(e),o=i.data("pollID");void 0===n._polls[o]&&(n._cache[o]={result:"",vote:""},n._polls[o]=i,n._canViewParticipants[o]=i.data("canViewParticipants")?!0:!1,n._canViewResult[o]=i.data("canViewResult")?!0:!1,n._canVote[o]=i.data("canVote")?!0:!1,n._bindListeners(o),i.data("inVote")&&n._prepareVote(o),n._toggleButtons(o))})},_bindListeners:function(t){this._polls[t].find(".jsButtonPollShowParticipants").data("pollID",t).click($.proxy(this._showParticipants,this)),this._polls[t].find(".jsButtonPollShowResult").data("pollID",t).click($.proxy(this._showResult,this)),this._polls[t].find(".jsButtonPollShowVote").data("pollID",t).click($.proxy(this._showVote,this)),this._polls[t].find(".jsButtonPollVote").data("pollID",t).click($.proxy(this._vote,this))},_showResult:function(t,e){var n=null===t?e:$(t.currentTarget).data("pollID");this._canViewResult[n]&&this._polls[n].data("inVote")&&(this._cache[n].result?(this._polls[n].find(".pollInnerContainer").html(this._cache[n].result),this._polls[n].data("inVote",!1),this._toggleButtons(n)):(this._proxy.setOption("data",{actionName:"getResult",pollID:n}),this._proxy.sendRequest()))},_showParticipants:function(t){var e=$(t.currentTarget).data("pollID");this._participants[e]||(this._participants[e]=new WCF.User.List("wcf\\data\\poll\\PollAction",this._polls[e].data("question"),{pollID:e})),this._participants[e].open()},_showVote:function(t,e){var n=null===t?e:$(t.currentTarget).data("pollID");this._canVote[n]&&(this._polls[n].data("inVote")||(this._cache[n].vote?(this._polls[n].find(".pollInnerContainer").html(this._cache[n].vote),this._polls[n].data("inVote",!0),this._prepareVote(n),this._toggleButtons(n)):(this._proxy.setOption("data",{actionName:"getVote",pollID:n}),this._proxy.sendRequest())))},_success:function(t){if(t&&t.actionName){var e=t.pollID;switch(t.resultTemplate&&(this._cache[e].result=t.resultTemplate),t.voteTemplate&&(this._cache[e].vote=t.voteTemplate),t.actionName){case"getResult":this._showResult(null,e);break;case"getVote":this._showVote(null,e);break;case"vote":this._canViewResult[e]=!0,this._canVote[e]=t.canVote?!0:!1,this._showResult(null,e)}}},_prepareVote:function(t){this._polls[t].find(".jsButtonPollVote").disable();var e=this._polls[t].find(".pollInnerContainer > .jsPollVote"),n=this;this._inputElements[t]=e.find("input").change(function(){n._handleVoteButton(t)}),this._handleVoteButton(t);var i=e.data("maxVotes");this._inputElements[t].filter("[type=checkbox]").length&&(this._inputElements[t].change(function(){n._enforceMaxVotes(t,i)}),this._enforceMaxVotes(t,i))},_enforceMaxVotes:function(t,e){var n=this._inputElements[t];n.filter(":checked").length==e?n.filter(":not(:checked)").disable():n.enable()},_handleVoteButton:function(t){var e=this._inputElements[t],n=this._polls[t].find(".jsButtonPollVote");e.filter(":checked").length?n.enable():n.disable()},_toggleButtons:function(t){var e=this._polls[t].children(".formSubmit");e.find(".jsButtonPollShowParticipants, .jsButtonPollShowResult, .jsButtonPollShowVote, .jsButtonPollVote").hide();var n=!0;this._polls[t].data("inVote")?(n=!1,e.find(".jsButtonPollVote").show(),this._canViewResult[t]&&e.find(".jsButtonPollShowResult").show()):(this._canVote[t]&&(n=!1,e.find(".jsButtonPollShowVote").show()),this._canViewParticipants[t]&&(n=!1,e.find(".jsButtonPollShowParticipants").show())),n&&e.hide()},_vote:function(t){var e=$(t.currentTarget).data("pollID");if(this._canVote[e]){var n=[];this._inputElements[e].each(function(t,e){var i=$(e);i.is(":checked")&&n.push(i.data("optionID"))}),n.length&&(this._proxy.setOption("data",{actionName:"vote",optionIDs:n,pollID:e}),this._proxy.sendRequest())}}}); })(this);
+(function (window, undefined) {"use strict";WCF.Poll={},WCF.Poll.Management=Class.extend({_container:null,_count:0,_editorId:"",_maxOptions:0,init:function(t,e,n,i){return this._count=0,this._maxOptions=n||-1,this._container=$("#"+t).children("ol:eq(0)"),this._container.length?(e=e||[],this._createOptionList(e),i?(this._editorId=i,WCF.System.Event.addListener("com.woltlab.wcf.redactor2","reset_"+i,this._reset.bind(this)),WCF.System.Event.addListener("com.woltlab.wcf.redactor2","submit_"+i,this._submit.bind(this))):this._container.closest("form").submit($.proxy(this._submit,this)),void new WCF.Sortable.List(t,"",void 0,{toleranceElement:"> div"},!0)):void console.debug("[WCF.Poll.Management] Invalid container id given, aborting.")},_createOptionList:function(t){for(var e=0,n=t.length;n>e;e++){var i=t[e];this._createOption(i.optionValue,i.optionID)}this._createOption()},_createOption:function(t,e,n){t=t||"",e=parseInt(e)||0,n=n||null;var i=$('<li class="sortableNode" />').data("optionID",e);null===n?i.appendTo(this._container):i.insertAfter(n);var o=$('<div class="pollOptionInput" />').appendTo(i);$('<span class="icon icon16 fa-plus jsTooltip jsAddOption pointer" title="'+WCF.Language.get("wcf.poll.button.addOption")+'" />').click($.proxy(this._addOption,this)).appendTo(o),$('<span class="icon icon16 fa-times jsTooltip jsDeleteOption pointer" title="'+WCF.Language.get("wcf.poll.button.removeOption")+'" />').click($.proxy(this._removeOption,this)).appendTo(o);var s=$('<input type="text" value="'+t+'" maxlength="255" />').keydown($.proxy(this._keyDown,this)).appendTo(o);s.click(function(){document.activeElement!==this&&this.focus()}),null!==n&&s.focus(),WCF.DOMNodeInsertedHandler.execute(),this._count++,this._count===this._maxOptions&&this._container.find("span.jsAddOption").removeClass("pointer").addClass("disabled")},_keyDown:function(t){return 13!==t.which?!0:($(t.currentTarget).prev(".sortableButtonContainer").children(".jsAddOption").trigger("click"),t.preventDefault(),t.stopPropagation(),!1)},_addOption:function(t){if(this._count===this._maxOptions)return!1;var e=$(t.currentTarget).closest("li",this._container[0]);this._createOption(void 0,void 0,e)},_removeOption:function(t){$(t.currentTarget).closest("li",this._container[0]).remove(),this._count--,this._container.find("span.jsAddOption").addClass("pointer").removeClass("disabled"),0==this._container.children("li").length&&this._createOption()},_submit:function(t){var e=[];if(this._container.children("li").each(function(t,n){var i=$(n),o=$.trim(i.find("input").val());""!=o&&e.push(i.data("optionID")+"_"+o)}),"object"==typeof t.originalEvent&&t.originalEvent instanceof Event){if(e.length)for(var n=this._container.parents("form").find(".formSubmit"),i=0,o=e.length;o>i;i++)$('<input type="hidden" name="pollOptions['+i+']">').val(e[i]).appendTo(n)}else{t.poll={pollOptions:e};var s=this._container.parents(".messageTabMenuContent:eq(0)");s.find("input").each(function(e,n){n.name&&("checkbox"!==n.type||n.checked)&&(t.poll[n.name]=n.value)})}},_reset:function(){for(var t=this._container[0];t.childElementCount>1;)t.removeChild(t.children[1]);elBySel("input",t.children[0]).value="";var e=this._container.parents(".messageTabMenuContent:eq(0)");e.find("input").each(function(t,e){e.name&&("checkbox"===e.type?e.checked=!1:"text"===e.type?e.value="":"number"===e.type&&(e.value=e.min))}),require(["WoltLab/WCF/Date/Picker"],function(t){t.clear("pollEndTime_"+this._editorId)}.bind(this))}}),WCF.Poll.Manager=Class.extend({_cache:{},_canViewParticipants:{},_canViewResult:{},_canVote:{},_inputElements:{},_participants:{},_polls:{},_proxy:null,init:function(t){var e=$(t);if(!e.length)return void console.debug("[WCF.Poll.Manager] Given selector '"+t+"' does not match, aborting.");this._cache={},this._canViewParticipants={},this._canViewResult={},this._inputElements={},this._participants={},this._polls={},this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this),url:"index.php/Poll/?t="+SECURITY_TOKEN});var n=this;e.each(function(t,e){var i=$(e),o=i.data("pollID");void 0===n._polls[o]&&(n._cache[o]={result:"",vote:""},n._polls[o]=i,n._canViewParticipants[o]=i.data("canViewParticipants")?!0:!1,n._canViewResult[o]=i.data("canViewResult")?!0:!1,n._canVote[o]=i.data("canVote")?!0:!1,n._bindListeners(o),i.data("inVote")&&n._prepareVote(o),n._toggleButtons(o))})},_bindListeners:function(t){this._polls[t].find(".jsButtonPollShowParticipants").data("pollID",t).click($.proxy(this._showParticipants,this)),this._polls[t].find(".jsButtonPollShowResult").data("pollID",t).click($.proxy(this._showResult,this)),this._polls[t].find(".jsButtonPollShowVote").data("pollID",t).click($.proxy(this._showVote,this)),this._polls[t].find(".jsButtonPollVote").data("pollID",t).click($.proxy(this._vote,this))},_showResult:function(t,e){var n=null===t?e:$(t.currentTarget).data("pollID");this._canViewResult[n]&&this._polls[n].data("inVote")&&(this._cache[n].result?(this._polls[n].find(".pollInnerContainer").html(this._cache[n].result),this._polls[n].data("inVote",!1),this._toggleButtons(n)):(this._proxy.setOption("data",{actionName:"getResult",pollID:n}),this._proxy.sendRequest()))},_showParticipants:function(t){var e=$(t.currentTarget).data("pollID");this._participants[e]||(this._participants[e]=new WCF.User.List("wcf\\data\\poll\\PollAction",this._polls[e].data("question"),{pollID:e})),this._participants[e].open()},_showVote:function(t,e){var n=null===t?e:$(t.currentTarget).data("pollID");this._canVote[n]&&(this._polls[n].data("inVote")||(this._cache[n].vote?(this._polls[n].find(".pollInnerContainer").html(this._cache[n].vote),this._polls[n].data("inVote",!0),this._prepareVote(n),this._toggleButtons(n)):(this._proxy.setOption("data",{actionName:"getVote",pollID:n}),this._proxy.sendRequest())))},_success:function(t){if(t&&t.actionName){var e=t.pollID;switch(t.resultTemplate&&(this._cache[e].result=t.resultTemplate),t.voteTemplate&&(this._cache[e].vote=t.voteTemplate),t.actionName){case"getResult":this._showResult(null,e);break;case"getVote":this._showVote(null,e);break;case"vote":this._canViewResult[e]=!0,this._canVote[e]=t.canVote?!0:!1,this._showResult(null,e)}}},_prepareVote:function(t){this._polls[t].find(".jsButtonPollVote").disable();var e=this._polls[t].find(".pollInnerContainer > .jsPollVote"),n=this;this._inputElements[t]=e.find("input").change(function(){n._handleVoteButton(t)}),this._handleVoteButton(t);var i=e.data("maxVotes");this._inputElements[t].filter("[type=checkbox]").length&&(this._inputElements[t].change(function(){n._enforceMaxVotes(t,i)}),this._enforceMaxVotes(t,i))},_enforceMaxVotes:function(t,e){var n=this._inputElements[t];n.filter(":checked").length==e?n.filter(":not(:checked)").disable():n.enable()},_handleVoteButton:function(t){var e=this._inputElements[t],n=this._polls[t].find(".jsButtonPollVote");e.filter(":checked").length?n.enable():n.disable()},_toggleButtons:function(t){var e=this._polls[t].children(".formSubmit");e.find(".jsButtonPollShowParticipants, .jsButtonPollShowResult, .jsButtonPollShowVote, .jsButtonPollVote").hide();var n=!0;this._polls[t].data("inVote")?(n=!1,e.find(".jsButtonPollVote").show(),this._canViewResult[t]&&e.find(".jsButtonPollShowResult").show()):(this._canVote[t]&&(n=!1,e.find(".jsButtonPollShowVote").show()),this._canViewParticipants[t]&&(n=!1,e.find(".jsButtonPollShowParticipants").show())),n&&e.hide()},_vote:function(t){var e=$(t.currentTarget).data("pollID");if(this._canVote[e]){var n=[];this._inputElements[e].each(function(t,e){var i=$(e);i.is(":checked")&&n.push(i.data("optionID"))}),n.length&&(this._proxy.setOption("data",{actionName:"vote",optionIDs:n,pollID:e}),this._proxy.sendRequest())}}}); })(this);
 
 // WCF.Search.Message.js
 (function (window, undefined) {"use strict";WCF.Search.Message={},WCF.Search.Message.KeywordList=WCF.Search.Base.extend({_className:"wcf\\data\\search\\keyword\\SearchKeywordAction",_divider:null,_forceSubmit:!1,init:function(e,i,s){if(!$.isFunction(i))return void console.debug("[WCF.Search.Message.KeywordList] The given callback is invalid, aborting.");this._callback=i,this._excludedSearchValues=[],s&&(this._excludedSearchValues=s),this._searchInput=$(e).keyup($.proxy(this._keyUp,this)).keydown($.proxy(function(e){13===e.which&&this._itemCount&&-1!==this._itemIndex&&e.preventDefault()},this));var t=WCF.Dropdown.getDropdownMenu(this._searchInput.parents(".dropdown").wcfIdentify()),r=t.find("li.dropdownDivider").last();this._divider=$('<li class="dropdownDivider" />').hide().insertBefore(r),this._list=$('<li class="dropdownList"><ul /></li>').hide().insertBefore(r).children("ul"),t.find("input, label").on("click",function(e){e.stopPropagation()}),this._proxy=new WCF.Action.Proxy({showLoadingOverlay:!1,success:$.proxy(this._success,this)})},_createListItem:function(e){this._divider.show(),this._list.parent().show(),this._super(e)},_clearList:function(e){e&&this._searchInput.val(""),this._divider.hide(),this._list.empty().parent().hide(),WCF.CloseOverlayHandler.removeCallback("WCF.Search.Base"),this._itemCount=0,this._itemIndex=-1}}); })(this);
index 19901c32bd4801e61e1212b4f102dc8fbdfa0012..1a51e3f3db32864905d33a6beb2a1a73f6698f74 100644 (file)
@@ -2,7 +2,7 @@ var requirejs,require,define;!function(global){function isFunction(e){return"[ob
 S.$=a[a.length-x],S._$={first_line:r[r.length-(x||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(x||1)].first_column,last_column:r[r.length-1].last_column},b&&(S._$.range=[r[r.length-(x||1)].range[0],r[r.length-1].range[1]]),L=this.performAction.apply(S,[s,c,l,m.yy,w[1],a,r].concat(p)),"undefined"!=typeof L)return L;x&&(i=i.slice(0,-1*x*2),a=a.slice(0,-1*x),r=r.slice(0,-1*x)),i.push(this.productions_[w[1]][0]),a.push(S.$),r.push(S._$),T=o[i[i.length-2]][i[i.length-1]],i.push(T);break;case 3:return!0}}return!0}},v=function(){var e={EOF:1,parseError:function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},setInput:function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var e=this._input[0];this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e;var t=e.match(/(?:\r\n?|\n).*/g);return t?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var a=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[a[0],a[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},test_match:function(e,t){var n,i,a;if(this.options.backtrack_lexer&&(a={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(a.yylloc.range=this.yylloc.range.slice(0))),i=e[0].match(/(?:\r\n?|\n).*/g),i&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in a)this[r]=a[r];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,i;this._more||(this.yytext="",this.match="");for(var a=this._currentRules(),r=0;r<a.length;r++)if(n=this._input.match(this.rules[a[r]]),n&&(!t||n[0].length>t[0].length)){if(t=n,i=r,this.options.backtrack_lexer){if(e=this.test_match(n,a[r]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,a[i]),e!==!1?e:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var e=this.next();return e?e:this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){var e=this.conditionStack.length-1;return e>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:"INITIAL"},pushState:function(e){this.begin(e)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(e,t,n,i){switch(n){case 0:break;case 1:return t.yytext=t.yytext.substring(9,t.yytext.length-10),9;case 2:return 23;case 3:return 23;case 4:return 21;case 5:return 22;case 6:return 19;case 7:return 16;case 8:return 15;case 9:return 18;case 10:return 17;case 11:return 20;case 12:return 41;case 13:return 42;case 14:return 39;case 15:return 40;case 16:return this.begin("command"),24;case 17:return this.begin("command"),46;case 18:return this.begin("command"),46;case 19:return 44;case 20:return 28;case 21:return 36;case 22:return 37;case 23:return this.begin("command"),29;case 24:return this.begin("command"),31;case 25:return 32;case 26:return this.begin("command"),33;case 27:return 48;case 28:return 35;case 29:return 13;case 30:return this.popState(),12;case 31:return 12;case 32:return 14;case 33:return 5;case 34:return 11}},rules:[/^(?:\{\*.*\*\})/,/^(?:\{literal\}.*?\{\/literal\})/,/^(?:"([^"]|\\\.)*")/,/^(?:'([^']|\\\.)*')/,/^(?:\$)/,/^(?:[_a-zA-Z][_a-zA-Z0-9]*)/,/^(?:\.)/,/^(?:\[)/,/^(?:\])/,/^(?:\()/,/^(?:\))/,/^(?:=)/,/^(?:\{ldelim\})/,/^(?:\{rdelim\})/,/^(?:\{#)/,/^(?:\{@)/,/^(?:\{if )/,/^(?:\{else if )/,/^(?:\{elseif )/,/^(?:\{else\})/,/^(?:\{\/if\})/,/^(?:\{lang\})/,/^(?:\{\/lang\})/,/^(?:\{include )/,/^(?:\{implode )/,/^(?:\{\/implode\})/,/^(?:\{foreach )/,/^(?:\{foreachelse\})/,/^(?:\{\/foreach\})/,/^(?:\{)/,/^(?:\})/,/^(?:\})/,/^(?:\s+)/,/^(?:$)/,/^(?:[^{])/],conditions:{command:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],inclusive:!0},INITIAL:{rules:[0,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,31,32,33,34],inclusive:!0}}};return e}();return g.lexer=v,g}),define("WoltLab/WCF/NumberUtil",[],function(){"use strict";var e={round:function(e,t){return"undefined"==typeof t||0===+t?Math.round(e):(e=+e,t=+t,isNaN(e)||"number"!=typeof t||t%1!==0?NaN:(e=e.toString().split("e"),e=Math.round(+(e[0]+"e"+(e[1]?+e[1]-t:-t))),e=e.toString().split("e"),+(e[0]+"e"+(e[1]?+e[1]+t:t))))}};return e}),define("WoltLab/WCF/StringUtil",["Language","./NumberUtil"],function(e,t){"use strict";return{addThousandsSeparator:function(t){return void 0===e&&(e=require("Language")),String(t).replace(/(^-?\d{1,3}|\d{3})(?=(?:\d{3})+(?:$|\.))/g,"$1"+e.get("wcf.global.thousandsSeparator"))},escapeHTML:function(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},escapeRegExp:function(e){return String(e).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")},formatNumeric:function(n,i){void 0===e&&(e=require("Language")),n=String(t.round(n,i||-2));var a=n.split(".");return n=this.addThousandsSeparator(a[0]),a.length>1&&(n+=e.get("wcf.global.decimalPoint")+a[1]),n=n.replace("-","−")},lcfirst:function(e){return String(e).substring(0,1).toLowerCase()+e.substring(1)},ucfirst:function(e){return String(e).substring(0,1).toUpperCase()+e.substring(1)},unescapeHTML:function(e){return String(e).replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">")}}}),define("WoltLab/WCF/Template",["./Template.grammar","./StringUtil","Language"],function(e,t,n){"use strict";function i(){this.yy={}}function a(i){void 0===n&&(n=require("Language")),void 0===t&&(t=require("StringUtil"));try{i=e.parse(i),i="var tmp = {};\nfor (var key in v) tmp[key] = v[key];\nv = tmp;\nv.__wcf = window.WCF; v.__window = window;\nreturn "+i,this.fetch=new Function("StringUtil","Language","v",i).bind(void 0,t,n)}catch(a){throw console.debug(a.message),a}}return i.prototype=e,e.Parser=i,e=new i,Object.defineProperty(a,"callbacks",{enumerable:!1,configurable:!1,get:function(){throw new Error("WCF.Template.callbacks is no longer supported")},set:function(e){throw new Error("WCF.Template.callbacks is no longer supported")}}),a.prototype={fetch:function(e){throw new Error("This Template is not initialized.")}},a}),define("WoltLab/WCF/Language",["Dictionary","./Template"],function(e,t){"use strict";var n=new e,i={addObject:function(t){n.merge(e.fromObject(t))},add:function(e,t){n.set(e,t)},get:function(e,i){i||(i={});var a=n.get(e);return void 0===a?e:("string"==typeof a&&(n.set(e,new t(a)),a=n.get(e)),a instanceof t&&(a=a.fetch(i)),a)}};return i}),define("WoltLab/WCF/CallbackList",["Dictionary"],function(e){"use strict";function t(){this._dictionary=new e}return t.prototype={add:function(e,t){if("function"!=typeof t)throw new TypeError("Expected a valid callback as second argument for identifier '"+e+"'.");this._dictionary.has(e)||this._dictionary.set(e,[]),this._dictionary.get(e).push(t)},remove:function(e){this._dictionary["delete"](e)},forEach:function(e,t){if(null===e)this._dictionary.forEach(function(e,n){e.forEach(t)});else{var n=this._dictionary.get(e);void 0!==n&&n.forEach(t)}}},t}),define("WoltLab/WCF/Dom/Change/Listener",["CallbackList"],function(e){"use strict";var t=new e,n=!1;return{add:t.add.bind(t),remove:t.remove.bind(t),trigger:function(){if(!n)try{n=!0,t.forEach(null,function(e){e()})}finally{n=!1}}}}),define("WoltLab/WCF/Environment",[],function(){"use strict";var e="other",t="none",n="desktop",i=!1;return{setup:function(){if("object"==typeof window.chrome)e="chrome";else for(var a=window.getComputedStyle(document.documentElement),r=0,o=a.length;o>r;r++){var s=a[r];0===s.indexOf("-ms-")?e="microsoft":0===s.indexOf("-moz-")?e="firefox":0===s.indexOf("-webkit-")&&(e="safari")}var l=window.navigator.userAgent.toLowerCase();-1!==l.indexOf("crios")?(e="chrome",n="ios"):/(?:iphone|ipad|ipod)/.test(l)?(e="safari",n="ios"):-1!==l.indexOf("android")?n="android":-1!==l.indexOf("iemobile")&&(e="microsoft",n="windows"),"desktop"!==n||-1===l.indexOf("mobile")&&-1===l.indexOf("tablet")||(n="mobile"),t="redactor",i=!!("ontouchstart"in window)||!!("msMaxTouchPoints"in window.navigator)&&window.navigator.msMaxTouchPoints>0||window.DocumentTouch&&document instanceof DocumentTouch},browser:function(){return e},editor:function(){return t},platform:function(){return n},touch:function(){return i}}}),define("WoltLab/WCF/Dom/Util",["Environment","StringUtil"],function(e,t){"use strict";function n(e,t,n){if(!t.contains(e))throw new Error("Ancestor element does not contain target element.");for(var i,a=n+"Sibling";null!==e&&e!==t;){if(null!==e[n+"ElementSibling"])return!1;if(e[a])for(i=e[a];i;){if(""!==i.textContent.trim())return!1;i=i[a]}e=e.parentNode}return!0}var i=0,a={createFragmentFromHtml:function(e){var t=elCreate("div");t.innerHTML=e;for(var n=document.createDocumentFragment();t.childNodes.length;)n.appendChild(t.childNodes[0]);return n},getUniqueId:function(){var e;do e="wcf"+i++;while(null!==elById(e));return e},identify:function(e){if(!(e instanceof Element))throw new TypeError("Expected a valid DOM element as argument.");var t=elAttr(e,"id");return t||(t=this.getUniqueId(),elAttr(e,"id",t)),t},outerHeight:function(e,t){t=t||window.getComputedStyle(e);var n=e.offsetHeight;return n+=~~t.marginTop+~~t.marginBottom},outerWidth:function(e,t){t=t||window.getComputedStyle(e);var n=e.offsetWidth;return n+=~~t.marginLeft+~~t.marginRight},outerDimensions:function(e){var t=window.getComputedStyle(e);return{height:this.outerHeight(e,t),width:this.outerWidth(e,t)}},offset:function(e){var t=e.getBoundingClientRect();return{top:t.top+window.scrollY,left:t.left+window.scrollX}},prepend:function(e,t){0===t.childNodes.length?t.appendChild(e):t.insertBefore(e,t.childNodes[0])},insertAfter:function(e,t){null!==t.nextElementSibling?t.parentNode.insertBefore(e,t.nextElementSibling):t.parentNode.appendChild(e)},setStyles:function(t,n){var i=!1;for(var a in n)objOwns(n,a)&&(/ !important$/.test(n[a])?(i=!0,n[a]=n[a].replace(/ !important$/,"")):i=!1,"safari"!==e.browser()||"important"!==t.style.getPropertyPriority(a)||i||t.style.removeProperty(a),t.style.setProperty(a,n[a],i?"important":""))},styleAsInt:function(e,t){var n=e.getPropertyValue(t);return null===n?0:parseInt(n)},setInnerHtml:function(e,t){e.innerHTML=t;for(var n,i,a=elBySelAll("script",e),r=0,o=a.length;o>r;r++)i=a[r],n=elCreate("script"),i.src?n.src=i.src:n.textContent=i.textContent,e.appendChild(n),elRemove(i)},insertHtml:function(e,t,n){var i=elCreate("div");if(this.setInnerHtml(i,e),"append"===n||"after"===n)for(;i.childNodes.length;)"append"===n?t.appendChild(i.childNodes[0]):this.insertAfter(i.childNodes[0],t);else{if("prepend"!==n&&"before"!==n)throw new Error("Unknown insert method '"+n+"'.");for(var a=i.childNodes.length-1;a>=0;a--)"prepend"===n?this.prepend(i.childNodes[a],t):t.parentNode.insertBefore(i.childNodes[a],t)}},contains:function(e,t){for(;null!==t;)if(t=t.parentNode,e===t)return!0;return!1},getDataAttributes:function(e,n,i,a){n=n||"",/^data-/.test(n)||(n="data-"+n),i=i===!0,a=a===!0;for(var r,o,s,l={},c=0,d=e.attributes.length;d>c;c++)if(r=e.attributes[c],0===r.name.indexOf(n)){if(o=r.name.replace(new RegExp("^"+n),""),i){s=o.split("-"),o="";for(var u=0,h=s.length;h>u;u++)o.length&&(a&&"id"===s[u]?s[u]="ID":s[u]=t.ucfirst(s[u])),o+=s[u]}l[o]=r.value}return l},unwrapChildNodes:function(e){for(var t=e.parentNode;e.childNodes.length;)t.insertBefore(e.childNodes[0],e);elRemove(e)},replaceElement:function(e,t){for(;e.childNodes.length;)t.appendChild(e.childNodes[0]);e.parentNode.insertBefore(t,e),elRemove(e)},isAtNodeStart:function(e,t){return n(e,t,"previous")},isAtNodeEnd:function(e,t){return n(e,t,"next")}};return window.bc_wcfDomUtil=a,a}),function(e,t,n){var i=window.matchMedia;"undefined"!=typeof module&&module.exports?module.exports=n(i):"function"==typeof define&&define.amd?define("enquire",[],function(){return t[e]=n(i)}):t[e]=n(i)}("enquire",this,function(e){"use strict";function t(e,t){var n,i=0,a=e.length;for(i;a>i&&(n=t(e[i],i),n!==!1);i++);}function n(e){return"[object Array]"===Object.prototype.toString.apply(e)}function i(e){return"function"==typeof e}function a(e){this.options=e,!e.deferSetup&&this.setup()}function r(t,n){this.query=t,this.isUnconditional=n,this.handlers=[],this.mql=e(t);var i=this;this.listener=function(e){i.mql=e,i.assess()},this.mql.addListener(this.listener)}function o(){if(!e)throw new Error("matchMedia not present, legacy browsers require a polyfill");this.queries={},this.browserIsIncapable=!e("only all").matches}return a.prototype={setup:function(){this.options.setup&&this.options.setup(),this.initialised=!0},on:function(){!this.initialised&&this.setup(),this.options.match&&this.options.match()},off:function(){this.options.unmatch&&this.options.unmatch()},destroy:function(){this.options.destroy?this.options.destroy():this.off()},equals:function(e){return this.options===e||this.options.match===e}},r.prototype={addHandler:function(e){var t=new a(e);this.handlers.push(t),this.matches()&&t.on()},removeHandler:function(e){var n=this.handlers;t(n,function(t,i){return t.equals(e)?(t.destroy(),!n.splice(i,1)):void 0})},matches:function(){return this.mql.matches||this.isUnconditional},clear:function(){t(this.handlers,function(e){e.destroy()}),this.mql.removeListener(this.listener),this.handlers.length=0},assess:function(){var e=this.matches()?"on":"off";t(this.handlers,function(t){t[e]()})}},o.prototype={register:function(e,a,o){var s=this.queries,l=o&&this.browserIsIncapable;return s[e]||(s[e]=new r(e,l)),i(a)&&(a={match:a}),n(a)||(a=[a]),t(a,function(t){i(t)&&(t={match:t}),s[e].addHandler(t)}),this},unregister:function(e,t){var n=this.queries[e];return n&&(t?n.removeHandler(t):(n.clear(),delete this.queries[e])),this}},new o}),define("WoltLab/WCF/ObjectMap",[],function(){"use strict";function e(){this._map=t?new WeakMap:{key:[],value:[]}}var t=objOwns(window,"WeakMap")&&"function"==typeof window.WeakMap;return e.prototype={set:function(e,n){if("object"!=typeof e||null===e)throw new TypeError("Only objects can be used as key");if("object"!=typeof n||null===n)throw new TypeError("Only objects can be used as value");t?this._map.set(e,n):(this._map.key.push(e),this._map.value.push(n))},"delete":function(e){if(t)this._map["delete"](e);else{var n=this._map.key.indexOf(e);this._map.key.splice(n),this._map.value.splice(n)}},has:function(e){return t?this._map.has(e):-1!==this._map.key.indexOf(e)},get:function(e){if(t)return this._map.get(e);var n=this._map.key.indexOf(e);return-1!==n?this._map.value[n]:void 0}},e}),define("WoltLab/WCF/Dom/Traverse",[],function(){"use strict";var e=0,t=1,n=2,i=3,a=[function(e,t){return!0},function(e,t){return e.matches(t)},function(e,t){return e.classList.contains(t)},function(e,t){return e.nodeName===t}],r=function(e,t,n){if(!(e instanceof Element))throw new TypeError("Expected a valid element as first argument.");for(var i=[],r=0;r<e.childElementCount;r++)a[t](e.children[r],n)&&i.push(e.children[r]);return i},o=function(e,t,n,i){if(!(e instanceof Element))throw new TypeError("Expected a valid element as first argument.");for(e=e.parentNode;e instanceof Element;){if(e===i)return null;if(a[t](e,n))return e;e=e.parentNode}return null},s=function(e,t,n,i){if(!(e instanceof Element))throw new TypeError("Expected a valid element as first argument.");return e instanceof Element&&null!==e[t]&&a[n](e[t],i)?e[t]:null};return{childBySel:function(e,n){return r(e,t,n)[0]||null},childByClass:function(e,t){return r(e,n,t)[0]||null},childByTag:function(e,t){return r(e,i,t)[0]||null},childrenBySel:function(e,n){return r(e,t,n)},childrenByClass:function(e,t){return r(e,n,t)},childrenByTag:function(e,t){return r(e,i,t)},parentBySel:function(e,n,i){return o(e,t,n,i)},parentByClass:function(e,t,i){return o(e,n,t,i)},parentByTag:function(e,t,n){return o(e,i,t,n)},next:function(t){return s(t,"nextElementSibling",e,null)},nextBySel:function(e,n){return s(e,"nextElementSibling",t,n)},nextByClass:function(e,t){return s(e,"nextElementSibling",n,t)},nextByTag:function(e,t){return s(e,"nextElementSibling",i,t)},prev:function(t){return s(t,"previousElementSibling",e,null)},prevBySel:function(e,n){return s(e,"previousElementSibling",t,n)},prevByClass:function(e,t){return s(e,"previousElementSibling",n,t)},prevByTag:function(e,t){return s(e,"previousElementSibling",i,t)}}}),define("WoltLab/WCF/Ui/Confirmation",["Core","Language","Ui/Dialog"],function(e,t,n){"use strict";var i=!1,a=null,r=null,o={},s=null,l={show:function(t){if(void 0===n&&(n=require("Ui/Dialog")),!i){if(o=e.extend({cancel:null,confirm:null,legacyCallback:null,message:"",messageIsHtml:!1,parameters:{},template:""},t),o.message="string"==typeof o.message?o.message.trim():"",!o.message.length)throw new Error("Expected a non-empty string for option 'message'.");if("function"!=typeof o.confirm&&"function"!=typeof o.legacyCallback)throw new TypeError("Expected a valid callback for option 'confirm'.");null===r&&this._createDialog(),r.innerHTML="string"==typeof o.template?o.template.trim():"",o.messageIsHtml?s.innerHTML=o.message:s.textContent=o.message,i=!0,n.open(this)}},_dialogSetup:function(){return{id:"wcfSystemConfirmation",options:{onClose:this._onClose.bind(this),onShow:this._onShow.bind(this),title:t.get("wcf.global.confirmation.title")}}},getContentElement:function(){return r},_createDialog:function(){var e=elCreate("div");elAttr(e,"id","wcfSystemConfirmation"),e.classList.add("systemConfirmation"),s=elCreate("p"),e.appendChild(s),r=elCreate("div"),elAttr(r,"id","wcfSystemConfirmationContent"),e.appendChild(r);var i=elCreate("div");i.classList.add("formSubmit"),e.appendChild(i),a=elCreate("button"),a.classList.add("buttonPrimary"),a.textContent=t.get("wcf.global.confirmation.confirm"),a.addEventListener(WCF_CLICK_EVENT,this._confirm.bind(this)),i.appendChild(a);var o=elCreate("button");o.textContent=t.get("wcf.global.confirmation.cancel"),o.addEventListener(WCF_CLICK_EVENT,function(){n.close("wcfSystemConfirmation")}),i.appendChild(o),document.body.appendChild(e)},_confirm:function(){"function"==typeof o.legacyCallback?o.legacyCallback("confirm",o.parameters):o.confirm(o.parameters),i=!1,n.close("wcfSystemConfirmation")},_onClose:function(){i&&(a.blur(),i=!1,"function"==typeof o.legacyCallback?o.legacyCallback("cancel",o.parameters):"function"==typeof o.cancel&&o.cancel(o.parameters))},_onShow:function(){a.blur(),a.focus()}};return l}),define("WoltLab/WCF/Ui/Dialog",["enquire","Ajax","Core","Dictionary","Environment","Language","ObjectMap","Dom/ChangeListener","Dom/Traverse","Dom/Util","Ui/Confirmation"],function(e,t,n,i,a,r,o,s,l,c,d){"use strict";var u=null,h=null,p=new i,f=new o,m=!1,g=null,v=elByClass("jsStaticDialog");return{setup:function(){void 0===t&&(t=require("Ajax")),h=elCreate("div"),h.classList.add("dialogOverlay"),elAttr(h,"aria-hidden","true"),h.addEventListener(WCF_CLICK_EVENT,this._closeOnBackdrop.bind(this)),elById("content").appendChild(h),g=function(e){return 27===e.keyCode&&"INPUT"!==e.target.nodeName&&"TEXTAREA"!==e.target.nodeName?(this.close(u),!1):!0}.bind(this),e.register("(max-width: 767px)",{match:function(){m=!0},unmatch:function(){m=!1},setup:function(){m=!0},deferSetup:!0}),this._initStaticDialogs(),s.add("Ui/Dialog",this._initStaticDialogs.bind(this))},_initStaticDialogs:function(){for(var e,t,n;v.length;)e=v[0],e.classList.remove("jsStaticDialog"),n=elData(e,"dialog-id"),n&&(t=elById(n))&&function(e,t){t.classList.remove("jsStaticDialogContent"),elHide(t),e.addEventListener(WCF_CLICK_EVENT,this.openStatic.bind(this,t.id,null,{title:elData(t,"title")}))}.bind(this)(e,t)},open:function(e,i){var a=f.get(e);if(n.isPlainObject(a))return this.openStatic(a.id,i);if("function"!=typeof e._dialogSetup)throw new Error("Callback object does not implement the method '_dialogSetup()'.");var r=e._dialogSetup();if(!n.isPlainObject(r))throw new Error("Expected an object literal as return value of '_dialogSetup()'.");a={id:r.id};var o=!0;if(void 0===r.source){var s=elById(r.id);if(null===s)throw new Error("Element id '"+r.id+"' is invalid and no source attribute was given.");r.source=document.createDocumentFragment(),r.source.appendChild(s),s.removeAttribute("id"),elShow(s)}else if(null===r.source)r.source=i;else if("function"==typeof r.source)r.source();else if(n.isPlainObject(r.source)){if("string"!=typeof i||""===i.trim())return t.api(this,r.source.data,function(t){t.returnValues&&"string"==typeof t.returnValues.template&&(this.open(e,t.returnValues.template),"function"==typeof r.source.after&&r.source.after(p.get(r.id).content,t))}.bind(this)),{};r.source=i}else{if("string"==typeof r.source){var s=elCreate("div");elAttr(s,"id",r.id),s.innerHTML=r.source,r.source=document.createDocumentFragment(),r.source.appendChild(s)}if(!r.source.nodeType||r.source.nodeType!==Node.DOCUMENT_FRAGMENT_NODE)throw new Error("Expected at least a document fragment as 'source' attribute.");o=!1}return f.set(e,a),this.openStatic(r.id,r.source,r.options,o)},openStatic:function(e,t,i,a){return p.has(e)?this._updateDialog(e,t):(i=n.extend({backdropCloseOnClick:!0,closable:!0,closeButtonLabel:r.get("wcf.global.button.close"),closeConfirmMessage:"",disableContentPadding:!1,title:"",onBeforeClose:null,onClose:null,onShow:null},i),i.closable||(i.backdropCloseOnClick=!1),i.closeConfirmMessage&&(i.onBeforeClose=function(e){d.show({confirm:this.close.bind(this,e),message:i.closeConfirmMessage})}.bind(this)),this._createDialog(e,t,i)),p.get(e)},setTitle:function(e,t){if("object"==typeof e){var n=f.get(e);void 0!==n&&(e=n.id)}var i=p.get(e);if(void 0===i)throw new Error("Expected a valid dialog id, '"+e+"' does not match any active dialog.");var a=elByClass("dialogTitle",i.dialog);a.length&&(a[0].textContent=t)},_createDialog:function(e,t,n,i){var a=null;if(null===t&&(a=elById(e),null===a))throw new Error("Expected either a HTML string or an existing element id.");var r=elCreate("div");r.classList.add("dialogContainer"),elAttr(r,"aria-hidden","true"),elAttr(r,"role","dialog"),elData(r,"id",e);var o=elCreate("header");r.appendChild(o);var s=c.getUniqueId();elAttr(r,"aria-labelledby",s);var l=elCreate("span");if(l.classList.add("dialogTitle"),l.textContent=n.title,elAttr(l,"id",s),o.appendChild(l),n.closable){var d=elCreate("a");d.className="dialogCloseButton jsTooltip",elAttr(d,"title",n.closeButtonLabel),elAttr(d,"aria-label",n.closeButtonLabel),d.addEventListener(WCF_CLICK_EVENT,this._close.bind(this)),o.appendChild(d);var u=elCreate("span");u.className="icon icon24 fa-times",d.appendChild(u)}var f=elCreate("div");f.classList.add("dialogContent"),n.disableContentPadding&&f.classList.add("dialogContentNoPadding"),r.appendChild(f);var m;null===a?"string"==typeof t?(m=elCreate("div"),m.id=e,m.innerHTML=t):t instanceof DocumentFragment&&("div"!==t.children[0].nodeName||t.childElementCount>1?(m=elCreate("div"),m.id=e,m.appendChild(t)):m=t):m=a,f.appendChild(m),"none"===m.style.getPropertyValue("display")&&elShow(m),p.set(e,{backdropCloseOnClick:n.backdropCloseOnClick,content:m,dialog:r,header:o,onBeforeClose:n.onBeforeClose,onClose:n.onClose,onShow:n.onShow}),c.prepend(r,h),"function"==typeof n.onSetup&&n.onSetup(m),i!==!0&&this._updateDialog(e,null)},_updateDialog:function(e,t){var n=p.get(e);if(void 0===n)throw new Error("Expected a valid dialog id, '"+e+"' does not match any active dialog.");if("string"==typeof t){n.content.innerHTML="";var i=elCreate("div");i.innerHTML=t;for(var a=elBySelAll("script",i),r=0,o=a.length;o>r;r++){var l=a[r],c=elCreate("script");c.innerHTML=l.innerHTML,i.appendChild(c),elRemove(l)}n.content.appendChild(i)}if("true"===elAttr(n.dialog,"aria-hidden")){"true"===elAttr(h,"aria-hidden")&&window.addEventListener("keyup",g),elAttr(n.dialog,"aria-hidden","false"),elAttr(h,"aria-hidden","false"),elData(h,"close-on-click",n.backdropCloseOnClick?"true":"false"),u=e,this.rebuild(e);var d=elBySel(".jsDialogAutoFocus",n.dialog);null!==d&&null!==d.offsetParent&&d.focus(),"function"==typeof n.onShow&&n.onShow(e)}s.trigger()},rebuild:function(e){var t=p.get(e);if(void 0===t)throw new Error("Expected a valid dialog id, '"+e+"' does not match any active dialog.");if("true"!==elAttr(t.dialog,"aria-hidden")){var n=t.content.parentNode,i=elBySel(".formSubmit",t.content),r=0;null!==i?(n.classList.add("dialogForm"),i.classList.add("dialogFormSubmit"),r+=c.outerHeight(i),n.style.setProperty("margin-bottom",r+"px")):n.classList.remove("dialogForm"),r+=c.outerHeight(t.header);var o=window.innerHeight*(m?1:.8)-r;n.style.setProperty("max-height",~~o+"px"),"chrome"===a.browser()&&(t.content.scrollHeight>o?t.content.style.setProperty("margin-right","-1px"):t.content.style.removeProperty("margin-right"))}},_close:function(e){e.preventDefault();var t=p.get(u);return"function"==typeof t.onBeforeClose?(t.onBeforeClose(u),!1):void this.close(u)},_closeOnBackdrop:function(e){return e.target!==h?!0:void("true"===elData(h,"close-on-click")?this._close(e):e.preventDefault())},close:function(e){if("object"==typeof e){var t=f.get(e);void 0!==t&&(e=t.id)}var n=p.get(e);if(void 0===n)throw new Error("Expected a valid dialog id, '"+e+"' does not match any active dialog.");"function"==typeof n.onClose&&n.onClose(e),elAttr(n.dialog,"aria-hidden","true"),u=null;for(var i=0;i<h.childElementCount;i++){var a=h.children[i];if("false"===elAttr(a,"aria-hidden")){u=elData(a,"id");break}}null===u?(elAttr(h,"aria-hidden","true"),elData(h,"close-on-click","false"),window.removeEventListener("keyup",g)):(n=p.get(u),elData(h,"close-on-click",n.backdropCloseOnClick?"true":"false"))},getDialog:function(e){return p.get(e)},_ajaxSetup:function(){return{}}}}),define("WoltLab/WCF/Ajax/Status",["Language"],function(e){"use strict";var t=0,n=null,i=null,a={_init:function(){n=elCreate("div"),n.classList.add("spinner");var t=elCreate("span");t.className="icon icon48 fa-spinner",n.appendChild(t);var i=elCreate("span");i.textContent=e.get("wcf.global.loading"),n.appendChild(i),document.body.appendChild(n)},show:function(){null===n&&this._init(),t++,null===i&&(i=window.setTimeout(function(){t&&n.classList.add("active"),i=null},250))},hide:function(){t--,0===t&&(null!==i&&window.clearTimeout(i),n.classList.remove("active"))}};return a}),define("WoltLab/WCF/Ajax/Request",["Core","Language","Dom/ChangeListener","Dom/Util","Ui/Dialog","WoltLab/WCF/Ajax/Status"],function(e,t,n,i,a,r){"use strict";function o(e){this._data=null,this._options={},this._previousXhr=null,this._xhr=null,this._init(e)}var s=!1,l=!1;return o.prototype={_init:function(t){this._options=e.extend({data:{},contentType:"application/x-www-form-urlencoded; charset=UTF-8",responseType:"application/json",type:"POST",url:"",autoAbort:!1,ignoreError:!1,pinData:!1,silent:!1,failure:null,finalize:null,success:null,progress:null,uploadProgress:null,callbackObject:null},t),"object"==typeof t.callbackObject&&(this._options.callbackObject=t.callbackObject),this._options.url=e.convertLegacyUrl(this._options.url),this._options.pinData&&(this._data=e.extend({},this._options.data)),null!==this._options.callbackObject&&("function"==typeof this._options.callbackObject._ajaxFailure&&(this._options.failure=this._options.callbackObject._ajaxFailure.bind(this._options.callbackObject)),"function"==typeof this._options.callbackObject._ajaxFinalize&&(this._options.finalize=this._options.callbackObject._ajaxFinalize.bind(this._options.callbackObject)),"function"==typeof this._options.callbackObject._ajaxSuccess&&(this._options.success=this._options.callbackObject._ajaxSuccess.bind(this._options.callbackObject)),"function"==typeof this._options.callbackObject._ajaxProgress&&(this._options.progress=this._options.callbackObject._ajaxProgress.bind(this._options.callbackObject)),"function"==typeof this._options.callbackObject._ajaxUploadProgress&&(this._options.uploadProgress=this._options.callbackObject._ajaxUploadProgress.bind(this._options.callbackObject))),s===!1&&(s=!0,window.addEventListener("beforeunload",function(){l=!0}))},sendRequest:function(t){(t===!0||this._options.autoAbort)&&this.abortPrevious(),this._options.silent||r.show(),this._xhr instanceof XMLHttpRequest&&(this._previousXhr=this._xhr),this._xhr=new XMLHttpRequest,this._xhr.open(this._options.type,this._options.url,!0),this._options.contentType&&this._xhr.setRequestHeader("Content-Type",this._options.contentType),this._xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");var n=this,i=e.clone(this._options);if(this._xhr.onload=function(){this.readyState===XMLHttpRequest.DONE&&(this.status>=200&&this.status<300||304===this.status?i.responseType&&i.responseType!==this.getResponseHeader("Content-Type")?n._failure(this,i):n._success(this,i):n._failure(this,i))},this._xhr.onerror=function(){n._failure(this,i)},this._options.progress&&(this._xhr.onprogress=this._options.progress),this._options.uploadProgress&&(this._xhr.upload.onprogress=this._options.uploadProgress),
 "POST"===this._options.type){var a=this._options.data;"object"==typeof a&&"FormData"!==e.getType(a)&&(a=e.serialize(a)),this._xhr.send(a)}else this._xhr.send()},abortPrevious:function(){null!==this._previousXhr&&(this._previousXhr.abort(),this._previousXhr=null,this._options.silent||r.hide())},setOption:function(e,t){this._options[e]=t},getOption:function(e){return objOwns(this._options,e)?this._options[e]:null},setData:function(t){null!==this._data&&"FormData"!==e.getType(t)&&(t=e.extend(this._data,t)),this._options.data=t},_success:function(e,t){if(t.silent||r.hide(),"function"==typeof t.success){var n=null;if("application/json"===e.getResponseHeader("Content-Type")){try{n=JSON.parse(e.responseText)}catch(i){return void this._failure(e,t)}n&&n.returnValues&&void 0!==n.returnValues.template&&(n.returnValues.template=n.returnValues.template.trim())}t.success(n,e.responseText,e,t.data)}this._finalize(t)},_failure:function(e,n){if(!l){n.silent||r.hide();var o=null;try{o=JSON.parse(e.responseText)}catch(s){}var c=!0;if("function"==typeof n.failure&&(c=n.failure(o,e.responseText,e,n.data)),n.ignoreError!==!0&&c!==!1){var d="",u="";if(null!==o?(o.stacktrace?d="<br /><p>Stacktrace:</p><p>"+o.stacktrace+"</p>":o.exceptionID&&(d="<br /><p>Exception ID: <code>"+o.exceptionID+"</code></p>"),u=o.message):u=e.responseText,!u||"undefined"===u)return;var h='<div class="ajaxDebugMessage"><p>'+u+"</p>"+d+"</div>";void 0===a&&(a=require("Ui/Dialog")),a.openStatic(i.getUniqueId(),h,{title:t.get("wcf.global.error.title")})}this._finalize(n)}},_finalize:function(e){"function"==typeof e.finalize&&e.finalize(this._xhr),this._previousXhr=null,n.trigger();for(var t=elBySelAll('a[href*="#"]'),i=0,a=t.length;a>i;i++){var r=t[i],o=elAttr(r,"href");(-1!==o.indexOf("AJAXProxy")||-1!==o.indexOf("ajax-proxy"))&&(o=o.substr(o.indexOf("#")),elAttr(r,"href",document.location.toString().replace(/#.*/,"")+o))}}},o}),define("WoltLab/WCF/Ajax",["AjaxRequest","Core","ObjectMap"],function(e,t,n){"use strict";var i=new n,a={api:function(t,n,a,r){"object"!=typeof n&&(n={});var o=i.get(t);if(void 0===o){if("function"!=typeof t._ajaxSetup)throw new TypeError("Callback object must implement at least _ajaxSetup().");var s=t._ajaxSetup();s.pinData=!0,s.callbackObject=t,s.url||(s.url="index.php/AJAXProxy/?t="+SECURITY_TOKEN),o=new e(s),i.set(t,o)}var l=null,c=null;return"function"==typeof a&&(l=o.getOption("success"),o.setOption("success",a)),"function"==typeof r&&(c=o.getOption("failure"),o.setOption("failure",r)),o.setData(n),o.sendRequest(),null!==l&&o.setOption("success",l),null!==c&&o.setOption("failure",c),o},apiOnce:function(t){t.pinData=!1,t.callbackObject=null,t.url||(t.url="index.php/AJAXProxy/?t="+SECURITY_TOKEN);var n=new e(t);n.sendRequest()}};return a}),function(){var e=function(e){"use strict";function t(e){if(e.paused||e.ended||g)return!1;try{d.clearRect(0,0,l,s),d.drawImage(e,0,0,l,s)}catch(n){}_=setTimeout(t,M.duration,e),k.setIcon(c)}function n(e){var t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;e=e.replace(t,function(e,t,n,i){return t+t+n+n+i+i});var n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16)}:!1}function i(e,t){var n,i={};for(n in e)i[n]=e[n];for(n in t)i[n]=t[n];return i}function a(){return document.hidden||document.msHidden||document.webkitHidden||document.mozHidden}e=e?e:{};var r,o,s,l,c,d,u,h,p,f,m,g,v,b,_,y={bgColor:"#d00",textColor:"#fff",fontFamily:"sans-serif",fontStyle:"bold",type:"circle",position:"down",animation:"slide",elementId:!1,dataUrl:!1};v={},v.ff="undefined"!=typeof InstallTrigger,v.chrome=!!window.chrome,v.opera=!!window.opera||navigator.userAgent.indexOf("Opera")>=0,v.ie=!1,v.safari=Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0,v.supported=v.chrome||v.ff||v.opera;var C=[];m=function(){},h=g=!1;var w=function(){r=i(y,e),r.bgColor=n(r.bgColor),r.textColor=n(r.textColor),r.position=r.position.toLowerCase(),r.animation=M.types[""+r.animation]?r.animation:y.animation;var t=r.position.indexOf("up")>-1,a=r.position.indexOf("left")>-1;if(t||a)for(var h=0;h<M.types[""+r.animation].length;h++){var p=M.types[""+r.animation][h];t&&(p.y<.6?p.y=p.y-.4:p.y=p.y-2*p.y+(1-p.w)),a&&(p.x<.6?p.x=p.x-.4:p.x=p.x-2*p.x+(1-p.h)),M.types[""+r.animation][h]=p}r.type=E[""+r.type]?r.type:y.type,o=k.getIcon(),c=document.createElement("canvas"),u=document.createElement("img"),o.hasAttribute("href")?(u.setAttribute("src",o.getAttribute("href")),u.onload=function(){s=u.height>0?u.height:32,l=u.width>0?u.width:32,c.height=s,c.width=l,d=c.getContext("2d"),L.ready()}):(u.setAttribute("src",""),s=32,l=32,u.height=s,u.width=l,c.height=s,c.width=l,d=c.getContext("2d"),L.ready())},L={};L.ready=function(){h=!0,L.reset(),m()},L.reset=function(){h&&(C=[],p=!1,f=!1,d.clearRect(0,0,l,s),d.drawImage(u,0,0,l,s),k.setIcon(c),window.clearTimeout(b),window.clearTimeout(_))},L.start=function(){if(h&&!f){var e=function(){p=C[0],f=!1,C.length>0&&(C.shift(),L.start())};if(C.length>0){f=!0;var t=function(){["type","animation","bgColor","textColor","fontFamily","fontStyle"].forEach(function(e){e in C[0].options&&(r[e]=C[0].options[e])}),M.run(C[0].options,function(){e()},!1)};p?M.run(p.options,function(){t()},!0):t()}}};var E={},x=function(e){return e.n="number"==typeof e.n?Math.abs(0|e.n):e.n,e.x=l*e.x,e.y=s*e.y,e.w=l*e.w,e.h=s*e.h,e.len=(""+e.n).length,e};E.circle=function(e){e=x(e);var t=!1;2===e.len?(e.x=e.x-.4*e.w,e.w=1.4*e.w,t=!0):e.len>=3&&(e.x=e.x-.65*e.w,e.w=1.65*e.w,t=!0),d.clearRect(0,0,l,s),d.drawImage(u,0,0,l,s),d.beginPath(),d.font=r.fontStyle+" "+Math.floor(e.h*(e.n>99?.85:1))+"px "+r.fontFamily,d.textAlign="center",t?(d.moveTo(e.x+e.w/2,e.y),d.lineTo(e.x+e.w-e.h/2,e.y),d.quadraticCurveTo(e.x+e.w,e.y,e.x+e.w,e.y+e.h/2),d.lineTo(e.x+e.w,e.y+e.h-e.h/2),d.quadraticCurveTo(e.x+e.w,e.y+e.h,e.x+e.w-e.h/2,e.y+e.h),d.lineTo(e.x+e.h/2,e.y+e.h),d.quadraticCurveTo(e.x,e.y+e.h,e.x,e.y+e.h-e.h/2),d.lineTo(e.x,e.y+e.h/2),d.quadraticCurveTo(e.x,e.y,e.x+e.h/2,e.y)):d.arc(e.x+e.w/2,e.y+e.h/2,e.h/2,0,2*Math.PI),d.fillStyle="rgba("+r.bgColor.r+","+r.bgColor.g+","+r.bgColor.b+","+e.o+")",d.fill(),d.closePath(),d.beginPath(),d.stroke(),d.fillStyle="rgba("+r.textColor.r+","+r.textColor.g+","+r.textColor.b+","+e.o+")","number"==typeof e.n&&e.n>999?d.fillText((e.n>9999?9:Math.floor(e.n/1e3))+"k+",Math.floor(e.x+e.w/2),Math.floor(e.y+e.h-.2*e.h)):d.fillText(e.n,Math.floor(e.x+e.w/2),Math.floor(e.y+e.h-.15*e.h)),d.closePath()},E.rectangle=function(e){e=x(e);var t=!1;2===e.len?(e.x=e.x-.4*e.w,e.w=1.4*e.w,t=!0):e.len>=3&&(e.x=e.x-.65*e.w,e.w=1.65*e.w,t=!0),d.clearRect(0,0,l,s),d.drawImage(u,0,0,l,s),d.beginPath(),d.font=r.fontStyle+" "+Math.floor(e.h*(e.n>99?.9:1))+"px "+r.fontFamily,d.textAlign="center",d.fillStyle="rgba("+r.bgColor.r+","+r.bgColor.g+","+r.bgColor.b+","+e.o+")",d.fillRect(e.x,e.y,e.w,e.h),d.fillStyle="rgba("+r.textColor.r+","+r.textColor.g+","+r.textColor.b+","+e.o+")","number"==typeof e.n&&e.n>999?d.fillText((e.n>9999?9:Math.floor(e.n/1e3))+"k+",Math.floor(e.x+e.w/2),Math.floor(e.y+e.h-.2*e.h)):d.fillText(e.n,Math.floor(e.x+e.w/2),Math.floor(e.y+e.h-.15*e.h)),d.closePath()};var T=function(e,t){t=("string"==typeof t?{animation:t}:t)||{},m=function(){try{if("number"==typeof e?e>0:""!==e){var i={type:"badge",options:{n:e}};if("animation"in t&&M.types[""+t.animation]&&(i.options.animation=""+t.animation),"type"in t&&E[""+t.type]&&(i.options.type=""+t.type),["bgColor","textColor"].forEach(function(e){e in t&&(i.options[e]=n(t[e]))}),["fontStyle","fontFamily"].forEach(function(e){e in t&&(i.options[e]=t[e])}),C.push(i),C.length>100)throw"Too many badges requests in queue.";L.start()}else L.reset()}catch(a){throw"Error setting badge. Message: "+a.message}},h&&m()},D=function(e){m=function(){try{var t=e.width,n=e.height,i=document.createElement("img"),a=n/s>t/l?t/l:n/s;i.setAttribute("src",e.getAttribute("src")),i.height=n/a,i.width=t/a,d.clearRect(0,0,l,s),d.drawImage(i,0,0,l,s),k.setIcon(c)}catch(r){throw"Error setting image. Message: "+r.message}},h&&m()},S=function(e){m=function(){try{if("stop"===e)return g=!0,L.reset(),void(g=!1);e.addEventListener("play",function(){t(this)},!1)}catch(n){throw"Error setting video. Message: "+n.message}},h&&m()},I=function(e){if(window.URL&&window.URL.createObjectURL||(window.URL=window.URL||{},window.URL.createObjectURL=function(e){return e}),v.supported){var n=!1;navigator.getUserMedia=navigator.getUserMedia||navigator.oGetUserMedia||navigator.msGetUserMedia||navigator.mozGetUserMedia||navigator.webkitGetUserMedia,m=function(){try{if("stop"===e)return g=!0,L.reset(),void(g=!1);n=document.createElement("video"),n.width=l,n.height=s,navigator.getUserMedia({video:!0,audio:!1},function(e){n.src=URL.createObjectURL(e),n.play(),t(n)},function(){})}catch(i){throw"Error setting webcam. Message: "+i.message}},h&&m()}},k={};k.getIcon=function(){var e=!1,t=function(){for(var e=document.getElementsByTagName("head")[0].getElementsByTagName("link"),t=e.length,n=t-1;n>=0;n--)if(/(^|\s)icon(\s|$)/i.test(e[n].getAttribute("rel")))return e[n];return!1};return r.element?e=r.element:r.elementId?(e=document.getElementById(r.elementId),e.setAttribute("href",e.getAttribute("src"))):(e=t(),e===!1&&(e=document.createElement("link"),e.setAttribute("rel","icon"),document.getElementsByTagName("head")[0].appendChild(e))),e.setAttribute("type","image/png"),e},k.setIcon=function(e){var t=e.toDataURL("image/png");if(r.dataUrl&&r.dataUrl(t),r.element)r.element.setAttribute("src",t);else if(r.elementId)document.getElementById(r.elementId).setAttribute("src",t);else if(v.ff||v.opera){var n=o;o=document.createElement("link"),v.opera&&o.setAttribute("rel","icon"),o.setAttribute("rel","icon"),o.setAttribute("type","image/png"),document.getElementsByTagName("head")[0].appendChild(o),o.setAttribute("href",t),n.parentNode&&n.parentNode.removeChild(n)}else o.setAttribute("href",t)};var M={};return M.duration=40,M.types={},M.types.fade=[{x:.4,y:.4,w:.6,h:.6,o:0},{x:.4,y:.4,w:.6,h:.6,o:.1},{x:.4,y:.4,w:.6,h:.6,o:.2},{x:.4,y:.4,w:.6,h:.6,o:.3},{x:.4,y:.4,w:.6,h:.6,o:.4},{x:.4,y:.4,w:.6,h:.6,o:.5},{x:.4,y:.4,w:.6,h:.6,o:.6},{x:.4,y:.4,w:.6,h:.6,o:.7},{x:.4,y:.4,w:.6,h:.6,o:.8},{x:.4,y:.4,w:.6,h:.6,o:.9},{x:.4,y:.4,w:.6,h:.6,o:1}],M.types.none=[{x:.4,y:.4,w:.6,h:.6,o:1}],M.types.pop=[{x:1,y:1,w:0,h:0,o:1},{x:.9,y:.9,w:.1,h:.1,o:1},{x:.8,y:.8,w:.2,h:.2,o:1},{x:.7,y:.7,w:.3,h:.3,o:1},{x:.6,y:.6,w:.4,h:.4,o:1},{x:.5,y:.5,w:.5,h:.5,o:1},{x:.4,y:.4,w:.6,h:.6,o:1}],M.types.popFade=[{x:.75,y:.75,w:0,h:0,o:0},{x:.65,y:.65,w:.1,h:.1,o:.2},{x:.6,y:.6,w:.2,h:.2,o:.4},{x:.55,y:.55,w:.3,h:.3,o:.6},{x:.5,y:.5,w:.4,h:.4,o:.8},{x:.45,y:.45,w:.5,h:.5,o:.9},{x:.4,y:.4,w:.6,h:.6,o:1}],M.types.slide=[{x:.4,y:1,w:.6,h:.6,o:1},{x:.4,y:.9,w:.6,h:.6,o:1},{x:.4,y:.9,w:.6,h:.6,o:1},{x:.4,y:.8,w:.6,h:.6,o:1},{x:.4,y:.7,w:.6,h:.6,o:1},{x:.4,y:.6,w:.6,h:.6,o:1},{x:.4,y:.5,w:.6,h:.6,o:1},{x:.4,y:.4,w:.6,h:.6,o:1}],M.run=function(e,t,n,o){var s=M.types[a()?"none":r.animation];return o=n===!0?"undefined"!=typeof o?o:s.length-1:"undefined"!=typeof o?o:0,t=t?t:function(){},o<s.length&&o>=0?(E[r.type](i(e,s[o])),b=setTimeout(function(){n?o-=1:o+=1,M.run(e,t,n,o)},M.duration),k.setIcon(c),void 0):void t()},w(),{badge:T,video:S,image:D,webcam:I,reset:L.reset,browser:{supported:v.supported}}};"undefined"!=typeof define&&define.amd?define("favico",[],function(){return e}):"undefined"!=typeof module&&module.exports?module.exports=e:this.Favico=e}(),function e(t,n,i){function a(o,s){if(!n[o]){if(!t[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(r)return r(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var d=n[o]={exports:{}};t[o][0].call(d.exports,function(e){var n=t[o][1][e];return a(n?n:e)},d,d.exports,e,t,n,i)}return n[o].exports}for(var r="function"==typeof require&&require,o=0;o<i.length;o++)a(i[o]);return a}({1:[function(e,t,n){"use strict";var i=e("../main");"function"==typeof define&&define.amd?define("perfect-scrollbar",i):(window.PerfectScrollbar=i,"undefined"==typeof window.Ps&&(window.Ps=i))},{"../main":7}],2:[function(e,t,n){"use strict";function i(e,t){var n=e.className.split(" ");n.indexOf(t)<0&&n.push(t),e.className=n.join(" ")}function a(e,t){var n=e.className.split(" "),i=n.indexOf(t);i>=0&&n.splice(i,1),e.className=n.join(" ")}n.add=function(e,t){e.classList?e.classList.add(t):i(e,t)},n.remove=function(e,t){e.classList?e.classList.remove(t):a(e,t)},n.list=function(e){return e.classList?e.classList:e.className.split(" ")}},{}],3:[function(e,t,n){"use strict";function i(e,t){return window.getComputedStyle(e)[t]}function a(e,t,n){return"number"==typeof n&&(n=n.toString()+"px"),e.style[t]=n,e}function r(e,t){for(var n in t){var i=t[n];"number"==typeof i&&(i=i.toString()+"px"),e.style[n]=i}return e}n.e=function(e,t){var n=document.createElement(e);return n.className=t,n},n.appendTo=function(e,t){return t.appendChild(e),e},n.css=function(e,t,n){return"object"==typeof t?r(e,t):"undefined"==typeof n?i(e,t):a(e,t,n)},n.matches=function(e,t){return"undefined"!=typeof e.matches?e.matches(t):"undefined"!=typeof e.matchesSelector?e.matchesSelector(t):"undefined"!=typeof e.webkitMatchesSelector?e.webkitMatchesSelector(t):"undefined"!=typeof e.mozMatchesSelector?e.mozMatchesSelector(t):"undefined"!=typeof e.msMatchesSelector?e.msMatchesSelector(t):void 0},n.remove=function(e){"undefined"!=typeof e.remove?e.remove():e.parentNode&&e.parentNode.removeChild(e)}},{}],4:[function(e,t,n){"use strict";var i=function(e){this.element=e,this.events={}};i.prototype.bind=function(e,t){"undefined"==typeof this.events[e]&&(this.events[e]=[]),this.events[e].push(t),this.element.addEventListener(e,t,!1)},i.prototype.unbind=function(e,t){var n="undefined"!=typeof t;this.events[e]=this.events[e].filter(function(i){return n&&i!==t?!0:(this.element.removeEventListener(e,i,!1),!1)},this)},i.prototype.unbindAll=function(){for(var e in this.events)this.unbind(e)};var a=function(){this.eventElements=[]};a.prototype.eventElement=function(e){var t=this.eventElements.filter(function(t){return t.element===e})[0];return"undefined"==typeof t&&(t=new i(e),this.eventElements.push(t)),t},a.prototype.bind=function(e,t,n){this.eventElement(e).bind(t,n)},a.prototype.unbind=function(e,t,n){this.eventElement(e).unbind(t,n)},a.prototype.unbindAll=function(){for(var e=0;e<this.eventElements.length;e++)this.eventElements[e].unbindAll()},a.prototype.once=function(e,t,n){var i=this.eventElement(e),a=function(e){i.unbind(t,a),n(e)};i.bind(t,a)},t.exports=a},{}],5:[function(e,t,n){"use strict";t.exports=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return function(){return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}}()},{}],6:[function(e,t,n){"use strict";var i=e("./class"),a=e("./dom");n.toInt=function(e){return"string"==typeof e?parseInt(e,10):~~e},n.clone=function(e){if(null===e)return null;if("object"==typeof e){var t={};for(var n in e)t[n]=this.clone(e[n]);return t}return e},n.extend=function(e,t){var n=this.clone(e);for(var i in t)n[i]=this.clone(t[i]);return n},n.isEditable=function(e){return a.matches(e,"input,[contenteditable]")||a.matches(e,"select,[contenteditable]")||a.matches(e,"textarea,[contenteditable]")||a.matches(e,"button,[contenteditable]")},n.removePsClasses=function(e){for(var t=i.list(e),n=0;n<t.length;n++){var a=t[n];0===a.indexOf("ps-")&&i.remove(e,a)}},n.outerWidth=function(e){return this.toInt(a.css(e,"width"))+this.toInt(a.css(e,"paddingLeft"))+this.toInt(a.css(e,"paddingRight"))+this.toInt(a.css(e,"borderLeftWidth"))+this.toInt(a.css(e,"borderRightWidth"))},n.startScrolling=function(e,t){i.add(e,"ps-in-scrolling"),"undefined"!=typeof t?i.add(e,"ps-"+t):(i.add(e,"ps-x"),i.add(e,"ps-y"))},n.stopScrolling=function(e,t){i.remove(e,"ps-in-scrolling"),"undefined"!=typeof t?i.remove(e,"ps-"+t):(i.remove(e,"ps-x"),i.remove(e,"ps-y"))},n.env={isWebKit:"WebkitAppearance"in document.documentElement.style,supportsTouch:"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch,supportsIePointer:null!==window.navigator.msMaxTouchPoints}},{"./class":2,"./dom":3}],7:[function(e,t,n){"use strict";var i=e("./plugin/destroy"),a=e("./plugin/initialize"),r=e("./plugin/update");t.exports={initialize:a,update:r,destroy:i}},{"./plugin/destroy":9,"./plugin/initialize":17,"./plugin/update":20}],8:[function(e,t,n){"use strict";t.exports={wheelSpeed:1,wheelPropagation:!1,swipePropagation:!0,minScrollbarLength:null,maxScrollbarLength:null,useBothWheelAxes:!1,useKeyboard:!0,suppressScrollX:!1,suppressScrollY:!1,scrollXMarginOffset:0,scrollYMarginOffset:0}},{}],9:[function(e,t,n){"use strict";var i=e("../lib/dom"),a=e("../lib/helper"),r=e("./instances");t.exports=function(e){var t=r.get(e);t.event.unbindAll(),i.remove(t.scrollbarX),i.remove(t.scrollbarY),i.remove(t.scrollbarXRail),i.remove(t.scrollbarYRail),a.removePsClasses(e),r.remove(e)}},{"../lib/dom":3,"../lib/helper":6,"./instances":18}],10:[function(e,t,n){"use strict";function i(e,t){function n(e){return e.getBoundingClientRect()}var i=window.Event.prototype.stopPropagation.bind;t.event.bind(t.scrollbarY,"click",i),t.event.bind(t.scrollbarYRail,"click",function(i){var r=a.toInt(t.scrollbarYHeight/2),s=i.pageY-n(t.scrollbarYRail).top-r,l=t.containerHeight-t.scrollbarYHeight,c=s/l;0>c?c=0:c>1&&(c=1),e.scrollTop=(t.contentHeight-t.containerHeight)*c,o(e)}),t.event.bind(t.scrollbarX,"click",i),t.event.bind(t.scrollbarXRail,"click",function(i){var r=a.toInt(t.scrollbarXWidth/2),s=i.pageX-n(t.scrollbarXRail).left-r;console.log(i.pageX,t.scrollbarXRail.offsetLeft);var l=t.containerWidth-t.scrollbarXWidth,c=s/l;0>c?c=0:c>1&&(c=1),e.scrollLeft=(t.contentWidth-t.containerWidth)*c,o(e)})}var a=e("../../lib/helper"),r=e("../instances"),o=e("../update-geometry");t.exports=function(e){var t=r.get(e);i(e,t)}},{"../../lib/helper":6,"../instances":18,"../update-geometry":19}],11:[function(e,t,n){"use strict";function i(e,t){function n(n){var a=i+n,r=t.containerWidth-t.scrollbarXWidth;0>a?t.scrollbarXLeft=0:a>r?t.scrollbarXLeft=r:t.scrollbarXLeft=a;var s=o.toInt(t.scrollbarXLeft*(t.contentWidth-t.containerWidth)/(t.containerWidth-t.scrollbarXWidth));e.scrollLeft=s}var i=null,a=null,s=function(t){n(t.pageX-a),l(e),t.stopPropagation(),t.preventDefault()},c=function(){o.stopScrolling(e,"x"),t.event.unbind(t.ownerDocument,"mousemove",s)};t.event.bind(t.scrollbarX,"mousedown",function(n){a=n.pageX,i=o.toInt(r.css(t.scrollbarX,"left")),o.startScrolling(e,"x"),t.event.bind(t.ownerDocument,"mousemove",s),t.event.once(t.ownerDocument,"mouseup",c),n.stopPropagation(),n.preventDefault()})}function a(e,t){function n(n){var a=i+n,r=t.containerHeight-t.scrollbarYHeight;0>a?t.scrollbarYTop=0:a>r?t.scrollbarYTop=r:t.scrollbarYTop=a;var s=o.toInt(t.scrollbarYTop*(t.contentHeight-t.containerHeight)/(t.containerHeight-t.scrollbarYHeight));e.scrollTop=s}var i=null,a=null,s=function(t){n(t.pageY-a),l(e),t.stopPropagation(),t.preventDefault()},c=function(){o.stopScrolling(e,"y"),t.event.unbind(t.ownerDocument,"mousemove",s)};t.event.bind(t.scrollbarY,"mousedown",function(n){a=n.pageY,i=o.toInt(r.css(t.scrollbarY,"top")),o.startScrolling(e,"y"),t.event.bind(t.ownerDocument,"mousemove",s),t.event.once(t.ownerDocument,"mouseup",c),n.stopPropagation(),n.preventDefault()})}var r=e("../../lib/dom"),o=e("../../lib/helper"),s=e("../instances"),l=e("../update-geometry");t.exports=function(e){var t=s.get(e);i(e,t),a(e,t)}},{"../../lib/dom":3,"../../lib/helper":6,"../instances":18,"../update-geometry":19}],12:[function(e,t,n){"use strict";function i(e,t){function n(n,i){var a=e.scrollTop;if(0===n){if(!t.scrollbarYActive)return!1;if(0===a&&i>0||a>=t.contentHeight-t.containerHeight&&0>i)return!t.settings.wheelPropagation}var r=e.scrollLeft;if(0===i){if(!t.scrollbarXActive)return!1;if(0===r&&0>n||r>=t.contentWidth-t.containerWidth&&n>0)return!t.settings.wheelPropagation}return!0}var i=!1;t.event.bind(e,"mouseenter",function(){i=!0}),t.event.bind(e,"mouseleave",function(){i=!1});var r=!1;t.event.bind(t.ownerDocument,"keydown",function(s){if((!s.isDefaultPrevented||!s.isDefaultPrevented())&&i){var l=document.activeElement?document.activeElement:t.ownerDocument.activeElement;if(l){for(;l.shadowRoot;)l=l.shadowRoot.activeElement;if(a.isEditable(l))return}var c=0,d=0;switch(s.which){case 37:c=-30;break;case 38:d=30;break;case 39:c=30;break;case 40:d=-30;break;case 33:d=90;break;case 32:case 34:d=-90;break;case 35:d=s.ctrlKey?-t.contentHeight:-t.containerHeight;break;case 36:d=s.ctrlKey?e.scrollTop:t.containerHeight;break;default:return}e.scrollTop=e.scrollTop-d,e.scrollLeft=e.scrollLeft+c,o(e),r=n(c,d),r&&s.preventDefault()}})}var a=e("../../lib/helper"),r=e("../instances"),o=e("../update-geometry");t.exports=function(e){var t=r.get(e);i(e,t)}},{"../../lib/helper":6,"../instances":18,"../update-geometry":19}],13:[function(e,t,n){"use strict";function i(e,t){function n(n,i){var a=e.scrollTop;if(0===n){if(!t.scrollbarYActive)return!1;if(0===a&&i>0||a>=t.contentHeight-t.containerHeight&&0>i)return!t.settings.wheelPropagation}var r=e.scrollLeft;if(0===i){if(!t.scrollbarXActive)return!1;if(0===r&&0>n||r>=t.contentWidth-t.containerWidth&&n>0)return!t.settings.wheelPropagation}return!0}function i(e){var t=e.deltaX,n=-1*e.deltaY;return("undefined"==typeof t||"undefined"==typeof n)&&(t=-1*e.wheelDeltaX/6,n=e.wheelDeltaY/6),e.deltaMode&&1===e.deltaMode&&(t*=10,n*=10),t!==t&&n!==n&&(t=0,n=e.wheelDelta),[t,n]}function r(t,n){var i=e.querySelector("textarea:hover");if(i){var a=i.scrollHeight-i.clientHeight;if(a>0&&!(0===i.scrollTop&&n>0||i.scrollTop===a&&0>n))return!0;var r=i.scrollLeft-i.clientWidth;if(r>0&&!(0===i.scrollLeft&&0>t||i.scrollLeft===r&&t>0))return!0}return!1}function s(s){if(a.env.isWebKit||!e.querySelector("select:focus")){var c=i(s),d=c[0],u=c[1];r(d,u)||(l=!1,t.settings.useBothWheelAxes?t.scrollbarYActive&&!t.scrollbarXActive?(u?e.scrollTop=e.scrollTop-u*t.settings.wheelSpeed:e.scrollTop=e.scrollTop+d*t.settings.wheelSpeed,l=!0):t.scrollbarXActive&&!t.scrollbarYActive&&(d?e.scrollLeft=e.scrollLeft+d*t.settings.wheelSpeed:e.scrollLeft=e.scrollLeft-u*t.settings.wheelSpeed,l=!0):(e.scrollTop=e.scrollTop-u*t.settings.wheelSpeed,e.scrollLeft=e.scrollLeft+d*t.settings.wheelSpeed),o(e),l=l||n(d,u),l&&(s.stopPropagation(),s.preventDefault()))}}var l=!1;"undefined"!=typeof window.onwheel?t.event.bind(e,"wheel",s):"undefined"!=typeof window.onmousewheel&&t.event.bind(e,"mousewheel",s)}var a=e("../../lib/helper"),r=e("../instances"),o=e("../update-geometry");t.exports=function(e){var t=r.get(e);i(e,t)}},{"../../lib/helper":6,"../instances":18,"../update-geometry":19}],14:[function(e,t,n){"use strict";function i(e,t){t.event.bind(e,"scroll",function(){r(e)})}var a=e("../instances"),r=e("../update-geometry");t.exports=function(e){var t=a.get(e);i(e,t)}},{"../instances":18,"../update-geometry":19}],15:[function(e,t,n){"use strict";function i(e,t){function n(){var e=window.getSelection?window.getSelection():document.getSelection?document.getSelection():"";return 0===e.toString().length?null:e.getRangeAt(0).commonAncestorContainer}function i(){l||(l=setInterval(function(){return r.get(e)?(e.scrollTop=e.scrollTop+c.top,e.scrollLeft=e.scrollLeft+c.left,void o(e)):void clearInterval(l)},50))}function s(){l&&(clearInterval(l),l=null),a.stopScrolling(e)}var l=null,c={top:0,left:0},d=!1;t.event.bind(t.ownerDocument,"selectionchange",function(){e.contains(n())?d=!0:(d=!1,s())}),t.event.bind(window,"mouseup",function(){d&&(d=!1,s())}),t.event.bind(window,"mousemove",function(t){if(d){var n={x:t.pageX,y:t.pageY},r={left:e.offsetLeft,right:e.offsetLeft+e.offsetWidth,top:e.offsetTop,bottom:e.offsetTop+e.offsetHeight};n.x<r.left+3?(c.left=-5,a.startScrolling(e,"x")):n.x>r.right-3?(c.left=5,a.startScrolling(e,"x")):c.left=0,n.y<r.top+3?(r.top+3-n.y<5?c.top=-5:c.top=-20,a.startScrolling(e,"y")):n.y>r.bottom-3?(n.y-r.bottom+3<5?c.top=5:c.top=20,a.startScrolling(e,"y")):c.top=0,0===c.top&&0===c.left?s():i()}})}var a=e("../../lib/helper"),r=e("../instances"),o=e("../update-geometry");t.exports=function(e){var t=r.get(e);i(e,t)}},{"../../lib/helper":6,"../instances":18,"../update-geometry":19}],16:[function(e,t,n){"use strict";function i(e,t,n,i){function o(n,i){var a=e.scrollTop,r=e.scrollLeft,o=Math.abs(n),s=Math.abs(i);if(s>o){if(0>i&&a===t.contentHeight-t.containerHeight||i>0&&0===a)return!t.settings.swipePropagation}else if(o>s&&(0>n&&r===t.contentWidth-t.containerWidth||n>0&&0===r))return!t.settings.swipePropagation;return!0}function s(t,n){e.scrollTop=e.scrollTop-n,e.scrollLeft=e.scrollLeft-t,r(e)}function l(){_=!0}function c(){_=!1}function d(e){return e.targetTouches?e.targetTouches[0]:e}function u(e){return e.targetTouches&&1===e.targetTouches.length?!0:e.pointerType&&"mouse"!==e.pointerType&&e.pointerType!==e.MSPOINTER_TYPE_MOUSE?!0:!1}function h(e){if(u(e)){y=!0;var t=d(e);m.pageX=t.pageX,m.pageY=t.pageY,g=(new Date).getTime(),null!==b&&clearInterval(b),e.stopPropagation()}}function p(e){if(!_&&y&&u(e)){var t=d(e),n={pageX:t.pageX,pageY:t.pageY},i=n.pageX-m.pageX,a=n.pageY-m.pageY;s(i,a),m=n;var r=(new Date).getTime(),l=r-g;l>0&&(v.x=i/l,v.y=a/l,g=r),o(i,a)&&(e.stopPropagation(),e.preventDefault())}}function f(){!_&&y&&(y=!1,clearInterval(b),b=setInterval(function(){return a.get(e)?Math.abs(v.x)<.01&&Math.abs(v.y)<.01?void clearInterval(b):(s(30*v.x,30*v.y),v.x*=.8,void(v.y*=.8)):void clearInterval(b)},10))}var m={},g=0,v={},b=null,_=!1,y=!1;n&&(t.event.bind(window,"touchstart",l),t.event.bind(window,"touchend",c),t.event.bind(e,"touchstart",h),t.event.bind(e,"touchmove",p),t.event.bind(e,"touchend",f)),i&&(window.PointerEvent?(t.event.bind(window,"pointerdown",l),t.event.bind(window,"pointerup",c),t.event.bind(e,"pointerdown",h),t.event.bind(e,"pointermove",p),t.event.bind(e,"pointerup",f)):window.MSPointerEvent&&(t.event.bind(window,"MSPointerDown",l),t.event.bind(window,"MSPointerUp",c),t.event.bind(e,"MSPointerDown",h),t.event.bind(e,"MSPointerMove",p),t.event.bind(e,"MSPointerUp",f)))}var a=e("../instances"),r=e("../update-geometry");t.exports=function(e,t,n){var r=a.get(e);i(e,r,t,n)}},{"../instances":18,"../update-geometry":19}],17:[function(e,t,n){"use strict";var i=e("../lib/class"),a=e("../lib/helper"),r=e("./instances"),o=e("./update-geometry"),s=e("./handler/click-rail"),l=e("./handler/drag-scrollbar"),c=e("./handler/keyboard"),d=e("./handler/mouse-wheel"),u=e("./handler/native-scroll"),h=e("./handler/selection"),p=e("./handler/touch");t.exports=function(e,t){t="object"==typeof t?t:{},i.add(e,"ps-container");var n=r.add(e);n.settings=a.extend(n.settings,t),s(e),l(e),d(e),u(e),h(e),(a.env.supportsTouch||a.env.supportsIePointer)&&p(e,a.env.supportsTouch,a.env.supportsIePointer),n.settings.useKeyboard&&c(e),o(e)}},{"../lib/class":2,"../lib/helper":6,"./handler/click-rail":10,"./handler/drag-scrollbar":11,"./handler/keyboard":12,"./handler/mouse-wheel":13,"./handler/native-scroll":14,"./handler/selection":15,"./handler/touch":16,"./instances":18,"./update-geometry":19}],18:[function(e,t,n){"use strict";function i(e){var t=this;t.settings=u.clone(l),t.containerWidth=null,t.containerHeight=null,t.contentWidth=null,t.contentHeight=null,t.isRtl="rtl"===s.css(e,"direction"),t.event=new c,t.ownerDocument=e.ownerDocument||document,t.scrollbarXRail=s.appendTo(s.e("div","ps-scrollbar-x-rail"),e),t.scrollbarX=s.appendTo(s.e("div","ps-scrollbar-x"),t.scrollbarXRail),t.scrollbarXActive=null,t.scrollbarXWidth=null,t.scrollbarXLeft=null,t.scrollbarXBottom=u.toInt(s.css(t.scrollbarXRail,"bottom")),t.isScrollbarXUsingBottom=t.scrollbarXBottom===t.scrollbarXBottom,t.scrollbarXTop=t.isScrollbarXUsingBottom?null:u.toInt(s.css(t.scrollbarXRail,"top")),t.railBorderXWidth=u.toInt(s.css(t.scrollbarXRail,"borderLeftWidth"))+u.toInt(s.css(t.scrollbarXRail,"borderRightWidth")),t.railXMarginWidth=u.toInt(s.css(t.scrollbarXRail,"marginLeft"))+u.toInt(s.css(t.scrollbarXRail,"marginRight")),t.railXWidth=null,t.scrollbarYRail=s.appendTo(s.e("div","ps-scrollbar-y-rail"),e),t.scrollbarY=s.appendTo(s.e("div","ps-scrollbar-y"),t.scrollbarYRail),t.scrollbarYActive=null,t.scrollbarYHeight=null,t.scrollbarYTop=null,t.scrollbarYRight=u.toInt(s.css(t.scrollbarYRail,"right")),t.isScrollbarYUsingRight=t.scrollbarYRight===t.scrollbarYRight,t.scrollbarYLeft=t.isScrollbarYUsingRight?null:u.toInt(s.css(t.scrollbarYRail,"left")),t.scrollbarYOuterWidth=t.isRtl?u.outerWidth(t.scrollbarY):null,t.railBorderYWidth=u.toInt(s.css(t.scrollbarYRail,"borderTopWidth"))+u.toInt(s.css(t.scrollbarYRail,"borderBottomWidth")),t.railYMarginHeight=u.toInt(s.css(t.scrollbarYRail,"marginTop"))+u.toInt(s.css(t.scrollbarYRail,"marginBottom")),t.railYHeight=null}function a(e){return"undefined"==typeof e.dataset?e.getAttribute("data-ps-id"):e.dataset.psId}function r(e,t){"undefined"==typeof e.dataset?e.setAttribute("data-ps-id",t):e.dataset.psId=t}function o(e){"undefined"==typeof e.dataset?e.removeAttribute("data-ps-id"):delete e.dataset.psId}var s=e("../lib/dom"),l=e("./default-setting"),c=e("../lib/event-manager"),d=e("../lib/guid"),u=e("../lib/helper"),h={};n.add=function(e){var t=d();return r(e,t),h[t]=new i(e),h[t]},n.remove=function(e){delete h[a(e)],o(e)},n.get=function(e){return h[a(e)]}},{"../lib/dom":3,"../lib/event-manager":4,"../lib/guid":5,"../lib/helper":6,"./default-setting":8}],19:[function(e,t,n){"use strict";function i(e,t){return e.settings.minScrollbarLength&&(t=Math.max(t,e.settings.minScrollbarLength)),e.settings.maxScrollbarLength&&(t=Math.min(t,e.settings.maxScrollbarLength)),t}function a(e,t){var n={width:t.railXWidth};t.isRtl?n.left=e.scrollLeft+t.containerWidth-t.contentWidth:n.left=e.scrollLeft,t.isScrollbarXUsingBottom?n.bottom=t.scrollbarXBottom-e.scrollTop:n.top=t.scrollbarXTop+e.scrollTop,o.css(t.scrollbarXRail,n);var i={top:e.scrollTop,height:t.railYHeight};t.isScrollbarYUsingRight?t.isRtl?i.right=t.contentWidth-e.scrollLeft-t.scrollbarYRight-t.scrollbarYOuterWidth:i.right=t.scrollbarYRight-e.scrollLeft:t.isRtl?i.left=e.scrollLeft+2*t.containerWidth-t.contentWidth-t.scrollbarYLeft-t.scrollbarYOuterWidth:i.left=t.scrollbarYLeft+e.scrollLeft,o.css(t.scrollbarYRail,i),o.css(t.scrollbarX,{left:t.scrollbarXLeft,width:t.scrollbarXWidth-t.railBorderXWidth}),o.css(t.scrollbarY,{top:t.scrollbarYTop,height:t.scrollbarYHeight-t.railBorderYWidth})}var r=e("../lib/class"),o=e("../lib/dom"),s=e("../lib/helper"),l=e("./instances");t.exports=function(e){var t=l.get(e);t.containerWidth=e.clientWidth,t.containerHeight=e.clientHeight,t.contentWidth=e.scrollWidth,t.contentHeight=e.scrollHeight,e.contains(t.scrollbarXRail)||o.appendTo(t.scrollbarXRail,e),e.contains(t.scrollbarYRail)||o.appendTo(t.scrollbarYRail,e),!t.settings.suppressScrollX&&t.containerWidth+t.settings.scrollXMarginOffset<t.contentWidth?(t.scrollbarXActive=!0,t.railXWidth=t.containerWidth-t.railXMarginWidth,t.scrollbarXWidth=i(t,s.toInt(t.railXWidth*t.containerWidth/t.contentWidth)),t.scrollbarXLeft=s.toInt(e.scrollLeft*(t.railXWidth-t.scrollbarXWidth)/(t.contentWidth-t.containerWidth))):(t.scrollbarXActive=!1,t.scrollbarXWidth=0,t.scrollbarXLeft=0,e.scrollLeft=0),!t.settings.suppressScrollY&&t.containerHeight+t.settings.scrollYMarginOffset<t.contentHeight?(t.scrollbarYActive=!0,t.railYHeight=t.containerHeight-t.railYMarginHeight,t.scrollbarYHeight=i(t,s.toInt(t.railYHeight*t.containerHeight/t.contentHeight)),t.scrollbarYTop=s.toInt(e.scrollTop*(t.railYHeight-t.scrollbarYHeight)/(t.contentHeight-t.containerHeight))):(t.scrollbarYActive=!1,t.scrollbarYHeight=0,t.scrollbarYTop=0,e.scrollTop=0),t.scrollbarXLeft>=t.railXWidth-t.scrollbarXWidth&&(t.scrollbarXLeft=t.railXWidth-t.scrollbarXWidth),t.scrollbarYTop>=t.railYHeight-t.scrollbarYHeight&&(t.scrollbarYTop=t.railYHeight-t.scrollbarYHeight),a(e,t),r[t.scrollbarXActive?"add":"remove"](e,"ps-active-x"),r[t.scrollbarYActive?"add":"remove"](e,"ps-active-y")}},{"../lib/class":2,"../lib/dom":3,"../lib/helper":6,"./instances":18}],20:[function(e,t,n){
 "use strict";var i=e("../lib/dom"),a=e("./instances"),r=e("./update-geometry");t.exports=function(e){var t=a.get(e);i.css(t.scrollbarXRail,"display","none"),i.css(t.scrollbarYRail,"display","none"),r(e),i.css(t.scrollbarXRail,"display","block"),i.css(t.scrollbarYRail,"display","block")}},{"../lib/dom":3,"./instances":18,"./update-geometry":19}]},{},[1]),define("WoltLab/WCF/Date/Util",["Language"],function(e){"use strict";var t={formatDate:function(t){return this.format(t,e.get("wcf.date.dateFormat"))},formatTime:function(t){return this.format(t,e.get("wcf.date.timeFormat"))},formatDateTime:function(t){return this.format(t,e.get("wcf.date.dateTimeFormat").replace(/%date%/,e.get("wcf.date.dateFormat")).replace(/%time%/,e.get("wcf.date.timeFormat")))},format:function(t,n){var i,a="";"c"===n&&(n="Y-m-dTH:i:sP");for(var r=0,o=n.length;o>r;r++){switch(n[r]){case"s":i=("0"+t.getSeconds().toString()).slice(-2);break;case"i":i=t.getMinutes();break;case"a":i=t.getHours()>11?"pm":"am";break;case"g":i=t.getHours(),0===i?i=12:i>12&&(i-=12);break;case"h":i=t.getHours(),0===i?i=12:i>12&&(i-=12),i=("0"+i.toString()).slice(-2);break;case"A":i=t.getHours()>11?"PM":"AM";break;case"G":i=t.getHours();break;case"H":i=t.getHours(),i=("0"+i.toString()).slice(-2);break;case"d":i=t.getDate(),i=("0"+i.toString()).slice(-2);break;case"j":i=t.getDate();break;case"l":i=e.get("__days")[t.getDay()];break;case"D":i=e.get("__daysShort")[t.getDay()];break;case"S":i="";break;case"m":i=t.getMonth()+1,i=("0"+i.toString()).slice(-2);break;case"n":i=t.getMonth()+1;break;case"F":i=e.get("__months")[t.getMonth()];break;case"M":i=e.get("__monthsShort")[t.getMonth()];break;case"y":i=t.getYear().toString().replace(/^\d{2}/,"");break;case"Y":i=t.getFullYear();break;case"P":var s=t.getTimezoneOffset();i=s>0?"-":"+",s=Math.abs(s),i+=("0"+(~~(s/60)).toString()).slice(-2),i+=":",i+=("0"+(s%60).toString()).slice(-2);break;case"r":i=t.toString();break;case"U":i=Math.round(t.getTime()/1e3);break;default:i=n[r]}a+=i}return a},gmdate:function(e){return date instanceof Date||(date=new Date),Math.round(Date.UTC(date.getUTCFullYear(),date.getUTCMonth(),date.getUTCDay(),date.getUTCHours(),date.getUTCMinutes(),date.getUTCSeconds())/1e3)},getTimezoneDate:function(e,t){var n=new Date(e),i=6e4*n.getTimezoneOffset();return new Date(e+i+t)}};return t}),define("WoltLab/WCF/Timer/Repeating",[],function(){"use strict";function e(e,t){if("function"!=typeof e)throw new TypeError("Expected a valid callback as first argument.");if(0>t||t>864e5)throw new RangeError("Invalid delta "+t+". Delta must be in the interval [0, 86400000].");this._callback=e.bind(void 0,this),this._delta=t,this._timer=void 0,this.restart()}return e.prototype={restart:function(){this.stop(),this._timer=setInterval(this._callback,this._delta)},stop:function(){void 0!==this._timer&&(clearInterval(this._timer),this._timer=void 0)},setDelta:function(e){this._delta=e,this.restart()}},e}),define("WoltLab/WCF/Date/Time/Relative",["Dom/ChangeListener","Language","WoltLab/WCF/Date/Util","WoltLab/WCF/Timer/Repeating"],function(e,t,n,i){"use strict";var a=elByTag("time"),r=null;return{setup:function(){this._refresh(),new i(this._refresh.bind(this),6e4),e.add("WoltLab/WCF/Date/Time/Relative",this._refresh.bind(this))},_refresh:function(){var e=new Date,i=(e.getTime()-e.getMilliseconds())/1e3;null===r&&(r=i-TIME_NOW);for(var o=0,s=a.length;s>o;o++){var l=a[o];if(l.classList.contains("datetime")&&!elData(l,"is-future-date")){var c=~~elData(l,"timestamp")+r,d=elData(l,"date"),u=elData(l,"time"),h=elData(l,"offset");if(elAttr(l,"title")||elAttr(l,"title",t.get("wcf.date.dateTimeFormat").replace(/%date%/,d).replace(/%time%/,u)),c>=i||c+60>i)l.textContent=t.get("wcf.date.relative.now");else if(c+3540>i){var p=Math.max(Math.round((i-c)/60),1);l.textContent=t.get("wcf.date.relative.minutes",{minutes:p})}else if(c+86400>i){var f=Math.round((i-c)/3600);l.textContent=t.get("wcf.date.relative.hours",{hours:f})}else if(c+518400>i){var m=new Date(e.getFullYear(),e.getMonth(),e.getDate()),g=Math.ceil((m/1e3-c)/86400),v=n.getTimezoneDate(1e3*c,1e3*h),b=v.getDay(),_=t.get("__days")[b];l.textContent=t.get("wcf.date.relative.pastDays",{days:g,day:_,time:u})}else l.textContent=t.get("wcf.date.shortDateTimeFormat").replace(/%date%/,d).replace(/%time%/,u)}}}}}),define("WoltLab/WCF/Ui/Alignment",["Core","Language","Dom/Traverse","Dom/Util"],function(e,t,n,i){"use strict";return{set:function(a,r,o){o=e.extend({verticalOffset:0,pointer:!1,pointerOffset:4,pointerClassNames:[],refDimensionsElement:null,horizontal:"left",vertical:"bottom",allowFlip:"both"},o),Array.isArray(o.pointerClassNames)&&o.pointerClassNames.length===(o.pointer?1:2)||(o.pointerClassNames=[]),-1===["left","right","center"].indexOf(o.horizontal)&&(o.horizontal="left"),"bottom"!==o.vertical&&(o.vertical="top"),-1===["both","horizontal","vertical","none"].indexOf(o.allowFlip)&&(o.allowFlip="both"),i.setStyles(a,{bottom:"auto !important",left:"0 !important",right:"auto !important",top:"0 !important",visibility:"hidden !important"});var s=i.outerDimensions(a),l=i.outerDimensions(o.refDimensionsElement instanceof Element?o.refDimensionsElement:r),c=i.offset(r),d=window.innerHeight,u=document.body.clientWidth,h={result:null},p=!1;if("center"===o.horizontal&&(p=!0,h=this._tryAlignmentHorizontal(o.horizontal,s,l,c,u),h.result||("both"===o.allowFlip||"horizontal"===o.allowFlip?o.horizontal="left":h.result=!0)),"rtl"===t.get("wcf.global.pageDirection")&&(o.horizontal="left"===o.horizontal?"right":"left"),!h.result){var f=h;if(h=this._tryAlignmentHorizontal(o.horizontal,s,l,c,u),!h.result&&("both"===o.allowFlip||"horizontal"===o.allowFlip)){var m=this._tryAlignmentHorizontal("left"===o.horizontal?"right":"left",s,l,c,u);m.result?h=m:p&&(h=f)}}var g=h.left,v=h.right,b=this._tryAlignmentVertical(o.vertical,s,l,c,d,o.verticalOffset);if(!b.result&&("both"===o.allowFlip||"vertical"===o.allowFlip)){var _=this._tryAlignmentVertical("top"===o.vertical?"bottom":"top",s,l,c,d,o.verticalOffset);_.result&&(b=_)}var y=b.bottom,C=b.top;if(o.pointer){var w=n.childrenByClass(a,"elementPointer");if(w=w[0]||null,null===w)throw new Error("Expected the .elementPointer element to be a direct children.");"center"===h.align?(w.classList.add("center"),w.classList.remove("left"),w.classList.remove("right")):(w.classList.add(h.align),w.classList.remove("center"),w.classList.remove("left"===h.align?"right":"left")),"top"===b.align?w.classList.add("flipVertical"):w.classList.remove("flipVertical")}else if(2===o.pointerClassNames.length){var L=0,E=1;a.classList["auto"===C?"add":"remove"](o.pointerClassNames[L]),a.classList["auto"===g?"add":"remove"](o.pointerClassNames[E])}"auto"!==y&&(y=Math.round(y)+"px"),"auto"!==g&&(g=Math.ceil(g)+"px"),"auto"!==v&&(v=Math.floor(v)+"px"),"auto"!==C&&(C=Math.round(C)+"px"),i.setStyles(a,{bottom:y,left:g,right:v,top:C}),elShow(a),a.style.removeProperty("visibility")},_tryAlignmentHorizontal:function(e,t,n,i,a){var r="auto",o="auto",s=!0;return"left"===e?(r=i.left,r+t.width>a&&(s=!1)):"right"===e?(o=a-(i.left+n.width),0>o&&(s=!1)):(r=i.left+n.width/2-t.width/2,r=~~r,(0>r||r+t.width>a)&&(s=!1)),{align:e,left:r,right:o,result:s}},_tryAlignmentVertical:function(e,t,n,i,a,r){var o="auto",s="auto",l=!0;if("top"===e){var c=document.body.clientHeight;o=c-i.top+r,c-(o+t.height)<window.scrollY&&(l=!1)}else s=i.top+n.height+r,s+t.height-window.scrollY>a&&(l=!1);return{align:e,bottom:o,top:s,result:l}}}}),define("WoltLab/WCF/Ui/CloseOverlay",["CallbackList"],function(e){"use strict";var t=new e,n={setup:function(){document.body.addEventListener(WCF_CLICK_EVENT,this.execute.bind(this))},add:t.add.bind(t),remove:t.remove.bind(t),execute:function(){t.forEach(null,function(e){e()})}};return n.setup(),n}),define("WoltLab/WCF/Ui/Dropdown/Simple",["CallbackList","Core","Dictionary","Ui/Alignment","Dom/ChangeListener","Dom/Traverse","Dom/Util","Ui/CloseOverlay"],function(e,t,n,i,a,r,o,s){"use strict";var l=null,c=new e,d=!1,u=new n,h=new n,p=null;return{setup:function(){d||(d=!0,p=elCreate("div"),p.className="dropdownMenuContainer",document.body.appendChild(p),l=elByClass("dropdownToggle"),this.initAll(),s.add("WoltLab/WCF/Ui/Dropdown/Simple",this.closeAll.bind(this)),a.add("WoltLab/WCF/Ui/Dropdown/Simple",this.initAll.bind(this)),document.addEventListener("scroll",this._onScroll.bind(this)),window.bc_wcfSimpleDropdown=this)},initAll:function(){for(var e=0,t=l.length;t>e;e++)this.init(l[e],!1)},init:function(e,n){if(this.setup(),e.classList.contains("jsDropdownEnabled")||elData(e,"target"))return!1;var i=r.parentByClass(e,"dropdown");if(null===i)throw new Error("Invalid dropdown passed, button '"+o.identify(e)+"' does not have a parent with .dropdown.");var a=r.nextByClass(e,"dropdownMenu");if(null===a)throw new Error("Invalid dropdown passed, button '"+o.identify(e)+"' does not have a menu as next sibling.");p.appendChild(a);var s=o.identify(i);u.has(s)||(e.classList.add("jsDropdownEnabled"),e.addEventListener(WCF_CLICK_EVENT,this._toggle.bind(this)),u.set(s,i),h.set(s,a),s.match(/^wcf\d+$/)||elData(a,"source",s)),elData(e,"target",s),n&&setTimeout(function(){t.triggerEvent(e,WCF_CLICK_EVENT)},10)},initFragment:function(e,t){this.setup();var n=o.identify(e);u.has(n)||(u.set(n,e),p.appendChild(t),h.set(n,t))},registerCallback:function(e,t){c.add(e,t)},getDropdown:function(e){return u.get(e)},getDropdownMenu:function(e){return h.get(e)},toggleDropdown:function(e,t){this._toggle(null,e,t)},setAlignment:function(e,t,n){var a,r=elBySel(".dropdownToggle",e);null!==r&&r.parentNode.classList.contains("inputAddonTextarea")&&(a=r),i.set(t,n||e,{pointerClassNames:["dropdownArrowBottom","dropdownArrowRight"],refDimensionsElement:a||null,horizontal:"right"===elData(t,"dropdown-alignment-horizontal")?"right":"left",vertical:"top"===elData(t,"dropdown-alignment-vertical")?"top":"bottom"})},setAlignmentById:function(e){var t=u.get(e);if(void 0===t)throw new Error("Unknown dropdown identifier '"+e+"'.");var n=h.get(e);this.setAlignment(t,n)},isOpen:function(e){var t=h.get(e);return void 0!==t&&t.classList.contains("dropdownOpen")},open:function(e){var t=h.get(e);void 0===t||t.classList.contains("dropdownOpen")||this.toggleDropdown(e)},close:function(e){var t=u.get(e);void 0!==t&&(t.classList.remove("dropdownOpen"),h.get(e).classList.remove("dropdownOpen"))},closeAll:function(){u.forEach(function(e,t){e.classList.contains("dropdownOpen")&&(e.classList.remove("dropdownOpen"),h.get(t).classList.remove("dropdownOpen"),this._notifyCallbacks(t,"close"))}.bind(this))},destroy:function(e){if(!u.has(e))return!1;this.close(e);var t=h.get(e);return h.parentNode.removeChild(t),h["delete"](e),u["delete"](e),!0},_onDialogScroll:function(e){for(var t=e.currentTarget,n=elBySelAll(".dropdown.dropdownOpen",t),i=0,a=n.length;a>i;i++){var r=n[i],s=o.identify(r),l=o.offset(r),c=o.offset(t);l.top+r.clientHeight<=c.top?this.toggleDropdown(s):l.top>=c.top+t.offsetHeight?this.toggleDropdown(s):l.left<=c.left?this.toggleDropdown(s):l.left>=c.left+t.offsetWidth?this.toggleDropdown(s):this.setAlignment(s,h.get(s))}},_onScroll:function(){u.forEach(function(e,t){e.classList.contains("dropdownOpen")&&(elDataBool(e,"is-overlay-dropdown-button")?this.setAlignment(e,h.get(t)):this.close(t))}.bind(this))},_notifyCallbacks:function(e,t){c.forEach(e,function(n){n(e,t)})},_toggle:function(e,t,n){null!==e&&(e.preventDefault(),e.stopPropagation(),t=elData(e.currentTarget,"target"));var i=u.get(t),a=!1;if(void 0!==i&&(elDataBool(i,"dropdown-prevent-toggle")&&i.classList.contains("dropdownOpen")&&(a=!0),null===elData(i,"is-overlay-dropdown-button"))){var o=r.parentByClass(i,"dialogContent");elData(i,"is-overlay-dropdown-button",null!==o),null!==o&&o.addEventListener("scroll",this._onDialogScroll.bind(this))}return u.forEach(function(e,i){var r=h.get(i);e.classList.contains("dropdownOpen")?a===!1&&(e.classList.remove("dropdownOpen"),r.classList.remove("dropdownOpen"),this._notifyCallbacks(i,"close")):i===t&&r.childElementCount>0&&(e.classList.add("dropdownOpen"),r.classList.add("dropdownOpen"),this._notifyCallbacks(i,"open"),this.setAlignment(e,r,n))}.bind(this)),WCF.Dropdown.Interactive.Handler.closeAll(),null===e}}}),define("WoltLab/WCF/Ui/Screen",["Core","Dictionary"],function(e,t){"use strict";var n=new t,i=0,a=t.fromObject({"screen-xs":"(max-width: 544px)","screen-sm":"(min-width: 545px) and (max-width: 768px)","screen-sm-down":"(max-width: 768px)","screen-sm-up":"(min-width: 545px)","screen-sm-md":"(min-width: 545px) and (max-width: 1024px)","screen-md":"(min-width: 769px) and (max-width: 1024px)","screen-md-down":"(max-width: 1024px)","screen-md-up":"(min-width: 1024px)","screen-lg":"(min-width: 1025px)"});return{on:function(t,n){var i=e.getUuid(),a=this._getQueryObject(t);return"function"==typeof n.match&&a.callbacksMatch.set(i,n.match),"function"==typeof n.unmatch&&a.callbacksUnmatch.set(i,n.unmatch),"function"==typeof n.setup&&(a.mql.matches?n.setup():a.callbacksSetup.set(i,n.setup)),i},remove:function(e,t){var n=this._getQueryObject(e);n.callbacksMatch["delete"](t),n.callbacksUnmatch["delete"](t),n.callbacksSetup["delete"](t)},is:function(e){return this._getQueryObject(e).mql.matches},scrollDisable:function(){0===i&&document.documentElement.classList.add("disableScrolling"),i++},scrollEnable:function(){i&&(i--,0===i&&document.documentElement.classList.remove("disableScrolling"))},_getQueryObject:function(e){if("string"!=typeof e||""===e.trim())throw new TypeError("Expected a non-empty string for parameter 'query'.");a.has(e)&&(e=a.get(e));var i=n.get(e);return i||(i={callbacksMatch:new t,callbacksUnmatch:new t,callbacksSetup:new t,mql:window.matchMedia(e)},i.mql.addListener(this._mqlChange.bind(this)),n.set(e,i)),i},_mqlChange:function(e){var n=this._getQueryObject(e.media);e.matches?(n.callbacksSetup.size&&(n.callbacksSetup.forEach(function(e){e()}),n.callbacksSetup=new t),n.callbacksMatch.forEach(function(e){e()})):n.callbacksUnmatch.forEach(function(e){e()})}}}),define("WoltLab/WCF/Event/Handler",["Core","Dictionary"],function(e,t){"use strict";var n=new t;return{add:function(i,a,r){if("function"!=typeof r)throw new TypeError("[WoltLab/WCF/Event/Handler] Expected a valid callback for '"+a+"@"+i+"'.");var o=n.get(i);void 0===o&&(o=new t,n.set(i,o));var s=o.get(a);void 0===s&&(s=new t,o.set(a,s));var l=e.getUuid();return s.set(l,r),l},fire:function(e,t,i){i=i||{};var a=n.get(e);if(void 0!==a){var r=a.get(t);void 0!==r&&r.forEach(function(e){e(i)})}},remove:function(e,t,i){var a=n.get(e);if(void 0!==a){var r=a.get(t);void 0!==r&&r["delete"](i)}},removeAll:function(e,t){"string"!=typeof t&&(t=void 0);var i=n.get(e);void 0!==i&&("undefined"==typeof t?n["delete"](e):i["delete"](t))}}}),define("WoltLab/WCF/Ui/Page/Menu/Abstract",["Environment","EventHandler","ObjectMap","Dom/Traverse","Dom/Util","Ui/Screen"],function(e,t,n,i,a,r){"use strict";function o(e,t,n){this.init(e,t,n)}var s=elById("pageContainer");return o.prototype={init:function(e,i,r){this._activeList=[],this._depth=0,this._enabled=!0,this._eventIdentifier=e,this._items=new n,this._menu=elById(i),this._removeActiveList=!1;var o=this.open.bind(this),s=elBySel(r);s.addEventListener(WCF_CLICK_EVENT,o),this._initItems(),this._initHeader(),t.add(this._eventIdentifier,"open",o),t.add(this._eventIdentifier,"close",this.close.bind(this));var l,c=elByClass("menuOverlayItemList",this._menu);this._menu.addEventListener("animationend",function(){if(!this._menu.classList.contains("open"))for(var e=0,t=c.length;t>e;e++)l=c[e],l.classList.remove("active"),l.classList.remove("hidden")}.bind(this)),this._menu.children[0].addEventListener("transitionend",function(){if(this._menu.classList.add("allowScroll"),this._removeActiveList){this._removeActiveList=!1;var e=this._activeList.pop();e&&e.classList.remove("activeList")}}.bind(this));var d=elCreate("div");d.className="menuOverlayMobileBackdrop",d.addEventListener(WCF_CLICK_EVENT,this.close.bind(this)),a.insertAfter(d,this._menu)},open:function(e){this._enabled&&(e instanceof Event&&e.preventDefault(),this._menu.classList.add("open"),this._menu.classList.add("allowScroll"),this._menu.children[0].classList.add("activeList"),r.scrollDisable(),s.classList.add("menuOverlay-"+this._menu.id))},close:function(e){e instanceof Event&&e.preventDefault(),this._menu.classList.contains("open")&&(this._menu.classList.remove("open"),r.scrollEnable(),s.classList.remove("menuOverlay-"+this._menu.id))},enable:function(){this._enabled=!0},disable:function(){this._enabled=!1,this.close(!0)},_initItems:function(){elBySelAll(".menuOverlayItemLink",this._menu,this._initItem.bind(this))},_initItem:function(e){var n=e.parentNode,a=elData(n,"more");if(a)return void e.addEventListener(WCF_CLICK_EVENT,function(i){i.preventDefault(),i.stopPropagation(),t.fire(this._eventIdentifier,"more",{handler:this,identifier:a,item:e,parent:n})}.bind(this));var r,o=e.nextElementSibling;if(null!==o)if("OL"!==o.nodeName&&o.classList.contains("menuOverlayItemLinkIcon"))for(r=elCreate("span"),r.className="menuOverlayItemWrapper",n.insertBefore(r,e),r.appendChild(e);r.nextElementSibling;)r.appendChild(r.nextElementSibling);else{var s="#"!==elAttr(e,"href"),l=n.parentNode,c=elData(o,"title");this._items.set(e,{itemList:o,parentItemList:l}),""===c&&(c=i.childByClass(e,"menuOverlayItemTitle").textContent,elData(o,"title",c));var d=this._showItemList.bind(this,e);if(s){r=elCreate("span"),r.className="menuOverlayItemWrapper",n.insertBefore(r,e),r.appendChild(e);var u=elCreate("a");elAttr(u,"href","#"),u.className="menuOverlayItemLinkIcon"+(e.classList.contains("active")?" active":""),u.innerHTML='<span class="icon icon24 fa-angle-right"></span>',u.addEventListener(WCF_CLICK_EVENT,d),r.appendChild(u)}else e.classList.add("menuOverlayItemLinkMore"),e.addEventListener(WCF_CLICK_EVENT,d);var h=elCreate("li");h.className="menuOverlayHeader",r=elCreate("span"),r.className="menuOverlayItemWrapper";var p=elCreate("a");elAttr(p,"href","#"),p.className="menuOverlayItemLink menuOverlayBackLink",p.textContent=elData(l,"title"),p.addEventListener(WCF_CLICK_EVENT,this._hideItemList.bind(this,e));var f=elCreate("a");if(elAttr(f,"href","#"),f.className="menuOverlayItemLinkIcon",f.innerHTML='<span class="icon icon24 fa-times"></span>',f.addEventListener(WCF_CLICK_EVENT,this.close.bind(this)),r.appendChild(p),r.appendChild(f),h.appendChild(r),o.insertBefore(h,o.firstElementChild),!h.nextElementSibling.classList.contains("menuOverlayTitle")){var m=elCreate("li");m.className="menuOverlayTitle";var g=elCreate("span");g.textContent=c,m.appendChild(g),o.insertBefore(m,h.nextElementSibling)}}},_initHeader:function(){var e=elCreate("li");e.className="menuOverlayHeader";var t=elCreate("span");t.className="menuOverlayItemWrapper",e.appendChild(t);var n=elCreate("span");n.className="menuOverlayLogoWrapper",t.appendChild(n);var a=elCreate("span");a.className="menuOverlayLogo",a.style.setProperty("background-image",'url("'+elData(this._menu,"page-logo")+'")',""),n.appendChild(a);var r=elCreate("a");elAttr(r,"href","#"),r.className="menuOverlayItemLinkIcon",r.innerHTML='<span class="icon icon24 fa-times"></span>',r.addEventListener(WCF_CLICK_EVENT,this.close.bind(this)),t.appendChild(r);var o=i.childByClass(this._menu,"menuOverlayItemList");o.insertBefore(e,o.firstElementChild)},_hideItemList:function(e,t){t instanceof Event&&t.preventDefault(),this._menu.classList.remove("allowScroll"),this._removeActiveList=!0;var n=this._items.get(e);n.parentItemList.classList.remove("hidden"),this._updateDepth(!1)},_showItemList:function(e,n){n instanceof Event&&n.preventDefault();var i=this._items.get(e),a=elData(i.itemList,"load");if(a&&!elDataBool(e,"loaded")){var r=n.currentTarget.firstElementChild;return r.classList.contains("fa-angle-right")&&(r.classList.remove("fa-angle-right"),r.classList.add("fa-spinner")),void t.fire(this._eventIdentifier,"load_"+a)}this._menu.classList.remove("allowScroll"),i.itemList.classList.add("activeList"),i.parentItemList.classList.add("hidden"),this._activeList.push(i.itemList),this._updateDepth(!0)},_updateDepth:function(e){this._depth+=e?1:-1,this._menu.children[0].style.setProperty("transform","translateX("+-100*this._depth+"%)","")}},o}),define("WoltLab/WCF/Ui/Page/Menu/Main",["Core","./Abstract"],function(e,t){"use strict";function n(){this.init()}return e.inherit(n,t,{init:function(){n._super.prototype.init.call(this,"com.woltlab.wcf.MainMenuMobile","pageMainMenuMobile","#pageHeader .mainMenu")}}),n}),define("WoltLab/WCF/Ui/Page/Menu/User",["Core","EventHandler","./Abstract"],function(e,t,n){"use strict";function i(){this.init()}return e.inherit(i,n,{init:function(){i._super.prototype.init.call(this,"com.woltlab.wcf.UserMenuMobile","pageUserMenuMobile","#pageHeader .userPanel")}}),i}),define("WoltLab/WCF/Ui/Mobile",["Core","Environment","Language","Dom/ChangeListener","Ui/CloseOverlay","Ui/Screen","./Page/Menu/Main","./Page/Menu/User"],function(e,t,n,i,a,r,o,s){"use strict";var l=null,c=!1,d=null,u={},h=null,p=null;return{setup:function(n){u=e.extend({enableMobileMenu:!0},n),l=elByClass("buttonGroupNavigation"),d=elById("main"),t.touch()&&document.documentElement.classList.add("touch"),"desktop"!==t.platform()&&document.documentElement.classList.add("mobile"),r.on("screen-md-down",{match:this.enable.bind(this),unmatch:this.disable.bind(this),setup:this._init.bind(this)})},enable:function(){c=!0,u.enableMobileMenu&&(h.enable(),p.enable())},disable:function(){c=!1,u.enableMobileMenu&&(h.disable(),p.disable())},_init:function(){this._initButtonGroupNavigation(),this._initMobileMenu(),a.add("WoltLab/WCF/Ui/Mobile",this._closeAllMenus.bind(this)),i.add("WoltLab/WCF/Ui/Mobile",this._initButtonGroupNavigation.bind(this))},_initSearchBar:function(){var e=elBySel(".searchBar");e.addEventListener(WCF_CLICK_EVENT,function(){return c?(e.classList.add("searchBarOpen"),!1):!1}),d.addEventListener(WCF_CLICK_EVENT,function(){e.classList.remove("searchBarOpen")})},_initButtonGroupNavigation:function(){for(var e=0,t=l.length;t>e;e++){var n=l[e];if(!n.classList.contains("jsMobileButtonGroupNavigation")){n.classList.add("jsMobileButtonGroupNavigation");var i=elCreate("a");i.classList.add("dropdownLabel");var a=elCreate("span");a.className="icon icon24 fa-list",i.appendChild(a),function(e){e.addEventListener(WCF_CLICK_EVENT,function(t){var n=e.nextElementSibling;return null!==n?(n.classList.toggle("open"),t.stopPropagation(),!1):!0})}(i),n.insertBefore(i,n.firstChild)}}},_initMobileMenu:function(){u.enableMobileMenu&&(h=new o,p=new s)},_closeAllMenus:function(){for(var e=elBySelAll(".jsMobileButtonGroupNavigation > ul.open"),t=0,n=e.length;n>t;t++)e[t].classList.remove("open")}}}),define("WoltLab/WCF/Ui/TabMenu/Simple",["Dictionary","EventHandler","Dom/Traverse","Dom/Util"],function(e,t,n,i){"use strict";function a(t){this._container=t,this._containers=new e,this._isLegacy=null,this._store=null,this._tabs=new e}return a.prototype={validate:function(){if(!this._container.classList.contains("tabMenuContainer"))return!1;var e=n.childByTag(this._container,"NAV");if(null===e)return!1;var t=elByTag("li",e);if(0===t.length)return!1;var a,r,o,s,l=n.childrenByTag(this._container,"DIV");for(o=0,s=l.length;s>o;o++)a=l[o],r=elData(a,"name"),r||(r=i.identify(a)),elData(a,"name",r),this._containers.set(r,a);var c,d=this._container.id;for(o=0,s=t.length;s>o;o++)if(c=t[o],r=this._getTabName(c)){if(this._tabs.has(r))throw new Error("Tab names must be unique, li[data-name='"+r+"'] (tab menu id: '"+d+"') exists more than once.");if(a=this._containers.get(r),void 0===a)throw new Error("Expected content element for li[data-name='"+r+"'] (tab menu id: '"+d+"').");if(a.parentNode!==this._container)throw new Error("Expected content element '"+r+"' (tab menu id: '"+d+"') to be a direct children.");if(1!==c.childElementCount||"A"!==c.children[0].nodeName)throw new Error("Expected exactly one <a> as children for li[data-name='"+r+"'] (tab menu id: '"+d+"').");this._tabs.set(r,c)}if(!this._tabs.size)throw new Error("Expected at least one tab (tab menu id: '"+d+"').");return this._isLegacy&&(elData(this._container,"is-legacy",!0),this._tabs.forEach(function(e,t){elAttr(e,"aria-controls",t)})),!0},init:function(e){e=e||null,this._tabs.forEach(function(t){e&&e.get(elData(t,"name"))===t||t.children[0].addEventListener(WCF_CLICK_EVENT,this._onClick.bind(this))}.bind(this));var t=null;if(!e){var n=window.location.hash.replace(/^#/,""),i=null;if(""!==n&&(i=this._tabs.get(n),i&&this._container.parentNode.classList.contains("tabMenuContainer")&&(t=this._container)),!i){var a=elData(this._container,"preselect")||elData(this._container,"active");"true"!==a&&a||(a=!0),a===!0?this._tabs.forEach(function(e){i||e.previousElementSibling||(i=e)}):"false"!==a&&(i=this._tabs.get(a))}i&&(this._containers.forEach(function(e){e.classList.add("hidden")}),this.select(null,i,!0));var r=elData(this._container,"store");if(r){var o=elCreate("input");o.type="hidden",o.name=r,this._container.appendChild(o),this._store=o}}return t},select:function(e,n,i){if(n=n||this._tabs.get(e),!n){if(~~e==e){e=~~e;var a=0;this._tabs.forEach(function(t){a===e&&(n=t),a++})}if(!n)throw new Error("Expected a valid tab name, '"+e+"' given (tab menu id: '"+this._container.id+"').")}e=e||elData(n,"name");var r=this.getActiveTab(),o=null;if(r){if(elData(r,"name")===e)return;r.classList.remove("active"),o=this._containers.get(elData(r,"name")),o.classList.remove("active"),o.classList.add("hidden"),this._isLegacy&&(r.classList.remove("ui-state-active"),o.classList.remove("ui-state-active"))}n.classList.add("active");var s=this._containers.get(e);if(s.classList.add("active"),this._isLegacy&&(n.classList.add("ui-state-active"),s.classList.add("ui-state-active"),s.classList.remove("hidden")),this._store&&(this._store.value=e),!i){t.fire("com.woltlab.wcf.simpleTabMenu_"+this._container.id,"select",{active:n,activeName:e,previous:r,previousName:r?elData(r,"name"):null});var l=this._isLegacy&&"function"==typeof window.jQuery?window.jQuery:null;l&&l(this._container).trigger("wcftabsbeforeactivate",{newTab:l(n),oldTab:l(r),newPanel:l(s),oldPanel:l(o)}),window.history.replaceState(void 0,void 0,window.location.href.replace(/#[^#]+$/,"")+"#"+e)}},rebuild:function(){var t=new e;t.merge(this._tabs),this.validate(),this.init(t)},_onClick:function(e){e.preventDefault(),this.select(null,e.currentTarget.parentNode)},_getTabName:function(e){var t=elData(e,"name");return t||1===e.childElementCount&&"A"===e.children[0].nodeName&&e.children[0].href.match(/#([^#]+)$/)&&(t=RegExp.$1,null===elById(t)?t=null:(this._isLegacy=!0,elData(e,"name",t))),t},getActiveTab:function(){return elBySel("#"+this._container.id+" > nav > ul > li.active")},getContainers:function(){return this._containers},getTabs:function(){return this._tabs}},a}),define("WoltLab/WCF/Ui/TabMenu",["Dictionary","Dom/ChangeListener","Dom/Util","Ui/CloseOverlay","./TabMenu/Simple"],function(e,t,n,i,a){"use strict";var r=null,o=new e;return{setup:function(){this._init(),this._selectErroneousTabs(),t.add("WoltLab/WCF/Ui/TabMenu",this._init.bind(this)),i.add("WoltLab/WCF/Ui/TabMenu",function(){r&&(r.classList.remove("active"),r=null)})},_init:function(){for(var e,t,i,s,l,c=elBySelAll(".tabMenuContainer:not(.staticTabMenuContainer)"),d=0,u=c.length;u>d;d++)e=c[d],t=n.identify(e),o.has(t)||(l=new a(e),l.validate()&&(s=l.init(),o.set(t,l),s instanceof Element&&(l=this.getTabMenu(s.parentNode.id),l.select(s.id,null,!0)),i=elBySel("#"+t+" > nav > ul"),function(e){e.addEventListener(WCF_CLICK_EVENT,function(t){t.preventDefault(),t.stopPropagation(),t.target===e?(e.classList.add("active"),r=e):(e.classList.remove("active"),r=null)})}(i)))},_selectErroneousTabs:function(){o.forEach(function(e){var t=!1;e.getContainers().forEach(function(n){!t&&elByClass("formError",n).length&&(t=!0,e.select(n.id))})})},getTabMenu:function(e){return o.get(e)}}}),define("WoltLab/WCF/Ui/FlexibleMenu",["Core","Dictionary","Dom/ChangeListener","Dom/Traverse","Dom/Util","Ui/SimpleDropdown"],function(e,t,n,i,a,r){"use strict";var o=new t,s=new t,l=new t,c=new t,d={setup:function(){null!==elById("mainMenu")&&this.register("mainMenu");var e=elBySel(".navigationHeader");null!==e&&this.register(a.identify(e)),window.addEventListener("resize",this.rebuildAll.bind(this)),n.add("WoltLab/WCF/Ui/FlexibleMenu",this.registerTabMenus.bind(this))},register:function(e){var t=elById(e);if(null===t)throw"Expected a valid element id, '"+e+"' does not exist.";if(!o.has(e)){var n=i.childByTag(t,"UL");if(null===n)throw"Expected an <ul> element as child of container '"+e+"'.";o.set(e,t),c.set(e,n),this.rebuild(e)}},registerTabMenus:function(){for(var e=elBySelAll(".tabMenuContainer:not(.jsFlexibleMenuEnabled), .messageTabMenu:not(.jsFlexibleMenuEnabled)"),t=0,n=e.length;n>t;t++){var r=e[t],o=i.childByTag(r,"NAV");null!==o&&(r.classList.add("jsFlexibleMenuEnabled"),this.register(a.identify(o)))}},rebuildAll:function(){o.forEach(function(e,t){this.rebuild(t)}.bind(this))},rebuild:function(t){var n=o.get(t);if(void 0===n)throw"Expected a valid element id, '"+t+"' is unknown.";var d=window.getComputedStyle(n),u=n.parentNode.clientWidth;u-=a.styleAsInt(d,"margin-left"),u-=a.styleAsInt(d,"margin-right");var h=c.get(t),p=i.childrenByTag(h,"LI"),f=s.get(t),m=0;if(void 0!==f){for(var g=0,v=p.length;v>g;g++){var b=p[g];b.classList.contains("dropdown")||elShow(b)}null!==f.parentNode&&(m=a.outerWidth(f))}var _=h.scrollWidth-m,y=[];if(_>u)for(var g=p.length-1;g>=0;g--){var b=p[g];if(!(b.classList.contains("dropdown")||b.classList.contains("active")||b.classList.contains("ui-state-active"))&&(y.push(b),elHide(b),h.scrollWidth<u))break}if(y.length){var C;if(void 0===f){f=elCreate("li"),f.className="dropdown jsFlexibleMenuDropdown";var w=elCreate("a");w.className="icon icon16 fa-list",f.appendChild(w),C=elCreate("ul"),C.classList.add("dropdownMenu"),f.appendChild(C),s.set(t,f),l.set(t,C),r.init(w)}else C=l.get(t);null===f.parentNode&&h.appendChild(f);var L=document.createDocumentFragment(),E=this;y.forEach(function(n){var i=elCreate("li");i.innerHTML=n.innerHTML,i.addEventListener(WCF_CLICK_EVENT,function(i){i.preventDefault(),e.triggerEvent(elBySel("a",n),WCF_CLICK_EVENT),setTimeout(function(){E.rebuild(t)},59)}.bind(this)),L.appendChild(i)}),C.innerHTML="",C.appendChild(L)}else void 0!==f&&null!==f.parentNode&&elRemove(f)}};return d}),define("WoltLab/WCF/Ui/Tooltip",["Environment","Dom/ChangeListener","Ui/Alignment"],function(e,t,n){"use strict";var i=null,a=null,r=null,o=null;return{setup:function(){"desktop"===e.platform()&&(o=elCreate("div"),elAttr(o,"id","balloonTooltip"),o.classList.add("balloonTooltip"),r=elCreate("span"),elAttr(r,"id","balloonTooltipText"),o.appendChild(r),a=elCreate("span"),a.classList.add("elementPointer"),a.appendChild(elCreate("span")),o.appendChild(a),document.body.appendChild(o),i=elByClass("jsTooltip"),this.init(),t.add("WoltLab/WCF/Ui/Tooltip",this.init.bind(this)),window.addEventListener("scroll",this._mouseLeave.bind(this)))},init:function(){for(var e,t;i.length;)e=i[0],e.classList.remove("jsTooltip"),t=elAttr(e,"title").trim(),t.length&&(elData(e,"tooltip",t),e.removeAttribute("title"),e.addEventListener("mouseenter",this._mouseEnter.bind(this)),e.addEventListener("mouseleave",this._mouseLeave.bind(this)),e.addEventListener(WCF_CLICK_EVENT,this._mouseLeave.bind(this)))},_mouseEnter:function(e){var t=e.currentTarget,i=elAttr(t,"title");return i="string"==typeof i?i.trim():"",""!==i&&(elData(t,"tooltip",i),t.removeAttribute("title")),i=elData(t,"tooltip"),o.style.removeProperty("top"),o.style.removeProperty("left"),i.length?(o.classList.add("active"),r.textContent=i,void n.set(o,t,{horizontal:"center",verticalOffset:4,pointer:!0,pointerClassNames:["inverse"],vertical:"top"})):void o.classList.remove("active")},_mouseLeave:function(){o.classList.remove("active")}}}),define("WoltLab/WCF/Date/Picker",["DateUtil","Language","ObjectMap","Dom/ChangeListener","Ui/Alignment","WoltLab/WCF/Ui/CloseOverlay"],function(e,t,n,i,a,r){
-"use strict";var o=!1,s=0,l=new n,c=null,d=0,u=0,h=[],p=null,f=null,m=null,g=null,v=null,b=null,_=null,y=null,C=null,w=null,L={init:function(){this._setup();for(var t=elBySelAll('input[type="date"]:not(.inputDatePicker), input[type="datetime"]:not(.inputDatePicker)'),n=new Date,i=0,a=t.length;a>i;i++){var r=t[i];r.classList.add("inputDatePicker"),r.readOnly=!0;var o="datetime"===elAttr(r,"type");elData(r,"is-date-time",o);var s=null,c=elAttr(r,"value");elAttr(r,"value")&&(s=new Date(c),elData(r,"value",s.getTime()),c=e["formatDate"+(o?"Time":"")](s));var d=0===c.length;if(r.classList.contains("birthday")&&(elData(r,"min-date","100"),elData(r,"max-date","now")),this._initDateRange(r,n,!0),this._initDateRange(r,n,!1),elData(r,"min-date")===elData(r,"max-date"))throw new Error("Minimum and maximum date cannot be the same (element id '"+r.id+"').");r.type="text",r.value=c,elData(r,"empty",d),elData(r,"placeholder")&&elAttr(r,"placeholder",elData(r,"placeholder"));var u=elCreate("input");u.id=r.id+"DatePicker",u.name=r.name,u.type="hidden",null!==s&&(u.value=e.format(s,o?"c":"Y-m-d")),r.parentNode.insertBefore(u,r),r.removeAttribute("name"),r.addEventListener(WCF_CLICK_EVENT,w);var h=elCreate("div");h.className="inputAddon";var p=elCreate("a");p.className="inputSuffix button",p.addEventListener(WCF_CLICK_EVENT,w),h.appendChild(p);var f=elCreate("span");f.className="icon icon16 fa-calendar",p.appendChild(f),r.parentNode.insertBefore(h,r),h.insertBefore(r,p);for(var m=!1,g=["tiny","short","medium","long"],v=0;4>v;v++)r.classList.contains(g[v])&&(m=!0);m||r.classList.add("short"),l.set(r,{shadow:u,isDateTime:o,isEmpty:d,onClose:null})}},_initDateRange:function(e,t,n){var i="data-"+(n?"min":"max")+"-date",a=e.hasAttribute(i)?elAttr(e,i).trim():"";if(a.match(/^(\d{4})-(\d{2})-(\d{2})$/))a=new Date(a).getTime();else if("now"===a)a=t.getTime();else if(a.match(/^\d{1,3}$/)){var r=new Date(t.getTime());r.setFullYear(r.getFullYear()+~~a*(n?-1:1)),a=r.getTime()}else if(a.match(/^datePicker-(.+)$/)){if(a=RegExp.$1,null===elById(a))throw new Error("Reference date picker identified by '"+a+"' does not exists (element id: '"+e.id+"').")}else a=new Date(n?1970:2038,0,1).getTime();elAttr(e,i,a)},_setup:function(){o||(o=!0,s=~~t.get("wcf.date.firstDayOfTheWeek"),w=this._open.bind(this),i.add("WoltLab/WCF/Date/Picker",this.init.bind(this)),r.add("WoltLab/WCF/Date/Picker",this._close.bind(this)))},_open:function(e){e.preventDefault(),e.stopPropagation(),this._createPicker();var t="INPUT"===e.currentTarget.nodeName?e.currentTarget:e.currentTarget.previousElementSibling;if(t!==c){c=t;var n,i=l.get(c),r=elData(c,"value");r?(n=new Date(+r),"Invalid Date"===n.toString()&&(n=new Date)):n=new Date,u=elData(c,"min-date"),u.match(/^datePicker-(.+)$/)&&(u=elData(elById(RegExp.$1),"value")),u=new Date(+u),d=elData(c,"max-date"),d.match(/^datePicker-(.+)$/)&&(d=elData(elById(RegExp.$1),"value")),d=new Date(+d),i.isDateTime&&(f.value=n.getHours(),m.value=n.getMinutes()),this._renderPicker(n.getDate(),n.getMonth(),n.getFullYear()),a.set(C,c,{pointer:!0})}},_close:function(){if(null!==C&&C.classList.contains("active")){C.classList.remove("active");var e=l.get(c);"function"==typeof e.onClose&&e.onClose(),c=null,u=0,d=0}},_renderPicker:function(e,t,n){this._renderGrid(e,t,n);for(var i="",a=u.getFullYear(),r=d.getFullYear();r>=a;a++)i+='<option value="'+a+'">'+a+"</option>";y.innerHTML=i,y.value=n,g.value=t,C.classList.add("active")},_renderGrid:function(e,t,n){var i,a,r=void 0!==e,o=void 0!==t;if(e=~~e||~~elData(p,"day"),t=~~t,n=~~n,o||n){var l=0!==n,c=document.createDocumentFragment();c.appendChild(p),o||(t=~~elData(p,"month")),n=n||~~elData(p,"year");var f=new Date(n+"-"+("0"+(t+1).toString()).slice(-2)+"-"+("0"+e.toString()).slice(-2));for(u>f?(n=u.getFullYear(),t=u.getMonth(),e=u.getDate(),g.value=t,y.value=n,l=!0):f>d&&(n=d.getFullYear(),t=d.getMonth(),e=d.getDate(),g.value=t,y.value=n,l=!0),f=new Date(n+"-"+("0"+(t+1).toString()).slice(-2)+"-01");f.getDay()!==s;)f.setDate(f.getDate()-1);var m;for(a=0;35>a;a++)i=h[a],i.textContent=f.getDate(),m=f.getMonth()===t,m&&(u>f?m=!1:f>d&&(m=!1)),i.classList[m?"remove":"add"]("otherMonth"),f.setDate(f.getDate()+1);if(elData(p,"month",t),elData(p,"year",n),C.insertBefore(c,_),!r&&(f=new Date(n,t,e),f.getDate()!==e)){for(;f.getMonth()!==t;)f.setDate(f.getDate()-1);e=f.getDate()}if(l){for(a=0;12>a;a++){var w=g.children[a];w.disabled=n===u.getFullYear()&&w.value<u.getMonth()||n===d.getFullYear()&&w.value>d.getMonth()}var L=new Date(n+"-"+("0"+(t+1).toString()).slice(-2)+"-01");L.setMonth(L.getMonth()+1),v.classList[d>L?"add":"remove"]("active");var E=new Date(n+"-"+("0"+(t+1).toString()).slice(-2)+"-01");E.setDate(E.getDate()-1),b.classList[E>u?"add":"remove"]("active")}}if(e){for(a=0;35>a;a++)i=h[a],i.classList[i.classList.contains("otherMonth")||~~i.textContent!==e?"remove":"add"]("active");elData(p,"day",e)}this._formatValue()},_formatValue:function(){var t,n,i,a=l.get(c);"true"!==elData(c,"empty")&&(a.isDateTime?(t=new Date(elData(p,"year"),elData(p,"month"),elData(p,"day"),f.value,m.value),n=e.formatDateTime(t),i=e.format(t,"c")):(t=new Date(elData(p,"year"),elData(p,"month"),elData(p,"day")),n=e.formatDate(t),i=e.format(t,"Y-m-d")),c.value=n,elData(c,"value",t.getTime()),a.shadow.value=i)},_createPicker:function(){if(null===C){C=elCreate("div"),C.className="datePicker",C.addEventListener(WCF_CLICK_EVENT,function(e){e.stopPropagation()});var n=elCreate("span");n.className="elementPointer",n.innerHTML="<span></span>",C.appendChild(n);var i=elCreate("header");C.appendChild(i),b=elCreate("a"),b.className="icon icon16 fa-arrow-left previous",b.addEventListener(WCF_CLICK_EVENT,this.previousMonth.bind(this)),i.appendChild(b);var a=elCreate("span");i.appendChild(a),g=elCreate("select"),g.className="month",g.addEventListener("change",this._changeMonth.bind(this));var r=elCreate("label");r.className="selectDropdown",r.appendChild(g),a.appendChild(r);var o,l="",c=t.get("__monthsShort");for(o=0;12>o;o++)l+='<option value="'+o+'">'+c[o]+"</option>";g.innerHTML=l,y=elCreate("select"),y.className="year",y.addEventListener("change",this._changeYear.bind(this)),r=elCreate("label"),r.className="selectDropdown",r.appendChild(y),a.appendChild(r),v=elCreate("a"),v.className="icon icon16 fa-arrow-right next",v.addEventListener(WCF_CLICK_EVENT,this.nextMonth.bind(this)),i.appendChild(v),p=elCreate("ul"),C.appendChild(p);var d=elCreate("li");d.className="weekdays",p.appendChild(d);var u,w=t.get("__daysShort");for(o=0;7>o;o++){var L=o+s;L>6&&(L-=7),u=elCreate("span"),u.textContent=w[L],d.appendChild(u)}var E,x,T=this._click.bind(this);for(o=0;5>o;o++){x=elCreate("li"),p.appendChild(x);for(var D=0;7>D;D++)E=elCreate("a"),E.addEventListener(WCF_CLICK_EVENT,T),h.push(E),x.appendChild(E)}_=elCreate("footer"),C.appendChild(_),f=elCreate("select"),f.className="hour",f.addEventListener("change",this._formatValue.bind(this));var S="",I=new Date(2e3,0,1),k=t.get("wcf.date.timeFormat").replace(/:/,"").replace(/[isu]/g,"");for(o=0;24>o;o++)I.setHours(o),S+='<option value="'+o+'">'+e.format(I,k)+"</option>";for(f.innerHTML=S,_.appendChild(f),_.appendChild(document.createTextNode(" : ")),m=elCreate("select"),m.className="minute",m.addEventListener("change",this._formatValue.bind(this)),S="",o=0;60>o;o++)S+='<option value="'+o+'">'+(10>o?"0"+o.toString():o)+"</option>";m.innerHTML=S,_.appendChild(m),document.body.appendChild(C)}},previousMonth:function(){"0"===g.value?(g.value=11,y.value=~~y.value-1):g.value=~~g.value-1,this._renderGrid(void 0,g.value,y.value)},nextMonth:function(){"11"===g.value?(g.value=0,y.value=~~y.value+1):g.value=~~g.value+1,this._renderGrid(void 0,g.value,y.value)},_changeMonth:function(e){this._renderGrid(void 0,e.currentTarget.value)},_changeYear:function(e){this._renderGrid(void 0,void 0,e.currentTarget.value)},_click:function(e){e.currentTarget.classList.contains("otherMonth")||(elData(c,"empty",!1),this._renderGrid(e.currentTarget.textContent),this._close())},getDate:function(e){return e=this._getElement(e),e.hasAttribute("data-value")?new Date(+elData(e,"value")):null},setDate:function(t,n){t=this._getElement(t);var i=l.get(t);elData(t,"value",n.getTime()),t.value=e["formatDate"+(i.isDateTime?"Time":"")](n),i.shadow.value=e.format(n,i.isDateTime?"c":"Y-m-d")},clear:function(e){e=this._getElement(e);var t=l.get(e);e.removeAttribute("data-value"),e.value="",t.isEmpty=!0,t.shadow.value=""},destroy:function(e){e=this._getElement(e);var t=l.get(e),n=e.parentNode;n.parentNode.insertBefore(e,n),elRemove(n),elAttr(e,"type","date"+(t.isDateTime?"time":"")),e.value=t.shadow.value,e.removeAttribute("data-value"),e.removeEventListener(WCF_CLICK_EVENT,w),elRemove(t.shadow),e.classList.remove("inputDatePicker"),e.readOnly=!1,l["delete"](e)},setCloseCallback:function(e,t){e=this._getElement(e),l.get(e).onClose=t},_getElement:function(e){if("string"==typeof e&&(e=elById(e)),!(e instanceof Element&&e.classList.contains("inputDatePicker")&&l.has(e)))throw new Error("Expected a valid date picker input element or id.");return e}};return window.__wcf_bc_datePicker=L,L}),define("WoltLab/WCF/Ui/Page/Action",["Dictionary","Dom/Util"],function(e,t){"use strict";var n=new e,i=null,a=!1;return{setup:function(){a=!0,i=elCreate("ul"),i.className="pageAction",document.body.appendChild(i)},add:function(e,r,o){a===!1&&this.setup();var s=elCreate("li");if(s.appendChild(r),elAttr(s,"aria-hidden","toTop"===e?"true":"false"),elData(s,"name",e),"toTop"===e)s.className="toTop initiallyHidden",i.appendChild(s);else{var l=null;o&&(l=n.get(o),void 0!==l&&(l=l.parentNode)),null===l&&i.childElementCount&&(l=i.children[0]),null===l?t.prepend(s,i):i.insertBefore(s,l)}n.set(e,r),this._renderContainer()},remove:function(e){var t=n.get(e);if(void 0!==t){var a=t.parentNode;a.addEventListener("animationend",function(){i.removeChild(a),n["delete"](e)}),this.hide(e)}},hide:function(e){var t=n.get(e);t&&(elAttr(t.parentNode,"aria-hidden","true"),this._renderContainer())},show:function(e){var t=n.get(e);t&&(t.parentNode.classList.contains("initiallyHidden")&&t.parentNode.classList.remove("initiallyHidden"),elAttr(t.parentNode,"aria-hidden","false"),this._renderContainer())},_renderContainer:function(){var e=!1;if(i.childElementCount)for(var t=0,n=i.childElementCount;n>t;t++)if("false"===elAttr(i.children[t],"aria-hidden")){e=!0;break}i.classList[e?"add":"remove"]("active")}}}),define("WoltLab/WCF/Ui/Page/JumpToTop",["Environment","Language","./Action"],function(e,t,n){"use strict";function i(){this.init()}return i.prototype={init:function(){if("desktop"===e.platform()){this._callbackScrollEnd=this._afterScroll.bind(this),this._timeoutScroll=null;var i=elCreate("a");i.className="jsTooltip",i.href="#",elAttr(i,"title",t.get("wcf.global.scrollUp")),i.innerHTML='<span class="icon icon16 fa-arrow-up"></span>',i.addEventListener(WCF_CLICK_EVENT,this._jump.bind(this)),n.add("toTop",i),window.addEventListener("scroll",this._scroll.bind(this)),this._afterScroll()}},_jump:function(e){e.preventDefault(),elById("top").scrollIntoView({behavior:"smooth"})},_scroll:function(){null!==this._timeoutScroll&&window.clearTimeout(this._timeoutScroll),this._timeoutScroll=window.setTimeout(this._callbackScrollEnd,100)},_afterScroll:function(){this._timeoutScroll=null,n[window.scrollY>=window.innerHeight/2?"show":"hide"]("toTop")}},i}),define("WoltLab/WCF/Bootstrap",["favico","enquire","perfect-scrollbar","WoltLab/WCF/Date/Time/Relative","Ui/SimpleDropdown","WoltLab/WCF/Ui/Mobile","WoltLab/WCF/Ui/TabMenu","WoltLab/WCF/Ui/FlexibleMenu","Ui/Dialog","WoltLab/WCF/Ui/Tooltip","WoltLab/WCF/Language","WoltLab/WCF/Environment","WoltLab/WCF/Date/Picker","EventHandler","Core","WoltLab/WCF/Ui/Page/JumpToTop"],function(e,t,n,i,a,r,o,s,l,c,d,u,h,p,f,m){"use strict";return window.Favico=e,window.enquire=t,null==window.WCF&&(window.WCF={}),null==window.WCF.Language&&(window.WCF.Language={}),window.WCF.Language.get=d.get,window.WCF.Language.add=d.add,window.WCF.Language.addObject=d.addObject,window.__wcf_bc_eventHandler=p,{setup:function(e){e=f.extend({enableMobileMenu:!0},e),u.setup(),i.setup(),h.init(),a.setup(),r.setup({enableMobileMenu:e.enableMobileMenu}),o.setup(),l.setup(),c.setup(),new m;for(var t=elBySelAll("form[method=get]"),n=0,s=t.length;s>n;n++)t[n].setAttribute("method","post");"microsoft"===u.browser()&&(window.onbeforeunload=function(){});var d=0;d=window.setInterval(function(){"function"==typeof window.jQuery&&(window.clearInterval(d),window.jQuery.holdReady(!1))},20)}}}),define("WoltLab/WCF/Controller/Style/Changer",["Ajax","Language","Ui/Dialog"],function(e,t,n){"use strict";var i={setup:function(){var e=elBySel("#footerNavigation > ul.navigationItems");if(null!==e){var n=elCreate("li");n.classList.add("styleChanger"),n.addEventListener(WCF_CLICK_EVENT,this.showDialog.bind(this));var i=elCreate("a");elAttr(i,"href","#"),i.textContent=t.get("wcf.style.changeStyle"),n.appendChild(i),e.appendChild(n)}},showDialog:function(e){e.preventDefault(),n.open(this)},_dialogSetup:function(){return{id:"styleChanger",options:{disableContentPadding:!0,title:t.get("wcf.style.changeStyle")},source:{data:{actionName:"getStyleChooser",className:"wcf\\data\\style\\StyleAction"},after:function(e){for(var t=elBySelAll(".styleList > li",e),n=0,i=t.length;i>n;n++){var a=t[n];a.classList.add("pointer"),a.addEventListener(WCF_CLICK_EVENT,this._click.bind(this))}}.bind(this)}}},_click:function(t){t.preventDefault(),e.apiOnce({data:{actionName:"changeStyle",className:"wcf\\data\\style\\StyleAction",objectIDs:[elData(t.currentTarget,"style-id")]},success:function(){window.location.reload()}})}};return i}),define("WoltLab/WCF/Controller/Popover",["Ajax","Dictionary","Environment","Dom/ChangeListener","Dom/Util","Ui/Alignment"],function(e,t,n,i,a,r){"use strict";var o=null,s=new t,l=new t,c=new t,d=null,u=!1,h=null,p=null,f=null,m=null,g=null,v=null,b=null,_=null,y=0,C=1,w=2,L=500,E=300;return{_setup:function(){if(null===f){f=elCreate("div"),f.className="popover forceHide",m=elCreate("div"),m.className="popoverContent",f.appendChild(m);var e=elCreate("span");e.className="elementPointer",e.appendChild(elCreate("span")),f.appendChild(e),document.body.appendChild(f),g=this._hide.bind(this),b=this._mouseEnter.bind(this),_=this._mouseLeave.bind(this),f.addEventListener("mouseenter",this._popoverMouseEnter.bind(this)),f.addEventListener("mouseleave",_),f.addEventListener("animationend",this._clearContent.bind(this)),window.addEventListener("beforeunload",function(){u=!0,null!==h&&window.clearTimeout(h),this._hide(!0)}.bind(this)),i.add("WoltLab/WCF/Controller/Popover",this._init.bind(this))}},init:function(e){"desktop"===n.platform()&&(e.attributeName=e.attributeName||"data-object-id",e.legacy=e.legacy===!0,this._setup(),c.has(e.identifier)||(c.set(e.identifier,{attributeName:e.attributeName,elements:e.legacy?e.className:elByClass(e.className),legacy:e.legacy,loadCallback:e.loadCallback}),this._init(e.identifier)))},_init:function(e){"string"==typeof e&&e.length?this._initElements(c.get(e),e):c.forEach(this._initElements.bind(this))},_initElements:function(e,t){for(var n=e.legacy?elBySelAll(e.elements):e.elements,i=0,r=n.length;r>i;i++){var o=n[i],c=a.identify(o);if(s.has(c))return;var d=e.legacy?c:~~o.getAttribute(e.attributeName);if(0!==d){o.addEventListener("mouseenter",b),o.addEventListener("mouseleave",_),"A"===o.nodeName&&elAttr(o,"href")&&o.addEventListener(WCF_CLICK_EVENT,g);var u=t+"-"+d;elData(o,"cache-id",u),l.set(c,{element:o,identifier:t,objectId:d}),s.has(u)||s.set(t+"-"+d,{content:null,state:y})}}},setContent:function(e,t,n){var i=e+"-"+t,r=s.get(i);if(void 0===r)throw new Error("Unable to find element for object id '"+t+"' (identifier: '"+e+"').");if(r.content=a.createFragmentFromHtml(n),r.state=w,o){var c=l.get(o).element;elData(c,"cache-id")===i&&this._show()}},_mouseEnter:function(e){if(!u){null!==h&&(window.clearTimeout(h),h=null);var t=a.identify(e.currentTarget);o===t&&null!==p&&(window.clearTimeout(p),p=null),d=t,h=window.setTimeout(function(){h=null,d===t&&this._show()}.bind(this),E)}},_mouseLeave:function(){d=null,null===p&&(null===v&&(v=this._hide.bind(this)),null!==p&&window.clearTimeout(p),p=window.setTimeout(v,L))},_popoverMouseEnter:function(){null!==p&&(window.clearTimeout(p),p=null)},_show:function(){null!==p&&(window.clearTimeout(p),p=null);var e=!1;f.classList.contains("active")?(this._hide(),e=!0):m.childElementCount&&(e=!0),e&&(f.classList.add("forceHide"),f.offsetTop,this._clearContent(),f.classList.remove("forceHide")),o=d;var t=l.get(o),n=s.get(elData(t.element,"cache-id"));n.state===w?(m.appendChild(n.content),this._rebuild(o)):n.state===y&&(n.state=C,c.get(t.identifier).loadCallback(t.objectId,this))},_hide:function(){null!==p&&(window.clearTimeout(p),p=null),f.classList.remove("active")},_clearContent:function(){if(o&&m.childElementCount&&!f.classList.contains("active"))for(var e=s.get(elData(l.get(o).element,"cache-id"));m.childNodes.length;)e.content.appendChild(m.childNodes[0])},_rebuild:function(){f.classList.contains("active")||(f.classList.remove("forceHide"),f.classList.add("active"),r.set(f,l.get(o).element,{pointer:!0,vertical:"top"}))},_ajaxSetup:function(){return{}},ajaxApi:function(t,n,i){if("function"!=typeof n)throw new TypeError("Expected a valid callback for parameter 'success'.");e.api(this,t,n,i)}}}),define("WoltLab/WCF/List",[],function(){"use strict";function e(){this._set=t?new Set:[]}var t=objOwns(window,"Set")&&"function"==typeof window.Set;return e.prototype={add:function(e){t?this._set.add(e):this.has(e)||this._set.push(e)},clear:function(){t?this._set.clear():this._set=[]},"delete":function(e){if(t)return this._set["delete"](e);var n=this._set.indexOf(e);return-1===n?!1:(this._set.splice(n,1),!0)},forEach:function(e){if(t)this._set.forEach(e);else for(var n=0,i=this._set.length;i>n;n++)e(this._set[n])},has:function(e){return t?this._set.has(e):-1!==this._set.indexOf(e)}},Object.defineProperty(e.prototype,"size",{enumerable:!1,configurable:!0,get:function(){return t?this._set.size:this._set.length}}),e}),define("WoltLab/WCF/Ui/User/Ignore",["List","Dom/ChangeListener"],function(e,t){"use strict";var n=elByClass("ignoredUserMessage"),i=null,a=new e;return{init:function(){i=this._removeClass.bind(this),this._rebuild(),t.add("WoltLab/WCF/Ui/User/Ignore",this._rebuild.bind(this))},_rebuild:function(){for(var e,t=0,r=n.length;r>t;t++)e=n[t],a.has(e)||(e.addEventListener(WCF_CLICK_EVENT,i),a.add(e))},_removeClass:function(e){e.preventDefault();var t=e.currentTarget;t.classList.remove("ignoredUserMessage"),t.removeEventListener(WCF_CLICK_EVENT,i),a["delete"](t)}}}),define("WoltLab/WCF/BootstrapFrontend",["Ajax","WoltLab/WCF/Bootstrap","WoltLab/WCF/Controller/Style/Changer","WoltLab/WCF/Controller/Popover","WoltLab/WCF/Ui/User/Ignore"],function(e,t,n,i,a){"use strict";var r=0;return{setup:function(e){t.setup(),e.styleChanger,this._initUserPopover(),this._invokeBackgroundQueue(e.backgroundQueue.url,e.backgroundQueue.force),a.init()},_initUserPopover:function(){i.init({attributeName:"data-user-id",className:"userLink",identifier:"com.woltlab.wcf.user",loadCallback:function(e,t){var n=function(n){t.setContent("com.woltlab.wcf.user",e,n.returnValues.template)};t.ajaxApi({actionName:"getUserProfile",className:"wcf\\data\\user\\UserProfileAction",objectIDs:[e]},n,n)}})},_invokeBackgroundQueue:function(t,n){var i=this._invokeBackgroundQueue.bind(this,t,!0);(Math.random()<.1||n)&&e.apiOnce({url:t,ignoreError:!0,silent:!0,success:function(e){r++,e>0&&5>r&&setTimeout(i,1e3)}.bind(this)})}}}),define("WoltLab/WCF/ColorUtil",[],function(){"use strict";var e={hexToRgb:function(e){return e=e.replace(/^#/,""),/^([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(e)?(e=e.split(""),3===e.length?{r:parseInt(e[0]+""+e[0],16),g:parseInt(e[1]+""+e[1],16),b:parseInt(e[2]+""+e[2],16)}:{r:parseInt(e[0]+""+e[1],16),g:parseInt(e[2]+""+e[3],16),b:parseInt(e[4]+""+e[5],16)}):Number.NaN},rgbToHex:function(e,t,n){var i="0123456789ABCDEF";return void 0===t&&e.match(/^rgba?\((\d+), ?(\d+), ?(d\+)(?:, ?[0-9.]+)?\)$/)&&(e=RegExp.$1,t=RegExp.$2,n=RegExp.$3),i.charAt((e-e%16)/16)+""+i.charAt(e%16)+(i.charAt((t-t%16)/16)+""+i.charAt(t%16))+(i.charAt((n-n%16)/16)+""+i.charAt(n%16))}};return e}),define("WoltLab/WCF/Permission",["Dictionary"],function(e){"use strict";var t=new e,n={add:function(e,n){if("boolean"!=typeof n)throw new TypeError("Permission value has to be boolean.");t.set(e,n)},addObject:function(e){for(var t in e)objOwns(e,t)&&this.addPermission(t,e[t])},get:function(e){return t.has(e)?t.get(e):!1}};return n}),define("WoltLab/WCF/Upload",["AjaxRequest","Core","Dom/ChangeListener","Language","Dom/Util","Dom/Traverse"],function(e,t,n,i,a,r){"use strict";function o(e,n,i){if(i=i||{},void 0===i.className)throw new Error("Missing class name.");if(this._options=t.extend({action:"upload",multiple:!1,name:"__files[]",singleFileRequests:!1,url:"index.php/AJAXUpload/?t="+SECURITY_TOKEN},i),this._options.url=WCF.convertLegacyURL(this._options.url),this._buttonContainer=elById(e),null===this._buttonContainer)throw new Error("Element id '"+e+"' is unknown.");if(this._target=elById(n),null===n)throw new Error("Element id '"+n+"' is unknown.");if(i.multiple&&"UL"!==this._target.nodeName&&"OL"!==this._target.nodeName)throw new Error("Target element has to be list when allowing upload of multiple files.");this._fileElements=[],this._internalFileId=0,this._createButton()}return o.prototype={_createButton:function(){this._fileUpload=elCreate("input"),elAttr(this._fileUpload,"type","file"),elAttr(this._fileUpload,"name",this._options.name),this._options.multiple&&elAttr(this._fileUpload,"multiple","true"),this._fileUpload.addEventListener("change",this._upload.bind(this)),this._button=elCreate("p"),this._button.classList.add("button"),this._button.classList.add("uploadButton");var e=elCreate("span");e.textContent=i.get("wcf.global.button.upload"),this._button.appendChild(e),a.prepend(this._fileUpload,this._button),this._insertButton(),n.trigger()},_createFileElement:function(e){var t=elCreate("progress");if(elAttr(t,"max",100),"OL"===this._target.nodeName||"UL"===this._target.nodeName){var n=elCreate("li");return n.innerText=e.name,n.appendChild(t),this._target.appendChild(n),n}var i=elCreate("p");return i.appendChild(t),this._target.appendChild(i),i},_createFileElements:function(e){if(e.length){var t=this._fileElements.length;this._fileElements[t]=[];for(var i=0,a=e.length;a>i;i++){var r=e[i],o=this._createFileElement(r);o.classList.contains("uploadFailed")||(elData(o,"filename",r.name),elData(o,"internal-file-id",this._internalFileId++),this._fileElements[t][i]=o)}return n.trigger(),t}return null},_failure:function(e,t,n,i,a){return!0},_getParameters:function(){return{}},_insertButton:function(){a.prepend(this._button,this._buttonContainer)},_progress:function(e,t){var n=Math.round(t.loaded/t.total*100);for(var i in this._fileElements[e]){var a=elByTag("PROGRESS",this._fileElements[e][i]);1===a.length&&elAttr(a[0],"value",n)}},_removeButton:function(){elRemove(this._button),n.trigger()},_success:function(e,t,n,i,a){},_upload:function(e,t,n){for(var i=r.childrenByClass(this._target,"uploadFailed"),a=0,o=i.length;o>a;a++)elRemove(i[a]);var s=null,l=[];if(t)l.push(t);else if(n){var c="";switch(n.type){case"image/jpeg":c=".jpg";break;case"image/gif":c=".gif";break;case"image/png":c=".png"}l.push({name:"pasted-from-clipboard"+c})}else l=this._fileUpload.files;if(l.length)if(this._options.singleFileRequests){s=[];for(var a=0,o=l.length;o>a;a++)s.push(this._uploadFiles([l[a]],n))}else s=this._uploadFiles(l,n);return this._removeButton(),this._createButton(),s},_uploadFiles:function(t,n){var i=this._createFileElements(t);if(!this._fileElements[i].length)return null;for(var a=new FormData,r=0,o=t.length;o>r;r++)if(this._fileElements[i][r]){var s=elData(this._fileElements[i][r],"internal-file-id");n?a.append("__files["+s+"]",n,t[r].name):a.append("__files["+s+"]",t[r])}a.append("actionName",this._options.action),a.append("className",this._options.className),a.append("interfaceName","wcf\\data\\IUploadAction");var l=function(e,t){t=t||"";for(var n in e)"object"==typeof e[n]?l(e[n],t+"["+n+"]"):a.append("parameters"+t+"["+n+"]",e[n])};l(this._getParameters());var c=new e({data:a,contentType:!1,failure:this._failure.bind(this,i),silent:!0,success:this._success.bind(this,i),uploadProgress:this._progress.bind(this,i),url:this._options.url});return c.sendRequest(),i}},o}),define("WoltLab/WCF/Ajax/Jsonp",["Core"],function(e){"use strict";var t={send:function(t,n,i,a){if(t="string"==typeof t?t.trim():"",0===t.length)throw new Error("Expected a non-empty string for parameter 'url'.");if("function"!=typeof n)throw new TypeError("Expected a valid callback function for parameter 'success'.");a=e.extend({parameterName:"callback",timeout:10},a||{});var r="wcf_jsonp_"+e.getUuid().replace(/-/g,"").substr(0,8),o=window.setTimeout(function(){window[r]=function(){},"function"==typeof i&&i()},1e3*(~~a.timeout||10));window[r]=function(){window.clearTimeout(o),n.apply(null,arguments)},t+=-1===t.indexOf("?")?"?":"&",t+=a.parameterName+"="+r;var s=elCreate("script");s.async=!0,elAttr(s,"src",t),document.head.appendChild(s)}};return t}),define("WoltLab/WCF/Attachment/Upload",["Core","Dom/ChangeListener","Dom/Traverse","Language","List","Upload"],function(e,t,n,i,a,r){"use strict";function o(e,t,o,s,l,c,d,u,h){this._tmpHash=o,this._objectType=s,this._objectId=~~l,this._parentObjectId=~~parentObjectID,this._wysiwygContainerId=h,this._autoInsert=new a,r.call(this,"uploadImage","styleImage",{className:"wcf\\data\\attachment\\AttachmentAction",maxSize:~~u,maxUploads:~~d,multiple:!0}),n.childByClass(this._button,".button").addEventListener(WCF_CLICK_EVENT,this._validateLimit.bind(this)),elByClass(this._target,"jsButtonInsertAttachment").addEventListener(WCF_CLICK_EVENT,this._insert.bind(this)),elByClass(this._target,"jsButtonAttachmentInsertThumbnail").addEventListener(WCF_CLICK_EVENT,this._insert.bind(this)),elByClass(this._target,"jsButtonAttachmentInsertFull").addEventListener(WCF_CLICK_EVENT,this._insert.bind(this)),this._insertAllButton=elCreate("p"),this._insertAllButton.className="button jsButtonAttachmentInsertAll",this._insertAllButton.textContent=i.get("wcf.attachment.insertAll"),n.childBySel(this._target,"li:not(.uploadFailed)")&&elHide(this._insertAllButton),this._insertAllButton.addEventListener(WCF_CLICK_EVENT,this._insertAll.bind(this)),this._button.appendChild(this._insertAllButton),this._wysiwygContainerId}e.inherit(o,r,{_createFileElement:function(e){var t=elCreate("li");t.className="box64",elData(t,"filename",filename),this._target.appendChild(t),elShow(this._target);var n=elCreate("span");this._options.maxSize>=e.size?n.className="icon icon48 fa-spinnner":n.className="icon icon48 fa-ban-circle",t.appendChild(n);var a=elCreate("div");t.appendChild(a);var r=elCreate("div");a.appendChild(r);var o=elCreate("p");o.textContent=e.name,r.appendChild(o);var s=elCreate("small");if(r.appendChild(s),this._options.maxSize>=e.size){var l=elCreate("progress");elAttr(l,"max",100)}a.appendChild(elCreate("ul")),this._options.maxSize<e.size&&(s=elCreate("small"),s.className="innerError",s.textContent=i.get("wcf.attachment.upload.error.tooLarge"),r.appendChild(s),t.classList.add("uploadFailed"))},_createFileElements:function(e){for(var t=n.childrenBySel(this._target,"li.uploadFailed"),i=0,a=t.length;a>i;i++)this._target.removeChild(t[i]);return r.prototype._createFileElements.call(this,e)},_getParameters:function(){return{objectID:this._objectId,objectType:this._objectType,parentObjectID:this._parentObjectId,tmpHash:this._tmpHash}},_success:function(e,a){for(var r=0,o=this._fileElements[e].length;o>r;r++){var s=this._fileElements[e][r],l=elByTag(s,"PROGRESS");elRemove(l);var c=elData(s,"filename"),d=elData(s,"internal-file-id"),u=n.childByClass(s,"fa-spinner");if(a.returnValues&&a.returnValues.attachments[d]){var h=a.returnValues.attachments[d];if(h.tinyURL){var p=elCreate("img");p.className="attachmentTinyThumbnail",elAttr(p,"src",h.tinyURL),elAttr(p,"alt",""),u.parentNode.replaceChild(u,p),elData(s,"height",h.height),elData(s,"width",h.width)}else u.classList.remove("fa-spinner"),u.classList.add("fa-paper-clip");var f=elByTag(s,"P");f.innerHtml="";var m=elCreate("a");m.textContent=c,elAttr(m,"href",h.url),h.isImage&&(m.className="jsImageViewer",elAttr(m,"title",c)),f.appendChild(m),elByTag(s,"SMALL").textContent=h.formattedFilesize;var g=elByTag(s,"UL");g.classList.add("buttonGroup");var v=elCreate("li");g.appendChild(v);var b=elCreate("span");if(b.className="button small jsDeleteButton",b.textContent=i.get("wcf.global.button.delete"),elData(b,"object-id",h.attachmentID),elData(b,"confirm-message",i.get("wcf.attachment.delete.sure")),this._wysiwygContainerId&&elData(b,"event-name","attachment_"+this._wysiwygContainerId),v.appendChild(b),elData(b,"object-id",h.attachmentID),this._wysiwygContainerId)if(h.tinyURL){var _=elCreate("li");g.appendChild(_),b=elCreate("span"),b.className="button small jsButtonAttachmentInsertThumbnail",b.textContent=i.get("wcf.global.button.insertThumbnail"),elData(b,"object-id",h.attachmentID),b.addEventListener(WCF_CLICK_EVENT,this._insert.bind(this)),_.appendChild(b);var y=elCreate("li");g.appendChild(y),b=elCreate("span"),b.className="button small jsButtonAttachmentInsertFull",b.textContent=i.get("wcf.global.button.insertFull"),elData(b,"object-id",h.attachmentID),b.addEventListener(WCF_CLICK_EVENT,this._insert.bind(this)),y.appendChild(b)}else{var C=elCreate("li");g.appendChild(C),b=elCreate("span"),b.className="button small jsButtonAttachmentInsertPlain",b.textContent=i.get("wcf.global.button.insert"),elData(b,"object-id",h.attachmentID),b.addEventListener(WCF_CLICK_EVENT,this._insert.bind(this)),C.appendChild(b)}}else{u.classList.removeClass("fa-spinner"),u.classList.addClass("fa-ban-circle");var w="uploadFailed";a.returnValues&&a.returnValues.errors[d]&&(w=a.returnValues.errors[d].errorType);var L=elCreate("small");L.className="innerError",L.textContent=i.get("wcf.attachment.upload.error."+w),elBySel(s,"div > div").appendChild(L),s.classList.add("uploadFailed")}s.style.setProperty("display","block"),this._autoInsert.has(e)&&(this._autoInsert["delete"](e),s.classList.contains("uploadFailed"))}n.childrenBySel(this._target,"li:not(.uploadFailed)").length?elShow(this._insertAllButton):elHide(this._insertAllButton),t.trigger()},_upload:function(e,t,n){this._validateLimit()&&r.prototype._upload.call(this,e,t,n)},_validateLimit:function(){var e=n.nextBySel(this._button,"small.innerError"),t=this._options.maxUploads-n.childrenBySel(this._target,"li:not(.uploadFailed)").length;return 0>=t||t<this._fileUpload.files.length?(e||(e=elCreate("small"),e.className="innerError",DomUtil.insertAfter(e,this._button)),0>=t?e.textContent=i.get("wcf.attachment.upload.error.reachedLimit"):e.textContent=i.get("wcf.attachment.upload.error.reachedRemainingLimit",{remaining:t}),!1):(e&&elRemove(e),!0)}})}),define("WoltLab/WCF/Bbcode/Collapsible",[],function(){"use strict";var e=elByClass("jsCollapsibleBbcode"),t={observe:function(){for(var t,n;e.length;)t=e[0],t.classList.remove("jsCollapsibleBbcode"),n=elBySel(".toggleButton"),null!==n&&!function(e,t){var n=function(){var n=e.classList.contains("collapsed");e.classList[n?"remove":"add"]("collapsed"),t.textContent=elData(t,"title-"+(n?"collapse":"expand"))};t.addEventListener(WCF_CLICK_EVENT,n),e.addEventListener("scroll",n),0!==e.scrollTop&&n()}(t,n)}};return t}),define("WoltLab/WCF/Bbcode/FromHtml",["EventHandler","StringUtil","Dom/Traverse"],function(e,t,n){"use strict";function i(e,t){var n=e[t?"previousSibling":"nextSibling"];return null!==n&&n.nodeType===Node.TEXT_NODE&&/\s$/.test(n.textContent)?!1:!0}var a=[],r={},o=[],s={convert:function(t){t.length&&this._setup();var n=elCreate("div");n.innerHTML=t;for(var i=elByTag("P",n);i.length;)i[0].outerHTML=i[0].innerHTML;for(i=elByTag("BR",n);i.length;)i[0].outerHTML="\n";
+"use strict";var o=!1,s=0,l=new n,c=null,d=0,u=0,h=[],p=null,f=null,m=null,g=null,v=null,b=null,_=null,y=null,C=null,w=null,L={init:function(){this._setup();for(var t=elBySelAll('input[type="date"]:not(.inputDatePicker), input[type="datetime"]:not(.inputDatePicker)'),n=new Date,i=0,a=t.length;a>i;i++){var r=t[i];r.classList.add("inputDatePicker"),r.readOnly=!0;var o="datetime"===elAttr(r,"type");elData(r,"is-date-time",o);var s=null,c=elAttr(r,"value");elAttr(r,"value")&&(s=new Date(c),elData(r,"value",s.getTime()),c=e["formatDate"+(o?"Time":"")](s));var d=0===c.length;if(r.classList.contains("birthday")&&(elData(r,"min-date","100"),elData(r,"max-date","now")),this._initDateRange(r,n,!0),this._initDateRange(r,n,!1),elData(r,"min-date")===elData(r,"max-date"))throw new Error("Minimum and maximum date cannot be the same (element id '"+r.id+"').");r.type="text",r.value=c,elData(r,"empty",d),elData(r,"placeholder")&&elAttr(r,"placeholder",elData(r,"placeholder"));var u=elCreate("input");u.id=r.id+"DatePicker",u.name=r.name,u.type="hidden",null!==s&&(u.value=e.format(s,o?"c":"Y-m-d")),r.parentNode.insertBefore(u,r),r.removeAttribute("name"),r.addEventListener(WCF_CLICK_EVENT,w);var h=elCreate("div");h.className="inputAddon";var p=elCreate("a");p.className="inputSuffix button",p.addEventListener(WCF_CLICK_EVENT,w),h.appendChild(p);var f=elCreate("span");f.className="icon icon16 fa-calendar",p.appendChild(f),r.parentNode.insertBefore(h,r),h.insertBefore(r,p);for(var m=!1,g=["tiny","short","medium","long"],v=0;4>v;v++)r.classList.contains(g[v])&&(m=!0);m||r.classList.add("short"),l.set(r,{shadow:u,isDateTime:o,isEmpty:d,onClose:null})}},_initDateRange:function(e,t,n){var i="data-"+(n?"min":"max")+"-date",a=e.hasAttribute(i)?elAttr(e,i).trim():"";if(a.match(/^(\d{4})-(\d{2})-(\d{2})$/))a=new Date(a).getTime();else if("now"===a)a=t.getTime();else if(a.match(/^\d{1,3}$/)){var r=new Date(t.getTime());r.setFullYear(r.getFullYear()+~~a*(n?-1:1)),a=r.getTime()}else if(a.match(/^datePicker-(.+)$/)){if(a=RegExp.$1,null===elById(a))throw new Error("Reference date picker identified by '"+a+"' does not exists (element id: '"+e.id+"').")}else a=new Date(n?1970:2038,0,1).getTime();elAttr(e,i,a)},_setup:function(){o||(o=!0,s=~~t.get("wcf.date.firstDayOfTheWeek"),w=this._open.bind(this),i.add("WoltLab/WCF/Date/Picker",this.init.bind(this)),r.add("WoltLab/WCF/Date/Picker",this._close.bind(this)))},_open:function(e){e.preventDefault(),e.stopPropagation(),this._createPicker();var t="INPUT"===e.currentTarget.nodeName?e.currentTarget:e.currentTarget.previousElementSibling;if(t!==c){c=t;var n,i=l.get(c),r=elData(c,"value");r?(n=new Date(+r),"Invalid Date"===n.toString()&&(n=new Date)):n=new Date,u=elData(c,"min-date"),u.match(/^datePicker-(.+)$/)&&(u=elData(elById(RegExp.$1),"value")),u=new Date(+u),d=elData(c,"max-date"),d.match(/^datePicker-(.+)$/)&&(d=elData(elById(RegExp.$1),"value")),d=new Date(+d),i.isDateTime?(f.value=n.getHours(),m.value=n.getMinutes(),C.classList.add("datePickerTime")):C.classList.remove("datePickerTime"),this._renderPicker(n.getDate(),n.getMonth(),n.getFullYear()),a.set(C,c)}},_close:function(){if(null!==C&&C.classList.contains("active")){C.classList.remove("active");var e=l.get(c);"function"==typeof e.onClose&&e.onClose(),c=null,u=0,d=0}},_renderPicker:function(e,t,n){this._renderGrid(e,t,n);for(var i="",a=u.getFullYear(),r=d.getFullYear();r>=a;a++)i+='<option value="'+a+'">'+a+"</option>";y.innerHTML=i,y.value=n,g.value=t,C.classList.add("active")},_renderGrid:function(e,t,n){var i,a,r=void 0!==e,o=void 0!==t;if(e=~~e||~~elData(p,"day"),t=~~t,n=~~n,o||n){var l=0!==n,c=document.createDocumentFragment();c.appendChild(p),o||(t=~~elData(p,"month")),n=n||~~elData(p,"year");var f=new Date(n+"-"+("0"+(t+1).toString()).slice(-2)+"-"+("0"+e.toString()).slice(-2));for(u>f?(n=u.getFullYear(),t=u.getMonth(),e=u.getDate(),g.value=t,y.value=n,l=!0):f>d&&(n=d.getFullYear(),t=d.getMonth(),e=d.getDate(),g.value=t,y.value=n,l=!0),f=new Date(n+"-"+("0"+(t+1).toString()).slice(-2)+"-01");f.getDay()!==s;)f.setDate(f.getDate()-1);var m;for(a=0;35>a;a++)i=h[a],i.textContent=f.getDate(),m=f.getMonth()===t,m&&(u>f?m=!1:f>d&&(m=!1)),i.classList[m?"remove":"add"]("otherMonth"),f.setDate(f.getDate()+1);if(elData(p,"month",t),elData(p,"year",n),C.insertBefore(c,_),!r&&(f=new Date(n,t,e),f.getDate()!==e)){for(;f.getMonth()!==t;)f.setDate(f.getDate()-1);e=f.getDate()}if(l){for(a=0;12>a;a++){var w=g.children[a];w.disabled=n===u.getFullYear()&&w.value<u.getMonth()||n===d.getFullYear()&&w.value>d.getMonth()}var L=new Date(n+"-"+("0"+(t+1).toString()).slice(-2)+"-01");L.setMonth(L.getMonth()+1),v.classList[d>L?"add":"remove"]("active");var E=new Date(n+"-"+("0"+(t+1).toString()).slice(-2)+"-01");E.setDate(E.getDate()-1),b.classList[E>u?"add":"remove"]("active")}}if(e){for(a=0;35>a;a++)i=h[a],i.classList[i.classList.contains("otherMonth")||~~i.textContent!==e?"remove":"add"]("active");elData(p,"day",e)}this._formatValue()},_formatValue:function(){var t,n,i,a=l.get(c);"true"!==elData(c,"empty")&&(a.isDateTime?(t=new Date(elData(p,"year"),elData(p,"month"),elData(p,"day"),f.value,m.value),n=e.formatDateTime(t),i=e.format(t,"c")):(t=new Date(elData(p,"year"),elData(p,"month"),elData(p,"day")),n=e.formatDate(t),i=e.format(t,"Y-m-d")),c.value=n,elData(c,"value",t.getTime()),a.shadow.value=i)},_createPicker:function(){if(null===C){C=elCreate("div"),C.className="datePicker",C.addEventListener(WCF_CLICK_EVENT,function(e){e.stopPropagation()});var n=elCreate("header");C.appendChild(n),b=elCreate("a"),b.className="icon icon16 fa-arrow-left previous",b.addEventListener(WCF_CLICK_EVENT,this.previousMonth.bind(this)),n.appendChild(b);var i=elCreate("span");n.appendChild(i),g=elCreate("select"),g.className="month",g.addEventListener("change",this._changeMonth.bind(this));var a=elCreate("label");a.className="selectDropdown",a.appendChild(g),i.appendChild(a);var r,o="",l=t.get("__monthsShort");for(r=0;12>r;r++)o+='<option value="'+r+'">'+l[r]+"</option>";g.innerHTML=o,y=elCreate("select"),y.className="year",y.addEventListener("change",this._changeYear.bind(this)),a=elCreate("label"),a.className="selectDropdown",a.appendChild(y),i.appendChild(a),v=elCreate("a"),v.className="icon icon16 fa-arrow-right next",v.addEventListener(WCF_CLICK_EVENT,this.nextMonth.bind(this)),n.appendChild(v),p=elCreate("ul"),C.appendChild(p);var c=elCreate("li");c.className="weekdays",p.appendChild(c);var d,u=t.get("__daysShort");for(r=0;7>r;r++){var w=r+s;w>6&&(w-=7),d=elCreate("span"),d.textContent=u[w],c.appendChild(d)}var L,E,x=this._click.bind(this);for(r=0;5>r;r++){E=elCreate("li"),p.appendChild(E);for(var T=0;7>T;T++)L=elCreate("a"),L.addEventListener(WCF_CLICK_EVENT,x),h.push(L),E.appendChild(L)}_=elCreate("footer"),C.appendChild(_),f=elCreate("select"),f.className="hour",f.addEventListener("change",this._formatValue.bind(this));var D="",S=new Date(2e3,0,1),I=t.get("wcf.date.timeFormat").replace(/:/,"").replace(/[isu]/g,"");for(r=0;24>r;r++)S.setHours(r),D+='<option value="'+r+'">'+e.format(S,I)+"</option>";for(f.innerHTML=D,_.appendChild(f),_.appendChild(document.createTextNode(" : ")),m=elCreate("select"),m.className="minute",m.addEventListener("change",this._formatValue.bind(this)),D="",r=0;60>r;r++)D+='<option value="'+r+'">'+(10>r?"0"+r.toString():r)+"</option>";m.innerHTML=D,_.appendChild(m),document.body.appendChild(C)}},previousMonth:function(){"0"===g.value?(g.value=11,y.value=~~y.value-1):g.value=~~g.value-1,this._renderGrid(void 0,g.value,y.value)},nextMonth:function(){"11"===g.value?(g.value=0,y.value=~~y.value+1):g.value=~~g.value+1,this._renderGrid(void 0,g.value,y.value)},_changeMonth:function(e){this._renderGrid(void 0,e.currentTarget.value)},_changeYear:function(e){this._renderGrid(void 0,void 0,e.currentTarget.value)},_click:function(e){e.currentTarget.classList.contains("otherMonth")||(elData(c,"empty",!1),this._renderGrid(e.currentTarget.textContent),this._close())},getDate:function(e){return e=this._getElement(e),e.hasAttribute("data-value")?new Date(+elData(e,"value")):null},setDate:function(t,n){t=this._getElement(t);var i=l.get(t);elData(t,"value",n.getTime()),t.value=e["formatDate"+(i.isDateTime?"Time":"")](n),i.shadow.value=e.format(n,i.isDateTime?"c":"Y-m-d")},clear:function(e){e=this._getElement(e);var t=l.get(e);e.removeAttribute("data-value"),e.value="",t.isEmpty=!0,t.shadow.value=""},destroy:function(e){e=this._getElement(e);var t=l.get(e),n=e.parentNode;n.parentNode.insertBefore(e,n),elRemove(n),elAttr(e,"type","date"+(t.isDateTime?"time":"")),e.value=t.shadow.value,e.removeAttribute("data-value"),e.removeEventListener(WCF_CLICK_EVENT,w),elRemove(t.shadow),e.classList.remove("inputDatePicker"),e.readOnly=!1,l["delete"](e)},setCloseCallback:function(e,t){e=this._getElement(e),l.get(e).onClose=t},_getElement:function(e){if("string"==typeof e&&(e=elById(e)),!(e instanceof Element&&e.classList.contains("inputDatePicker")&&l.has(e)))throw new Error("Expected a valid date picker input element or id.");return e}};return window.__wcf_bc_datePicker=L,L}),define("WoltLab/WCF/Ui/Page/Action",["Dictionary","Dom/Util"],function(e,t){"use strict";var n=new e,i=null,a=!1;return{setup:function(){a=!0,i=elCreate("ul"),i.className="pageAction",document.body.appendChild(i)},add:function(e,r,o){a===!1&&this.setup();var s=elCreate("li");if(s.appendChild(r),elAttr(s,"aria-hidden","toTop"===e?"true":"false"),elData(s,"name",e),"toTop"===e)s.className="toTop initiallyHidden",i.appendChild(s);else{var l=null;o&&(l=n.get(o),void 0!==l&&(l=l.parentNode)),null===l&&i.childElementCount&&(l=i.children[0]),null===l?t.prepend(s,i):i.insertBefore(s,l)}n.set(e,r),this._renderContainer()},remove:function(e){var t=n.get(e);if(void 0!==t){var a=t.parentNode;a.addEventListener("animationend",function(){i.removeChild(a),n["delete"](e)}),this.hide(e)}},hide:function(e){var t=n.get(e);t&&(elAttr(t.parentNode,"aria-hidden","true"),this._renderContainer())},show:function(e){var t=n.get(e);t&&(t.parentNode.classList.contains("initiallyHidden")&&t.parentNode.classList.remove("initiallyHidden"),elAttr(t.parentNode,"aria-hidden","false"),this._renderContainer())},_renderContainer:function(){var e=!1;if(i.childElementCount)for(var t=0,n=i.childElementCount;n>t;t++)if("false"===elAttr(i.children[t],"aria-hidden")){e=!0;break}i.classList[e?"add":"remove"]("active")}}}),define("WoltLab/WCF/Ui/Page/JumpToTop",["Environment","Language","./Action"],function(e,t,n){"use strict";function i(){this.init()}return i.prototype={init:function(){if("desktop"===e.platform()){this._callbackScrollEnd=this._afterScroll.bind(this),this._timeoutScroll=null;var i=elCreate("a");i.className="jsTooltip",i.href="#",elAttr(i,"title",t.get("wcf.global.scrollUp")),i.innerHTML='<span class="icon icon16 fa-arrow-up"></span>',i.addEventListener(WCF_CLICK_EVENT,this._jump.bind(this)),n.add("toTop",i),window.addEventListener("scroll",this._scroll.bind(this)),this._afterScroll()}},_jump:function(e){e.preventDefault(),elById("top").scrollIntoView({behavior:"smooth"})},_scroll:function(){null!==this._timeoutScroll&&window.clearTimeout(this._timeoutScroll),this._timeoutScroll=window.setTimeout(this._callbackScrollEnd,100)},_afterScroll:function(){this._timeoutScroll=null,n[window.scrollY>=window.innerHeight/2?"show":"hide"]("toTop")}},i}),define("WoltLab/WCF/Bootstrap",["favico","enquire","perfect-scrollbar","WoltLab/WCF/Date/Time/Relative","Ui/SimpleDropdown","WoltLab/WCF/Ui/Mobile","WoltLab/WCF/Ui/TabMenu","WoltLab/WCF/Ui/FlexibleMenu","Ui/Dialog","WoltLab/WCF/Ui/Tooltip","WoltLab/WCF/Language","WoltLab/WCF/Environment","WoltLab/WCF/Date/Picker","EventHandler","Core","WoltLab/WCF/Ui/Page/JumpToTop"],function(e,t,n,i,a,r,o,s,l,c,d,u,h,p,f,m){"use strict";return window.Favico=e,window.enquire=t,null==window.WCF&&(window.WCF={}),null==window.WCF.Language&&(window.WCF.Language={}),window.WCF.Language.get=d.get,window.WCF.Language.add=d.add,window.WCF.Language.addObject=d.addObject,window.__wcf_bc_eventHandler=p,{setup:function(e){e=f.extend({enableMobileMenu:!0},e),u.setup(),i.setup(),h.init(),a.setup(),r.setup({enableMobileMenu:e.enableMobileMenu}),o.setup(),l.setup(),c.setup(),new m;for(var t=elBySelAll("form[method=get]"),n=0,s=t.length;s>n;n++)t[n].setAttribute("method","post");"microsoft"===u.browser()&&(window.onbeforeunload=function(){});var d=0;d=window.setInterval(function(){"function"==typeof window.jQuery&&(window.clearInterval(d),window.jQuery.holdReady(!1))},20)}}}),define("WoltLab/WCF/Controller/Style/Changer",["Ajax","Language","Ui/Dialog"],function(e,t,n){"use strict";var i={setup:function(){var e=elBySel("#footerNavigation > ul.navigationItems");if(null!==e){var n=elCreate("li");n.classList.add("styleChanger"),n.addEventListener(WCF_CLICK_EVENT,this.showDialog.bind(this));var i=elCreate("a");elAttr(i,"href","#"),i.textContent=t.get("wcf.style.changeStyle"),n.appendChild(i),e.appendChild(n)}},showDialog:function(e){e.preventDefault(),n.open(this)},_dialogSetup:function(){return{id:"styleChanger",options:{disableContentPadding:!0,title:t.get("wcf.style.changeStyle")},source:{data:{actionName:"getStyleChooser",className:"wcf\\data\\style\\StyleAction"},after:function(e){for(var t=elBySelAll(".styleList > li",e),n=0,i=t.length;i>n;n++){var a=t[n];a.classList.add("pointer"),a.addEventListener(WCF_CLICK_EVENT,this._click.bind(this))}}.bind(this)}}},_click:function(t){t.preventDefault(),e.apiOnce({data:{actionName:"changeStyle",className:"wcf\\data\\style\\StyleAction",objectIDs:[elData(t.currentTarget,"style-id")]},success:function(){window.location.reload()}})}};return i}),define("WoltLab/WCF/Controller/Popover",["Ajax","Dictionary","Environment","Dom/ChangeListener","Dom/Util","Ui/Alignment"],function(e,t,n,i,a,r){"use strict";var o=null,s=new t,l=new t,c=new t,d=null,u=!1,h=null,p=null,f=null,m=null,g=null,v=null,b=null,_=null,y=0,C=1,w=2,L=500,E=300;return{_setup:function(){if(null===f){f=elCreate("div"),f.className="popover forceHide",m=elCreate("div"),m.className="popoverContent",f.appendChild(m);var e=elCreate("span");e.className="elementPointer",e.appendChild(elCreate("span")),f.appendChild(e),document.body.appendChild(f),g=this._hide.bind(this),b=this._mouseEnter.bind(this),_=this._mouseLeave.bind(this),f.addEventListener("mouseenter",this._popoverMouseEnter.bind(this)),f.addEventListener("mouseleave",_),f.addEventListener("animationend",this._clearContent.bind(this)),window.addEventListener("beforeunload",function(){u=!0,null!==h&&window.clearTimeout(h),this._hide(!0)}.bind(this)),i.add("WoltLab/WCF/Controller/Popover",this._init.bind(this))}},init:function(e){"desktop"===n.platform()&&(e.attributeName=e.attributeName||"data-object-id",e.legacy=e.legacy===!0,this._setup(),c.has(e.identifier)||(c.set(e.identifier,{attributeName:e.attributeName,elements:e.legacy?e.className:elByClass(e.className),legacy:e.legacy,loadCallback:e.loadCallback}),this._init(e.identifier)))},_init:function(e){"string"==typeof e&&e.length?this._initElements(c.get(e),e):c.forEach(this._initElements.bind(this))},_initElements:function(e,t){for(var n=e.legacy?elBySelAll(e.elements):e.elements,i=0,r=n.length;r>i;i++){var o=n[i],c=a.identify(o);if(s.has(c))return;var d=e.legacy?c:~~o.getAttribute(e.attributeName);if(0!==d){o.addEventListener("mouseenter",b),o.addEventListener("mouseleave",_),"A"===o.nodeName&&elAttr(o,"href")&&o.addEventListener(WCF_CLICK_EVENT,g);var u=t+"-"+d;elData(o,"cache-id",u),l.set(c,{element:o,identifier:t,objectId:d}),s.has(u)||s.set(t+"-"+d,{content:null,state:y})}}},setContent:function(e,t,n){var i=e+"-"+t,r=s.get(i);if(void 0===r)throw new Error("Unable to find element for object id '"+t+"' (identifier: '"+e+"').");if(r.content=a.createFragmentFromHtml(n),r.state=w,o){var c=l.get(o).element;elData(c,"cache-id")===i&&this._show()}},_mouseEnter:function(e){if(!u){null!==h&&(window.clearTimeout(h),h=null);var t=a.identify(e.currentTarget);o===t&&null!==p&&(window.clearTimeout(p),p=null),d=t,h=window.setTimeout(function(){h=null,d===t&&this._show()}.bind(this),E)}},_mouseLeave:function(){d=null,null===p&&(null===v&&(v=this._hide.bind(this)),null!==p&&window.clearTimeout(p),p=window.setTimeout(v,L))},_popoverMouseEnter:function(){null!==p&&(window.clearTimeout(p),p=null)},_show:function(){null!==p&&(window.clearTimeout(p),p=null);var e=!1;f.classList.contains("active")?(this._hide(),e=!0):m.childElementCount&&(e=!0),e&&(f.classList.add("forceHide"),f.offsetTop,this._clearContent(),f.classList.remove("forceHide")),o=d;var t=l.get(o),n=s.get(elData(t.element,"cache-id"));n.state===w?(m.appendChild(n.content),this._rebuild(o)):n.state===y&&(n.state=C,c.get(t.identifier).loadCallback(t.objectId,this))},_hide:function(){null!==p&&(window.clearTimeout(p),p=null),f.classList.remove("active")},_clearContent:function(){if(o&&m.childElementCount&&!f.classList.contains("active"))for(var e=s.get(elData(l.get(o).element,"cache-id"));m.childNodes.length;)e.content.appendChild(m.childNodes[0])},_rebuild:function(){f.classList.contains("active")||(f.classList.remove("forceHide"),f.classList.add("active"),r.set(f,l.get(o).element,{pointer:!0,vertical:"top"}))},_ajaxSetup:function(){return{}},ajaxApi:function(t,n,i){if("function"!=typeof n)throw new TypeError("Expected a valid callback for parameter 'success'.");e.api(this,t,n,i)}}}),define("WoltLab/WCF/List",[],function(){"use strict";function e(){this._set=t?new Set:[]}var t=objOwns(window,"Set")&&"function"==typeof window.Set;return e.prototype={add:function(e){t?this._set.add(e):this.has(e)||this._set.push(e)},clear:function(){t?this._set.clear():this._set=[]},"delete":function(e){if(t)return this._set["delete"](e);var n=this._set.indexOf(e);return-1===n?!1:(this._set.splice(n,1),!0)},forEach:function(e){if(t)this._set.forEach(e);else for(var n=0,i=this._set.length;i>n;n++)e(this._set[n])},has:function(e){return t?this._set.has(e):-1!==this._set.indexOf(e)}},Object.defineProperty(e.prototype,"size",{enumerable:!1,configurable:!0,get:function(){return t?this._set.size:this._set.length}}),e}),define("WoltLab/WCF/Ui/User/Ignore",["List","Dom/ChangeListener"],function(e,t){"use strict";var n=elByClass("ignoredUserMessage"),i=null,a=new e;return{init:function(){i=this._removeClass.bind(this),this._rebuild(),t.add("WoltLab/WCF/Ui/User/Ignore",this._rebuild.bind(this))},_rebuild:function(){for(var e,t=0,r=n.length;r>t;t++)e=n[t],a.has(e)||(e.addEventListener(WCF_CLICK_EVENT,i),a.add(e))},_removeClass:function(e){e.preventDefault();var t=e.currentTarget;t.classList.remove("ignoredUserMessage"),t.removeEventListener(WCF_CLICK_EVENT,i),a["delete"](t)}}}),define("WoltLab/WCF/BootstrapFrontend",["Ajax","WoltLab/WCF/Bootstrap","WoltLab/WCF/Controller/Style/Changer","WoltLab/WCF/Controller/Popover","WoltLab/WCF/Ui/User/Ignore"],function(e,t,n,i,a){"use strict";var r=0;return{setup:function(e){t.setup(),e.styleChanger,this._initUserPopover(),this._invokeBackgroundQueue(e.backgroundQueue.url,e.backgroundQueue.force),a.init()},_initUserPopover:function(){i.init({attributeName:"data-user-id",className:"userLink",identifier:"com.woltlab.wcf.user",loadCallback:function(e,t){var n=function(n){t.setContent("com.woltlab.wcf.user",e,n.returnValues.template)};t.ajaxApi({actionName:"getUserProfile",className:"wcf\\data\\user\\UserProfileAction",objectIDs:[e]},n,n)}})},_invokeBackgroundQueue:function(t,n){var i=this._invokeBackgroundQueue.bind(this,t,!0);(Math.random()<.1||n)&&e.apiOnce({url:t,ignoreError:!0,silent:!0,success:function(e){r++,e>0&&5>r&&setTimeout(i,1e3)}.bind(this)})}}}),define("WoltLab/WCF/ColorUtil",[],function(){"use strict";var e={hexToRgb:function(e){return e=e.replace(/^#/,""),/^([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(e)?(e=e.split(""),3===e.length?{r:parseInt(e[0]+""+e[0],16),g:parseInt(e[1]+""+e[1],16),b:parseInt(e[2]+""+e[2],16)}:{r:parseInt(e[0]+""+e[1],16),g:parseInt(e[2]+""+e[3],16),b:parseInt(e[4]+""+e[5],16)}):Number.NaN},rgbToHex:function(e,t,n){var i="0123456789ABCDEF";return void 0===t&&e.match(/^rgba?\((\d+), ?(\d+), ?(d\+)(?:, ?[0-9.]+)?\)$/)&&(e=RegExp.$1,t=RegExp.$2,n=RegExp.$3),i.charAt((e-e%16)/16)+""+i.charAt(e%16)+(i.charAt((t-t%16)/16)+""+i.charAt(t%16))+(i.charAt((n-n%16)/16)+""+i.charAt(n%16))}};return e}),define("WoltLab/WCF/Permission",["Dictionary"],function(e){"use strict";var t=new e,n={add:function(e,n){if("boolean"!=typeof n)throw new TypeError("Permission value has to be boolean.");t.set(e,n)},addObject:function(e){for(var t in e)objOwns(e,t)&&this.addPermission(t,e[t])},get:function(e){return t.has(e)?t.get(e):!1}};return n}),define("WoltLab/WCF/Upload",["AjaxRequest","Core","Dom/ChangeListener","Language","Dom/Util","Dom/Traverse"],function(e,t,n,i,a,r){"use strict";function o(e,n,i){if(i=i||{},void 0===i.className)throw new Error("Missing class name.");if(this._options=t.extend({action:"upload",multiple:!1,name:"__files[]",singleFileRequests:!1,url:"index.php/AJAXUpload/?t="+SECURITY_TOKEN},i),this._options.url=WCF.convertLegacyURL(this._options.url),this._buttonContainer=elById(e),null===this._buttonContainer)throw new Error("Element id '"+e+"' is unknown.");if(this._target=elById(n),null===n)throw new Error("Element id '"+n+"' is unknown.");if(i.multiple&&"UL"!==this._target.nodeName&&"OL"!==this._target.nodeName)throw new Error("Target element has to be list when allowing upload of multiple files.");this._fileElements=[],this._internalFileId=0,this._createButton()}return o.prototype={_createButton:function(){this._fileUpload=elCreate("input"),elAttr(this._fileUpload,"type","file"),elAttr(this._fileUpload,"name",this._options.name),this._options.multiple&&elAttr(this._fileUpload,"multiple","true"),this._fileUpload.addEventListener("change",this._upload.bind(this)),this._button=elCreate("p"),this._button.classList.add("button"),this._button.classList.add("uploadButton");var e=elCreate("span");e.textContent=i.get("wcf.global.button.upload"),this._button.appendChild(e),a.prepend(this._fileUpload,this._button),this._insertButton(),n.trigger()},_createFileElement:function(e){var t=elCreate("progress");if(elAttr(t,"max",100),"OL"===this._target.nodeName||"UL"===this._target.nodeName){var n=elCreate("li");return n.innerText=e.name,n.appendChild(t),this._target.appendChild(n),n}var i=elCreate("p");return i.appendChild(t),this._target.appendChild(i),i},_createFileElements:function(e){if(e.length){var t=this._fileElements.length;this._fileElements[t]=[];for(var i=0,a=e.length;a>i;i++){var r=e[i],o=this._createFileElement(r);o.classList.contains("uploadFailed")||(elData(o,"filename",r.name),elData(o,"internal-file-id",this._internalFileId++),this._fileElements[t][i]=o)}return n.trigger(),t}return null},_failure:function(e,t,n,i,a){return!0},_getParameters:function(){return{}},_insertButton:function(){a.prepend(this._button,this._buttonContainer)},_progress:function(e,t){var n=Math.round(t.loaded/t.total*100);for(var i in this._fileElements[e]){var a=elByTag("PROGRESS",this._fileElements[e][i]);1===a.length&&elAttr(a[0],"value",n)}},_removeButton:function(){elRemove(this._button),n.trigger()},_success:function(e,t,n,i,a){},_upload:function(e,t,n){for(var i=r.childrenByClass(this._target,"uploadFailed"),a=0,o=i.length;o>a;a++)elRemove(i[a]);var s=null,l=[];if(t)l.push(t);else if(n){var c="";switch(n.type){case"image/jpeg":c=".jpg";break;case"image/gif":c=".gif";break;case"image/png":c=".png"}l.push({name:"pasted-from-clipboard"+c})}else l=this._fileUpload.files;if(l.length)if(this._options.singleFileRequests){s=[];for(var a=0,o=l.length;o>a;a++)s.push(this._uploadFiles([l[a]],n))}else s=this._uploadFiles(l,n);return this._removeButton(),this._createButton(),s},_uploadFiles:function(t,n){var i=this._createFileElements(t);if(!this._fileElements[i].length)return null;for(var a=new FormData,r=0,o=t.length;o>r;r++)if(this._fileElements[i][r]){var s=elData(this._fileElements[i][r],"internal-file-id");n?a.append("__files["+s+"]",n,t[r].name):a.append("__files["+s+"]",t[r])}a.append("actionName",this._options.action),a.append("className",this._options.className),a.append("interfaceName","wcf\\data\\IUploadAction");var l=function(e,t){t=t||"";for(var n in e)"object"==typeof e[n]?l(e[n],t+"["+n+"]"):a.append("parameters"+t+"["+n+"]",e[n])};l(this._getParameters());var c=new e({data:a,contentType:!1,failure:this._failure.bind(this,i),silent:!0,success:this._success.bind(this,i),uploadProgress:this._progress.bind(this,i),url:this._options.url});return c.sendRequest(),i}},o}),define("WoltLab/WCF/Ajax/Jsonp",["Core"],function(e){"use strict";var t={send:function(t,n,i,a){if(t="string"==typeof t?t.trim():"",0===t.length)throw new Error("Expected a non-empty string for parameter 'url'.");if("function"!=typeof n)throw new TypeError("Expected a valid callback function for parameter 'success'.");a=e.extend({parameterName:"callback",timeout:10},a||{});var r="wcf_jsonp_"+e.getUuid().replace(/-/g,"").substr(0,8),o=window.setTimeout(function(){window[r]=function(){},"function"==typeof i&&i()},1e3*(~~a.timeout||10));window[r]=function(){window.clearTimeout(o),n.apply(null,arguments)},t+=-1===t.indexOf("?")?"?":"&",t+=a.parameterName+"="+r;var s=elCreate("script");s.async=!0,elAttr(s,"src",t),document.head.appendChild(s)}};return t}),define("WoltLab/WCF/Attachment/Upload",["Core","Dom/ChangeListener","Dom/Traverse","Language","List","Upload"],function(e,t,n,i,a,r){"use strict";function o(e,t,o,s,l,c,d,u,h){this._tmpHash=o,this._objectType=s,this._objectId=~~l,this._parentObjectId=~~parentObjectID,this._wysiwygContainerId=h,this._autoInsert=new a,r.call(this,"uploadImage","styleImage",{className:"wcf\\data\\attachment\\AttachmentAction",maxSize:~~u,maxUploads:~~d,multiple:!0}),n.childByClass(this._button,".button").addEventListener(WCF_CLICK_EVENT,this._validateLimit.bind(this)),elByClass(this._target,"jsButtonInsertAttachment").addEventListener(WCF_CLICK_EVENT,this._insert.bind(this)),elByClass(this._target,"jsButtonAttachmentInsertThumbnail").addEventListener(WCF_CLICK_EVENT,this._insert.bind(this)),elByClass(this._target,"jsButtonAttachmentInsertFull").addEventListener(WCF_CLICK_EVENT,this._insert.bind(this)),this._insertAllButton=elCreate("p"),this._insertAllButton.className="button jsButtonAttachmentInsertAll",this._insertAllButton.textContent=i.get("wcf.attachment.insertAll"),n.childBySel(this._target,"li:not(.uploadFailed)")&&elHide(this._insertAllButton),this._insertAllButton.addEventListener(WCF_CLICK_EVENT,this._insertAll.bind(this)),this._button.appendChild(this._insertAllButton),this._wysiwygContainerId}e.inherit(o,r,{_createFileElement:function(e){var t=elCreate("li");t.className="box64",elData(t,"filename",filename),this._target.appendChild(t),elShow(this._target);var n=elCreate("span");this._options.maxSize>=e.size?n.className="icon icon48 fa-spinnner":n.className="icon icon48 fa-ban-circle",t.appendChild(n);var a=elCreate("div");t.appendChild(a);var r=elCreate("div");a.appendChild(r);var o=elCreate("p");o.textContent=e.name,r.appendChild(o);var s=elCreate("small");if(r.appendChild(s),this._options.maxSize>=e.size){var l=elCreate("progress");elAttr(l,"max",100)}a.appendChild(elCreate("ul")),this._options.maxSize<e.size&&(s=elCreate("small"),s.className="innerError",s.textContent=i.get("wcf.attachment.upload.error.tooLarge"),r.appendChild(s),t.classList.add("uploadFailed"))},_createFileElements:function(e){for(var t=n.childrenBySel(this._target,"li.uploadFailed"),i=0,a=t.length;a>i;i++)this._target.removeChild(t[i]);return r.prototype._createFileElements.call(this,e)},_getParameters:function(){return{objectID:this._objectId,objectType:this._objectType,parentObjectID:this._parentObjectId,tmpHash:this._tmpHash}},_success:function(e,a){for(var r=0,o=this._fileElements[e].length;o>r;r++){var s=this._fileElements[e][r],l=elByTag(s,"PROGRESS");elRemove(l);var c=elData(s,"filename"),d=elData(s,"internal-file-id"),u=n.childByClass(s,"fa-spinner");if(a.returnValues&&a.returnValues.attachments[d]){var h=a.returnValues.attachments[d];if(h.tinyURL){var p=elCreate("img");p.className="attachmentTinyThumbnail",elAttr(p,"src",h.tinyURL),elAttr(p,"alt",""),u.parentNode.replaceChild(u,p),elData(s,"height",h.height),elData(s,"width",h.width)}else u.classList.remove("fa-spinner"),u.classList.add("fa-paper-clip");var f=elByTag(s,"P");f.innerHtml="";var m=elCreate("a");m.textContent=c,elAttr(m,"href",h.url),h.isImage&&(m.className="jsImageViewer",elAttr(m,"title",c)),f.appendChild(m),elByTag(s,"SMALL").textContent=h.formattedFilesize;var g=elByTag(s,"UL");g.classList.add("buttonGroup");var v=elCreate("li");g.appendChild(v);var b=elCreate("span");if(b.className="button small jsDeleteButton",b.textContent=i.get("wcf.global.button.delete"),elData(b,"object-id",h.attachmentID),elData(b,"confirm-message",i.get("wcf.attachment.delete.sure")),this._wysiwygContainerId&&elData(b,"event-name","attachment_"+this._wysiwygContainerId),v.appendChild(b),elData(b,"object-id",h.attachmentID),this._wysiwygContainerId)if(h.tinyURL){var _=elCreate("li");g.appendChild(_),b=elCreate("span"),b.className="button small jsButtonAttachmentInsertThumbnail",b.textContent=i.get("wcf.global.button.insertThumbnail"),elData(b,"object-id",h.attachmentID),b.addEventListener(WCF_CLICK_EVENT,this._insert.bind(this)),_.appendChild(b);var y=elCreate("li");g.appendChild(y),b=elCreate("span"),b.className="button small jsButtonAttachmentInsertFull",b.textContent=i.get("wcf.global.button.insertFull"),elData(b,"object-id",h.attachmentID),b.addEventListener(WCF_CLICK_EVENT,this._insert.bind(this)),y.appendChild(b)}else{var C=elCreate("li");g.appendChild(C),b=elCreate("span"),b.className="button small jsButtonAttachmentInsertPlain",b.textContent=i.get("wcf.global.button.insert"),elData(b,"object-id",h.attachmentID),b.addEventListener(WCF_CLICK_EVENT,this._insert.bind(this)),C.appendChild(b)}}else{u.classList.removeClass("fa-spinner"),u.classList.addClass("fa-ban-circle");var w="uploadFailed";a.returnValues&&a.returnValues.errors[d]&&(w=a.returnValues.errors[d].errorType);var L=elCreate("small");L.className="innerError",L.textContent=i.get("wcf.attachment.upload.error."+w),elBySel(s,"div > div").appendChild(L),s.classList.add("uploadFailed")}s.style.setProperty("display","block"),this._autoInsert.has(e)&&(this._autoInsert["delete"](e),s.classList.contains("uploadFailed"))}n.childrenBySel(this._target,"li:not(.uploadFailed)").length?elShow(this._insertAllButton):elHide(this._insertAllButton),t.trigger()},_upload:function(e,t,n){this._validateLimit()&&r.prototype._upload.call(this,e,t,n)},_validateLimit:function(){var e=n.nextBySel(this._button,"small.innerError"),t=this._options.maxUploads-n.childrenBySel(this._target,"li:not(.uploadFailed)").length;return 0>=t||t<this._fileUpload.files.length?(e||(e=elCreate("small"),e.className="innerError",DomUtil.insertAfter(e,this._button)),0>=t?e.textContent=i.get("wcf.attachment.upload.error.reachedLimit"):e.textContent=i.get("wcf.attachment.upload.error.reachedRemainingLimit",{remaining:t}),!1):(e&&elRemove(e),!0)}})}),define("WoltLab/WCF/Bbcode/Collapsible",[],function(){"use strict";var e=elByClass("jsCollapsibleBbcode"),t={observe:function(){for(var t,n;e.length;)t=e[0],t.classList.remove("jsCollapsibleBbcode"),n=elBySel(".toggleButton"),null!==n&&!function(e,t){var n=function(){var n=e.classList.contains("collapsed");e.classList[n?"remove":"add"]("collapsed"),t.textContent=elData(t,"title-"+(n?"collapse":"expand"))};t.addEventListener(WCF_CLICK_EVENT,n),e.addEventListener("scroll",n),0!==e.scrollTop&&n()}(t,n)}};return t}),define("WoltLab/WCF/Bbcode/FromHtml",["EventHandler","StringUtil","Dom/Traverse"],function(e,t,n){"use strict";function i(e,t){var n=e[t?"previousSibling":"nextSibling"];return null!==n&&n.nodeType===Node.TEXT_NODE&&/\s$/.test(n.textContent)?!1:!0}var a=[],r={},o=[],s={convert:function(t){t.length&&this._setup();var n=elCreate("div");n.innerHTML=t;for(var i=elByTag("P",n);i.length;)i[0].outerHTML=i[0].innerHTML;for(i=elByTag("BR",n);i.length;)i[0].outerHTML="\n";
 var r=this._preserveSourceElements(n);e.fire("com.woltlab.wcf.bbcode.fromHtml","beforeConvert",{container:n});for(var o=0,s=a.length;s>o;o++)this._convert(n,a[o]);for(e.fire("com.woltlab.wcf.bbcode.fromHtml","afterConvert",{container:n}),this._restoreSourceElements(n,r),i=elByTag("*",n);i.length;)i[0].outerHTML=i[0].innerHTML;return t=this._convertSpecials(n.innerHTML)},_preserveSourceElements:function(e){for(var t,n,i=[],a=0,r=o.length;r>a;a++){t=elBySelAll(o[a].selector,e),n=[];for(var s=0,l=t.length;l>s;s++)this._preserveSourceElement(t[s],n);i.push(n)}return i},_preserveSourceElement:function(e,t){var n=elCreate("var");elData(n,"source","wcf"),e.parentNode.insertBefore(n,e);var i=document.createDocumentFragment();i.appendChild(e),t.push({fragment:i,placeholder:n})},_restoreSourceElements:function(e,t){for(var n,i,a,r=0,s=t.length;s>r;r++)if(i=t[r],0!==i.length)for(var l=0,c=i.length;c>l;l++)n=i[l],a=n.placeholder,a.parentNode.insertBefore(n.fragment,a),o[r].callback(a.previousElementSibling),elRemove(a)},_convertSpecials:function(e){return e=e.replace(/&amp;/g,"&"),e=e.replace(/&lt;/g,"<"),e=e.replace(/&gt;/g,">")},_setup:function(){a.length||(a=[{tagName:"STRONG",bbcode:"b"},{tagName:"DEL",bbcode:"s"},{tagName:"EM",bbcode:"i"},{tagName:"SUB",bbcode:"sub"},{tagName:"SUP",bbcode:"sup"},{tagName:"U",bbcode:"u"},{tagName:"KBD",bbcode:"tt"},{tagName:"A",callback:this._convertUrl.bind(this)},{tagName:"IMG",callback:this._convertImage.bind(this)},{tagName:"LI",callback:this._convertListItem.bind(this)},{tagName:"OL",callback:this._convertList.bind(this)},{tagName:"TABLE",callback:this._convertTable.bind(this)},{tagName:"UL",callback:this._convertList.bind(this)},{tagName:"BLOCKQUOTE",callback:this._convertBlockquote.bind(this)},{tagName:"SPAN",callback:this._convertSpan.bind(this)},{tagName:"DIV",callback:this._convertDiv.bind(this)}],r={span:[{style:"color",callback:this._convertInlineColor.bind(this)},{style:"font-size",callback:this._convertInlineFontSize.bind(this)},{style:"font-family",callback:this._convertInlineFontFamily.bind(this)}],div:[{style:"text-align",callback:this._convertInlineTextAlign.bind(this)}]},o=[{selector:"div.codeBox",callback:this._convertSourceCodeBox.bind(this)}],e.fire("com.woltlab.wcf.bbcode.fromHtml","init",{converter:a,inlineConverter:r,sourceConverter:o}))},_convert:function(e,t){if("function"==typeof t)return void t(e);for(var n,i=elByTag(t.tagName,e);i.length;)n=i[0],t.bbcode?n.outerHTML="["+t.bbcode+"]"+n.innerHTML+"[/"+t.bbcode+"]":t.callback(n)},_convertBlockquote:function(e){var i=elData(e,"author"),a=elAttr(e,"cite"),r="[quote]";i&&(i=t.escapeHTML(i).replace(/(\\)?'/g,function(e,t){return t?e:"\\'"}),r=a?"[quote='"+i+"','"+t.escapeHTML(a)+"']":"[quote='"+i+"']");var o=n.childByTag(e,"HEADER");null!==o&&e.removeChild(o);for(var s=n.childrenByTag(e,"DIV"),l=0,c=s.length;c>l;l++)s[l].outerHTML=s[l].innerHTML+"\n";e.outerHTML=r+e.innerHTML.replace(/^\n*/,"").replace(/\n*$/,"")+"[/quote]\n"},_convertImage:function(e){if(e.classList.contains("smiley"))return void(e.outerHTML=(i(e,!0)?" ":"")+elAttr(e,"alt")+(i(e,!1)?" ":""));var t=e.style.getPropertyValue("float")||"none",n=e.style.getPropertyValue("width");if(n="string"==typeof n?~~n.replace(/px$/,""):0,e.classList.contains("redactorEmbeddedAttachment")){var a=elData(e,"attachment-id");n>0?e.outerHTML="[attach="+a+","+t+","+n+"][/attach]":"none"!==t?e.outerHTML="[attach="+a+","+t+"][/attach]":e.outerHTML="[attach="+a+"][/attach]"}else{var r=e.src.trim();n>0?e.outerHTML="[img='"+r+"',"+t+","+n+"][/img]":"none"!==t?e.outerHTML="[img='"+r+"',"+t+"][/img]":e.outerHTML="[img]"+r+"[/img]"}},_convertList:function(e){var t;if("OL"===e.nodeName)t="[list=1]";else{var n=e.style.getPropertyValue("list-style-type")||"";t=""===n?"[list]":"[list="+("lower-latin"===n?"a":n)+"]"}e.outerHTML=t+e.innerHTML+"[/list]"},_convertListItem:function(e){"UL"!==e.parentNode.nodeName&&"OL"!==e.parentNode.nodeName?e.outerHTML=e.innerHTML:e.outerHTML="[*]"+e.innerHTML},_convertSpan:function(e){if(e.style.length||e.className)for(var t,n,i=0,a=r.span.length;a>i;i++)t=r.span[i],t.style?(n=e.style.getPropertyValue(t.style)||"",n&&t.callback(e,n)):e.classList.contains(t.className)&&t.callback(e);e.outerHTML=e.innerHTML},_convertDiv:function(e){if(e.className.length||e.style.length)for(var t,n,i=0,a=r.div.length;a>i;i++)t=r.div[i],t.className&&e.classList.contains(t.className)?t.callback(e):t.style&&(n=e.style.getPropertyValue(t.style)||"",n&&t.callback(e,n));e.outerHTML=e.innerHTML},_convertInlineColor:function(e,t){if(t.match(/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/i)){var n=RegExp.$1,i=RegExp.$2,a=RegExp.$3,r="0123456789ABCDEF";t="#"+(r.charAt((n-n%16)/16)+""+r.charAt(n%16))+(r.charAt((i-i%16)/16)+""+r.charAt(i%16))+(r.charAt((a-a%16)/16)+""+r.charAt(a%16))}e.innerHTML="[color="+t+"]"+e.innerHTML+"[/color]"},_convertInlineFontSize:function(e,t){t.match(/^(\d+)pt$/)?t=RegExp.$1:t.match(/^(\d+)(px|em|rem|%)$/)?(t=window.getComputedStyle(t).fontSize.replace(/^(\d+).*$/,"$1"),t=Math.round(t)):t="",t&&(t=Math.min(Math.max(t,8),36),e.innerHTML="[size="+t+"]"+e.innerHTML+"[/size]")},_convertInlineFontFamily:function(e,t){e.innerHTML="[font="+t.replace(/'/g,"")+"]"+e.innerHTML+"[/font]"},_convertInlineTextAlign:function(e,t){-1!==["center","justify","left","right"].indexOf(t)&&(e.innerHTML="[align="+t+"]"+e.innerHTML+"[/align]")},_convertTable:function(e){for(var t=elByTag("TD",e);t.length;)t[0].outerHTML="[td]"+t[0].innerHTML+"[/td]\n";for(t=elByTag("TR",e);t.length;)t[0].outerHTML="\n[tr]\n"+t[0].innerHTML+"[/tr]";var i=n.childByTag(e,"TBODY"),a=null===i?e.innerHTML:i.innerHTML;e.outerHTML="\n[table]"+a+"\n[/table]\n"},_convertUrl:function(e){var t=e.textContent.trim(),n=e.href.trim(),i="url";return""===n||""===t?void(e.outerHTML=e.innerHTML):(0===n.indexOf("mailto:")&&(n=n.substr(7),i="email"),void(n===t?e.outerHTML="["+i+"]"+n+"[/"+i+"]":e.outerHTML="["+i+"='"+n+"']"+e.innerHTML+"[/"+i+"]"))},_convertSourceCodeBox:function(e){var t=elData(e,"filename").trim()||"",i=elData(e,"highlighter");window.dtdesign=e;for(var a=n.childByTag(e.children[0],"OL"),r=~~elAttr(a,"start")||1,o="",s=0,l=a.childElementCount;l>s;s++)o&&(o+="\n"),o+=a.children[s].textContent;var c="[code='"+i+"',"+r+",'"+t+"']";e.outerHTML=c+o+"[/code]"}};return s}),define("WoltLab/WCF/Bbcode/Parser",[],function(){"use strict";var e={parse:function(e){var t=this._splitTags(e);return this._buildLinearTree(t),t},_splitTags:function(e){for(var t,n,i=__REDACTOR_BBCODES.join("|"),a="(\\[(?:/(?:"+i+")|(?:"+i+")(?:=(?:\\'[^\\'\\\\]*(?:\\\\.[^\\'\\\\]*)*\\'|[^,\\]]*)(?:,(?:\\'[^\\'\\\\]*(?:\\\\.[^\\'\\\\]*)*'|[^,\\]]*))*)?)\\])",r=new RegExp("^"+a+"$","i"),o=e.split(new RegExp(a,"i")),s=[],l=0,c=o.length;c>l;l++)t=o[l],""!==t&&(t.match(r)?(n={name:"",closing:!1,attributes:[],source:t},"/"===t[1]?(n.name=t.substring(2,t.length-1),n.closing=!0):t.match(/^\[([a-z0-9]+)=?(.*)\]$/i)&&(n.name=RegExp.$1,RegExp.$2&&(n.attributes=this._parseAttributes(RegExp.$2))),s.push(n)):s.push(t));return s},_buildLinearTree:function(e){for(var t,n,i=[],a="",r=0;r<e.length;r++)if(t=e[r],"object"==typeof t){if(a.length&&(t.name!==a||!t.closing)){e[r]=t.source;continue}if(t.closing){if(this._hasOpenTag(i,t.name)){n=this._closeUnclosedTags(e,i,t.name);for(var o=0,s=n.length;s>o;o++)e.splice(r,n[o]),r++;i.pop().pair=r}else e[r]=t.source;a===t.name&&(a="")}else i.push(t),-1!==__REDACTOR_SOURCE_BBCODES.indexOf(t.name)&&(a=t.name)}this._closeUnclosedTags(e,i,"")},_closeUnclosedTags:function(e,t,n){for(var i,a,r=[],o=t.length-1;o>=0&&(i=t[o],i.name!==n);o--)a={name:i.name,closing:!0,attributes:i.attributes.slice(),source:"[/"+i.name+"]"},i.pair=e.length,e.push(a),t.pop(),r.push({name:i.name,closing:!1,attributes:i.attributes.slice(),source:i.source});return r.reverse()},_hasOpenTag:function(e,t){for(var n=e.length-1;n>=0;n--)if(e[n].name===t)return!0;return!1},_parseAttributes:function(e){for(var t,n=e.split(/(?:^|,)('[^'\\\\]*(?:\\\\.[^'\\\\]*)*'|[^,]*)/g),i=[],a=0,r=n.length;r>a;a++)t=n[a],""!==t&&("'"===t.charAt(0)&&"'"===t.substr(-1)?i.push(t.substring(1,t.length-1).trim()):i.push(t.trim()));return i}};return e}),define("WoltLab/WCF/Bbcode/ToHtml",["Core","EventHandler","Language","StringUtil","WoltLab/WCF/Bbcode/Parser"],function(e,t,n,i,a){"use strict";function r(e){return e&&e==~~e}function o(e){return-1!==e.indexOf(".")||!r(e)&&!s(e)}function s(e){return objOwns(__REDACTOR_CODE_HIGHLIGHTERS,e)}var l=null,c={},d=[],u=[],h={convert:function(n,i){c=e.extend({attachments:{images:{},thumbnailUrl:"",url:""}},i),this._convertSpecials(n);var r=a.parse(n);r.length&&this._initBBCodes(),t.fire("com.woltlab.wcf.bbcode.toHtml","beforeConvert",{stack:r});for(var o,s,l=0,d=r.length;d>l;l++)o=r[l],"object"==typeof o&&(s=this._convert(r,o,l),Array.isArray(s)?(r[l]=null===s[0]?o.source:s[0],r[o.pair]=null===s[1]?r[o.pair].source:s[1]):r[l]=s);return t.fire("com.woltlab.wcf.bbcode.toHtml","afterConvert",{stack:r}),n=r.join(""),n=n.replace(/\n/g,"<br>")},_convertSpecials:function(e){return e=e.replace(/&/g,"&amp;"),e=e.replace(/</g,"&lt;"),e=e.replace(/>/g,"&gt;")},_initBBCodes:function(){null===l&&(l={b:"strong",i:"em",u:"u",s:"del",sub:"sub",sup:"sup",table:"table",td:"td",tr:"tr",tt:"kbd",align:this._convertAlignment.bind(this),attach:this._convertAttachment.bind(this),color:this._convertColor.bind(this),code:this._convertCode.bind(this),email:this._convertEmail.bind(this),list:this._convertList.bind(this),quote:this._convertQuote.bind(this),size:this._convertSize.bind(this),url:this._convertUrl.bind(this),img:this._convertImage.bind(this)},d=["quote","table","td","tr"],u=["table","td","tr"],t.fire("com.woltlab.wcf.bbcode.toHtml","init",{bbcodes:l,removeNewlineAfter:d,removeNewlineBefore:u}))},_convert:function(e,t,n){var i,a=l[t.name];return void 0===a?[null,null]:(-1!==d.indexOf(t.name)&&(i=e[n+1],"string"==typeof i&&(e[n+1]=i.replace(/^\n/,"")),e.length>t.pair+1&&(i=e[t.pair+1],"string"==typeof i&&(e[t.pair+1]=i.replace(/^\n/,"")))),-1!==u.indexOf(t.name)&&(n-1>=0&&(i=e[n-1],"string"==typeof i&&(e[n-1]=i.replace(/\n$/,""))),i=e[t.pair-1],"string"==typeof i&&(e[t.pair-1]=i.replace(/\n$/,""))),this._convertSmilies(e),"string"==typeof a?["<"+a+">","</"+a+">"]:a(e,t,n))},_convertAlignment:function(e,t,n){var i=t.attributes.length?t.attributes[0]:"";return-1===["center","justify","left","right"].indexOf(i)?[null,null]:['<div style="text-align: '+i+'">',"</div>"]},_convertAttachment:function(e,t,n){var i=0,a=t.attributes,r=a.length;if(c.attachments.url?r>0&&(i=~~a[0],objOwns(c.attachments.images,i)||(r=0)):r=0,0===r)return[null,null];var o=~~c.attachments.images[i].height,s=~~c.attachments.images[i].width,l=["max-height: "+o+"px","max-width: "+s+"px"];r>1&&("left"===t.attributes[1]||"right"===a[1])&&(l.push("float: "+a[1]),l.push("margin: "+("left"===a[1]?"0 15px 7px 0":"0 0 7px 15px")));var d,u=c.attachments.thumbnailUrl;return r>2&&(d=~~a[2]||0,d&&(d>s&&(d=s),l.push("width: "+d+"px"),u=c.attachments.url)),['<img src="'+u.replace(/987654321/,i)+'" class="redactorEmbeddedAttachment redactorDisableResize" data-attachment-id="'+i+'"'+(l.length?' style="'+l.join(";")+'"':"")+">",""]},_convertCode:function(e,t,n){var a=t.attributes,l="",c="auto",d=0;switch(a.length){case 1:r(a[0])?d=~~a[0]:o(a[0])?l=a[0]:s(a[0])&&(c=a[0]);break;case 2:r(a[0])?(d=~~a[0],s(a[1])?c=a[1]:o(a[1])&&(l=a[1])):(s(a[0])&&(c=a[0]),o(a[1])&&(l=a[1]));break;case 3:s(a[0])&&(c=a[0]),r(a[1])&&(d=~~a[1]),o(a[2])&&(l=a[2])}for(var u,h,p=!0,f=-1,m=n+1;m<t.pair;m++){if(h=e[m],""===h.trim()){if(p){e[m]="";continue}-1===f&&(f=m)}else p=!1,f=-1;u=h.split("\n");for(var g=0,v=u.length;v>g;g++)u[g]="<li>"+(u[g]?i.escapeHTML(u[g]):"​")+"</li>";e[m]=u.join("")}if(!p&&-1!==f)for(var m=t.pair-1;m>=f;m--)e[m]="";return['<div class="codeBox container" contenteditable="false" data-highlighter="'+c+'" data-filename="'+(l?i.escapeHTML(l):"")+'"><div><div><h3>'+__REDACTOR_CODE_HIGHLIGHTERS[c]+(l?": "+i.escapeHTML(l):"")+'</h3></div><ol start="'+(d>1?d:1)+'">',"</ol></div></div>"]},_convertColor:function(e,t,n){return t.attributes.length&&t.attributes[0].match(/^[a-z0-9#]+$/i)?['<span style="color: '+i.escapeHTML(t.attributes[0])+'">',"</span>"]:[null,null]},_convertEmail:function(e,t,n){var a="";if(t.attributes.length)a=t.attributes[0];else{for(var r,o=n+1;o<t.pair;o++){if(r=e[o],"object"==typeof r){a="";break}a+=r}if(""===a.trim())return[null,null]}return['<a href="mailto:'+i.escapeHTML(a)+'">',"</a>"]},_convertImage:function(e,t,n){var a="none",r="",o=0;switch(t.attributes.length){case 0:if(!(n+1<t.pair&&"string"==typeof e[n+1]))return"";r=e[n+1],e[n+1]="";break;case 1:r=t.attributes[0];break;case 2:r=t.attributes[0],a=t.attributes[1];break;case 3:r=t.attributes[0],a=t.attributes[1],o=~~t.attributes[2]}"left"!==a&&"right"!==a&&(a="none");var s=[];return o>0&&s.push("width: "+o+"px"),"none"!==a&&(s.push("float: "+a),s.push("margin: "+("left"===a?"0 15px 7px 0":"0 0 7px 15px"))),['<img src="'+i.escapeHTML(r)+'"'+(s.length?' style="'+s.join(";")+'"':"")+">",""]},_convertList:function(e,t,n){for(var i=t.attributes.length?t.attributes[0]:"",a=n+1;a<t.pair;a++)"string"==typeof e[a]&&(e[a]=e[a].replace(/\[\*\]/g,"<li>"));return"1"==i||"decimal"===i?["<ol>","</ol>"]:i.length&&i.match(/^(?:none|circle|square|disc|decimal|lower-roman|upper-roman|decimal-leading-zero|lower-greek|lower-latin|upper-latin|armenian|georgian)$/)?['<ul style="list-style-type: '+i+'">',"</ul>"]:["<ul>","</ul>"]},_convertQuote:function(e,t,a){var r="",o="";t.attributes.length>1?(r=t.attributes[0],o=t.attributes[1]):1===t.attributes.length&&(r=t.attributes[0]);for(var s=t.pair-1;s>a;s--)if("string"==typeof e[s]){e[s]=e[s].replace(/\n$/,"");break}var l="";return r?(o&&(l='<a href="'+i.escapeHTML(o)+'" tabindex="-1">'),l+=n.get("wcf.bbcode.quote.title.javascript",{quoteAuthor:r.replace(/\\'/g,"'")}),o&&(l+="</a>")):l="<small>"+n.get("wcf.bbcode.quote.title.clickToSet")+"</small>",['<blockquote class="quoteBox container containerPadding quoteBoxSimple" cite="'+i.escapeHTML(o)+'" data-author="'+i.escapeHTML(r)+'"><header contenteditable="false"><h3>'+l+'</h3><a class="redactorQuoteEdit"></a></header><div>​',"</div></blockquote>"]},_convertSmilies:function(e){for(var t,n,a,r=0,o=e.length;o>r;r++)if(n=e[r],"string"==typeof n){for(var s in __REDACTOR_SMILIES)objOwns(__REDACTOR_SMILIES,s)&&(t=s.replace(/</g,"&lt;").replace(/>/g,"&gt;"),a=new RegExp("(\\s|^)"+i.escapeRegExp(s)+"(?=\\s|$)","gi"),n=n.replace(a,'$1<img src="'+__REDACTOR_SMILIES[s]+'" class="smiley" alt="'+t+'">'));e[r]=n}else-1!==__REDACTOR_SOURCE_BBCODES.indexOf(n.name)&&(r=n.pair)},_convertSize:function(e,t,n){return t.attributes.length&&0!==~~t.attributes[0]?['<span style="font-size: '+~~t.attributes[0]+'pt">',"</span>"]:[null,null]},_convertUrl:function(e,t,n){return t.attributes.length?['<a href="'+i.escapeHTML(t.attributes[0])+'">',"</a>"]:[null,null]}};return h}),define("WoltLab/WCF/Controller/Clipboard",["Ajax","Core","Dictionary","EventHandler","Language","List","ObjectMap","Dom/ChangeListener","Dom/Traverse","Dom/Util","Ui/Confirmation","Ui/SimpleDropdown","WoltLab/WCF/Ui/Page/Action"],function(e,t,n,i,a,r,o,s,l,c,d,u,h){"use strict";var p=new n,f=new n,m=new n,g=elByClass("jsClipboardContainer"),v=new o,b=new r,_={},y=null,C=null,w=null;return{setup:function(e){if(y=this._mark.bind(this),C=this._executeAction.bind(this),w=this._unmarkAll.bind(this),_=t.extend({hasMarkedItems:!1,pageClassName:"",pageObjectId:0},e),!_.pageClassName)throw new Error("Expected a non-empty string for parameter 'pageClassName'.");this._initContainers(),_.hasMarkedItems&&g.length&&this._loadMarkedItems(),s.add("WoltLab/WCF/Controller/Clipboard",this._initContainers.bind(this))},reload:function(){p.size&&this._loadMarkedItems()},_initContainers:function(){for(var e=0,t=g.length;t>e;e++){var n=g[e],i=c.identify(n),a=p.get(i);if(void 0===a){var o=elBySel(".jsClipboardMarkAll",n);null!==o&&(elData(o,"container-id",i),o.addEventListener(WCF_CLICK_EVENT,this._markAll.bind(this))),a={checkboxes:elByClass("jsClipboardItem",n),element:n,markAll:o,markedObjectIds:new r},p.set(i,a)}for(var s=0,l=a.checkboxes.length;l>s;s++){var d=a.checkboxes[s];b.has(d)||(elData(d,"container-id",i),d.addEventListener(WCF_CLICK_EVENT,y),b.add(d))}}},_loadMarkedItems:function(){e.api(this,{actionName:"getMarkedItems",parameters:{pageClassName:_.pageClassName,pageObjectID:_.pageObjectId}})},_markAll:function(e){for(var t=e.currentTarget,n="INPUT"!==t.nodeName||t.checked,i=[],a=elData(t,"container-id"),r=p.get(a),o=elData(r.element,"type"),s=0,c=r.checkboxes.length;c>s;s++){var d=r.checkboxes[s],u=~~elData(d,"object-id");n?d.checked||(d.checked=!0,r.markedObjectIds.add(u),i.push(u)):d.checked&&(d.checked=!1,r.markedObjectIds["delete"](u),i.push(u));var h=l.parentByClass(t,"jsClipboardObject");null!==h&&h.classList[n?"addClass":"removeClass"]("jsMarked")}this._saveState(o,i,n)},_mark:function(e){var t=e.currentTarget,n=~~elData(t,"object-id"),i=t.checked,a=elData(t,"container-id"),r=p.get(a),o=elData(r.element,"type"),s=l.parentByClass(t,"jsClipboardObject");if(r.markedObjectIds[i?"add":"delete"](n),s.classList[i?"add":"remove"]("jsMarked"),null!==r.markAll){for(var c=!0,d=0,u=r.checkboxes.length;u>d;d++)if(!r.checkboxes[d].checked){c=!1;break}r.markAll.checked=c}this._saveState(o,[n],i)},_saveState:function(t,n,i){e.api(this,{actionName:i?"mark":"unmark",parameters:{pageClassName:_.pageClassName,pageObjectID:_.pageObjectId,objectIDs:n,objectType:t}})},_executeAction:function(e){var t=e.currentTarget,n=v.get(t);if(n.url)return void(window.location.href=n.url);var a=function(){var e=elData(t,"type");i.fire("com.woltlab.wcf.clipboard",e,{data:n,listItem:t,responseData:null})},r="string"==typeof n.internalData.confirmMessage?n.internalData.confirmMessage:"",o=!0;if("object"==typeof n.parameters&&n.parameters.actionName&&n.parameters.className){if("unmarkAll"===n.parameters.actionName||Array.isArray(n.parameters.objectIDs))if(r.length){var s="string"==typeof n.internalData.template?n.internalData.template:"";d.show({confirm:function(){var e={};if(s.length)for(var i=elBySelAll("input, select, textarea",d.getContentElement()),a=0,r=i.length;r>a;a++){var o=i[a],l=elAttr(o,"name");switch(o.nodeName){case"INPUT":o.checked&&(e[l]=elAttr(o,"value"));break;case"SELECT":e[l]=o.value;break;case"TEXTAREA":e[l]=o.value.trim()}}this._executeProxyAction(t,n,e)}.bind(this),message:r,template:s})}else this._executeProxyAction(t,n)}else r.length&&(o=!1,d.show({confirm:a,message:r}));o&&a()},_executeProxyAction:function(t,n,a){a=a||{};var r="unmarkAll"!==n.parameters.actionName?n.parameters.objectIDs:[],o={data:a};if("object"==typeof n.internalData.parameters)for(var s in n.internalData.parameters)objOwns(n.internalData.parameters,s)&&(o[s]=n.internalData.parameters[s]);e.api(this,{actionName:n.parameters.actionName,className:n.parameters.className,objectIDs:r,parameters:o},function(e){if("unmarkAll"!==n.actionName){var a=elData(t,"type");i.fire("com.woltlab.wcf.clipboard",a,{data:n,listItem:t,responseData:e})}this._loadMarkedItems()}.bind(this))},_unmarkAll:function(t){var n=elData(t.currentTarget,"type");e.api(this,{actionName:"unmarkAll",parameters:{objectType:n}})},_ajaxSetup:function(){return{data:{className:"wcf\\data\\clipboard\\item\\ClipboardItemAction"}}},_ajaxSuccess:function(e){if("unmarkAll"===e.actionName)return void p.forEach(function(t){if(elData(t.element,"type")===e.returnValues.objectType){for(var n=elByClass("jsMarked",t.element);n.length;)n[0].classList.remove("jsMarked");null!==t.markAll&&(t.markAll.checked=!1);for(var i=0,a=t.checkboxes.length;a>i;i++)t.checkboxes[i].checked=!1;h.remove("wcfClipboard-"+e.returnValues.objectType)}}.bind(this));v=new o,p.forEach(function(t){var n=elData(t.element,"type"),i=e.returnValues.markedItems&&objOwns(e.returnValues.markedItems,n)?e.returnValues.markedItems[n]:[];this._rebuildMarkings(t,i)}.bind(this));var t,n=[];if(e.returnValues&&e.returnValues.items)for(t in e.returnValues.items)objOwns(e.returnValues.items,t)&&n.push(t);if(f.forEach(function(e,t){-1===n.indexOf(t)&&(h.remove("wcfClipboard-"+t),m.get(t).innerHTML="")}),e.returnValues&&e.returnValues.items){var i,r,s,l,c,d,g,b,_,y;for(t in e.returnValues.items)if(objOwns(e.returnValues.items,t)){l=e.returnValues.items[t],i=!1,s=f.get(t),r=m.get(t),void 0===s?(i=!0,s=elCreate("a"),s.className="dropdownToggle",s.textContent=l.label,f.set(t,s),r=elCreate("ol"),r.className="dropdownMenu",m.set(t,r)):(s.textContent=l.label,r.innerHTML="");for(b in l.items)objOwns(l.items,b)&&(g=l.items[b],d=elCreate("li"),_=elCreate("span"),_.textContent=g.label,d.appendChild(_),r.appendChild(d),elData(d,"type",t),d.addEventListener(WCF_CLICK_EVENT,C),v.set(d,g));c=elCreate("li"),c.classList.add("dropdownDivider"),r.appendChild(c),y=elCreate("li"),elData(y,"type",t),_=elCreate("span"),_.textContent=a.get("wcf.clipboard.item.unmarkAll"),y.appendChild(_),y.addEventListener(WCF_CLICK_EVENT,w),r.appendChild(y),-1!==n.indexOf(t)&&h.add("wcfClipboard-"+t,s),i&&(s.parentNode.classList.add("dropdown"),s.parentNode.appendChild(r),u.init(s))}}},_rebuildMarkings:function(e,t){for(var n=!0,i=0,a=e.checkboxes.length;a>i;i++){var r=e.checkboxes[i],o=l.parentByClass(r,"jsClipboardObject"),s=-1!==t.indexOf(~~elData(r,"object-id"));s||(n=!1),r.checked=s,o.classList[s?"add":"remove"]("jsMarked")}null!==e.markAll&&(e.markAll.checked=n)}}}),define("WoltLab/WCF/Event/Key",[],function(){"use strict";function e(e,t,n){if(!(e instanceof Event))throw new TypeError("Expected a valid event when testing for key '"+t+"'.");return e.key===t||e.which===n}return{ArrowDown:function(t){return e(t,"ArrowDown",40)},ArrowLeft:function(t){return e(t,"ArrowLeft",37)},ArrowRight:function(t){return e(t,"ArrowRight",39)},ArrowUp:function(t){return e(t,"ArrowUp",38)},Enter:function(t){return e(t,"Enter",13)},Escape:function(t){return e(t,"Escape",27)}}}),define("WoltLab/WCF/File/Util",[],function(){var e={getIconClassByMimeType:function(e){if("image/"==e.substr(0,6))return"fa-file-image-o";if("video/"==e.substr(0,6))return"fa-file-video-o";if("audio/"==e.substr(0,6))return"fa-file-sound-o";if("text/"==e.substr(0,5))return"fa-file-text-o";switch(e){case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return"fa-file-word-o";case"application/pdf":return"fa-file-pdf-o";case"application/vnd.ms-powerpoint":case"application/vnd.openxmlformats-officedocument.presentationml.presentation":return"fa-file-powerpoint-o";case"application/vnd.ms-excel":case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return"fa-file-excel-o";case"application/zip":case"application/x-tar":case"application/x-gzip":return"fa-file-archive-o";case"application/xml":return"fa-file-text-o"}return"fa-file-o"}};return e}),define("WoltLab/WCF/Language/Chooser",["Dictionary","Language","Dom/Traverse","Dom/Util","ObjectMap","Ui/SimpleDropdown"],function(e,t,n,i,a,r){"use strict";var o=new e,s=!1,l=new a,c=null;return{init:function(e,t,n,i,a,r){if(!o.has(t)){var s=elById(e);if(null===s)throw new Error("Expected a valid container id, cannot find '"+t+"'.");var l=elById(t);null===l&&(l=elCreate("input"),elAttr(l,"type","hidden"),elAttr(l,"id",t),elAttr(l,"name",t),elAttr(l,"value",n),s.appendChild(l)),this._initElement(t,l,n,i,a,r)}},_setup:function(){s||(s=!0,c=this._submit.bind(this))},_initElement:function(e,i,a,s,d,u){var h;"DD"===i.parentNode.nodeName?(h=elCreate("div"),h.className="dropdown",i.parentNode.insertBefore(h,i)):(h=i.parentNode,h.classList.add("dropdown")),elHide(i);var p=elCreate("a");p.className="dropdownToggle boxFlag box24 inputPrefix"+("DD"===i.parentNode.nodeName?" button":""),h.appendChild(p);var f=elCreate("ul");f.className="dropdownMenu",h.appendChild(f);var m,g,v,b,_,y=function(t){var i=~~elData(t.currentTarget,"language-id"),a=n.childByClass(f,"active");null!==a&&a.classList.remove("active"),i&&t.currentTarget.classList.add("active"),this._select(e,i,t.currentTarget)}.bind(this);for(var C in s)if(objOwns(s,C)){var w=s[C];_=elCreate("li"),_.className="boxFlag",_.addEventListener(WCF_CLICK_EVENT,y),elData(_,"language-id",C),f.appendChild(_),m=elCreate("a"),m.className="box24",_.appendChild(m),g=elCreate("div"),m.appendChild(g),b=elCreate("img"),elAttr(b,"src",w.iconPath),elAttr(b,"alt",""),b.className="iconFlag",g.appendChild(b),g=elCreate("div"),m.appendChild(g),v=elCreate("h3"),v.textContent=w.languageName,g.appendChild(v),C==a&&(p.innerHTML=_.firstChild.innerHTML)}if(u)_=elCreate("li"),_.className="dropdownDivider",f.appendChild(_),_=elCreate("li"),elData(_,"language-id",C),_.addEventListener(WCF_CLICK_EVENT,y),f.appendChild(_),m=elCreate("a"),m.textContent=t.get("wcf.global.language.noSelection"),_.appendChild(m),0===a&&(p.innerHTML=_.firstChild.innerHTML),_.addEventListener(WCF_CLICK_EVENT,y);else if(0===a){p.innerHTML=null,g=elCreate("div"),p.appendChild(g);var L=elCreate("span");L.className="icon icon24 fa-question",g.appendChild(L),g=elCreate("div"),p.appendChild(g),v=elCreate("h3"),v.textContent=t.get("wcf.global.language.noSelection"),g.appendChild(v)}r.init(p),o.set(e,{callback:d,dropdownMenu:f,dropdownToggle:p,element:i});var E=n.parentByTag(i,"FORM");if(null!==E){E.addEventListener("submit",c);var x=l.get(E);void 0===x&&(x=[],l.set(E,x)),x.push(e)}},_select:function(e,t,n){var i=o.get(e);if(void 0===n){for(var a=i.dropdownMenu.childNodes,r=0,s=a.length;s>r;r++){var l=a[r];if(~~elData(l,"language-id")===t){n=l;break}}if(void 0===n)throw new Error("Cannot select unknown language id '"+t+"'")}i.element.value=t,i.dropdownToggle.innerHTML=n.firstChild.innerHTML,o.set(e,i),"function"==typeof i.callback&&i.callback(n)},_submit:function(e){for(var t,n=l.get(e.currentTarget),i=0,a=n.length;a>i;i++)t=elCreate("input"),t.type="hidden",t.name=n[i],t.value=this.getLanguageId(n[i]),e.currentTarget.appendChild(t)},getChooser:function(e){var t=o.get(e);if(void 0===t)throw new Error("Expected a valid language chooser input element, '"+e+"' is not i18n input field.");return t},getLanguageId:function(e){return~~this.getChooser(e).element.value},setLanguageId:function(e,t){if(void 0===o.get(e))throw new Error("Expected a valid  input element, '"+e+"' is not i18n input field.");this._select(e,t)}}}),define("WoltLab/WCF/Language/Input",["Core","Dictionary","Language","ObjectMap","StringUtil","Dom/Traverse","Dom/Util","Ui/SimpleDropdown"],function(e,t,n,i,a,r,o,s){"use strict";var l=new t,c=!1,d=new i,u=new t,h=null,p=null,f={init:function(e,n,i,r){if(!u.has(e)){var o=elById(e);if(null===o)throw new Error("Expected a valid element id, cannot find '"+e+"'.");this._setup();var s=new t;for(var l in n)objOwns(n,l)&&s.set(~~l,a.unescapeHTML(n[l]));u.set(e,s),this._initElement(e,o,s,i,r)}},_setup:function(){c||(c=!0,h=this._dropdownToggle.bind(this),p=this._submit.bind(this))},_initElement:function(e,t,i,a,c){var u=t.parentNode;u.classList.contains("inputAddon")||(u=elCreate("div"),u.className="inputAddon"+("TEXTAREA"===t.nodeName?" inputAddonTextarea":""),elData(u,"input-id",e),t.parentNode.insertBefore(u,t),u.appendChild(t)),u.classList.add("dropdown");var f=elCreate("span");f.className="button dropdownToggle inputPrefix";var m=elCreate("span");m.textContent=n.get("wcf.global.button.disabledI18n"),f.appendChild(m),u.insertBefore(f,t);var g=elCreate("ul");g.className="dropdownMenu",o.insertAfter(g,f);var v=function(t,n){var i=~~elData(t.currentTarget,"language-id"),a=r.childByClass(g,"active");null!==a&&a.classList.remove("active"),i&&t.currentTarget.classList.add("active"),this._select(e,i,n||!1)}.bind(this);for(var b in a)if(objOwns(a,b)){var _=elCreate("li");elData(_,"language-id",b),m=elCreate("span"),m.textContent=a[b],_.appendChild(m),_.addEventListener(WCF_CLICK_EVENT,v),g.appendChild(_)}if(c!==!0){var _=elCreate("li");_.className="dropdownDivider",g.appendChild(_),_=elCreate("li"),elData(_,"language-id",0),m=elCreate("span"),m.textContent=n.get("wcf.global.button.disabledI18n"),_.appendChild(m),_.addEventListener(WCF_CLICK_EVENT,v),g.appendChild(_)}var y=null;if(c===!0||i.size)for(var C=0,w=g.childElementCount;w>C;C++)if(~~elData(g.children[C],"language-id")===LANGUAGE_ID){y=g.children[C];break}s.init(f),s.registerCallback(u.id,h),l.set(e,{buttonLabel:f.children[0],element:t,languageId:0,isEnabled:!0,forceSelection:c});var L=r.parentByTag(t,"FORM");if(null!==L){L.addEventListener("submit",p);var E=d.get(L);void 0===E&&(E=[],d.set(L,E)),E.push(e)}null!==y&&v({currentTarget:y},!0)},_select:function(e,n,i){for(var a,r=l.get(e),o=s.getDropdownMenu(r.element.parentNode.id),c="",d=0,h=o.childElementCount;h>d;d++){a=o.children[d];var p=elData(a,"language-id");p.length&&n===~~p&&(c=a.children[0].textContent)}if(r.languageId!==n){var f=u.get(e);r.languageId&&f.set(r.languageId,r.element.value),0===n?u.set(e,new t):(r.buttonLabel.classList.contains("active")||i===!0)&&(r.element.value=f.has(n)?f.get(n):""),r.buttonLabel.textContent=c,r.buttonLabel.classList[n?"add":"remove"]("active"),r.languageId=n}r.element.blur(),r.element.focus()},_dropdownToggle:function(e,t){if("open"===t)for(var n,i,a=s.getDropdownMenu(e),r=elData(elById(e),"input-id"),o=u.get(r),l=0,c=a.childElementCount;c>l;l++)n=a.children[l],i=~~elData(n,"language-id"),i&&n.classList[o.has(i)||!o.size?"remove":"add"]("missingValue")},_submit:function(e){for(var t,n,i,a,r=d.get(e.currentTarget),o=0,s=r.length;s>o;o++)n=r[o],t=l.get(n),t.isEnabled&&(a=u.get(n),t.languageId&&a.set(t.languageId,t.element.value),a.size&&(a.forEach(function(t,a){i=elCreate("input"),i.type="hidden",i.name=n+"_i18n["+a+"]",i.value=t,e.currentTarget.appendChild(i)}),t.element.removeAttribute("name")))},getValues:function(e){var t=l.get(e);if(void 0===t)throw new Error("Expected a valid i18n input element, '"+e+"' is not i18n input field.");var n=u.get(e);return n.set(t.languageId,t.element.value),n},setValues:function(n,i){var a=l.get(n);if(void 0===a)throw new Error("Expected a valid i18n input element, '"+n+"' is not i18n input field.");e.isPlainObject(i)&&(i=t.fromObject(i)),a.element.value="",i.has(0)&&(a.element.value=i.get(0),i["delete"](0)),u.set(n,i),a.languageId=0,this._select(n,LANGUAGE_ID,!0)},disable:function(e){var t=l.get(e);if(void 0===t)throw new Error("Expected a valid i18n input element, '"+e+"' is not i18n input field.");if(t.isEnabled){t.isEnabled=!1,elHide(t.buttonLabel.parentNode);var n=t.buttonLabel.parentNode.parentNode;n.classList.remove("inputAddon"),n.classList.remove("dropdown")}},enable:function(e){var t=l.get(e);if(void 0===t)throw new Error("Expected a valid i18n input element, '"+e+"' is not i18n input field.");if(!t.isEnabled){t.isEnabled=!0,elShow(t.buttonLabel.parentNode);var n=t.buttonLabel.parentNode.parentNode;n.classList.add("inputAddon"),n.classList.add("dropdown")}},isEnabled:function(e){var t=l.get(e);if(void 0===t)throw new Error("Expected a valid i18n input element, '"+e+"' is not i18n input field.");return t.isEnabled},validate:function(e,t){var n=l.get(e);if(void 0===n)throw new Error("Expected a valid i18n input element, '"+e+"' is not i18n input field.");if(!n.isEnabled)return!0;var i=u.get(e),a=s.getDropdownMenu(n.element.parentNode.id);n.languageId&&i.set(n.languageId,n.element.value);for(var r,o,c=!1,d=!1,h=0,p=a.childElementCount;p>h;h++)if(r=a.children[h],o=~~elData(r,"language-id"))if(i.has(o)&&0!==i.get(o).length){if(c)return!1;d=!0}else{if(d)return!1;c=!0}return c&&!t?!1:!0}};return f}),define("WoltLab/WCF/Ui/Notification",["Language"],function(e){"use strict";var t=!1,n=null,i=null,a=null,r=null,o=null,s={show:function(s,l,c){t||(this._init(),n="function"==typeof l?l:null,i.className=c||"success",i.textContent=e.get(s||"wcf.global.success"),t=!0,a.classList.add("active"),r=setTimeout(o,2e3))},_init:function(){null===a&&(o=this._hide.bind(this),a=elCreate("div"),a.id="systemNotification",i=elCreate("p"),i.addEventListener(WCF_CLICK_EVENT,o),a.appendChild(i),document.body.appendChild(a))},_hide:function(){clearTimeout(r),a.classList.remove("active"),
 null!==n&&n(),t=!1}};return s}),define("WoltLab/WCF/Media/Editor",["Ajax","Core","Dictionary","Dom/ChangeListener","Dom/Traverse","Language","Ui/Dialog","Ui/Notification","WoltLab/WCF/Language/Chooser","WoltLab/WCF/Language/Input","WoltLab/WCF/File/Util"],function(e,t,n,i,a,r,o,s,l,c,d){"use strict";function u(e){if("object"!=typeof e)throw new TypeError("Parameter 'callbackObject' has to be an object, "+typeof e+" given.");if("function"!=typeof e._editorClose)throw new TypeError("Callback object has no function '_editorClose'.");if("function"!=typeof e._editorSuccess)throw new TypeError("Callback object has no function '_editorSuccess'.");this._callbackObject=e,this._media=null,this._elements={}}return u.prototype={_ajaxSetup:function(){return{data:{actionName:"update",className:"wcf\\data\\media\\MediaAction"}}},_ajaxSuccess:function(e){s.show(),this._callbackObject._editorSuccess(this._media),o.close("mediaEditor"),this._media=null},_close:function(){this._media=null,this._callbackObject._editorClose()},_dialogSetup:function(){return{id:"mediaEditor",options:{backdropCloseOnClick:!1,onClose:this._close.bind(this),title:r.get("wcf.media.edit")},source:{after:function(e,t){var n=o.getDialog("mediaEditor").content;this._elements.thumbnail=elById("mediaThumbnail"),this._elements.filename=elById("mediaFilename"),this._elements.filesize=elById("mediaFilesize"),this._elements.imageDimensions=elById("mediaImageDimensions"),this._elements.fileIcon=elById("mediaFileIcon"),this._elements.uploader=elById("mediaUploader"),this._elements.altText=elById("altText"),this._elements.caption=elById("caption"),this._elements.isMultilingual=elById("isMultilingual"),this._elements.isMultilingual.addEventListener("change",this._updateLanguageFields.bind(this)),this._elements.title=elById("title"),this._elements.languageIdContainer=elById("languageIDContainer");var i=this._keyPress.bind(this);this._elements.altText.addEventListener("keypress",i),this._elements.title.addEventListener("keypress",i),setTimeout(this._setData.bind(this),100),elBySel('button[data-type="submit"]',n).addEventListener(WCF_CLICK_EVENT,this._saveData.bind(this))}.bind(this),data:{actionName:"getEditorDialog",className:"wcf\\data\\media\\MediaAction"}}}},_keyPress:function(e){13===e.charCode&&(e.preventDefault(),this._saveData())},_saveData:function(){var t=!1,n=a.childByClass(this._elements.altText.parentNode.parentNode,"innerError"),i=a.childByClass(this._elements.caption.parentNode.parentNode,"innerError"),o=a.childByClass(this._elements.title.parentNode.parentNode,"innerError");if(this._media.isMultilingual=~~this._elements.isMultilingual.checked,this._media.languageID=this._media.isMultilingual?null:l.getLanguageId("languageID"),this._media.altText={},this._media.caption={},this._media.title={},this._media.isMultilingual){if(!c.validate("altText",!0)&&(t=!0,!n)){var s=elCreate("small");s.className="innerError",s.textContent=r.get("wcf.global.form.error.multilingual"),this._elements.altText.parentNode.parentNode.appendChild(s)}if(!c.validate("caption",!0)&&(t=!0,!i)){var s=elCreate("small");s.className="innerError",s.textContent=r.get("wcf.global.form.error.multilingual"),this._elements.caption.parentNode.parentNode.appendChild(s)}if(!c.validate("title",!0)&&(t=!0,!o)){var s=elCreate("small");s.className="innerError",s.textContent=r.get("wcf.global.form.error.multilingual"),this._elements.title.parentNode.parentNode.appendChild(s)}this._media.altText=c.getValues("altText").toObject(),this._media.caption=c.getValues("caption").toObject(),this._media.title=c.getValues("title").toObject()}else this._media.altText[this._media.languageID]=this._elements.altText.value,this._media.caption[this._media.languageID]=this._elements.caption.value,this._media.title[this._media.languageID]=this._elements.title.value;t||(n&&elRemove(n),i&&elRemove(i),o&&elRemove(o),e.api(this,{actionName:"update",objectIDs:[this._media.mediaID],parameters:{altText:this._media.altText,caption:this._media.caption,data:{isMultilingual:this._media.isMultilingual,languageID:this._media.languageID},title:this._media.title}}))},_setData:function(){if(this._elements.thumbnail.innerHTML="",this._elements.filename.textContent=this._media.filename,this._elements.filesize.textContent=this._media.formattedFilesize,this._elements.uploader.innerHTML="",this._media.userLink){var e=elCreate("a");e.className="userLink",elAttr(e,"href",this._media.userLink),elData(e,"user-id",this._media.userID),e.textContent=this._media.username,this._elements.uploader.appendChild(e)}else this._elements.uploader.textContent=this._media.username;if(this._media.isImage){if(this._media.smallThumbnailLink){var t=elCreate("img");elAttr(t,"src",this._media.smallThumbnailLink),elAttr(t,"alt",""),this._elements.thumbnail.appendChild(t)}this._elements.imageDimensions.textContent=r.get("wcf.media.imageDimensions.value",{height:this._media.height,width:this._media.width}),elShow(this._elements.imageDimensions),elShow(this._elements.imageDimensions.previousElementSibling),this._elements.fileIcon.className="icon icon48 fa-file-image-o"}else elHide(this._elements.imageDimensions),elHide(this._elements.imageDimensions.previousElementSibling),this._elements.fileIcon.className="icon icon48 "+d.getIconClassByMimeType(this._media.fileType);this._elements.isMultilingual.checked=this._media.isMultilingual,l.setLanguageId("languageID",this._media.languageID||LANGUAGE_ID),this._media.isMultilingual?(c.setValues("altText",n.fromObject(this._media.altText||{})),c.setValues("caption",n.fromObject(this._media.caption||{})),c.setValues("title",n.fromObject(this._media.title||{}))):(this._elements.altText.value=this._media.altText?this._media.altText[this._media.languageID]:"",this._elements.caption.value=this._media.caption?this._media.caption[this._media.languageID]:"",this._elements.title.value=this._media.title?this._media.title[this._media.languageID]:""),this._updateLanguageFields(),i.trigger()},_updateLanguageFields:function(){this._elements.isMultilingual.checked?(c.enable("title"),c.enable("caption"),c.enable("altText"),elHide(this._elements.languageIdContainer.parentNode)):(c.disable("title"),c.disable("caption"),c.disable("altText"),elShow(this._elements.languageIdContainer.parentNode))},edit:function(e){if(null!==this._media)throw new Error("Cannot edit media with id '"+e.mediaID+"' while editing media with id '"+this._media.mediaID+"'");this._media=e,void 0!==o.getDialog("mediaEditor")&&this._setData(),o.open(this)}},u}),define("WoltLab/WCF/Media/Search",["Ajax","Dom/Traverse","Dom/Util","Language","Ui/SimpleDropdown"],function(e,t,n,i,a){"use strict";function r(e){this._fileType="all";var n=a.getDropdownMenu(this._getIdPrefix()+"Search");if(n){this._fileTypes=t.childrenBySel(n,"li:not(.dropdownDivider)");for(var i=this._selectFileType.bind(this),r=0,o=this._fileTypes.length;o>r;r++){var s=this._fileTypes[r];e&&elData(s,"file-type")==e&&(this._fileType=e),this._fileTypes[r].addEventListener(WCF_CLICK_EVENT,i)}e&&e.length&&this._updateDropdownButtonLabel(),a.registerCallback(this._getIdPrefix()+"Search",this._updateFileTypeDropdown.bind(this));var l=t.parentByTag(elById(this._getIdPrefix()+"Search"),"FORM");l&&l.addEventListener("submit",function(){var e=elCreate("input");elAttr(e,"type","hidden"),elAttr(e,"name","fileType"),elAttr(e,"value",this._fileType),l.appendChild(e)}.bind(this))}else this._fileType=null}return r.prototype={_getIdPrefix:function(){return"media"},_selectFileType:function(e){this._fileType=elData(e.currentTarget,"file-type"),this._updateDropdownButtonLabel(e)},_updateDropdownButtonLabel:function(e){var n=a.getDropdown(this._getIdPrefix()+"Search"),r=t.childBySel(t.childByClass(n,"dropdownToggle"),"SPAN");if("all"!==this._fileType){var o;if(e)o=e.currentTarget;else for(var s=0,l=this._fileTypes.length;l>s;s++){var c=this._fileTypes[s];if(elData(c,"file-type")==this._fileType){o=c;break}}r.textContent=t.childBySel(o,"SPAN").textContent}else r.textContent=i.get("wcf.media.search.filetype")},_updateFileTypeDropdown:function(){for(var e=0,t=this._fileTypes.length;t>e;e++){var n=this._fileTypes[e];n.classList[elData(n,"file-type")===this._fileType?"add":"remove"]("active")}}},r}),define("WoltLab/WCF/Media/Upload",["Core","Dom/ChangeListener","Dom/Traverse","Dom/Util","EventHandler","Language","Permission","Upload","WoltLab/WCF/File/Util"],function(e,t,n,i,a,r,o,s,l){"use strict";function c(t,n,i){i=i||{},this._mediaManager=null,i.mediaManager&&(this._mediaManager=i.mediaManager,delete i.mediaManager),s.call(this,t,n,e.extend({className:"wcf\\data\\media\\MediaAction",multiple:this._mediaManager?!0:!1,singleFileRequests:!0},i))}return e.inherit(c,s,{_createFileElement:function(e){var n;n="OL"===this._target.nodeName||"UL"===this._target.nodeName?elCreate("li"):elCreate("p");var a=elCreate("div");a.className="mediaThumbnail",n.appendChild(a);var r=elCreate("span");r.className="icon icon144 fa-spinner",a.appendChild(r);var o=elCreate("div");o.className="mediaInformation",n.appendChild(o);var s=elCreate("p");s.className="mediaTitle",s.textContent=e.name,o.appendChild(s);var l=elCreate("progress");return elAttr(l,"max",100),o.appendChild(l),i.prepend(n,this._target),t.trigger(),n},_getParameters:function(){return this._mediaManager?e.extend(c._super.prototype._getParameters.call(this),{fileTypeFilters:this._mediaManager.getOption("fileTypeFilters")}):c._super.prototype._getParameters.call(this)},_success:function(e,i){for(var o=this._fileElements[e],s=0,c=o.length;c>s;s++){var d=o[s],u=elData(d,"internal-file-id"),h=i.returnValues.media[u];if(elRemove(n.childByTag(n.childByClass(d,"mediaInformation"),"PROGRESS")),h){var p=n.childByTag(n.childByClass(d,"mediaThumbnail"),"SPAN");if(h.tinyThumbnailType){var f=p.parentNode;elRemove(p);var m=elCreate("img");elAttr(m,"src",h.tinyThumbnailLink),elAttr(m,"alt",""),m.style.setProperty("width","144px"),m.style.setProperty("height","144px"),f.appendChild(m)}else p.classList.remove("fa-spinner"),p.classList.add(l.getIconClassByMimeType(h.fileType));d.className="jsClipboardObject",elData(d,"object-id",h.mediaID),this._mediaManager&&(this._mediaManager.setupMediaElement(h,d),this._mediaManager.resetMedia(),this._mediaManager.addMedia(h,d))}else{var g=i.returnValues.errors[u];g||(g={errorType:"uploadFailed",filename:elData(d,"filename")});var p=n.childByTag(n.childByClass(d,"mediaThumbnail"),"SPAN");p.classList.remove("fa-spinner"),p.classList.add("fa-remove"),p.classList.add("pointer"),d.classList.add("uploadFailed"),d.addEventListener(WCF_CLICK_EVENT,function(){elRemove(this)});var v=n.childByClass(n.childByClass(d,"mediaInformation"),"mediaTitle");v.innerText=r.get("wcf.media.upload.error."+g.errorType,{filename:g.filename})}t.trigger()}a.fire("com.woltlab.wcf.media.upload","success",{files:o,media:i.returnValues.media,upload:this})}}),c}),define("WoltLab/WCF/Ui/Suggestion",["Ajax","Core","Ui/SimpleDropdown"],function(e,t,n){"use strict";function i(e,t){this.init(e,t)}return i.prototype={init:function(e,n){if(this._dropdownMenu=null,this._value="",this._element=elById(e),null===this._element)throw new Error("Expected a valid element id.");if(this._options=t.extend({ajax:{actionName:"getSearchResultList",className:"",interfaceName:"wcf\\data\\ISearchAction",parameters:{data:{}}},callbackSelect:null,excludedSearchValues:[],treshold:3},n),"function"!=typeof this._options.callbackSelect)throw new Error("Expected a valid callback for option 'callbackSelect'.");this._element.addEventListener(WCF_CLICK_EVENT,function(e){e.stopPropagation()}),this._element.addEventListener("keydown",this._keyDown.bind(this)),this._element.addEventListener("keyup",this._keyUp.bind(this))},addExcludedValue:function(e){-1===this._options.excludedSearchValues.indexOf(e)&&this._options.excludedSearchValues.push(e)},removeExcludedValue:function(e){var t=this._options.excludedSearchValues.indexOf(e);-1!==t&&this._options.excludedSearchValues.splice(t,1)},_keyDown:function(e){if(null===this._dropdownMenu||!n.isOpen(this._element.id))return!0;if(13!==e.keyCode&&27!==e.keyCode&&38!==e.keyCode&&40!==e.keyCode)return!0;for(var t,i=0,a=this._dropdownMenu.childElementCount;a>i&&(t=this._dropdownMenu.children[i],!t.classList.contains("active"));)i++;if(13===e.keyCode)n.close(this._element.id),this._select(t);else if(27===e.keyCode){if(!n.isOpen(this._element.id))return!0;n.close(this._element.id)}else{var r=0;38===e.keyCode?r=(0===i?a:i)-1:40===e.keyCode&&(r=i+1,r===a&&(r=0)),r!==i&&(t.classList.remove("active"),this._dropdownMenu.children[r].classList.add("active"))}return e.preventDefault(),!1},_select:function(e){var t=e instanceof Event;t&&(e=e.currentTarget.parentNode),this._options.callbackSelect(this._element.id,{objectId:elData(e.children[0],"object-id"),value:e.textContent}),t&&this._element.focus()},_keyUp:function(t){var i=t.currentTarget.value.trim();if(this._value!==i){if(i.length<this._options.treshold)return null!==this._dropdownMenu&&n.close(this._element.id),void(this._value=i);this._value=i,e.api(this,{parameters:{data:{excludedSearchValues:this._options.excludedSearchValues,searchString:i}}})}},_ajaxSetup:function(){return{data:this._options.ajax}},_ajaxSuccess:function(e){if(null===this._dropdownMenu?(this._dropdownMenu=elCreate("div"),this._dropdownMenu.className="dropdownMenu",n.initFragment(this._element,this._dropdownMenu)):this._dropdownMenu.innerHTML="",e.returnValues.length){for(var t,i,a,r=0,o=e.returnValues.length;o>r;r++)i=e.returnValues[r],t=elCreate("a"),t.textContent=i.label,elData(t,"object-id",i.objectID),t.addEventListener(WCF_CLICK_EVENT,this._select.bind(this)),a=elCreate("li"),0===r&&(a.className="active"),a.appendChild(t),this._dropdownMenu.appendChild(a);n.open(this._element.id)}else n.close(this._element.id)}},i}),define("WoltLab/WCF/Ui/ItemList",["Core","Dictionary","Language","Dom/Traverse","WoltLab/WCF/Ui/Suggestion"],function(e,t,n,i,a){"use strict";var r="",o=new t,s=!1,l=null,c=null,d=null,u=null,h={init:function(t,n,r){var s=elById(t);if(null===s)throw new Error("Expected a valid element id.");r=e.extend({ajax:{actionName:"getSearchResultList",className:"",data:{}},excludedSearchValues:[],maxItems:-1,maxLength:-1,restricted:!1,isCSV:!1,callbackChange:null,callbackSubmit:null,submitFieldName:""},r);var l=i.parentByTag(s,"FORM");if(null!==l&&r.isCSV===!1){if(!r.submitFieldName.length&&"function"!=typeof r.callbackSubmit)throw new Error("Expected a valid function for option 'callbackSubmit', a non-empty value for option 'submitFieldName' or enabling the option 'submitFieldCSV'.");l.addEventListener("submit",function(){var e=this.getValues(t);if(r.submitFieldName.length)for(var n,i=0,a=e.length;a>i;i++)n=elCreate("input"),n.type="hidden",n.name=r.submitFieldName.replace(/{$objectId}/,e[i].objectId),n.value=e[i].value,l.appendChild(n);else r.callbackSubmit(l,e)}.bind(this))}this._setup();var c=this._createUI(s,r,n),d=new a(t,{ajax:r.ajax,callbackSelect:this._addItem.bind(this),excludedSearchValues:r.excludedSearchValues});if(o.set(t,{dropdownMenu:null,element:c.element,list:c.list,listItem:c.element.parentNode,options:r,shadow:c.shadow,suggestion:d}),n=c.values.length?c.values:n,Array.isArray(n))for(var u,h=0,p=n.length;p>h;h++)u=n[h],"string"==typeof u&&(u={objectId:0,value:u}),this._addItem(t,u)},getValues:function(e){if(!o.has(e))throw new Error("Element id '"+e+"' is unknown.");for(var t,n,a=o.get(e),r=i.childrenByClass(a.list,"item"),s=[],l=0,c=r.length;c>l;l++)n=r[l],t={objectId:elData(n,"object-id"),value:i.childByTag(n,"SPAN").textContent},s.push(t);return s},setValues:function(e,t){if(!o.has(e))throw new Error("Element id '"+e+"' is unknown.");for(var n=o.get(e),a=i.childrenByClass(n.list,"item"),r=0,s=a.length;s>r;r++)this._removeItem(null,a[r],!0);for(var r=0,s=t.length;s>r;r++)this._addItem(e,t[r])},_setup:function(){s||(s=!0,l=this._keyDown.bind(this),c=this._keyPress.bind(this),d=this._keyUp.bind(this),u=this._removeItem.bind(this))},_createUI:function(e,t){var n=elCreate("ol");n.className="inputItemList",elData(n,"element-id",e.id),n.addEventListener(WCF_CLICK_EVENT,function(t){t.target===n&&e.focus()});var i=elCreate("li");i.className="input",n.appendChild(i),e.addEventListener("keydown",l),e.addEventListener("keypress",c),e.addEventListener("keyup",d),e.parentNode.insertBefore(n,e),i.appendChild(e),-1!==t.maxLength&&elAttr(e,"maxLength",t.maxLength);var a=null,r=[];if(t.isCSV&&(a=elCreate("input"),a.className="itemListInputShadow",a.type="hidden",a.name=e.name,e.removeAttribute("name"),n.parentNode.insertBefore(a,n),"TEXTAREA"===e.nodeName)){for(var o,s=e.value.split(","),u=0,h=s.length;h>u;u++)o=s[u].trim(),o.length&&r.push(o);var p=elCreate("input");e.parentNode.insertBefore(p,e),p.id=e.id,elRemove(e),e=p}return{element:e,list:n,shadow:a,values:r}},_handleLimit:function(e){var t=o.get(e);-1!==t.options.maxItems&&(t.list.childElementCount-1<t.options.maxItems?t.element.disabled&&(t.element.disabled=!1,t.element.removeAttribute("placeholder")):t.element.disabled||(t.element.disabled=!0,elAttr(t.element,"placeholder",n.get("wcf.global.form.input.maxItems"))))},_keyDown:function(e){var t=e.currentTarget,n=t.parentNode.previousElementSibling;r=t.id,8===e.keyCode?0===t.value.length&&null!==n&&(n.classList.contains("active")?this._removeItem(null,n):n.classList.add("active")):27===e.keyCode&&null!==n&&n.classList.contains("active")&&n.classList.remove("active")},_keyPress:function(e){if(13===e.charCode||44===e.charCode){if(e.preventDefault(),o.get(e.currentTarget.id).options.restricted)return;var t=e.currentTarget.value.trim();t.length&&this._addItem(e.currentTarget.id,{objectId:0,value:t})}},_keyUp:function(e){var t=e.currentTarget;if(t.value.length>0){var n=t.parentNode.previousElementSibling;null!==n&&n.classList.remove("active")}},_addItem:function(e,t){var n=o.get(e),i=elCreate("li");i.className="item";var a=elCreate("span");a.className="content",elData(a,"object-id",t.objectId),a.textContent=t.value;var r=elCreate("a");r.className="icon icon16 fa-times",r.addEventListener(WCF_CLICK_EVENT,u),i.appendChild(a),i.appendChild(r),n.list.insertBefore(i,n.listItem),n.suggestion.addExcludedValue(t.value),n.element.value="",this._handleLimit(e);var s=this._syncShadow(n);"function"==typeof n.options.callbackChange&&(null===s&&(s=this.getValues(e)),n.options.callbackChange(e,s))},_removeItem:function(e,t,n){t=null===e?t:e.currentTarget.parentNode;var i=t.parentNode,a=elData(i,"element-id"),r=o.get(a);r.suggestion.removeExcludedValue(t.children[0].textContent),i.removeChild(t),n||r.element.focus(),this._handleLimit(a);var s=this._syncShadow(r);"function"==typeof r.options.callbackChange&&(null===s&&(s=this.getValues(a)),r.options.callbackChange(a,s))},_syncShadow:function(e){if(!e.options.isCSV)return null;for(var t="",n=this.getValues(e.element.id),i=0,a=n.length;a>i;i++)t+=(t.length?",":"")+n[i].value;return e.shadow.value=t,n}};return h}),define("WoltLab/WCF/Ui/Page/JumpTo",["Language","ObjectMap","Ui/Dialog"],function(e,t,n){"use strict";var i=null,a=null,r=null,o=new t,s=null,l={init:function(e,t){if(t=t||null,null===t){var n=elData(e,"link");t=n?function(e){window.location=n.replace(/pageNo=%d/,"pageNo="+e)}:function(){}}else if("function"!=typeof t)throw new TypeError("Expected a valid function for parameter 'callback'.");if(!o.has(e)){var i=elBySel(".jumpTo",e);null!==i&&(i.addEventListener(WCF_CLICK_EVENT,this._click.bind(this,e)),o.set(e,{callback:t}))}},_click:function(t,a){i=t,"object"==typeof a&&a.preventDefault(),n.open(this);var o=elData(t,"pages");s.value=o,s.setAttribute("max",o),r.textContent=e.get("wcf.global.page.jumpTo.description").replace(/#pages#/,o)},_keyUp:function(e){if(13===e.which&&a.disabled===!1)return void this._submit();var t=~~s.value;1>t||t>~~elAttr(s,"max")?a.disabled=!0:a.disabled=!1},_submit:function(e){o.get(i).callback(~~s.value),n.close(this)},_dialogSetup:function(){var t='<dl><dt><label for="jsPaginationPageNo">'+e.get("wcf.global.page.jumpTo")+'</label></dt><dd><input type="number" id="jsPaginationPageNo" value="1" min="1" max="1" class="tiny"><small></small></dd></dl><div class="formSubmit"><button class="buttonPrimary">'+e.get("wcf.global.button.submit")+"</button></div>";return{id:"paginationOverlay",options:{onSetup:function(e){s=elByTag("input",e)[0],s.addEventListener("keyup",this._keyUp.bind(this)),r=elByTag("small",e)[0],a=elByTag("button",e)[0],a.addEventListener(WCF_CLICK_EVENT,this._submit.bind(this))}.bind(this),title:e.get("wcf.global.page.pagination")},source:t}}};return l}),define("WoltLab/WCF/Ui/Pagination",["Core","Language","ObjectMap","StringUtil","WoltLab/WCF/Ui/Page/JumpTo"],function(e,t,n,i,a){"use strict";function r(e,t){this.init(e,t)}return r.prototype={SHOW_LINKS:11,init:function(t,n){this._element=t,this._options=e.extend({activePage:1,maxPage:1,callbackShouldSwitch:null,callbackSwitch:null},n),"function"!=typeof this._options.callbackShouldSwitch&&(this._options.callbackShouldSwitch=null),"function"!=typeof this._options.callbackSwitch&&(this._options.callbackSwitch=null),this._element.classList.add("pagination"),this._element.classList.add("small"),this._rebuild(this._element)},_rebuild:function(){var e=!1;this._element.innerHTML="";var n,i=elCreate("ul"),r=elCreate("li");r.className="skip",i.appendChild(r);var o="icon icon16 fa-angle-double-left";this._options.activePage>1?(n=elCreate("a"),n.className=o+" jsTooltip",n.href="#",n.title=t.get("wcf.global.page.previous"),r.appendChild(n),n.addEventListener(WCF_CLICK_EVENT,this.switchPage.bind(this,this._options.activePage-1))):(r.innerHTML='<span class="'+o+'"></span>',r.classList.add("disabled")),i.appendChild(this._createLink(1,this._options));var s=this.SHOW_LINKS-4,l=this._options.activePage-2;0>l&&(l=0);var c=this._options.maxPage-(this._options.activePage+1);0>c&&(c=0),this._options.activePage>1&&this._options.activePage<this._options.maxPage&&s--;var d=s/2,u=this._options.activePage,h=this._options.activePage;1>u&&(u=1),1>h&&(h=1),h>this._options.maxPage-1&&(h=this._options.maxPage-1),l>=d?u-=d:(u-=l,h+=d-l),c>=d?h+=d:(h+=c,u-=d-c),h=Math.ceil(h),u=Math.ceil(u),1>u&&(u=1),h>this._options.maxPage&&(h=this._options.maxPage);var p='<a class="jsTooltip" title="'+t.get("wcf.global.page.jumpTo")+'">&hellip;</a>';if(u>1)if(2>u-1)i.appendChild(this._createLink(2,this._options));else{var r=elCreate("li");r.className="jumpTo",r.innerHTML=p,i.appendChild(r),e=!0}for(var f=u+1;h>f;f++)i.appendChild(this._createLink(f,this._options));if(h<this._options.maxPage)if(this._options.maxPage-h<2)i.appendChild(this._createLink(this._options.maxPage-1,this._options));else{var r=elCreate("li");r.className="jumpTo",r.innerHTML=p,i.appendChild(r),e=!0}i.appendChild(this._createLink(this._options.maxPage,this._options)),r=elCreate("li"),r.className="skip",i.appendChild(r),o="icon icon16 fa-angle-double-right",this._options.activePage<this._options.maxPage?(n=elCreate("a"),n.className=o+" jsTooltip",n.href="#",n.title=t.get("wcf.global.page.next"),r.appendChild(n),n.addEventListener(WCF_CLICK_EVENT,this.switchPage.bind(this,this._options.activePage+1))):(r.innerHTML='<span class="'+o+'"></span>',r.classList.add("disabled")),e&&(elData(i,"pages",this._options.maxPage),a.init(i,this.switchPage.bind(this))),this._element.appendChild(i)},_createLink:function(e){var n=elCreate("li");if(e!==this._options.activePage){var a=elCreate("a");a.textContent=i.addThousandsSeparator(e),a.addEventListener(WCF_CLICK_EVENT,this.switchPage.bind(this,e)),n.appendChild(a)}else n.classList.add("active"),n.innerHTML="<span>"+i.addThousandsSeparator(e)+'</span><span class="invisible">'+t.get("wcf.page.pagePosition",{pageNo:e,pages:this._options.maxPage})+"</span>";return n},switchPage:function(e,t){if("object"==typeof t&&t.preventDefault(),e=~~e,e>0&&this._options.activePage!==e&&e<=this._options.maxPage){if(null!==this._options.callbackShouldSwitch&&this._options.callbackShouldSwitch(e)!==!0)return;this._options.activePage=e,this._rebuild(),null!==this._options.callbackSwitch&&this._options.callbackSwitch(e)}}},r}),define("WoltLab/WCF/Ui/Scroll",["Dom/Util"],function(e){"use strict";var t=null,n=null,i=null;return{element:function(i,a){if(!(i instanceof Element))throw new TypeError("Expected a valid DOM element.");if(void 0!==a&&"function"!=typeof a)throw new TypeError("Expected a valid callback function.");if(!document.body.contains(i))throw new Error("Element must be part of the visible DOM.");if(null!==t)throw new Error("Cannot scroll to element, a concurrent request is running.");a&&(t=a,null===n&&(n=this._onScroll.bind(this)),window.addEventListener("scroll",n));var r=e.offset(i).top;50>=r?r=0:r-=50,window.scrollTo({left:0,top:r,behavior:"smooth"})},_onScroll:function(){null!==i&&window.clearTimeout(i),i=window.setTimeout(function(){t(),window.removeEventListener("scroll",n),t=null,i=null},100)}}}),define("WoltLab/WCF/Controller/Notice/Dismiss",["Ajax"],function(e){"use strict";var t={setup:function(){var e=elByClass("jsDismissNoticeButton");if(e.length)for(var t=this._click.bind(this),n=0,i=e.length;i>n;n++)e[n].addEventListener(WCF_CLICK_EVENT,t)},_click:function(t){var n=t.currentTarget;e.apiOnce({data:{actionName:"dismiss",className:"wcf\\data\\notice\\NoticeAction",objectIDs:[elData(n,"object-id")]},success:function(){var e=n.parentNode;e.addEventListener("transitionend",function(){elRemove(e)}),e.classList.remove("active")}})}};return t}),define("WoltLab/WCF/Media/Manager/Search",["Ajax","Core","Dom/Traverse","Dom/Util","Language","WoltLab/WCF/Media/Search","Ui/SimpleDropdown"],function(e,t,n,i,a,r,o){"use strict";function s(e){r.call(this),this._mediaManager=e,this._searchMode=!1,this._input=elById(this._getIdPrefix()+"SearchField"),this._input.addEventListener("keypress",this._keyPress.bind(this)),this._cancelButton=elById(this._getIdPrefix()+"SearchCancelButton"),this._cancelButton.addEventListener(WCF_CLICK_EVENT,this._cancelSearch.bind(this))}return t.inherit(s,r,{_ajaxSetup:function(){return{data:{actionName:"getSearchResultList",className:"wcf\\data\\media\\MediaAction",interfaceName:"wcf\\data\\ISearchAction"}}},_ajaxSuccess:function(e){this._mediaManager.setMedia(e.returnValues.media||{},e.returnValues.template||"")},_cancelSearch:function(){this._searchMode&&(this._searchMode=!1,this._mediaManager.resetMedia(),this.resetSearch())},_getIdPrefix:function(){return"mediaManager"},_keyPress:function(e){if(13===e.charCode){e.preventDefault();var t=n.childByClass(this._input.parentNode.parentNode,"innerInfo");this._input.value.length>=3?(t&&elHide(t),this._search()):t?elShow(t):(t=elCreate("p"),t.className="innerInfo",t.textContent=a.get("wcf.media.search.info.searchStringTreshold"),i.insertAfter(t,this._input.parentNode))}},_search:function(){this._searchMode=!0,e.api(this,{parameters:{fileType:this._fileType,fileTypeFilters:this._mediaManager.getOption("fileTypeFilters"),mode:this._mediaManager.getMode(),searchString:this._input.value}})},_selectFileType:function(e){s._super.prototype._selectFileType.call(this,e),this._search()},hideSearch:function(){elHide(elById(this._getIdPrefix()+"Search"))},resetSearch:function(){this._input.value="",this._fileType="all",this._updateDropdownButtonLabel()},showSearch:function(){elShow(elById(this._getIdPrefix()+"Search"))}}),s}),define("WoltLab/WCF/Media/Manager/Base",["Core","Dictionary","Dom/ChangeListener","Dom/Traverse","Dom/Util","EventHandler","Language","List","Permission","Ui/Dialog","Ui/Notification","WoltLab/WCF/Controller/Clipboard","WoltLab/WCF/Media/Editor","WoltLab/WCF/Media/Upload","WoltLab/WCF/Media/Manager/Search"],function(e,t,n,i,a,r,o,s,l,c,d,u,h,p,f){"use strict";function m(i){this._options=e.extend({dialogTitle:o.get("wcf.media.manager"),fileTypeFilters:{}},i),this._media=new t,this._mediaData=new t,this._mediaCache=null,this._mediaManagerMediaList=null,this._search=null,l.get("admin.content.cms.canManageMedia")&&(this._mediaEditor=new h(this)),n.add("WoltLab/WCF/Media/Manager",this._addButtonEventListeners.bind(this))}return m.prototype={_addButtonEventListeners:function(){if(this._mediaManagerMediaList)for(var e=i.childrenByTag(this._mediaManagerMediaList,"LI"),t=0,n=e.length;n>t;t++){var a=e[t];if(l.get("admin.content.cms.canManageMedia")){var r=elByClass("jsMediaEditIcon",a)[0];r&&(r.classList.remove("jsMediaEditIcon"),r.addEventListener(WCF_CLICK_EVENT,this._editMedia.bind(this)))}}},_click:function(e){e.preventDefault(),c.open(this)},_clipboardAction:function(e){if(null!==e.responseData)switch(e.data.actionName){case"com.woltlab.wcf.media.delete":for(var t=e.responseData.objectIDs,n=0,i=t.length;i>n;n++)this.removeMedia(~~t[n],!0);d.show()}},_dialogSetup:function(){return{id:"mediaManager",options:{title:this._options.dialogTitle},source:{after:this._initDialog.bind(this),data:{actionName:"getManagementDialog",className:"wcf\\data\\media\\MediaAction",parameters:{mode:this.getMode(),fileTypeFilters:this._options.fileTypeFilters}}}}},_editMedia:function(e){if(!l.get("admin.content.cms.canManageMedia"))throw new Error("You are not allowed to edit media files.");c.close("mediaManager"),this._mediaEditor.edit(this._mediaData.get(~~elData(e.currentTarget,"object-id")))},_editorClose:function(){c.open(this)},_editorSuccess:function(e){c.open(this),this._mediaData.set(~~e.mediaID,e);var t=this._media.get(~~e.mediaID),n=elByClass("mediaTitle",t)[0];e.isMultilingual?n.textContent=e.title[LANGUAGE_ID]||e.filename:n.textContent=e.title[e.languageID]||e.filename},_initDialog:function(e,t){var n=t.returnValues.media||{};for(var a in n)objOwns(n,a)&&this._mediaData.set(~~a,n[a]);this._mediaManagerMediaList=elById("mediaManagerMediaList");for(var o=i.childrenByTag(this._mediaManagerMediaList,"LI"),s=0,c=o.length;c>s;s++){var d=o[s];this._media.set(~~elData(d,"object-id"),d)}l.get("admin.content.cms.canManageMedia")&&(new p("mediaManagerMediaUploadButton","mediaManagerMediaList",{mediaManager:this}),u.setup({hasMarkedItems:t.returnValues.hasMarkedItems?!0:!1,pageClassName:"menuManagerDialog-"+this.getMode()}),r.add("com.woltlab.wcf.clipboard","com.woltlab.wcf.media",this._clipboardAction.bind(this))),this._search=new f(this),o.length||this._search.hideSearch()},_setMedia:function(r){e.isPlainObject(r)?this._media=t.fromObject(r):this._media=r;var s=i.nextByClass(this._mediaManagerMediaList,"info");this._media.size?s&&elHide(s):(null===s&&(s=elCreate("p"),s.className="info",s.textContent=o.get("wcf.media.search.noResults")),elShow(s),a.insertAfter(s,this._mediaManagerMediaList));for(var l=i.childrenByTag(this._mediaManagerMediaList,"LI"),c=0,d=l.length;d>c;c++){var h=l[c];this._media.has(elData(h,"object-id"))?elShow(h):elHide(h)}n.trigger(),u.reload()},addMedia:function(e,t){e.languageID||(e.isMultilingual=1),this._mediaData.set(~~e.mediaID,e),this._media.set(~~e.mediaID,t),1===this._media.size&&this._search.showSearch()},getMode:function(){return""},getOption:function(e){return this._options[e]?this._options[e]:null},removeMedia:function(e,t){this._media.has(e)&&(elRemove(this._media.get(e)),this._media["delete"](e),this._mediaData["delete"](e)),t&&this._mediaCache&&this._mediaCache.has(e)&&this._mediaCache["delete"](e)},resetMedia:function(){null!==this._mediaCache&&(this._setMedia(this._mediaCache),this._mediaCache=null,this._search.resetSearch())},setMedia:function(e,t){this._mediaCache||(this._mediaCache=this._media);var n=!1;for(var a in e)objOwns(e,a)&&(n=!0);if(n){var r=elCreate("ul");r.innerHTML=t;for(var o=i.childrenByTag(r,"LI"),s=0,l=o.length;l>s;s++){var c=o[s];this._mediaData.has(~~elData(c,"object-id"))||(this._mediaData.set(elData(c,"object-id"),c),this._mediaManagerMediaList.appendChild(c))}}this._setMedia(e)},setupMediaElement:function(e,t){var n=i.childByClass(t,"mediaInformation"),a=elCreate("nav");a.className="buttonGroupNavigation",n.parentNode.appendChild(a);var r=elCreate("ul");r.className="smallButtons buttonGroup",a.appendChild(r);var s=elCreate("li");r.appendChild(s);var c=elCreate("input");
 if(c.className="jsClipboardItem jsMediaCheckbox",elAttr(c,"type","checkbox"),elData(c,"object-id",e.mediaID),s.appendChild(c),l.get("admin.content.cms.canManageMedia")){s=elCreate("li"),r.appendChild(s);var d=elCreate("a");s.appendChild(d);var u=elCreate("span");u.className="icon icon16 fa-pencil jsTooltip jsMediaEditIcon",elData(u,"object-id",e.mediaID),elAttr(u,"title",o.get("wcf.global.button.edit")),d.appendChild(u),s=elCreate("li"),r.appendChild(s),d=elCreate("a"),s.appendChild(d),u=elCreate("span"),u.className="icon icon16 fa-times jsTooltip jsMediaDeleteIcon",elData(u,"object-id",e.mediaID),elAttr(u,"title",o.get("wcf.global.button.delete")),d.appendChild(u)}}},m}),define("WoltLab/WCF/Media/Manager/Editor",["Core","Dom/Traverse","Language","Ui/Dialog","WoltLab/WCF/Media/Manager/Base"],function(e,t,n,i,a){"use strict";function r(e){a.call(this,e),this._activeButton=null,this._buttons=elByClass(this._options.buttonClass||"jsMediaEditorButton");for(var t=0,n=this._buttons.length;n>t;t++)this._buttons[t].addEventListener(WCF_CLICK_EVENT,this._click.bind(this));this._activeButton=null}return e.inherit(r,a,{_addButtonEventListeners:function(){if(r._super.prototype._addButtonEventListeners.call(this),this._mediaManagerMediaList)for(var e=t.childrenByTag(this._mediaManagerMediaList,"LI"),n=0,i=e.length;i>n;n++){var a=e[n],o=elByClass("jsMediaInsertIcon",a)[0];o&&(o.classList.remove("jsMediaInsertIcon"),o.addEventListener(WCF_CLICK_EVENT,this._openInsertDialog.bind(this)))}},_click:function(e){this._activeButton=e.currentTarget,r._super.prototype._click.call(this,e)},_insertMedia:function(){},_openInsertDialog:function(e){var t=this._mediaData.get(~~elData(e.currentTarget,"object-id"));if(t.isImage&&t.smallThumbnailType){i.close(this);var a="mediaInsert"+t.mediaID;if(i.getDialog(a))i.openStatic(a);else{var r=elCreate("div"),o=elCreate("fieldset");r.appendChild(o);var s=elCreate("dl");o.appendChild(s);var l=elCreate("dt");l.textContent=n.get("wcf.media.insert.imageSize"),s.appendChild(l);var c=elCreate("dd");s.appendChild(c);var d=elCreate("select");c.appendChild(d);for(var u,h,p=["small","medium","large"],f=0,m=p.length;m>f;f++)u=p[f],t[u+"ThumbnailType"]&&(h=elCreate("option"),elAttr(h,"value",u),h.textContent=n.get("wcf.media.insert.imageSize."+u,{height:t[u+"ThumbnailHeight"],width:t[u+"ThumbnailWidth"]}),d.appendChild(h));h=elCreate("option"),elAttr(h,"value","original"),h.textContent=n.get("wcf.media.insert.imageSize.original",{height:t.height,width:t.width}),d.appendChild(h);var g=elCreate("div");g.className="formSubmit",r.appendChild(g);var v=elCreate("button");v.className="buttonPrimary",v.textContent=n.get("wcf.global.button.insert"),elData(v,"object-id",t.mediaID),v.addEventListener(WCF_CLICK_EVENT,this._insertMedia.bind(this)),g.appendChild(v),i.open({_dialogSetup:function(){return{id:a,options:{onClose:this._editorClose.bind(this),title:n.get("wcf.media.insert")},source:r.outerHTML}}.bind(this)})}}},getMode:function(){return"editor"},setupMediaElement:function(e,t){r._super.prototype.setupMediaElement.call(this,e,t);var i=elBySel("> nav.buttonGroupNavigation > ul.smallButtons",t),a=elCreate("li");i.appendChild(a);var o=elCreate("a");a.appendChild(o);var s=elCreate("span");s.className="icon icon16 fa-plus jsTooltip jsMediaInsertIcon",elData(s,"object-id",e.mediaID),elAttr(s,"title",n.get("wcf.media.button.insert")),o.appendChild(s)}}),r}),define("WoltLab/WCF/Media/Manager/Select",["Core","Dom/Traverse","Language","ObjectMap","Ui/Dialog","WoltLab/WCF/Media/Manager/Base"],function(e,t,n,i,a,r){"use strict";function o(e){r.call(this,e),this._activeButton=null,this._buttons=elByClass(this._options.buttonClass||"jsMediaSelectButton"),this._storeElements=new i;for(var t=0,n=this._buttons.length;n>t;t++){var a=this._buttons[t],o=elData(a,"store");if(o){var s=elById(o);s&&"INPUT"===s.tagName&&(this._buttons[t].addEventListener(WCF_CLICK_EVENT,this._click.bind(this)),this._storeElements.set(a,s))}}}return e.inherit(o,r,{_addButtonEventListeners:function(){if(o._super.prototype._addButtonEventListeners.call(this),this._mediaManagerMediaList)for(var e=t.childrenByTag(this._mediaManagerMediaList,"LI"),n=0,i=e.length;i>n;n++){var a=e[n],r=elByClass("jsMediaSelectIcon",a)[0];r&&(r.classList.remove("jsMediaSelectIcon"),r.addEventListener(WCF_CLICK_EVENT,this._chooseMedia.bind(this)))}},_chooseMedia:function(e){if(null===this._activeButton)throw new Error("Media cannot be chosen if no button is active.");var t=this._mediaData.get(~~elData(e.currentTarget,"object-id"));elById(elData(this._activeButton,"store")).value=t.mediaID;var n=elData(this._activeButton,"display");if(n){var i=elById(n);i&&t.isImage&&(i.innerHTML='<img src="'+t.smallThumbnailLink+'" alt="'+t.altText+'" />')}a.close("mediaManager")},_click:function(e){if(this._activeButton=e.currentTarget,o._super.prototype._click.call(this,e),this._mediaManagerMediaList)for(var n,i=this._storeElements.get(this._activeButton),a=t.childrenByTag(this._mediaManagerMediaList,"LI"),r=0,s=a.length;s>r;r++)n=a[r],i.value&&i.value==elData(n,"object-id")?n.classList.add("jsSelected"):n.classList.remove("jsSelected")},getMode:function(){return"select"},setupMediaElement:function(e,t){o._super.prototype.setupMediaElement.call(this,e,t);var i=elBySel("nav.buttonGroupNavigation > ul.smallButtons",t),a=elCreate("li");i.appendChild(a);var r=elCreate("a");a.appendChild(r);var s=elCreate("span");s.className="icon icon16 fa-check jsTooltip jsMediaSelectIcon",elData(s,"object-id",e.mediaID),elAttr(s,"title",n.get("wcf.media.button.choose")),r.appendChild(s)}}),o}),define("WoltLab/WCF/Ui/Dropdown/Reusable",["Dictionary","Ui/SimpleDropdown"],function(e,t){"use strict";function n(e){if(!i.has(e))throw new Error("Unknown dropdown identifier '"+e+"'");return i.get(e)}var i=new e,a=0;return{init:function(e,n){if(!i.has(e)){var r=elCreate("div");r.id="reusableDropdownGhost"+a++,t.initFragment(r,n),i.set(e,r.id)}},getDropdownMenu:function(e){return t.getDropdownMenu(n(e))},registerCallback:function(e,i){t.registerCallback(n(e),i)},toggleDropdown:function(e,i){t.toggleDropdown(n(e),i)}}}),define("WoltLab/WCF/Ui/ItemList/User",["WoltLab/WCF/Ui/ItemList"],function(e){"use strict";var t={init:function(t,n){e.init(t,[],{ajax:{className:"wcf\\data\\user\\UserAction",parameters:{data:{includeUserGroups:~~n.includeUserGroups}}},callbackChange:"function"==typeof n.callbackChange?n.callbackChange:null,excludedSearchValues:Array.isArray(n.excludedSearchValues)?n.excludedSearchValues:[],isCSV:!0,maxItems:~~n.maxItems||-1,restricted:!0})},getValues:function(t){return e.getValues(t)}};return t}),define("WoltLab/WCF/Ui/User/List",["Ajax","Core","Dictionary","Dom/Util","Ui/Dialog","WoltLab/WCF/Ui/Pagination"],function(e,t,n,i,a,r){"use strict";function o(e){this.init(e)}return o.prototype={init:function(e){this._cache=new n,this._pageCount=0,this._pageNo=1,this._options=t.extend({className:"",dialogTitle:"",parameters:{}},e)},open:function(){this._pageNo=1,this._showPage()},_showPage:function(t){if("number"==typeof t&&(this._pageNo=~~t),0!==this._pageCount&&(this._pageNo<1||this._pageNo>this._pageCount))throw new RangeError("pageNo must be between 1 and "+this._pageCount+" ("+this._pageNo+" given).");if(this._cache.has(this._pageNo)){var n=a.open(this,this._cache.get(this._pageNo));if(this._pageCount>1){var i=elBySel(".jsPagination",n.content);null!==i&&new r(i,{activePage:this._pageNo,maxPage:this._pageCount,callbackSwitch:this._showPage.bind(this)})}}else this._options.parameters.pageNo=this._pageNo,e.api(this,{parameters:this._options.parameters})},_ajaxSuccess:function(e){void 0!==e.returnValues.pageCount&&(this._pageCount=~~e.returnValues.pageCount),this._cache.set(this._pageNo,e.returnValues.template),this._showPage()},_ajaxSetup:function(){return{data:{actionName:"getGroupedUserList",className:this._options.className,interfaceName:"wcf\\data\\IGroupedUserListAction"}}},_dialogSetup:function(){return{id:i.getUniqueId(),options:{title:this._options.dialogTitle},source:null}}},o}),define("WoltLab/WCF/Ui/Like/Handler",["Ajax","Core","Dictionary","Language","ObjectMap","StringUtil","Dom/ChangeListener","Dom/Util","Ui/Dialog","WoltLab/WCF/Ui/User/List"],function(e,t,n,i,a,r,o,s,l,c){"use strict";function d(e,t){this.init(e,t)}var u=!1;return d.prototype={init:function(e,n){if(""===n.containerSelector)throw new Error("[WoltLab/WCF/Ui/Like/Handler] Expected a non-emtpy string for option 'containerSelector'.");this._containers=new a,this._details=new a,this._objectType=e,this._options=t.extend({badgeClassNames:"",isSingleItem:!1,markListItemAsActive:!1,renderAsButton:!0,summaryPrepend:!0,summaryUseIcon:!0,canDislike:!1,canLike:!1,canLikeOwnContent:!1,canViewSummary:!1,badgeContainerSelector:".messageHeader .messageStatus",buttonAppendToSelector:".messageFooter .messageFooterButtons",buttonBeforeSelector:"",containerSelector:"",summarySelector:".messageFooterGroup"},n),this.initContainers(n,e),o.add("WoltLab/WCF/Ui/Like/Handler-"+e,this.initContainers.bind(this))},initContainers:function(){for(var e,t,n=elBySelAll(this._options.containerSelector),i=!1,a=0,r=n.length;r>a;a++)e=n[a],this._containers.has(e)||(t={badge:null,dislikeButton:null,likeButton:null,summary:null,dislikes:~~elData(e,"like-dislikes"),liked:~~elData(e,"like-liked"),likes:~~elData(e,"like-likes"),objectId:~~elData(e,"object-id"),users:JSON.parse(elData(e,"like-users"))},this._containers.set(e,t),this._buildWidget(e,t),i=!0);i&&o.trigger()},_buildWidget:function(e,t){if(this._options.canViewSummary){var n,i,a,r=elBySel(this._options.summarySelector,e);null!==r&&(n=elCreate("div"),n.className="likesSummary",this._options.summaryUseIcon&&(a=elCreate("span"),a.className="icon icon16 fa-thumbs-o-up",n.appendChild(a)),i=elCreate("span"),i.className="likesSummaryContent",i.addEventListener(WCF_CLICK_EVENT,this._showSummary.bind(this,e)),n.appendChild(i),this._options.summaryPrepend?s.prepend(n,r):r.appendChild(n),t.summary=i,this._updateSummary(e))}var o,l,c=elBySel(this._options.badgeContainerSelector,e);if(null!==c&&(o=elCreate("a"),o.href="#",o.className="wcfLikeCounter jsTooltip"+(this._options.badgeClassNames?" "+this._options.badgeClassNames:""),o.addEventListener(WCF_CLICK_EVENT,this._showSummary.bind(this,e)),"OL"===c.nodeName||"UL"===c.nodeName?(l=elCreate("li"),l.appendChild(o),c.appendChild(l)):c.appendChild(o),t.badge=o,this._updateBadge(e)),WCF.User.userID!=elData(e,"user-id")||this._options.canLikeOwnContent){var d=this._options.buttonAppendToSelector?elBySel(this._options.buttonAppendToSelector,e):null,u=this._options.buttonBeforeSelector?elBySel(this._options.buttonBeforeSelector,e):null;if(null===u&&null===d)throw new Error("Unable to find insert location for like/dislike buttons.");t.likeButton=this._createButton(e,!0,u,d),this._options.canDislike&&(t.dislikeButton=this._createButton(e,!1,u,d)),this._updateActiveState(e)}},_createButton:function(e,t,n,a){var r=i.get("wcf.like.button."+(t?"like":"dislike")),o=elCreate("li");o.className="wcf"+(t?"Like":"Dislike")+"Button";var s=elCreate("a");return s.className="jsTooltip"+(this._options.renderAsButton?" button":""),s.href="#",s.title=r,s.innerHTML='<span class="icon icon16 fa-thumbs-o-'+(t?"up":"down")+'" /> <span class="invisible">'+r+"</span>",s.addEventListener(WCF_CLICK_EVENT,this._like.bind(this,e)),elData(s,"type",t?"like":"dislike"),o.appendChild(s),n?n.parentNode.insertBefore(o,n):a.appendChild(o),s},_showSummary:function(e,t){t.preventDefault(),this._details.has(e)||this._details.set(e,new c({className:"wcf\\data\\like\\LikeAction",dialogTitle:i.get("wcf.like.details"),parameters:{data:{containerID:s.identify(e),objectID:this._containers.get(e).objectId,objectType:this._objectType}}})),this._details.get(e).open()},_updateBadge:function(e){var t=this._containers.get(e);if(0===t.likes&&0===t.dislikes)elHide(t.badge);else{elShow(t.badge);var n=t.likes-t.dislikes,a='<span class="icon icon16 fa-thumbs-o-'+(0>n?"down":"up")+'"></span><span class="wcfLikeValue">';a+=n>0?"+"+r.addThousandsSeparator(n):0>n?"−"+r.addThousandsSeparator(Math.abs(n)):"±0",t.badge.innerHTML=a+"</span>",t.badge.setAttribute("data-tooltip",i.get("wcf.like.tooltip",{dislikes:t.dislikes,likes:t.likes}))}},_updateSummary:function(e){var t=this._containers.get(e);if(t.likes){elShow(t.summary.parentNode);for(var n=[],a=Object.keys(t.users),r=0,o=a.length;o>r;r++)n.push(t.users[a[r]]);var s=t.likes-n.length;t.summary.innerHTML=i.get("wcf.like.summary",{users:n,others:s})}else elHide(t.summary.parentNode)},_updateActiveState:function(e){var t=this._containers.get(e),n=this._options.markListItemAsActive?t.dislikeButton.parentNode:t.dislikeButton,i=this._options.markListItemAsActive?t.likeButton.parentNode:t.likeButton;null!==t.dislikeButton&&n.classList.remove("active"),i.classList.remove("active"),1===t.liked?i.classList.add("active"):-1===t.liked&&null!==t.dislikeButton&&n.classList.add("active")},_like:function(t,n){n.preventDefault(),u||(u=!0,e.api(this,{actionName:elData(n.currentTarget,"type"),parameters:{data:{containerID:s.identify(t),objectID:this._containers.get(t).objectId,objectType:this._objectType}}}))},_ajaxSuccess:function(e){var t=elById(e.returnValues.containerID),n=this._containers.get(t);if(void 0!==n){n.dislikes=~~e.returnValues.dislikes,n.likes=~~e.returnValues.likes;var i=e.returnValues.users;n.users=[];for(var a=Object.keys(i),o=0,s=a.length;s>o;o++)n.users.push(r.escapeHTML(i[a[o]].username));1==e.returnValues.isLiked?n.liked=1:1==e.returnValues.isDisliked?n.liked=-1:n.liked=0,this._updateBadge(t),this._options.canViewSummary&&this._updateSummary(t),this._updateActiveState(t),this._details["delete"](t),u=!1}},_ajaxSetup:function(){return{data:{className:"wcf\\data\\like\\LikeAction"}}}},d}),define("WoltLab/WCF/Ui/Message/InlineEditor",["Ajax","Core","Dictionary","Environment","EventHandler","Language","ObjectMap","Dom/Traverse","Dom/Util","Ui/Notification","Ui/ReusableDropdown"],function(e,t,n,i,a,r,o,s,l,c,d){"use strict";function u(e){this.init(e)}return u.prototype={init:function(e){this._activeDropdownElement=null,this._activeElement=null,this._dropdownMenu=null,this._elements=new o,this._options=t.extend({canEditInline:!1,className:"",containerId:0,dropdownIdentifier:"",editorPrefix:"messageEditor",messageSelector:".jsMessage"},e),this.rebuild()},rebuild:function(){for(var e,t,n,i=elBySelAll(this._options.messageSelector),a=0,r=i.length;r>a;a++)if(n=i[a],!this._elements.has(n)){e=elBySel(".jsMessageEditButton",n),null!==e&&(t=elDataBool(n,"can-edit"),this._options.canEditInline?(e.addEventListener(WCF_CLICK_EVENT,this._clickDropdown.bind(this,n)),e.classList.add("jsDropdownEnabled"),t&&e.addEventListener("dblclick",this._click.bind(this,n))):t&&e.addEventListener(WCF_CLICK_EVENT,this._click.bind(this,n)));var o=elBySel(".messageBody",n),s=elBySel(".messageFooter",n),l=elBySel(".messageHeader",n);this._elements.set(n,{button:e,messageBody:o,messageBodyEditor:null,messageFooter:s,messageFooterButtons:elBySel(".messageFooterButtons",s),messageHeader:l,messageText:elBySel(".messageText",o)})}},_click:function(t,n){null===t&&(t=this._activeDropdownElement),n&&n.preventDefault(),null===this._activeElement?(this._activeElement=t,this._prepare(),e.api(this,{actionName:"beginEdit",parameters:{containerID:this._options.containerId,objectID:this._getObjectId(t)}})):c.show("wcf.message.error.editorAlreadyInUse",null,"warning")},_clickDropdown:function(e,n){n.preventDefault();var i=n.currentTarget;if(!i.classList.contains("dropdownToggle")){if(i.classList.add("dropdownToggle"),i.parentNode.classList.add("dropdown"),function(e,t){e.addEventListener(WCF_CLICK_EVENT,function(n){n.preventDefault(),n.stopPropagation(),this._activeDropdownElement=t,d.toggleDropdown(this._options.dropdownIdentifier,e)}.bind(this))}.bind(this)(i,e),null===this._dropdownMenu){this._dropdownMenu=elCreate("ul"),this._dropdownMenu.className="dropdownMenu";var r=this._dropdownGetItems();a.fire("com.woltlab.wcf.inlineEditor","dropdownInit_"+this._options.dropdownIdentifier,{items:r}),this._dropdownBuild(r),d.init(this._options.dropdownIdentifier,this._dropdownMenu),d.registerCallback(this._options.dropdownIdentifier,this._dropdownToggle.bind(this))}setTimeout(function(){t.triggerEvent(i,WCF_CLICK_EVENT)},10)}},_dropdownBuild:function(e){for(var t,n,i,a=this._clickDropdownItem.bind(this),o=0,s=e.length;s>o;o++)t=e[o],i=elCreate("li"),elData(i,"item",t.item),"divider"===t.item?i.className="dropdownDivider":(n=elCreate("span"),n.textContent=r.get(t.label),i.appendChild(n),"editItem"===t.item?i.addEventListener(WCF_CLICK_EVENT,this._click.bind(this,null)):i.addEventListener(WCF_CLICK_EVENT,a)),this._dropdownMenu.appendChild(i)},_dropdownToggle:function(e,t){var n=this._elements.get(this._activeDropdownElement);if(n.button.parentNode.classList["open"===t?"add":"remove"]("dropdownOpen"),n.messageFooterButtons.classList["open"===t?"add":"remove"]("forceVisible"),"open"===t){var i=this._dropdownOpen();a.fire("com.woltlab.wcf.inlineEditor","dropdownOpen_"+this._options.dropdownIdentifier,{element:this._activeDropdownElement,visibility:i});for(var r,o,s=!1,l=0;l<this._dropdownMenu.childElementCount;l++)o=this._dropdownMenu.children[l],r=elData(o,"item"),"divider"===r?s?(elShow(o),s=!1):elHide(o):objOwns(i,r)&&i[r]===!1?elHide(o):(elShow(o),s=!0)}},_dropdownGetItems:function(){},_dropdownOpen:function(){},_dropdownSelect:function(e){},_clickDropdownItem:function(e){e.preventDefault(),this._dropdownSelect(elData(e.currentTarget,"item"))},_prepare:function(){var e=this._elements.get(this._activeElement),t=elCreate("div");t.className="messageBody editor",e.messageBodyEditor=t;var n=elCreate("span");n.className="icon icon48 fa-spinner",t.appendChild(n),l.insertAfter(t,e.messageBody),elHide(e.messageBody)},_showEditor:function(e){var t=this._getEditorId(),n=this._elements.get(this._activeElement);this._activeElement.classList.add("jsInvalidQuoteTarget");var r=s.childByClass(n.messageBodyEditor,"icon");elRemove(r);var o=n.messageBodyEditor,c=elCreate("div");c.className="editorContainer",l.setInnerHtml(c,e.returnValues.template),o.appendChild(c);var d=elBySel(".formSubmit",c),u=elBySel('button[data-type="save"]',d);u.addEventListener(WCF_CLICK_EVENT,this._save.bind(this));var h=elBySel('button[data-type="cancel"]',d);h.addEventListener(WCF_CLICK_EVENT,this._restoreMessage.bind(this)),a.add("com.woltlab.wcf.redactor","submitEditor_"+t,function(e){e.cancel=!0,this._save()}.bind(this)),elHide(n.messageHeader),elHide(n.messageFooter);var p=elById(t);"redactor"===i.editor()?window.setTimeout(function(){this._quoteManager&&this._quoteManager.setAlternativeEditor($element),(new WCF.Effect.Scroll).scrollTo(this._activeElement,!0)}.bind(this),250):p.focus()},_restoreMessage:function(){var e=this._elements.get(this._activeElement);this._destroyEditor(),elRemove(e.messageBodyEditor),e.messageBodyEditor=null,elShow(e.messageBody),elShow(e.messageFooter),elShow(e.messageHeader),this._activeElement.classList.remove("jsInvalidQuoteTarget"),this._activeElement=null,this._quoteManager&&this._quoteManager.clearAlternativeEditor()},_save:function(){var t={containerID:this._options.containerId,data:{message:""},objectID:this._getObjectId(this._activeElement),removeQuoteIDs:[]},n=this._getEditorId();a.fire("com.woltlab.wcf.redactor2","getText_"+n,t.data),a.fire("com.woltlab.wcf.redactor2","submit_"+n,t),e.api(this,{actionName:"save",parameters:t}),this._hideEditor()},_showMessage:function(e){var t=this._elements.get(this._activeElement),n=elBySelAll(".attachmentThumbnailList, .attachmentFileList",t.messageBody);if(l.setInnerHtml(t.messageBody,e.returnValues.message),"string"==typeof e.returnValues.attachmentList){for(var i=0,a=n.length;a>i;i++)elRemove(n[i]);var r=elCreate("div");for(l.setInnerHtml(r,e.returnValues.attachmentList);r.childNodes.length;)t.messageBody.appendChild(r.childNodes[0])}if("string"==typeof e.returnValues.poll){var o=elBySel(".pollContainer",t.messageBody);null!==o&&elRemove(o.parentNode);var s=elCreate("div");s.className="jsInlineEditorHideContent",l.setInnerHtml(s,e.returnValues.poll),l.prepend(s,t.messageBody)}this._restoreMessage(),this._updateHistory(this._getHash(this._getObjectId(this._activeElement))),c.show()},_hideEditor:function(){var e=this._elements.get(this._activeElement);elHide(s.childByClass(e.messageBodyEditor,"editorContainer"));var t=elCreate("span");t.className="icon icon48 fa-spinner",e.messageBodyEditor.appendChild(t)},_restoreEditor:function(){var e=this._elements.get(this._activeElement),t=elBySel(".fa-spinner",e.messageBodyEditor);elRemove(t);var n=s.childByClass(e.messageBodyEditor,"editorContainer");null!==n&&elShow(n)},_destroyEditor:function(){a.fire("com.woltlab.wcf.redactor","destroy_"+this._getEditorId())},_getHash:function(e){return"#message"+e},_updateHistory:function(e){window.location.hash=e},_getEditorId:function(){return this._options.editorPrefix+this._getObjectId(this._activeElement)},_getObjectId:function(e){return~~elData(e,"object-id")},_ajaxFailure:function(e){var t=this._elements.get(this._activeElement),n=elBySel(".redactor-editor",t.messageBodyEditor);if(null===n)return this._restoreMessage(),!0;if(this._restoreEditor(),!e||void 0===e.returnValues||void 0===e.returnValues.errorType)return!0;var i=elBySel(".innerError",t.messageBodyEditor);return null===i&&(i=elCreate("small"),i.className="innerError",l.insertAfter(i,n)),i.textContent=e.returnValues.errorType,!1},_ajaxSuccess:function(e){switch(e.actionName){case"beginEdit":this._showEditor(e);break;case"save":this._showMessage(e)}},_ajaxSetup:function(){return{data:{className:this._options.className,interfaceName:"wcf\\data\\IMessageInlineEditorAction"}}},legacyGetDropdownMenus:function(){return this._dropdownMenus},legacyGetElements:function(){return this._elements},legacyEdit:function(e){this._click(elById(e),null)}},u}),define("WoltLab/WCF/Ui/Message/Manager",["Ajax","Core","Dictionary","Language","Dom/Util"],function(e,t,n,i,a){"use strict";function r(e){this.init(e)}return r.prototype={init:function(e){this._elements=null,this._options=t.extend({className:"",selector:""},e),this.rebuild()},rebuild:function(){this._elements=new n;for(var e,t=elBySelAll(this._options.selector),i=0,a=t.length;a>i;i++)e=t[i],this._elements.set(elData(e,"object-id"),e)},getPermission:function(e,t){t="can-"+this._getAttributeName(t);var n=this._elements.get(e);if(void 0===n)throw new Error("Unknown object id '"+e+"' for selector '"+this._options.selector+"'");return elDataBool(n,t)},getPropertyValue:function(e,t,n){var i=this._elements.get(e);if(void 0===i)throw new Error("Unknown object id '"+e+"' for selector '"+this._options.selector+"'");return window[n?"elDataBool":"elData"](i,this._getAttributeName(t))},update:function(t,n,i){e.api(this,{actionName:n,parameters:i||{},objectIDs:[t]})},updateItems:function(e,t){Array.isArray(e)||(e=[e]);for(var n,i=0,a=e.length;a>i;i++)if(n=this._elements.get(e[i]),void 0!==n)for(var r in t)t.hasOwnProperty(r)&&this._update(n,r,t[r])},updateAllItems:function(e){var t=[];this._elements.forEach(function(e,n){t.push(n)}.bind(this)),this.updateItems(t,e)},_update:function(e,t,n){elData(e,this._getAttributeName(t),n);var i=1==n||n===!0||"true"===n;this._updateState(e,t,n,i)},_updateState:function(e,t,n,i){switch(t){case"isDeleted":e.classList[i?"add":"remove"]("messageDeleted"),this._toggleMessageStatus(e,"jsIconDeleted","wcf.message.status.deleted","red",i);break;case"isDisabled":e.classList[i?"add":"remove"]("messageDisabled"),this._toggleMessageStatus(e,"jsIconDisabled","wcf.message.status.disabled","green",i)}},_toggleMessageStatus:function(e,t,n,r,o){var s=elBySel(".messageStatus",e);if(null===s){var l=elBySel(".messageHeaderMetaData",e);if(null===l)return;s=elCreate("ul"),s.className="messageStatus",a.insertAfter(s,l)}var c=elBySel("."+t,s);if(o){if(null!==c)return;c=elCreate("span"),c.className="badge label "+r+" "+t,c.textContent=i.get(n);var d=elCreate("li");d.appendChild(c),s.appendChild(d)}else{if(null===c)return;elRemove(c.parentNode)}},_getAttributeName:function(e){if(-1!==e.indexOf("-"))return e;for(var t,n="",i=e.split(/([A-Z][a-z]+)/),a=0,r=i.length;r>a;a++)t=i[a],t.length&&(n.length&&(n+="-"),n+=t.toLowerCase());return n},_ajaxSuccess:function(){throw new Error("Method _ajaxSuccess() must be implemented by deriving functions.")},_ajaxSetup:function(){return{data:{className:this._options.className}}}},r}),define("WoltLab/WCF/Ui/Message/Reply",["Ajax","Core","EventHandler","Language","Dom/Util","Ui/Notification","../Scroll"],function(e,t,n,i,a,r,o){"use strict";function s(e){this.init(e)}return s.prototype={init:function(e){this._options=t.extend({ajax:{className:""},successMessage:"wcf.global.success.add"},e),this._container=elById("messageQuickReply"),this._content=elBySel(".messageContent",this._container),this._textarea=elById("text"),this._editor=null,this._loadingOverlay=null,elBySel(".message",this._container).classList.add("jsInvalidQuoteTarget");var n=this._submit.bind(this),i=elBySel('button[data-type="save"]');i.addEventListener(WCF_CLICK_EVENT,n);for(var a=elBySelAll(".jsQuickReply"),r=0,s=a.length;s>r;r++)a[r].addEventListener(WCF_CLICK_EVENT,function(e){e.preventDefault(),o.element(this._container,function(){this._getEditor().focus.end()}.bind(this))}.bind(this))},_submit:function(t){if(t.preventDefault(),this._validate()){this._showLoadingOverlay();var i=a.getDataAttributes(this._container,"data-",!0,!0);i.data={message:this._getEditor().code.get()},n.fire("com.woltlab.wcf.redactor2","submit_text",i.data),e.api(this,{parameters:i})}},_validate:function(){for(var e=elByClass("innerError",this._container);e.length;)e[0].parentNode.removeChild(e[0]);if(this._getEditor().utils.isEmpty())return this.throwError(this._textarea,i.get("wcf.global.form.error.empty")),!1;var t={api:this,editor:this._getEditor(),message:this._getEditor().code.get(),valid:!0};return n.fire("com.woltlab.wcf.redactor2","validate_text",t),t.valid!==!1},throwError:function(e,t){var n=elCreate("small");n.className="innerError",n.textContent=t,a.insertAfter(n,e)},_showLoadingOverlay:function(){null===this._loadingOverlay&&(this._loadingOverlay=elCreate("div"),this._loadingOverlay.className="messageContentLoadingOverlay",this._loadingOverlay.innerHTML='<span class="icon icon96 fa-spinner"></span>'),this._content.classList.add("loading"),this._content.appendChild(this._loadingOverlay)},_hideLoadingOverlay:function(){this._content.classList.remove("loading");var e=elBySel(".messageContentLoadingOverlay",this._content);null!==e&&e.parentNode.removeChild(e)},_reset:function(){this._getEditor().code.set("<p>​</p>"),n.fire("com.woltlab.wcf.redactor2","reset_text")},_handleError:function(e){this.throwError(this._textarea,e.returnValues.errorType)},_getEditor:function(){if(null===this._editor){if("function"!=typeof window.jQuery)throw new Error("Unable to access editor, jQuery has not been loaded yet.");this._editor=window.jQuery(this._textarea).data("redactor")}return this._editor},_insertMessage:function(e){if(e.returnValues.url)window.location=e.returnValues.url;else{if(e.returnValues.template){var t;"DESC"===elData(this._container,"sort-order")?(a.insertHtml(e.returnValues.template,this._container,"after"),t=a.identify(this._container.nextElementSibling)):(a.insertHtml(e.returnValues.template,this._container,"before"),t=a.identify(this._container.previousElementSibling)),elData(this._container,"last-post-time",e.returnValues.lastPostTime),window.location.hash=t,o.element(elById(t))}r.show(i.get(this._options.successMessage))}},_ajaxSuccess:function(e){this._insertMessage(e),this._reset(),this._hideLoadingOverlay()},_ajaxFailure:function(e){return this._hideLoadingOverlay(),null===e||void 0===e.returnValues||void 0===e.returnValues.errorType?!0:(this._handleError(e),!1)},_ajaxSetup:function(){return{data:{actionName:"quickReply",className:this._options.ajax.className,interfaceName:"wcf\\data\\IMessageQuickReplyAction"}}}},s}),define("WoltLab/WCF/Ui/Redactor/Format",["Dom/Util"],function(e){"use strict";return{format:function(t,n,i,a){document.execCommand("strikethrough");for(var r,o,s,l=elBySelAll("strike",t),c=0,d=l.length;d>c;c++){if(s=l[c],r=elCreate(n),i&&(r.className=i),"object"==typeof a)for(o in a)a.hasOwnProperty(o)&&elAttr(r,key,a[key]);e.replaceElement(s,r)}},removeFormat:function(t,n){n=n.toUpperCase();for(var i=elByTag("strike",t);i.length;)e.unwrapChildNodes(i[0]);document.execCommand("strikethrough");for(var a,r,o;i.length;){for(o=i[0],r=this._getLastMatchingParent(o,t,n),null!==r&&this._handleParentNodes(o,r,n),a=elByTag(n.toLowerCase(),o);a.length;)e.unwrapChildNodes(a[0]);e.unwrapChildNodes(o)}},_handleParentNodes:function(t,n,i){var a;if(!e.isAtNodeStart(t,n)){a=document.createRange(),a.setStartBefore(n),a.setEndBefore(t);var r=a.extractContents();n.parentNode.insertBefore(r,n)}e.isAtNodeEnd(t,n)||(a=document.createRange(),a.setStartAfter(t),a.setEndAfter(n),r=a.extractContents(),n.parentNode.insertBefore(r,n.nextSibling));for(var o=elByTag(i,n);o.length;)e.unwrapChildNodes(o[0]);e.unwrapChildNodes(n)},_getLastMatchingParent:function(e,t,n){for(var i=e.parentNode,a=null;i!==t;)i.nodeName===n&&(a=i),i=i.parentNode;return a}}}),define("WoltLab/WCF/Ui/Redactor/Link",["Language","Ui/Dialog"],function(e,t){"use strict";var n=!1,i=null;return{showDialog:function(a){t.open(this),t.setTitle(this,e.get("wcf.redactor.link."+(a.insert?"add":"edit")));var r=elById("redactor-modal-button-action");r.textContent=e.get("wcf.global.button."+(a.insert?"insert":"save")),i=a.submitCallback,n||(n=!0,r.addEventListener(WCF_CLICK_EVENT,this._submit.bind(this)))},_submit:function(){if(i())t.close(this);else{var n=elById("redactor-link-url"),a=n.nextElementSibling&&"SMALL"===n.nextElementSibling.nodeName?n.nextElementSibling:null;null===a&&(a=elCreate("small"),a.className="innerError",a.textContent=e.get("wcf.global.form.error.empty"),n.parentNode.appendChild(a))}},_dialogSetup:function(){return{id:"redactorDialogLink",options:{onClose:function(){var e=elById("redactor-link-url"),t=e.nextElementSibling&&"SMALL"===e.nextElementSibling.nodeName?e.nextElementSibling:null;null!==t&&elRemove(t)}},source:'<dl><dt><label for="redactor-link-url">'+e.get("wcf.redactor.link.url")+'</label></dt><dd><input type="url" id="redactor-link-url" class="long"></dd></dl><dl><dt><label for="redactor-link-url-text">'+e.get("wcf.redactor.link.text")+'</label></dt><dd><input type="text" id="redactor-link-url-text" class="long"></dd></dl><div class="formSubmit"><button id="redactor-modal-button-action" class="buttonPrimary"></button></div>'}}}}),define("WoltLab/WCF/Ui/Redactor/Mention",["Ajax","Environment","EventHandler","Ui/Alignment"],function(e,t,n,i){"use strict";function a(e){this.init(e)}return a.prototype={init:function(e){this._active=!1,this._caret=null,this._dropdownActive=!1,this._dropdownMenu=null,this._itemIndex=0,this._lineHeight=null,this._mentionStart="",this._redactor=e,this._timer=null,e.WoltLabEvent.register("keydown",this._keyDown.bind(this)),e.WoltLabEvent.register("keyup",this._keyUp.bind(this))},_keyDown:function(e){if(this._dropdownActive){var t=e.event;switch(t.which){case 13:this._setUsername(null,this._dropdownMenu.children[this._itemIndex].children[0]);break;case 38:this._selectItem(-1);break;case 40:this._selectItem(1);break;default:return}t.preventDefault(),e.cancel=!0}},_keyUp:function(t){var n=t.event;if(13===n.which)return void(this._active=!1);var i=this._getTextLineInFrontOfCaret();if(i.length){var a=i.match(/@([^,]{3,})$/);a?(!a.index||i[a.index-1].match(/\s/))&&(this._mentionStart=a[1],null!==this._timer&&(window.clearTimeout(this._timer),this._timer=null),this._timer=window.setTimeout(function(){e.api(this,{parameters:{data:{searchString:this._mentionStart}}}),this._timer=null}.bind(this),500)):this._hideDropdown()}else this._hideDropdown()},_setUsername:function(e,t){e&&(e.preventDefault(),t=e.currentTarget);