Updating minified JavaScript files
authorwoltlab.com <woltlab@woltlab.com>
Sun, 17 Jul 2016 11:04:53 +0000 (13:04 +0200)
committerwoltlab.com <woltlab@woltlab.com>
Sun, 17 Jul 2016 11:04:53 +0000 (13:04 +0200)
wcfsetup/install/files/js/WCF.Core.min.js

index 44a33898b022f2a85e4306635bd13fd49af40128..d13bdcafd05217ab373eb1829e3670c40e7e1686 100644 (file)
@@ -4,7 +4,7 @@ D.$=a[a.length-x],D._$={first_line:r[r.length-(x||1)].first_line,last_line:r[r.l
 "../lib/helper":6,"./instances":18}],20:[function(e,t,i){"use strict";var n=e("../lib/dom"),a=e("./instances"),r=e("./update-geometry");t.exports=function(e){var t=a.get(e);n.css(t.scrollbarXRail,"display","none"),n.css(t.scrollbarYRail,"display","none"),r(e),n.css(t.scrollbarXRail,"display","block"),n.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,i){var n,a="";"c"===i&&(i="Y-m-dTH:i:sP");for(var r=0,o=i.length;o>r;r++){switch(i[r]){case"s":n=("0"+t.getSeconds().toString()).slice(-2);break;case"i":n=t.getMinutes(),10>n&&(n="0"+n);break;case"a":n=t.getHours()>11?"pm":"am";break;case"g":n=t.getHours(),0===n?n=12:n>12&&(n-=12);break;case"h":n=t.getHours(),0===n?n=12:n>12&&(n-=12),n=("0"+n.toString()).slice(-2);break;case"A":n=t.getHours()>11?"PM":"AM";break;case"G":n=t.getHours();break;case"H":n=t.getHours(),n=("0"+n.toString()).slice(-2);break;case"d":n=t.getDate(),n=("0"+n.toString()).slice(-2);break;case"j":n=t.getDate();break;case"l":n=e.get("__days")[t.getDay()];break;case"D":n=e.get("__daysShort")[t.getDay()];break;case"S":n="";break;case"m":n=t.getMonth()+1,n=("0"+n.toString()).slice(-2);break;case"n":n=t.getMonth()+1;break;case"F":n=e.get("__months")[t.getMonth()];break;case"M":n=e.get("__monthsShort")[t.getMonth()];break;case"y":n=t.getYear().toString().replace(/^\d{2}/,"");break;case"Y":n=t.getFullYear();break;case"P":var s=t.getTimezoneOffset();n=s>0?"-":"+",s=Math.abs(s),n+=("0"+(~~(s/60)).toString()).slice(-2),n+=":",n+=("0"+(s%60).toString()).slice(-2);break;case"r":n=t.toString();break;case"U":n=Math.round(t.getTime()/1e3);break;default:n=i[r]}a+=n}return a},gmdate:function(e){return e instanceof Date||(e=new Date),Math.round(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDay(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds())/1e3)},getTimezoneDate:function(e,t){var i=new Date(e),n=6e4*i.getTimezoneOffset();return new Date(e+n+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,i,n){"use strict";var a=elByTag("time"),r=null;return{setup:function(){this._refresh(),new n(this._refresh.bind(this),6e4),e.add("WoltLab/WCF/Date/Time/Relative",this._refresh.bind(this))},_refresh:function(){var e=new Date,n=(e.getTime()-e.getMilliseconds())/1e3;null===r&&(r=n-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>=n||c+60>n)l.textContent=t.get("wcf.date.relative.now");else if(c+3540>n){var p=Math.max(Math.round((n-c)/60),1);l.textContent=t.get("wcf.date.relative.minutes",{minutes:p})}else if(c+86400>n){var f=Math.round((n-c)/3600);l.textContent=t.get("wcf.date.relative.hours",{hours:f})}else if(c+518400>n){var m=new Date(e.getFullYear(),e.getMonth(),e.getDate()),g=Math.ceil((m/1e3-c)/86400),v=i.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,i,n){"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"),n.setStyles(a,{bottom:"auto !important",left:"0 !important",right:"auto !important",top:"0 !important",visibility:"hidden !important"});var s=n.outerDimensions(a),l=n.outerDimensions(o.refDimensionsElement instanceof Element?o.refDimensionsElement:r),c=n.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=i.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"),n.setStyles(a,{bottom:y,left:g,right:v,top:C}),elShow(a),a.style.removeProperty("visibility")},_tryAlignmentHorizontal:function(e,t,i,n,a){var r="auto",o="auto",s=!0;return"left"===e?(r=n.left,r+t.width>a&&(s=!1)):"right"===e?(o=a-(n.left+i.width),0>o&&(s=!1)):(r=n.left+i.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,i,n,a,r){var o="auto",s="auto",l=!0;if("top"===e){var c=document.body.clientHeight;o=c-n.top+r,c-(o+t.height)<window.scrollY&&(l=!1)}else s=n.top+i.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,i={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 i.setup(),i}),define("WoltLab/WCF/Ui/Dropdown/Simple",["CallbackList","Core","Dictionary","Ui/Alignment","Dom/ChangeListener","Dom/Traverse","Dom/Util","Ui/CloseOverlay"],function(e,t,i,n,a,r,o,s){"use strict";var l=null,c=new e,d=!1,u=new i,h=new i,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,i){if(this.setup(),e.classList.contains("jsDropdownEnabled")||elData(e,"target"))return!1;var n=r.parentByClass(e,"dropdown");if(null===n)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(n);u.has(s)||(e.classList.add("jsDropdownEnabled"),e.addEventListener(WCF_CLICK_EVENT,this._toggle.bind(this)),u.set(s,n),h.set(s,a),s.match(/^wcf\d+$/)||elData(a,"source",s)),elData(e,"target",s),i&&setTimeout(function(){t.triggerEvent(e,WCF_CLICK_EVENT)},10)},initFragment:function(e,t){this.setup();var i=o.identify(e);u.has(i)||(u.set(i,e),p.appendChild(t),h.set(i,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,i){var a,r=elBySel(".dropdownToggle",e);null!==r&&r.parentNode.classList.contains("inputAddonTextarea")&&(a=r),n.set(t,i||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 i=h.get(e);this.setAlignment(t,i)},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,i=elBySelAll(".dropdown.dropdownOpen",t),n=0,a=i.length;a>n;n++){var r=i[n],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(i){i(e,t)})},_toggle:function(e,t,i){null!==e&&(e.preventDefault(),e.stopPropagation(),t=elData(e.currentTarget,"target"));var n=u.get(t),a=!1;if(void 0!==n&&(elDataBool(n,"dropdown-prevent-toggle")&&n.classList.contains("dropdownOpen")&&(a=!0),null===elData(n,"is-overlay-dropdown-button"))){var o=r.parentByClass(n,"dialogContent");elData(n,"is-overlay-dropdown-button",null!==o),null!==o&&o.addEventListener("scroll",this._onDialogScroll.bind(this))}return u.forEach(function(e,n){var r=h.get(n);e.classList.contains("dropdownOpen")?a===!1&&(e.classList.remove("dropdownOpen"),r.classList.remove("dropdownOpen"),this._notifyCallbacks(n,"close")):n===t&&r.childElementCount>0&&(e.classList.add("dropdownOpen"),r.classList.add("dropdownOpen"),this._notifyCallbacks(n,"open"),this.setAlignment(e,r,i))}.bind(this)),WCF.Dropdown.Interactive.Handler.closeAll(),null===e}}}),define("WoltLab/WCF/Event/Handler",["Core","Dictionary"],function(e,t){"use strict";var i=new t;return{add:function(n,a,r){if("function"!=typeof r)throw new TypeError("[WoltLab/WCF/Event/Handler] Expected a valid callback for '"+a+"@"+n+"'.");var o=i.get(n);void 0===o&&(o=new t,i.set(n,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,n){n=n||{};var a=i.get(e);if(void 0!==a){var r=a.get(t);void 0!==r&&r.forEach(function(e){e(n)})}},remove:function(e,t,n){var a=i.get(e);if(void 0!==a){var r=a.get(t);void 0!==r&&r["delete"](n)}},removeAll:function(e,t){"string"!=typeof t&&(t=void 0);var n=i.get(e);void 0!==n&&("undefined"==typeof t?i["delete"](e):n["delete"](t))}}}),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 i=this._set.indexOf(e);return-1===i?!1:(this._set.splice(i,1),!0)},forEach:function(e){if(t)this._set.forEach(e);else for(var i=0,n=this._set.length;n>i;i++)e(this._set[i])},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/Screen",["Core","Dictionary"],function(e,t){"use strict";var i=new t,n=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,i){var n=e.getUuid(),a=this._getQueryObject(t);return"function"==typeof i.match&&a.callbacksMatch.set(n,i.match),"function"==typeof i.unmatch&&a.callbacksUnmatch.set(n,i.unmatch),"function"==typeof i.setup&&(a.mql.matches?i.setup():a.callbacksSetup.set(n,i.setup)),n},remove:function(e,t){var i=this._getQueryObject(e);i.callbacksMatch["delete"](t),i.callbacksUnmatch["delete"](t),i.callbacksSetup["delete"](t)},is:function(e){return this._getQueryObject(e).mql.matches},scrollDisable:function(){0===n&&document.documentElement.classList.add("disableScrolling"),n++},scrollEnable:function(){n&&(n--,0===n&&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 n=i.get(e);return n||(n={callbacksMatch:new t,callbacksUnmatch:new t,callbacksSetup:new t,mql:window.matchMedia(e)},n.mql.addListener(this._mqlChange.bind(this)),i.set(e,n)),n},_mqlChange:function(e){var i=this._getQueryObject(e.media);e.matches?(i.callbacksSetup.size&&(i.callbacksSetup.forEach(function(e){e()}),i.callbacksSetup=new t),i.callbacksMatch.forEach(function(e){e()})):i.callbacksUnmatch.forEach(function(e){e()})}}}),define("WoltLab/WCF/Ui/Page/Menu/Abstract",["Environment","EventHandler","ObjectMap","Dom/Traverse","Dom/Util","Ui/Screen"],function(e,t,i,n,a,r){"use strict";function o(e,t,i){this.init(e,t,i)}var s=elById("pageContainer");return o.prototype={init:function(e,n,r){this._activeList=[],this._depth=0,this._enabled=!0,this._eventIdentifier=e,this._items=new i,this._menu=elById(n),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),document.documentElement.classList.add("pageOverlayActive"))},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),document.documentElement.classList.remove("pageOverlayActive"))},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 i=e.parentNode,a=elData(i,"more");if(a)return void e.addEventListener(WCF_CLICK_EVENT,function(n){n.preventDefault(),n.stopPropagation(),t.fire(this._eventIdentifier,"more",{handler:this,identifier:a,item:e,parent:i})}.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",i.insertBefore(r,e),r.appendChild(e);r.nextElementSibling;)r.appendChild(r.nextElementSibling);else{var s="#"!==elAttr(e,"href"),l=i.parentNode,c=elData(o,"title");this._items.set(e,{itemList:o,parentItemList:l}),""===c&&(c=n.childByClass(e,"menuOverlayItemTitle").textContent,elData(o,"title",c));var d=this._showItemList.bind(this,e);if(s){r=elCreate("span"),r.className="menuOverlayItemWrapper",i.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 i=elCreate("span");i.className="menuOverlayLogoWrapper",t.appendChild(i);var a=elCreate("span");a.className="menuOverlayLogo",a.style.setProperty("background-image",'url("'+elData(this._menu,"page-logo")+'")',""),i.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=n.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 i=this._items.get(e);i.parentItemList.classList.remove("hidden"),this._updateDepth(!1)},_showItemList:function(e,i){i instanceof Event&&i.preventDefault();var n=this._items.get(e),a=elData(n.itemList,"load");if(a&&!elDataBool(e,"loaded")){var r=i.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"),n.itemList.classList.add("activeList"),n.parentItemList.classList.add("hidden"),this._activeList.push(n.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 i(){this.init()}return e.inherit(i,t,{init:function(){i._super.prototype.init.call(this,"com.woltlab.wcf.MainMenuMobile","pageMainMenuMobile","#pageHeader .mainMenu")}}),i}),define("WoltLab/WCF/Ui/Page/Menu/User",["Core","EventHandler","./Abstract"],function(e,t,i){"use strict";function n(){this.init()}return e.inherit(n,i,{init:function(){n._super.prototype.init.call(this,"com.woltlab.wcf.UserMenuMobile","pageUserMenuMobile","#pageHeader .userPanel")}}),n}),define("WoltLab/WCF/Ui/Mobile",["Core","Environment","EventHandler","Language","List","Dom/ChangeListener","Ui/CloseOverlay","Ui/Screen","./Page/Menu/Main","./Page/Menu/User"],function(e,t,i,n,a,r,o,s,l,c){"use strict";var d=elByClass("buttonGroupNavigation"),u=!1,h=new a,p=null,f=elByClass("message"),m={},g=null,v=null;return{setup:function(i){m=e.extend({enableMobileMenu:!0},i),p=elById("main"),t.touch()&&document.documentElement.classList.add("touch"),"desktop"!==t.platform()&&document.documentElement.classList.add("mobile"),s.on("screen-md-down",{match:this.enable.bind(this),unmatch:this.disable.bind(this),setup:this._init.bind(this)})},enable:function(){u=!0,m.enableMobileMenu&&(g.enable(),v.enable())},disable:function(){u=!1,m.enableMobileMenu&&(g.disable(),v.disable())},_init:function(){u=!0,this._initSearchBar(),this._initButtonGroupNavigation(),this._initMessages(),this._initMobileMenu(),o.add("WoltLab/WCF/Ui/Mobile",this._closeAllMenus.bind(this)),r.add("WoltLab/WCF/Ui/Mobile",this._initButtonGroupNavigation.bind(this))},_initSearchBar:function(){var e=elById("pageHeaderSearch"),t=elById("pageHeaderSearchInput");i.add("com.woltlab.wcf.MainMenuMobile","more",function(i){"com.woltlab.wcf.search"===i.identifier&&(e.style.setProperty("top",elById("pageHeader").offsetHeight+"px",""),e.classList.add("open"),t.focus(),i.handler.close(!0))}),p.addEventListener(WCF_CLICK_EVENT,function(){e.classList.remove("open")})},_initButtonGroupNavigation:function(){for(var e=0,t=d.length;t>e;e++){var i=d[e];if(!i.classList.contains("jsMobileButtonGroupNavigation")){i.classList.add("jsMobileButtonGroupNavigation"),i.parentNode.classList.add("hasMobileNavigation");var n=elCreate("a");n.className="dropdownLabel";var a=elCreate("span");a.className="icon icon24 fa-ellipsis-v",n.appendChild(a);var r=elBySel(".buttonList",i);r.addEventListener(WCF_CLICK_EVENT,function(e){e.stopPropagation()}),function(e,t){t.addEventListener(WCF_CLICK_EVENT,function(t){t.preventDefault(),t.stopPropagation(),e.classList.toggle("open")})}(i,n),i.insertBefore(n,i.firstChild)}}},_initMessages:function(){Array.prototype.forEach.call(f,function(e){if(!h.has(e)){var t=elBySel(".jsMobileNavigation",e),i=elBySel(".messageQuickOptions",e);i&&(i.addEventListener(WCF_CLICK_EVENT,function(e){u&&(e.preventDefault(),e.stopPropagation(),t.classList.toggle("open"))}),t.addEventListener(WCF_CLICK_EVENT,function(e){e.stopPropagation()})),h.add(e)}})},_initMobileMenu:function(){m.enableMobileMenu&&(g=new l,v=new c),elBySelAll(".boxMenu",null,function(e){e.addEventListener(WCF_CLICK_EVENT,function(t){t.stopPropagation(),t.target===e&&(t.preventDefault(),e.classList.add("open"))})})},_closeAllMenus:function(){elBySelAll(".jsMobileButtonGroupNavigation.open, .jsMobileNavigation.open, .boxMenu.open",null,function(e){e.classList.remove("open")})}}}),define("WoltLab/WCF/Ui/TabMenu/Simple",["Dictionary","EventHandler","Dom/Traverse","Dom/Util"],function(e,t,i,n){"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=i.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=i.childrenByTag(this._container,"DIV");for(o=0,s=l.length;s>o;o++)a=l[o],r=elData(a,"name"),r||(r=n.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 i=window.location.hash.replace(/^#/,""),n=null;if(""!==i&&(n=this._tabs.get(i),n&&this._container.parentNode.classList.contains("tabMenuContainer")&&(t=this._container)),!n){var a=elData(this._container,"preselect")||elData(this._container,"active");"true"!==a&&a||(a=!0),a===!0?this._tabs.forEach(function(e){n||e.previousElementSibling||(n=e)}):"false"!==a&&(n=this._tabs.get(a))}n&&(this._containers.forEach(function(e){e.classList.add("hidden")}),this.select(null,n,!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,i,n){if(i=i||this._tabs.get(e),!i){if(~~e==e){e=~~e;var a=0;this._tabs.forEach(function(t){a===e&&(i=t),a++})}if(!i)throw new Error("Expected a valid tab name, '"+e+"' given (tab menu id: '"+this._container.id+"').")}e=e||elData(i,"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"))}i.classList.add("active");var s=this._containers.get(e);if(s.classList.add("active"),s.classList.remove("hidden"),this._isLegacy&&(i.classList.add("ui-state-active"),s.classList.add("ui-state-active")),this._store&&(this._store.value=e),!n){t.fire("com.woltlab.wcf.simpleTabMenu_"+this._container.id,"select",{active:i,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(i),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,i,n,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)),n.add("WoltLab/WCF/Ui/TabMenu",function(){r&&(r.classList.remove("active"),r=null)})},_init:function(){for(var e,t,n,s,l,c=elBySelAll(".tabMenuContainer:not(.staticTabMenuContainer)"),d=0,u=c.length;u>d;d++)e=c[d],t=i.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)),n=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)})}(n)))},_selectErroneousTabs:function(){o.forEach(function(e){var t=!1;e.getContainers().forEach(function(i){!t&&elByClass("formError",i).length&&(t=!0,e.select(i.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,i,n,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)),i.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 i=n.childByTag(t,"UL");if(null===i)throw"Expected an <ul> element as child of container '"+e+"'.";o.set(e,t),c.set(e,i),this.rebuild(e)}},registerTabMenus:function(){for(var e=elBySelAll(".tabMenuContainer:not(.jsFlexibleMenuEnabled), .messageTabMenu:not(.jsFlexibleMenuEnabled)"),t=0,i=e.length;i>t;t++){var r=e[t],o=n.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 i=o.get(t);if(void 0===i)throw"Expected a valid element id, '"+t+"' is unknown.";var d=window.getComputedStyle(i),u=i.parentNode.clientWidth;u-=a.styleAsInt(d,"margin-left"),u-=a.styleAsInt(d,"margin-right");var h=c.get(t),p=n.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(i){var n=elCreate("li");n.innerHTML=i.innerHTML,n.addEventListener(WCF_CLICK_EVENT,function(n){n.preventDefault(),
 e.triggerEvent(elBySel("a",i),WCF_CLICK_EVENT),setTimeout(function(){E.rebuild(t)},59)}.bind(this)),L.appendChild(n)}),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,i){"use strict";var n=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),n=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;n.length;)e=n[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,n=elAttr(t,"title");return n="string"==typeof n?n.trim():"",""!==n&&(elData(t,"tooltip",n),t.removeAttribute("title")),n=elData(t,"tooltip"),o.style.removeProperty("top"),o.style.removeProperty("left"),n.length?(o.classList.add("active"),r.textContent=n,void i.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,i,n,a,r){"use strict";var o=!1,s=0,l=new i,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)'),i=new Date,n=0,a=t.length;a>n;n++){var r=t[n];r.classList.add("inputDatePicker"),r.readOnly=!0;var o="datetime"===elAttr(r,"type"),s=o&&elDataBool(r,"time-only");elData(r,"is-date-time",o),elData(r,"is-time-only",s);var c=null,d=elAttr(r,"value");if(elAttr(r,"value")){if(s){c=new Date;var u=d.split(":");c.setHours(u[0],u[1])}else c=new Date(d);elData(r,"value",c.getTime());var h=s?"formatTime":"formatDate"+(o?"Time":"");d=e[h](c)}var p=0===d.length;if(r.classList.contains("birthday")?(elData(r,"min-date","100"),elData(r,"max-date","now")):(r.min&&elData(r,"min-date",r.min),r.max&&elData(r,"max-date",r.max)),this._initDateRange(r,i,!0),this._initDateRange(r,i,!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=d,elData(r,"empty",p),elData(r,"placeholder")&&elAttr(r,"placeholder",elData(r,"placeholder"));var f=elCreate("input");f.id=r.id+"DatePicker",f.name=r.name,f.type="hidden",null!==c&&(s?f.value=e.format(c,"H:i"):f.value=e.format(c,o?"c":"Y-m-d")),r.parentNode.insertBefore(f,r),r.removeAttribute("name"),r.addEventListener(WCF_CLICK_EVENT,w);var m=elCreate("div");m.className="inputAddon";var g=elCreate("a");g.className="inputSuffix button",g.addEventListener(WCF_CLICK_EVENT,w),m.appendChild(g);var v=elCreate("span");v.className="icon icon16 fa-calendar",g.appendChild(v),r.parentNode.insertBefore(m,r),m.insertBefore(r,g),g=elCreate("a"),g.className="inputSuffix button",g.addEventListener(WCF_CLICK_EVENT,this.clear.bind(this,r)),p&&g.style.setProperty("visibility","hidden",""),m.appendChild(g),v=elCreate("span"),v.className="icon icon16 fa-times",g.appendChild(v);for(var b=!1,_=["tiny","short","medium","long"],y=0;4>y;y++)r.classList.contains(_[y])&&(b=!0);b||r.classList.add("short"),l.set(r,{clearButton:g,shadow:f,isDateTime:o,isEmpty:p,isTimeOnly:s,onClose:null})}},_initDateRange:function(e,t,i){var n="data-"+(i?"min":"max")+"-date",a=e.hasAttribute(n)?elAttr(e,n).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*(i?-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=/^\d{4}\-\d{2}\-\d{2}T/.test(a)?new Date(a).getTime():new Date(i?1970:2038,0,1).getTime();elAttr(e,n,a)},_setup:function(){o||(o=!0,s=~~t.get("wcf.date.firstDayOfTheWeek"),w=this._open.bind(this),n.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 i,n=l.get(c),r=elData(c,"value");r?(i=new Date(+r),"Invalid Date"===i.toString()&&(i=new Date)):i=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),n.isDateTime?(f.value=i.getHours(),m.value=i.getMinutes(),C.classList.add("datePickerTime")):C.classList.remove("datePickerTime"),C.classList[n.isTimeOnly?"add":"remove"]("datePickerTimeOnly"),this._renderPicker(i.getDate(),i.getMonth(),i.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,i){this._renderGrid(e,t,i);for(var n="",a=u.getFullYear(),r=d.getFullYear();r>=a;a++)n+='<option value="'+a+'">'+a+"</option>";y.innerHTML=n,y.value=i,g.value=t,C.classList.add("active")},_renderGrid:function(e,t,i){var n,a,r=void 0!==e,o=void 0!==t;if(e=~~e||~~elData(p,"day"),t=~~t,i=~~i,o||i){var l=0!==i,c=document.createDocumentFragment();c.appendChild(p),o||(t=~~elData(p,"month")),i=i||~~elData(p,"year");var f=new Date(i+"-"+("0"+(t+1).toString()).slice(-2)+"-"+("0"+e.toString()).slice(-2));for(u>f?(i=u.getFullYear(),t=u.getMonth(),e=u.getDate(),g.value=t,y.value=i,l=!0):f>d&&(i=d.getFullYear(),t=d.getMonth(),e=d.getDate(),g.value=t,y.value=i,l=!0),f=new Date(i+"-"+("0"+(t+1).toString()).slice(-2)+"-01");f.getDay()!==s;)f.setDate(f.getDate()-1);var m;for(a=0;35>a;a++)n=h[a],n.textContent=f.getDate(),m=f.getMonth()===t,m&&(u>f?m=!1:f>d&&(m=!1)),n.classList[m?"remove":"add"]("otherMonth"),f.setDate(f.getDate()+1);if(elData(p,"month",t),elData(p,"year",i),C.insertBefore(c,_),!r&&(f=new Date(i,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=i===u.getFullYear()&&w.value<u.getMonth()||i===d.getFullYear()&&w.value>d.getMonth()}var L=new Date(i+"-"+("0"+(t+1).toString()).slice(-2)+"-01");L.setMonth(L.getMonth()+1),v.classList[d>L?"add":"remove"]("active");var E=new Date(i+"-"+("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++)n=h[a],n.classList[n.classList.contains("otherMonth")||~~n.textContent!==e?"remove":"add"]("active");elData(p,"day",e)}this._formatValue()},_formatValue:function(){var t,i,n,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),a.isTimeOnly?(i=e.formatTime(t),n=e.format(t,"H:i")):(i=e.formatDateTime(t),n=e.format(t,"c"))):(t=new Date(elData(p,"year"),elData(p,"month"),elData(p,"day")),i=e.formatDate(t),n=e.format(t,"Y-m-d")),c.value=i,elData(c,"value",t.getTime()),a.clearButton.style.removeProperty("visibility"),a.shadow.value=n)},_createPicker:function(){if(null===C){C=elCreate("div"),C.className="datePicker",C.addEventListener(WCF_CLICK_EVENT,function(e){e.stopPropagation()});var i=elCreate("header");C.appendChild(i),b=elCreate("a"),b.className="previous",b.innerHTML='<span class="icon icon16 fa-arrow-left"></span>',b.addEventListener(WCF_CLICK_EVENT,this.previousMonth.bind(this)),i.appendChild(b);var n=elCreate("span");i.appendChild(n),g=elCreate("select"),g.className="month",g.addEventListener("change",this._changeMonth.bind(this));var a=elCreate("label");a.className="selectDropdown",a.appendChild(g),n.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),n.appendChild(a),v=elCreate("a"),v.className="next",v.innerHTML='<span class="icon icon16 fa-arrow-right"></span>',v.addEventListener(WCF_CLICK_EVENT,this.nextMonth.bind(this)),i.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 S="",D=new Date(2e3,0,1),I=t.get("wcf.date.timeFormat").replace(/:/,"").replace(/[isu]/g,"");for(r=0;24>r;r++)D.setHours(r),S+='<option value="'+r+'">'+e.format(D,I)+"</option>";for(f.innerHTML=S,_.appendChild(f),_.appendChild(document.createTextNode(" : ")),m=elCreate("select"),m.className="minute",m.addEventListener("change",this._formatValue.bind(this)),S="",r=0;60>r;r++)S+='<option value="'+r+'">'+(10>r?"0"+r.toString():r)+"</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,i){t=this._getElement(t);var n=l.get(t);elData(t,"value",i.getTime()),t.value=e["formatDate"+(n.isDateTime?"Time":"")](i),n.shadow.value=e.format(i,n.isDateTime?"c":"Y-m-d")},clear:function(e){e=this._getElement(e);var t=l.get(e);e.removeAttribute("data-value"),e.value="",t.clearButton.style.setProperty("visibility","hidden",""),t.isEmpty=!0,t.shadow.value=""},destroy:function(e){e=this._getElement(e);var t=l.get(e),i=e.parentNode;i.parentNode.insertBefore(e,i),elRemove(i),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 i=new e,n=null,a=!1;return{setup:function(){a=!0,n=elCreate("ul"),n.className="pageAction",document.body.appendChild(n)},add:function(e,r,o){a===!1&&this.setup();var s=elCreate("li");if(r.classList.add("button"),r.classList.add("buttonPrimary"),s.appendChild(r),elAttr(s,"aria-hidden","toTop"===e?"true":"false"),elData(s,"name",e),"toTop"===e)s.className="toTop initiallyHidden",n.appendChild(s);else{var l=null;o&&(l=i.get(o),void 0!==l&&(l=l.parentNode)),null===l&&n.childElementCount&&(l=n.children[0]),null===l?t.prepend(s,n):n.insertBefore(s,l)}i.set(e,r),this._renderContainer()},has:function(e){return i.has(e)},get:function(e){return i.get(e)},remove:function(e){var t=i.get(e);if(void 0!==t){var a=t.parentNode;a.addEventListener("animationend",function(){n.removeChild(a),i["delete"](e)}),this.hide(e)}},hide:function(e){var t=i.get(e);t&&(elAttr(t.parentNode,"aria-hidden","true"),this._renderContainer())},show:function(e){var t=i.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(n.childElementCount)for(var t=0,i=n.childElementCount;i>t;t++)if("false"===elAttr(n.children[t],"aria-hidden")){e=!0;break}n.classList[e?"add":"remove"]("active")}}}),define("WoltLab/WCF/Ui/Page/JumpToTop",["Environment","Language","./Action"],function(e,t,i){"use strict";function n(){this.init()}return n.prototype={init:function(){if("desktop"===e.platform()){this._callbackScrollEnd=this._afterScroll.bind(this),this._timeoutScroll=null;var n=elCreate("a");n.className="jsTooltip",n.href="#",elAttr(n,"title",t.get("wcf.global.scrollUp")),n.innerHTML='<span class="icon icon32 fa-angle-up"></span>',n.addEventListener(WCF_CLICK_EVENT,this._jump.bind(this)),i.add("toTop",n),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,i[window.scrollY>=window.innerHeight/2?"show":"hide"]("toTop")}},n}),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,i,n,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(),n.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]"),i=0,s=t.length;s>i;i++)t[i].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,i){"use strict";var n={setup:function(){var e=elBySel("#footerNavigation > ul.navigationItems");if(null!==e){var i=elCreate("li");i.classList.add("styleChanger"),i.addEventListener(WCF_CLICK_EVENT,this.showDialog.bind(this));var n=elCreate("a");elAttr(n,"href","#"),n.textContent=t.get("wcf.style.changeStyle"),i.appendChild(n),e.appendChild(i)}},showDialog:function(e){e.preventDefault(),i.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),i=0,n=t.length;n>i;i++){var a=t[i];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 n}),define("WoltLab/WCF/Controller/Popover",["Ajax","Dictionary","Environment","Dom/ChangeListener","Dom/Util","Ui/Alignment"],function(e,t,i,n,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)),n.add("WoltLab/WCF/Controller/Popover",this._init.bind(this))}},init:function(e){"desktop"===i.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 i=e.legacy?elBySelAll(e.elements):e.elements,n=0,r=i.length;r>n;n++){var o=i[n],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,i){var n=e+"-"+t,r=s.get(n);if(void 0===r)throw new Error("Unable to find element for object id '"+t+"' (identifier: '"+e+"').");if(r.content=a.createFragmentFromHtml(i),r.state=w,o){var c=l.get(o).element;elData(c,"cache-id")===n&&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),i=s.get(elData(t.element,"cache-id"));i.state===w?(m.appendChild(i.content),this._rebuild(o)):i.state===y&&(i.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,i,n){if("function"!=typeof i)throw new TypeError("Expected a valid callback for parameter 'success'.");e.api(this,t,i,n)}}}),define("WoltLab/WCF/Ui/User/Ignore",["List","Dom/ChangeListener"],function(e,t){"use strict";var i=elByClass("ignoredUserMessage"),n=null,a=new e;return{init:function(){n=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=i.length;r>t;t++)e=i[t],a.has(e)||(e.addEventListener(WCF_CLICK_EVENT,n),a.add(e))},_removeClass:function(e){e.preventDefault();var t=e.currentTarget;t.classList.remove("ignoredUserMessage"),t.removeEventListener(WCF_CLICK_EVENT,n),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,i,n,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(){n.init({attributeName:"data-user-id",className:"userLink",identifier:"com.woltlab.wcf.user",loadCallback:function(e,t){var i=function(i){t.setContent("com.woltlab.wcf.user",e,i.returnValues.template)};t.ajaxApi({actionName:"getUserProfile",className:"wcf\\data\\user\\UserProfileAction",objectIDs:[e]},i,i)}})},_invokeBackgroundQueue:function(t,i){var n=this._invokeBackgroundQueue.bind(this,t,!0);(Math.random()<.1||i)&&e.apiOnce({url:t,ignoreError:!0,silent:!0,success:function(e){r++,e>0&&5>r&&setTimeout(n,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,i){var n="0123456789ABCDEF";return void 0===t&&e.match(/^rgba?\((\d+), ?(\d+), ?(d\+)(?:, ?[0-9.]+)?\)$/)&&(e=RegExp.$1,t=RegExp.$2,i=RegExp.$3),n.charAt((e-e%16)/16)+""+n.charAt(e%16)+(n.charAt((t-t%16)/16)+""+n.charAt(t%16))+(n.charAt((i-i%16)/16)+""+n.charAt(i%16))}};return e}),define("WoltLab/WCF/Permission",["Dictionary"],function(e){"use strict";var t=new e;return{add:function(e,i){if("boolean"!=typeof i)throw new TypeError("Permission value has to be boolean.");t.set(e,i)},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}}}),define("WoltLab/WCF/Upload",["AjaxRequest","Core","Dom/ChangeListener","Language","Dom/Util","Dom/Traverse"],function(e,t,i,n,a,r){"use strict";function o(e,i,n){if(n=n||{},void 0===n.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},n),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(i),null===i)throw new Error("Element id '"+i+"' is unknown.");if(n.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=n.get("wcf.global.button.upload"),this._button.appendChild(e),a.prepend(this._fileUpload,this._button),this._insertButton(),i.trigger()},_createFileElement:function(e){var t=elCreate("progress");if(elAttr(t,"max",100),"OL"===this._target.nodeName||"UL"===this._target.nodeName){var i=elCreate("li");return i.innerText=e.name,i.appendChild(t),this._target.appendChild(i),i}var n=elCreate("p");return n.appendChild(t),this._target.appendChild(n),n},_createFileElements:function(e){if(e.length){var t=this._fileElements.length;this._fileElements[t]=[];for(var n=0,a=e.length;a>n;n++){var r=e[n],o=this._createFileElement(r);o.classList.contains("uploadFailed")||(elData(o,"filename",r.name),elData(o,"internal-file-id",this._internalFileId++),this._fileElements[t][n]=o)}return i.trigger(),t}return null},_failure:function(e,t,i,n,a){return!0},_getParameters:function(){return{}},_insertButton:function(){a.prepend(this._button,this._buttonContainer)},_progress:function(e,t){var i=Math.round(t.loaded/t.total*100);for(var n in this._fileElements[e]){var a=elByTag("PROGRESS",this._fileElements[e][n]);1===a.length&&elAttr(a[0],"value",i)}},_removeButton:function(){elRemove(this._button),i.trigger()},_success:function(e,t,i,n,a){},_upload:function(e,t,i){for(var n=r.childrenByClass(this._target,"uploadFailed"),a=0,o=n.length;o>a;a++)elRemove(n[a]);var s=null,l=[];if(t)l.push(t);else if(i){var c="";switch(i.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]],i))}else s=this._uploadFiles(l,i);return this._removeButton(),this._createButton(),s},_uploadFiles:function(t,i){var n=this._createFileElements(t);if(!this._fileElements[n].length)return null;for(var a=new FormData,r=0,o=t.length;o>r;r++)if(this._fileElements[n][r]){var s=elData(this._fileElements[n][r],"internal-file-id");i?a.append("__files["+s+"]",i,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 i in e)"object"==typeof e[i]?l(e[i],t+"["+i+"]"):a.append("parameters"+t+"["+i+"]",e[i])};l(this._getParameters());var c=new e({data:a,contentType:!1,failure:this._failure.bind(this,n),silent:!0,success:this._success.bind(this,n),uploadProgress:this._progress.bind(this,n),url:this._options.url});return c.sendRequest(),n}},o}),define("WoltLab/WCF/Ajax/Jsonp",["Core"],function(e){"use strict";var t={send:function(t,i,n,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 i)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 n&&n()},1e3*(~~a.timeout||10));window[r]=function(){window.clearTimeout(o),i.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,i,n,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}),i.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=n.get("wcf.attachment.insertAll"),i.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 i=elCreate("span");this._options.maxSize>=e.size?i.className="icon icon48 fa-spinner":i.className="icon icon48 fa-ban-circle",t.appendChild(i);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=n.get("wcf.attachment.upload.error.tooLarge"),r.appendChild(s),t.classList.add("uploadFailed"))},_createFileElements:function(e){for(var t=i.childrenBySel(this._target,"li.uploadFailed"),n=0,a=t.length;a>n;n++)this._target.removeChild(t[n]);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=i.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=n.get("wcf.global.button.delete"),elData(b,"object-id",h.attachmentID),elData(b,"confirm-message",n.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=n.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=n.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=n.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=n.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"))}i.childrenBySel(this._target,"li:not(.uploadFailed)").length?elShow(this._insertAllButton):elHide(this._insertAllButton),t.trigger()},_upload:function(e,t,i){this._validateLimit()&&r.prototype._upload.call(this,e,t,i)},_validateLimit:function(){var e=i.nextBySel(this._button,"small.innerError"),t=this._options.maxUploads-i.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=n.get("wcf.attachment.upload.error.reachedLimit"):e.textContent=n.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,i;e.length;)t=e[0],t.classList.remove("jsCollapsibleBbcode"),i=elBySel(".toggleButton"),null!==i&&!function(e,t){var i=function(){var i=e.classList.contains("collapsed");e.classList[i?"remove":"add"]("collapsed"),t.textContent=elData(t,"title-"+(i?"collapse":"expand"))};t.addEventListener(WCF_CLICK_EVENT,i),e.addEventListener("scroll",i),0!==e.scrollTop&&i()}(t,i)}};return t}),define("WoltLab/WCF/Bbcode/FromHtml",["EventHandler","StringUtil","Dom/Traverse"],function(e,t,i){"use strict";function n(e,t){var i=e[t?"previousSibling":"nextSibling"];return null!==i&&i.nodeType===Node.TEXT_NODE&&/\s$/.test(i.textContent)?!1:!0}var a=[],r={},o=[],s={convert:function(t){t.length&&this._setup();var i=elCreate("div");i.innerHTML=t;for(var n=elByTag("P",i);n.length;)n[0].outerHTML=n[0].innerHTML;for(n=elByTag("BR",i);n.length;)n[0].outerHTML="\n";var r=this._preserveSourceElements(i);e.fire("com.woltlab.wcf.bbcode.fromHtml","beforeConvert",{container:i});for(var o=0,s=a.length;s>o;o++)this._convert(i,a[o]);for(e.fire("com.woltlab.wcf.bbcode.fromHtml","afterConvert",{container:i}),this._restoreSourceElements(i,r),n=elByTag("*",i);n.length;)n[0].outerHTML=n[0].innerHTML;return t=this._convertSpecials(i.innerHTML)},_preserveSourceElements:function(e){for(var t,i,n=[],a=0,r=o.length;r>a;a++){t=elBySelAll(o[a].selector,e),i=[];for(var s=0,l=t.length;l>s;s++)this._preserveSourceElement(t[s],i);n.push(i)}return n},_preserveSourceElement:function(e,t){var i=elCreate("var");elData(i,"source","wcf"),e.parentNode.insertBefore(i,e);var n=document.createDocumentFragment();n.appendChild(e),t.push({fragment:n,placeholder:i})},_restoreSourceElements:function(e,t){for(var i,n,a,r=0,s=t.length;s>r;r++)if(n=t[r],0!==n.length)for(var l=0,c=n.length;c>l;l++)i=n[l],a=i.placeholder,a.parentNode.insertBefore(i.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 i,n=elByTag(t.tagName,e);n.length;)i=n[0],t.bbcode?i.outerHTML="["+t.bbcode+"]"+i.innerHTML+"[/"+t.bbcode+"]":t.callback(i)},_convertBlockquote:function(e){var n=elData(e,"author"),a=elAttr(e,"cite"),r="[quote]";n&&(n=t.escapeHTML(n).replace(/(\\)?'/g,function(e,t){return t?e:"\\'"}),r=a?"[quote='"+n+"','"+t.escapeHTML(a)+"']":"[quote='"+n+"']");var o=i.childByTag(e,"HEADER");null!==o&&e.removeChild(o);for(var s=i.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=(n(e,!0)?" ":"")+elAttr(e,"alt")+(n(e,!1)?" ":""));var t=e.style.getPropertyValue("float")||"none",i=e.style.getPropertyValue("width");if(i="string"==typeof i?~~i.replace(/px$/,""):0,e.classList.contains("redactorEmbeddedAttachment")){var a=elData(e,"attachment-id");i>0?e.outerHTML="[attach="+a+","+t+","+i+"][/attach]":"none"!==t?e.outerHTML="[attach="+a+","+t+"][/attach]":e.outerHTML="[attach="+a+"][/attach]"}else{var r=e.src.trim();i>0?e.outerHTML="[img='"+r+"',"+t+","+i+"][/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 i=e.style.getPropertyValue("list-style-type")||"";t=""===i?"[list]":"[list="+("lower-latin"===i?"a":i)+"]"}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,i,n=0,a=r.span.length;a>n;n++)t=r.span[n],t.style?(i=e.style.getPropertyValue(t.style)||"",i&&t.callback(e,i)):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,i,n=0,a=r.div.length;a>n;n++)t=r.div[n],t.className&&e.classList.contains(t.className)?t.callback(e):t.style&&(i=e.style.getPropertyValue(t.style)||"",i&&t.callback(e,i));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 i=RegExp.$1,n=RegExp.$2,a=RegExp.$3,r="0123456789ABCDEF";t="#"+(r.charAt((i-i%16)/16)+""+r.charAt(i%16))+(r.charAt((n-n%16)/16)+""+r.charAt(n%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 n=i.childByTag(e,"TBODY"),a=null===n?e.innerHTML:n.innerHTML;e.outerHTML="\n[table]"+a+"\n[/table]\n"},_convertUrl:function(e){var t=e.textContent.trim(),i=e.href.trim(),n="url";return""===i||""===t?void(e.outerHTML=e.innerHTML):(0===i.indexOf("mailto:")&&(i=i.substr(7),n="email"),void(i===t?e.outerHTML="["+n+"]"+i+"[/"+n+"]":e.outerHTML="["+n+"='"+i+"']"+e.innerHTML+"[/"+n+"]"))},_convertSourceCodeBox:function(e){var t=elData(e,"filename").trim()||"",n=elData(e,"highlighter");window.dtdesign=e;for(var a=i.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='"+n+"',"+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,i,n=__REDACTOR_BBCODES.join("|"),a="(\\[(?:/(?:"+n+")|(?:"+n+")(?:=(?:\\'[^\\'\\\\]*(?:\\\\.[^\\'\\\\]*)*\\'|[^,\\]]*)(?:,(?:\\'[^\\'\\\\]*(?:\\\\.[^\\'\\\\]*)*'|[^,\\]]*))*)?)\\])",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)?(i={name:"",closing:!1,attributes:[],source:t},"/"===t[1]?(i.name=t.substring(2,t.length-1),i.closing=!0):t.match(/^\[([a-z0-9]+)=?(.*)\]$/i)&&(i.name=RegExp.$1,RegExp.$2&&(i.attributes=this._parseAttributes(RegExp.$2))),s.push(i)):s.push(t));return s},_buildLinearTree:function(e){for(var t,i,n=[],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(n,t.name)){i=this._closeUnclosedTags(e,n,t.name);for(var o=0,s=i.length;s>o;o++)e.splice(r,i[o]),r++;n.pop().pair=r}else e[r]=t.source;a===t.name&&(a="")}else n.push(t),-1!==__REDACTOR_SOURCE_BBCODES.indexOf(t.name)&&(a=t.name)}this._closeUnclosedTags(e,n,"")},_closeUnclosedTags:function(e,t,i){for(var n,a,r=[],o=t.length-1;o>=0&&(n=t[o],n.name!==i);o--)a={name:n.name,closing:!0,attributes:n.attributes.slice(),source:"[/"+n.name+"]"},n.pair=e.length,e.push(a),t.pop(),r.push({name:n.name,closing:!1,attributes:n.attributes.slice(),source:n.source});return r.reverse()},_hasOpenTag:function(e,t){for(var i=e.length-1;i>=0;i--)if(e[i].name===t)return!0;return!1},_parseAttributes:function(e){for(var t,i=e.split(/(?:^|,)('[^'\\\\]*(?:\\\\.[^'\\\\]*)*'|[^,]*)/g),n=[],a=0,r=i.length;r>a;a++)t=i[a],""!==t&&("'"===t.charAt(0)&&"'"===t.substr(-1)?n.push(t.substring(1,t.length-1).trim()):n.push(t.trim()));return n}};return e}),define("WoltLab/WCF/Bbcode/ToHtml",["Core","EventHandler","Language","StringUtil","WoltLab/WCF/Bbcode/Parser"],function(e,t,i,n,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(i,n){c=e.extend({attachments:{images:{},thumbnailUrl:"",url:""}},n),this._convertSpecials(i);var r=a.parse(i);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}),i=r.join(""),i=i.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,i){var n,a=l[t.name];return void 0===a?[null,null]:(-1!==d.indexOf(t.name)&&(n=e[i+1],"string"==typeof n&&(e[i+1]=n.replace(/^\n/,"")),e.length>t.pair+1&&(n=e[t.pair+1],"string"==typeof n&&(e[t.pair+1]=n.replace(/^\n/,"")))),-1!==u.indexOf(t.name)&&(i-1>=0&&(n=e[i-1],"string"==typeof n&&(e[i-1]=n.replace(/\n$/,""))),n=e[t.pair-1],"string"==typeof n&&(e[t.pair-1]=n.replace(/\n$/,""))),this._convertSmilies(e),"string"==typeof a?["<"+a+">","</"+a+">"]:a(e,t,i))},_convertAlignment:function(e,t,i){var n=t.attributes.length?t.attributes[0]:"";return-1===["center","justify","left","right"].indexOf(n)?[null,null]:['<div style="text-align: '+n+'">',"</div>"]},_convertAttachment:function(e,t,i){var n=0,a=t.attributes,r=a.length;if(c.attachments.url?r>0&&(n=~~a[0],objOwns(c.attachments.images,n)||(r=0)):r=0,0===r)return[null,null];var o=~~c.attachments.images[n].height,s=~~c.attachments.images[n].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/,n)+'" class="redactorEmbeddedAttachment redactorDisableResize" data-attachment-id="'+n+'"'+(l.length?' style="'+l.join(";")+'"':"")+">",""]},_convertCode:function(e,t,i){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=i+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]?n.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?n.escapeHTML(l):"")+'"><div><div><h3>'+__REDACTOR_CODE_HIGHLIGHTERS[c]+(l?": "+n.escapeHTML(l):"")+'</h3></div><ol start="'+(d>1?d:1)+'">',"</ol></div></div>"]},_convertColor:function(e,t,i){return t.attributes.length&&t.attributes[0].match(/^[a-z0-9#]+$/i)?['<span style="color: '+n.escapeHTML(t.attributes[0])+'">',"</span>"]:[null,null]},_convertEmail:function(e,t,i){var a="";if(t.attributes.length)a=t.attributes[0];else{for(var r,o=i+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:'+n.escapeHTML(a)+'">',"</a>"]},_convertImage:function(e,t,i){var a="none",r="",o=0;switch(t.attributes.length){case 0:if(!(i+1<t.pair&&"string"==typeof e[i+1]))return"";r=e[i+1],e[i+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="'+n.escapeHTML(r)+'"'+(s.length?' style="'+s.join(";")+'"':"")+">",""]},_convertList:function(e,t,i){for(var n=t.attributes.length?t.attributes[0]:"",a=i+1;a<t.pair;a++)"string"==typeof e[a]&&(e[a]=e[a].replace(/\[\*\]/g,"<li>"));return"1"==n||"decimal"===n?["<ol>","</ol>"]:n.length&&n.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: '+n+'">',"</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="'+n.escapeHTML(o)+'" tabindex="-1">'),l+=i.get("wcf.bbcode.quote.title.javascript",{quoteAuthor:r.replace(/\\'/g,"'")}),o&&(l+="</a>")):l="<small>"+i.get("wcf.bbcode.quote.title.clickToSet")+"</small>",['<blockquote class="quoteBox container containerPadding quoteBoxSimple" cite="'+n.escapeHTML(o)+'" data-author="'+n.escapeHTML(r)+'"><header contenteditable="false"><h3>'+l+'</h3><a class="redactorQuoteEdit"></a></header><div>​',"</div></blockquote>"]},_convertSmilies:function(e){for(var t,i,a,r=0,o=e.length;o>r;r++)if(i=e[r],"string"==typeof i){for(var s in __REDACTOR_SMILIES)objOwns(__REDACTOR_SMILIES,s)&&(t=s.replace(/</g,"&lt;").replace(/>/g,"&gt;"),a=new RegExp("(\\s|^)"+n.escapeRegExp(s)+"(?=\\s|$)","gi"),i=i.replace(a,'$1<img src="'+__REDACTOR_SMILIES[s]+'" class="smiley" alt="'+t+'">'));e[r]=i}else-1!==__REDACTOR_SOURCE_BBCODES.indexOf(i.name)&&(r=i.pair)},_convertSize:function(e,t,i){return t.attributes.length&&0!==~~t.attributes[0]?['<span style="font-size: '+~~t.attributes[0]+'pt">',"</span>"]:[null,null]},_convertUrl:function(e,t,i){return t.attributes.length?['<a href="'+n.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,i,n,a,r,o,s,l,c,d,u,h){"use strict";var p=new i,f=new i,m=new i,g=elByClass("jsClipboardContainer"),v=new o,b=new r,_={},y=null,C=null,w=null,L=!1;return{setup:function(e){if(!e.pageClassName)throw new Error("Expected a non-empty string for parameter 'pageClassName'.");if(null===y)y=this._mark.bind(this),C=this._executeAction.bind(this),w=this._unmarkAll.bind(this),_=t.extend({hasMarkedItems:!1,pageClassNames:[e.pageClassName],pageObjectId:0},e),delete _.pageClassName;else{if(e.pageObjectId)throw new Error("Cannot load secondary clipboard with page object id set.");_.pageClassNames.push(e.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 i=g[e],n=c.identify(i),a=p.get(n);if(void 0===a){var o=elBySel(".jsClipboardMarkAll",i);null!==o&&(elData(o,"container-id",n),o.addEventListener(WCF_CLICK_EVENT,this._markAll.bind(this))),a={checkboxes:elByClass("jsClipboardItem",i),element:i,markAll:o,markedObjectIds:new r},p.set(n,a)}for(var s=0,l=a.checkboxes.length;l>s;s++){var d=a.checkboxes[s];b.has(d)||(elData(d,"container-id",n),d.addEventListener(WCF_CLICK_EVENT,y),b.add(d))}}},_loadMarkedItems:function(){e.api(this,{actionName:"getMarkedItems",parameters:{pageClassNames:_.pageClassNames,pageObjectID:_.pageObjectId}})},_markAll:function(e){for(var t=e.currentTarget,i="INPUT"!==t.nodeName||t.checked,n=[],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");i?d.checked||(d.checked=!0,r.markedObjectIds.add(u),n.push(u)):d.checked&&(d.checked=!1,r.markedObjectIds["delete"](u),n.push(u));var h=l.parentByClass(t,"jsClipboardObject");null!==h&&h.classList[i?"addClass":"removeClass"]("jsMarked")}this._saveState(o,n,i)},_mark:function(e){var t=e.currentTarget,i=~~elData(t,"object-id"),n=t.checked,a=elData(t,"container-id"),r=p.get(a),o=elData(r.element,"type"),s=l.parentByClass(t,"jsClipboardObject");if(r.markedObjectIds[n?"add":"delete"](i),s.classList[n?"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,[i],n)},_saveState:function(t,i,n){e.api(this,{actionName:n?"mark":"unmark",parameters:{pageClassNames:_.pageClassNames,pageObjectID:_.pageObjectId,objectIDs:i,objectType:t}})},_executeAction:function(e){var t=e.currentTarget,i=v.get(t);if(i.url)return void(window.location.href=i.url);var a=function(){var e=elData(t,"type");n.fire("com.woltlab.wcf.clipboard",e,{data:i,listItem:t,responseData:null})},r="string"==typeof i.internalData.confirmMessage?i.internalData.confirmMessage:"",o=!0;if("object"==typeof i.parameters&&i.parameters.actionName&&i.parameters.className){if("unmarkAll"===i.parameters.actionName||Array.isArray(i.parameters.objectIDs))if(r.length){var s="string"==typeof i.internalData.template?i.internalData.template:"";d.show({confirm:function(){var e={};if(s.length)for(var n=elBySelAll("input, select, textarea",d.getContentElement()),a=0,r=n.length;r>a;a++){var o=n[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,i,e)}.bind(this),message:r,template:s})}else this._executeProxyAction(t,i)}else r.length&&(o=!1,d.show({confirm:a,message:r}));o&&a()},_executeProxyAction:function(t,i,a){a=a||{};var r="unmarkAll"!==i.parameters.actionName?i.parameters.objectIDs:[],o={data:a};if("object"==typeof i.internalData.parameters)for(var s in i.internalData.parameters)objOwns(i.internalData.parameters,s)&&(o[s]=i.internalData.parameters[s]);e.api(this,{actionName:i.parameters.actionName,className:i.parameters.className,objectIDs:r,parameters:o},function(e){if("unmarkAll"!==i.actionName){var a=elData(t,"type");n.fire("com.woltlab.wcf.clipboard",a,{data:i,listItem:t,responseData:e})}this._loadMarkedItems()}.bind(this))},_unmarkAll:function(t){var i=elData(t.currentTarget,"type");e.api(this,{actionName:"unmarkAll",parameters:{objectType:i}})},_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 i=elByClass("jsMarked",t.element);i.length;)i[0].classList.remove("jsMarked");null!==t.markAll&&(t.markAll.checked=!1);for(var n=0,a=t.checkboxes.length;a>n;n++)t.checkboxes[n].checked=!1;h.remove("wcfClipboard-"+e.returnValues.objectType)}}.bind(this));v=new o,p.forEach(function(t){var i=elData(t.element,"type"),n=e.returnValues.markedItems&&objOwns(e.returnValues.markedItems,i)?e.returnValues.markedItems[i]:[];this._rebuildMarkings(t,n)}.bind(this));var t,i=[];if(e.returnValues&&e.returnValues.items)for(t in e.returnValues.items)objOwns(e.returnValues.items,t)&&i.push(t);if(f.forEach(function(e,t){-1===i.indexOf(t)&&(h.remove("wcfClipboard-"+t),m.get(t).innerHTML="")}),e.returnValues&&e.returnValues.items){var n,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],n=!1,s=f.get(t),r=m.get(t),void 0===s?(n=!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!==i.indexOf(t)&&h.add("wcfClipboard-"+t,s),n&&(s.parentNode.classList.add("dropdown"),s.parentNode.appendChild(r),u.init(s))}}},_rebuildMarkings:function(e,t){for(var i=!0,n=0,a=e.checkboxes.length;a>n;n++){var r=e.checkboxes[n],o=l.parentByClass(r,"jsClipboardObject"),s=-1!==t.indexOf(~~elData(r,"object-id"));s||(i=!1),r.checked=s,o.classList[s?"add":"remove"]("jsMarked")}if(null!==e.markAll){e.markAll.checked=i;for(var c=e.markAll;c=c.parentNode;)if(c instanceof Element&&c.classList.contains("columnMark")){c=c.parentNode;break}c&&c.classList[i?"add":"remove"]("jsMarked")}},hideEditor:function(e){h.remove("wcfClipboard-"+e),L&&(L=!1,document.documentElement.classList.add("pageOverlayActive"))},showEditor:function(e){this._loadMarkedItems(),document.documentElement.classList.contains("pageOverlayActive")&&(document.documentElement.classList.remove("pageOverlayActive"),L=!0)}}}),define("WoltLab/WCF/Event/Key",[],function(){"use strict";function e(e,t,i){if(!(e instanceof Event))throw new TypeError("Expected a valid event when testing for key '"+t+"'.");return e.key===t||e.which===i}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)},Tab:function(t){return e(t,"Tab",9)}}}),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,i,n,a,r){"use strict";var o=new e,s=!1,l=new a,c=null;return{init:function(e,t,i,n,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",i),s.appendChild(l)),this._initElement(t,l,i,n,a,r)}},_setup:function(){s||(s=!0,c=this._submit.bind(this))},_initElement:function(e,n,a,s,d,u){var h;"DD"===n.parentNode.nodeName?(h=elCreate("div"),h.className="dropdown",n.parentNode.insertBefore(h,n)):(h=n.parentNode,h.classList.add("dropdown")),elHide(n);var p=elCreate("a");p.className="dropdownToggle dropdownIndicator boxFlag box24 inputPrefix"+("DD"===n.parentNode.nodeName?" button":""),h.appendChild(p);var f=elCreate("ul");f.className="dropdownMenu",h.appendChild(f);var m,g,v,b,_=function(t){var n=~~elData(t.currentTarget,"language-id"),a=i.childByClass(f,"active");null!==a&&a.classList.remove("active"),n&&t.currentTarget.classList.add("active"),this._select(e,n,t.currentTarget)}.bind(this);for(var y in s)if(s.hasOwnProperty(y)){var C=s[y];v=elCreate("li"),v.className="boxFlag",v.addEventListener(WCF_CLICK_EVENT,_),elData(v,"language-id",y),void 0!==C.languageCode&&elData(v,"language-code",C.languageCode),f.appendChild(v),m=elCreate("a"),m.className="box24",v.appendChild(m),g=elCreate("img"),elAttr(g,"src",C.iconPath),elAttr(g,"alt",""),g.className="iconFlag",m.appendChild(g),b=elCreate("span"),b.textContent=C.languageName,m.appendChild(b),y==a&&(p.innerHTML=v.firstChild.innerHTML)}if(u)v=elCreate("li"),v.className="dropdownDivider",f.appendChild(v),v=elCreate("li"),elData(v,"language-id",0),v.addEventListener(WCF_CLICK_EVENT,_),f.appendChild(v),m=elCreate("a"),m.textContent=t.get("wcf.global.language.noSelection"),v.appendChild(m),0===a&&(p.innerHTML=v.firstChild.innerHTML),v.addEventListener(WCF_CLICK_EVENT,_);else if(0===a){p.innerHTML=null;var w=elCreate("div");p.appendChild(w),b=elCreate("span"),b.className="icon icon24 fa-question",w.appendChild(b),b=elCreate("span"),b.textContent=t.get("wcf.global.language.noSelection"),w.appendChild(b)}r.init(p),o.set(e,{callback:d,dropdownMenu:f,dropdownToggle:p,element:n});var L=i.parentByTag(n,"FORM");if(null!==L){L.addEventListener("submit",c);var E=l.get(L);void 0===E&&(E=[],l.set(L,E)),E.push(e)}},_select:function(e,t,i){var n=o.get(e);if(void 0===i){for(var a=n.dropdownMenu.childNodes,r=0,s=a.length;s>r;r++){var l=a[r];if(~~elData(l,"language-id")===t){i=l;break}}if(void 0===i)throw new Error("Cannot select unknown language id '"+t+"'")}n.element.value=t,n.dropdownToggle.innerHTML=i.firstChild.innerHTML,o.set(e,n),"function"==typeof n.callback&&n.callback(i)},_submit:function(e){for(var t,i=l.get(e.currentTarget),n=0,a=i.length;a>n;n++)t=elCreate("input"),t.type="hidden",t.name=i[n],t.value=this.getLanguageId(i[n]),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,i,n,a,r,o,s){"use strict";var l=new t,c=!1,d=new n,u=new t,h=null,p=null,f={init:function(e,i,n,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 i)objOwns(i,l)&&s.set(~~l,a.unescapeHTML(i[l]));u.set(e,s),this._initElement(e,o,s,n,r)}},_setup:function(){c||(c=!0,h=this._dropdownToggle.bind(this),p=this._submit.bind(this))},_initElement:function(e,t,n,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=i.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,i){var n=~~elData(t.currentTarget,"language-id"),a=r.childByClass(g,"active");null!==a&&a.classList.remove("active"),n&&t.currentTarget.classList.add("active"),this._select(e,n,i||!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=i.get("wcf.global.button.disabledI18n"),_.appendChild(m),_.addEventListener(WCF_CLICK_EVENT,v),g.appendChild(_)}var y=null;if(c===!0||n.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,i,n){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&&i===~~p&&(c=a.children[0].textContent)}if(r.languageId!==i){var f=u.get(e);r.languageId&&f.set(r.languageId,r.element.value),0===i?u.set(e,new t):(r.buttonLabel.classList.contains("active")||n===!0)&&(r.element.value=f.has(i)?f.get(i):""),r.buttonLabel.textContent=c,r.buttonLabel.classList[i?"add":"remove"]("active"),r.languageId=i}r.element.blur(),r.element.focus()},_dropdownToggle:function(e,t){if("open"===t)for(var i,n,a=s.getDropdownMenu(e),r=elData(elById(e),"input-id"),o=u.get(r),l=0,c=a.childElementCount;c>l;l++)i=a.children[l],
-n=~~elData(i,"language-id"),n&&i.classList[o.has(n)||!o.size?"remove":"add"]("missingValue")},_submit:function(e){for(var t,i,n,a,r=d.get(e.currentTarget),o=0,s=r.length;s>o;o++)i=r[o],t=l.get(i),t.isEnabled&&(a=u.get(i),t.languageId&&a.set(t.languageId,t.element.value),a.size&&(a.forEach(function(t,a){n=elCreate("input"),n.type="hidden",n.name=i+"_i18n["+a+"]",n.value=t,e.currentTarget.appendChild(n)}),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 i=u.get(e);return i.set(t.languageId,t.element.value),i},setValues:function(i,n){var a=l.get(i);if(void 0===a)throw new Error("Expected a valid i18n input element, '"+i+"' is not i18n input field.");e.isPlainObject(n)&&(n=t.fromObject(n)),a.element.value="",n.has(0)&&(a.element.value=n.get(0),n["delete"](0)),u.set(i,n),a.languageId=0,this._select(i,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 i=t.buttonLabel.parentNode.parentNode;i.classList.remove("inputAddon"),i.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 i=t.buttonLabel.parentNode.parentNode;i.classList.add("inputAddon"),i.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 i=l.get(e);if(void 0===i)throw new Error("Expected a valid i18n input element, '"+e+"' is not i18n input field.");if(!i.isEnabled)return!0;var n=u.get(e),a=s.getDropdownMenu(i.element.parentNode.id);i.languageId&&n.set(i.languageId,i.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(n.has(o)&&0!==n.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,i=null,n=null,a=null,r=null,o=null,s={show:function(s,l,c){t||(this._init(),i="function"==typeof l?l:null,n.className=c||"success",n.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",n=elCreate("p"),n.addEventListener(WCF_CLICK_EVENT,o),a.appendChild(n),document.body.appendChild(a))},_hide:function(){clearTimeout(r),a.classList.remove("active"),null!==i&&i(),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,i,n,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._dialogs=new i}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.mediaID),this._media=null},_close:function(){this._media=null,this._callbackObject._editorClose()},_keyPress:function(e){13===e.charCode&&(e.preventDefault(),this._saveData())},_saveData:function(){var t=o.getDialog("mediaEditor_"+this._media.mediaID).content,i=elBySel("input[name=altText]",t),n=elBySel("textarea[name=caption]",t),s=elBySel("input[name=title]",t),d=!1,u=a.childByClass(i.parentNode.parentNode,"innerError"),h=a.childByClass(n.parentNode.parentNode,"innerError"),p=a.childByClass(s.parentNode.parentNode,"innerError");if(this._media.isMultilingual=~~elBySel("input[name=isMultilingual]",t).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_"+this._media.mediaID,!0)&&(d=!0,!u)){var f=elCreate("small");f.className="innerError",f.textContent=r.get("wcf.global.form.error.multilingual"),i.parentNode.parentNode.appendChild(f)}if(!c.validate("caption_"+this._media.mediaID,!0)&&(d=!0,!h)){var f=elCreate("small");f.className="innerError",f.textContent=r.get("wcf.global.form.error.multilingual"),n.parentNode.parentNode.appendChild(f)}if(!c.validate("title_"+this._media.mediaID,!0)&&(d=!0,!p)){var f=elCreate("small");f.className="innerError",f.textContent=r.get("wcf.global.form.error.multilingual"),thistitle.parentNode.parentNode.appendChild(f)}this._media.altText=c.getValues("altText_"+this._media.mediaID).toObject(),this._media.caption=c.getValues("caption_"+this._media.mediaID).toObject(),this._media.title=c.getValues("title_"+this._media.mediaID).toObject()}else this._media.altText[this._media.languageID]=i.value,this._media.caption[this._media.languageID]=n.value,this._media.title[this._media.languageID]=s.value;for(var m={allowAll:~~elById("mediaEditor_"+this._media.mediaID+"_aclAllowAll").checked,group:[],user:[]},g=elBySelAll('input[name="aclValues[group][]"]',t),v=0,b=g.length;b>v;v++)m.group.push(~~g[v].value);for(var _=elBySelAll('input[name="aclValues[user][]"]',t),v=0,b=_.length;b>v;v++)m.user.push(~~_[v].value);d||(u&&elRemove(u),h&&elRemove(h),p&&elRemove(p),e.api(this,{actionName:"update",objectIDs:[this._media.mediaID],parameters:{aclValues:m,altText:this._media.altText,caption:this._media.caption,data:{isMultilingual:this._media.isMultilingual,languageID:this._media.languageID},title:this._media.title}}))},_updateLanguageFields:function(e,t){e&&(t=e.currentTarget);var i=elById("mediaEditor_"+this._media.mediaID+"_languageIDContainer").parentNode;t.checked?(c.enable("title_"+this._media.mediaID),c.enable("caption_"+this._media.mediaID),c.enable("altText_"+this._media.mediaID),elHide(i)):(c.disable("title_"+this._media.mediaID),c.disable("caption_"+this._media.mediaID),c.disable("altText_"+this._media.mediaID),elShow(i))},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,this._dialogs.has("mediaEditor_"+e.mediaID)||this._dialogs.set("mediaEditor_"+e.mediaID,{_dialogSetup:function(){return{id:"mediaEditor_"+e.mediaID,options:{backdropCloseOnClick:!1,onClose:this._close.bind(this),title:r.get("wcf.media.edit")},source:{after:function(e,t){setTimeout(function(){l.setLanguageId("languageID",this._media.languageID||LANGUAGE_ID),this._media.isMultilingual&&(c.setValues("altText_"+this._media.mediaID,i.fromObject(this._media.altText||{})),c.setValues("caption_"+this._media.mediaID,i.fromObject(this._media.caption||{})),c.setValues("title_"+this._media.mediaID,i.fromObject(this._media.title||{})));var t=elBySel("input[name=isMultilingual]",e);t.addEventListener("change",this._updateLanguageFields.bind(this)),this._updateLanguageFields(null,t);var a=this._keyPress.bind(this);elBySel("input[name=altText]",e).addEventListener("keypress",a),elBySel("input[name=title]",e).addEventListener("keypress",a),elBySel("button[data-type=submit]",e).addEventListener(WCF_CLICK_EVENT,this._saveData.bind(this)),document.activeElement.blur(),elById("mediaEditor_"+this._media.mediaID).parentNode.scrollTop=0,n.trigger()}.bind(this),100)}.bind(this),data:{actionName:"getEditorDialog",className:"wcf\\data\\media\\MediaAction",objectIDs:[e.mediaID]}}}}.bind(this)}),o.open(this._dialogs.get("mediaEditor_"+e.mediaID))}},u}),define("WoltLab/WCF/Media/Search",["Ajax","Dom/Traverse","Dom/Util","Language","Ui/SimpleDropdown"],function(e,t,i,n,a){"use strict";function r(e){this._fileType="all";var i=a.getDropdownMenu(this._getIdPrefix()+"Search");if(i){this._fileTypes=t.childrenBySel(i,"li:not(.dropdownDivider)");for(var n=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,n)}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 i=a.getDropdown(this._getIdPrefix()+"Search"),r=t.childBySel(t.childByClass(i,"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=n.get("wcf.media.search.filetype")},_updateFileTypeDropdown:function(){for(var e=0,t=this._fileTypes.length;t>e;e++){var i=this._fileTypes[e];i.classList[elData(i,"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,i,n,a,r,o,s,l){"use strict";function c(t,i,n){n=n||{},this._mediaManager=null,n.mediaManager&&(this._mediaManager=n.mediaManager,delete n.mediaManager),s.call(this,t,i,e.extend({className:"wcf\\data\\media\\MediaAction",multiple:this._mediaManager?!0:!1,singleFileRequests:!0},n))}return e.inherit(c,s,{_createFileElement:function(e){var i;i="OL"===this._target.nodeName||"UL"===this._target.nodeName?elCreate("li"):elCreate("p");var a=elCreate("div");a.className="mediaThumbnail",i.appendChild(a);var r=elCreate("span");r.className="icon icon144 fa-spinner",a.appendChild(r);var o=elCreate("div");o.className="mediaInformation",i.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),n.prepend(i,this._target),t.trigger(),i},_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,n){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=n.returnValues.media[u];if(elRemove(i.childByTag(i.childByClass(d,"mediaInformation"),"PROGRESS")),h){var p=i.childByTag(i.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=n.returnValues.errors[u];g||(g={errorType:"uploadFailed",filename:elData(d,"filename")});var p=i.childByTag(i.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=i.childByClass(i.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:n.returnValues.media,upload:this})}}),c}),define("WoltLab/WCF/Ui/Suggestion",["Ajax","Core","Ui/SimpleDropdown"],function(e,t,i){"use strict";function n(e,t){this.init(e,t)}return n.prototype={init:function(e,i){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},i),"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||!i.isOpen(this._element.id))return!0;if(13!==e.keyCode&&27!==e.keyCode&&38!==e.keyCode&&40!==e.keyCode)return!0;for(var t,n=0,a=this._dropdownMenu.childElementCount;a>n&&(t=this._dropdownMenu.children[n],!t.classList.contains("active"));)n++;if(13===e.keyCode)i.close(this._element.id),this._select(t);else if(27===e.keyCode){if(!i.isOpen(this._element.id))return!0;i.close(this._element.id)}else{var r=0;38===e.keyCode?r=(0===n?a:n)-1:40===e.keyCode&&(r=n+1,r===a&&(r=0)),r!==n&&(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 n=t.currentTarget.value.trim();if(this._value!==n){if(n.length<this._options.treshold)return null!==this._dropdownMenu&&i.close(this._element.id),void(this._value=n);this._value=n,e.api(this,{parameters:{data:{excludedSearchValues:this._options.excludedSearchValues,searchString:n}}})}},_ajaxSetup:function(){return{data:this._options.ajax}},_ajaxSuccess:function(e){if(null===this._dropdownMenu?(this._dropdownMenu=elCreate("div"),this._dropdownMenu.className="dropdownMenu",i.initFragment(this._element,this._dropdownMenu)):this._dropdownMenu.innerHTML="",e.returnValues.length){for(var t,n,a,r=0,o=e.returnValues.length;o>r;r++)n=e.returnValues[r],t=elCreate("a"),t.textContent=n.label,elData(t,"object-id",n.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);i.open(this._element.id)}else i.close(this._element.id)}},n}),define("WoltLab/WCF/Ui/ItemList",["Core","Dictionary","Language","Dom/Traverse","WoltLab/WCF/Ui/Suggestion"],function(e,t,i,n,a){"use strict";var r="",o=new t,s=!1,l=null,c=null,d=null,u=null;return{init:function(t,i,r){var s=elById(t);if(null===s)throw new Error("Expected a valid element id, '"+t+"' is invalid.");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=n.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 i,n=0,a=e.length;a>n;n++)i=elCreate("input"),i.type="hidden",i.name=r.submitFieldName.replace(/{$objectId}/,e[n].objectId),i.value=e[n].value,l.appendChild(i);else r.callbackSubmit(l,e)}.bind(this))}this._setup();var c=this._createUI(s,r),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}),i=c.values.length?c.values:i,Array.isArray(i))for(var u,h=0,p=i.length;p>h;h++)u=i[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,i,a=o.get(e),r=n.childrenByClass(a.list,"item"),s=[],l=0,c=r.length;c>l;l++)i=r[l],t={objectId:elData(i,"object-id"),value:n.childByTag(i,"SPAN").textContent},s.push(t);return s},setValues:function(e,t){if(!o.has(e))throw new Error("Element id '"+e+"' is unknown.");var i,a,r=o.get(e),s=n.childrenByClass(r.list,"item");for(i=0,a=s.length;a>i;i++)this._removeItem(null,s[i],!0);for(i=0,a=t.length;a>i;i++)this._addItem(e,t[i])},_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 i=elCreate("ol");i.className="inputItemList",elData(i,"element-id",e.id),i.addEventListener(WCF_CLICK_EVENT,function(t){t.target===i&&e.focus()});var n=elCreate("li");n.className="input",i.appendChild(n),e.addEventListener("keydown",l),e.addEventListener("keypress",c),e.addEventListener("keyup",d),e.parentNode.insertBefore(i,e),n.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"),i.parentNode.insertBefore(a,i),"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:i,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",i.get("wcf.global.form.input.maxItems"))))},_keyDown:function(e){var t=e.currentTarget,i=t.parentNode.previousElementSibling;r=t.id,8===e.keyCode?0===t.value.length&&null!==i&&(i.classList.contains("active")?this._removeItem(null,i):i.classList.add("active")):27===e.keyCode&&null!==i&&i.classList.contains("active")&&i.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 i=t.parentNode.previousElementSibling;null!==i&&i.classList.remove("active")}},_addItem:function(e,t){var i=o.get(e),n=elCreate("li");n.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),n.appendChild(a),n.appendChild(r),i.list.insertBefore(n,i.listItem),i.suggestion.addExcludedValue(t.value),i.element.value="",this._handleLimit(e);var s=this._syncShadow(i);"function"==typeof i.options.callbackChange&&(null===s&&(s=this.getValues(e)),i.options.callbackChange(e,s))},_removeItem:function(e,t,i){t=null===e?t:e.currentTarget.parentNode;var n=t.parentNode,a=elData(n,"element-id"),r=o.get(a);r.suggestion.removeExcludedValue(t.children[0].textContent),n.removeChild(t),i||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="",i=this.getValues(e.element.id),n=0,a=i.length;a>n;n++)t+=(t.length?",":"")+i[n].value;return e.shadow.value=t,i}}}),define("WoltLab/WCF/Ui/Page/JumpTo",["Language","ObjectMap","Ui/Dialog"],function(e,t,i){"use strict";var n=null,a=null,r=null,o=new t,s=null,l={init:function(e,t){if(t=t||null,null===t){var i=elData(e,"link");t=i?function(e){window.location=i.replace(/pageNo=%d/,"pageNo="+e)}:function(){}}else if("function"!=typeof t)throw new TypeError("Expected a valid function for parameter 'callback'.");o.has(e)||elBySelAll(".jumpTo",e,function(i){i.addEventListener(WCF_CLICK_EVENT,this._click.bind(this,e)),o.set(e,{callback:t})}.bind(this))},_click:function(t,a){n=t,"object"==typeof a&&a.preventDefault(),i.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(n).callback(~~s.value),i.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,i,n,a){"use strict";function r(e,t){this.init(e,t)}return r.prototype={SHOW_LINKS:11,init:function(t,i){this._element=t,this._options=e.extend({activePage:1,maxPage:1,callbackShouldSwitch:null,callbackSwitch:null},i),"function"!=typeof this._options.callbackShouldSwitch&&(this._options.callbackShouldSwitch=null),"function"!=typeof this._options.callbackSwitch&&(this._options.callbackSwitch=null),this._element.classList.add("pagination"),this._rebuild(this._element)},_rebuild:function(){var e=!1;this._element.innerHTML="";var i,n=elCreate("ul"),r=elCreate("li");r.className="skip",n.appendChild(r);var o="icon icon16 fa-chevron-left";this._options.activePage>1?(i=elCreate("a"),i.className=o+" jsTooltip",i.href="#",i.title=t.get("wcf.global.page.previous"),r.appendChild(i),i.addEventListener(WCF_CLICK_EVENT,this.switchPage.bind(this,this._options.activePage-1))):(r.innerHTML='<span class="'+o+'"></span>',r.classList.add("disabled")),n.appendChild(this._createLink(1));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>';u>1&&(2>u-1?n.appendChild(this._createLink(2)):(r=elCreate("li"),r.className="jumpTo",r.innerHTML=p,n.appendChild(r),e=!0));for(var f=u+1;h>f;f++)n.appendChild(this._createLink(f));h<this._options.maxPage&&(this._options.maxPage-h<2?n.appendChild(this._createLink(this._options.maxPage-1)):(r=elCreate("li"),r.className="jumpTo",r.innerHTML=p,n.appendChild(r),e=!0)),n.appendChild(this._createLink(this._options.maxPage)),r=elCreate("li"),r.className="skip",n.appendChild(r),o="icon icon16 fa-chevron-right",this._options.activePage<this._options.maxPage?(i=elCreate("a"),i.className=o+" jsTooltip",i.href="#",i.title=t.get("wcf.global.page.next"),r.appendChild(i),i.addEventListener(WCF_CLICK_EVENT,this.switchPage.bind(this,this._options.activePage+1))):(r.innerHTML='<span class="'+o+'"></span>',r.classList.add("disabled")),e&&(elData(n,"pages",this._options.maxPage),a.init(n,this.switchPage.bind(this))),this._element.appendChild(n)},_createLink:function(e){var i=elCreate("li");if(e!==this._options.activePage){var a=elCreate("a");a.textContent=n.addThousandsSeparator(e),a.addEventListener(WCF_CLICK_EVENT,this.switchPage.bind(this,e)),i.appendChild(a)}else i.classList.add("active"),i.innerHTML="<span>"+n.addThousandsSeparator(e)+'</span><span class="invisible">'+t.get("wcf.page.pagePosition",{pageNo:e,pages:this._options.maxPage})+"</span>";return i},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,i=null,n=null;return{element:function(n,a){if(!(n 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(n))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===i&&(i=this._onScroll.bind(this)),window.addEventListener("scroll",i));var r=e.offset(n).top;50>=r?r=0:r-=50,window.scrollTo({left:0,top:r,behavior:"smooth"})},_onScroll:function(){null!==n&&window.clearTimeout(n),n=window.setTimeout(function(){t(),window.removeEventListener("scroll",i),t=null,n=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),i=0,n=e.length;n>i;i++)e[i].addEventListener(WCF_CLICK_EVENT,t)},_click:function(t){var i=t.currentTarget;e.apiOnce({data:{actionName:"dismiss",className:"wcf\\data\\notice\\NoticeAction",objectIDs:[elData(i,"object-id")]},success:function(){var e=i.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,i,n,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=i.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.searchStringThreshold"),n.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,i,n,a,r,o,s,l,c,d,u,h,p,f){"use strict";function m(n){this._options=e.extend({dialogTitle:o.get("wcf.media.manager"),fileTypeFilters:{}},n),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)),i.add("WoltLab/WCF/Media/Manager",this._addButtonEventListeners.bind(this))}return m.prototype={_addButtonEventListeners:function(){if(this._mediaManagerMediaList)for(var e=n.childrenByTag(this._mediaManagerMediaList,"LI"),t=0,i=e.length;i>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("com.woltlab.wcf.media.delete"===e.data.actionName&&null===e.responseData){for(var t=e.responseData.objectIDs,i=0,n=t.length;n>i;i++)this.removeMedia(~~t[i],!0);d.show()}},_dialogClose:function(){u.hideEditor("com.woltlab.wcf.media")},_dialogSetup:function(){return{id:"mediaManager",options:{onClose:this._dialogClose.bind(this),onShow:this._dialogShow.bind(this),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}}}}},_dialogShow:function(){u.showEditor("com.woltlab.wcf.media")},_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),i=elByClass("mediaTitle",t)[0];e.isMultilingual?i.textContent=e.title[LANGUAGE_ID]||e.filename:i.textContent=e.title[e.languageID]||e.filename},_initDialog:function(e,t){var i=t.returnValues.media||{};for(var a in i)objOwns(i,a)&&this._mediaData.set(~~a,i[a]);this._mediaManagerMediaList=elById("mediaManagerMediaList");for(var o=n.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=n.nextByClass(this._mediaManagerMediaList,"info");
+n=~~elData(i,"language-id"),n&&i.classList[o.has(n)||!o.size?"remove":"add"]("missingValue")},_submit:function(e){for(var t,i,n,a,r=d.get(e.currentTarget),o=0,s=r.length;s>o;o++)i=r[o],t=l.get(i),t.isEnabled&&(a=u.get(i),t.languageId&&a.set(t.languageId,t.element.value),a.size&&(a.forEach(function(t,a){n=elCreate("input"),n.type="hidden",n.name=i+"_i18n["+a+"]",n.value=t,e.currentTarget.appendChild(n)}),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 i=u.get(e);return i.set(t.languageId,t.element.value),i},setValues:function(i,n){var a=l.get(i);if(void 0===a)throw new Error("Expected a valid i18n input element, '"+i+"' is not i18n input field.");e.isPlainObject(n)&&(n=t.fromObject(n)),a.element.value="",n.has(0)&&(a.element.value=n.get(0),n["delete"](0)),u.set(i,n),a.languageId=0,this._select(i,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 i=t.buttonLabel.parentNode.parentNode;i.classList.remove("inputAddon"),i.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 i=t.buttonLabel.parentNode.parentNode;i.classList.add("inputAddon"),i.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 i=l.get(e);if(void 0===i)throw new Error("Expected a valid i18n input element, '"+e+"' is not i18n input field.");if(!i.isEnabled)return!0;var n=u.get(e),a=s.getDropdownMenu(i.element.parentNode.id);i.languageId&&n.set(i.languageId,i.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(n.has(o)&&0!==n.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,i=null,n=null,a=null,r=null,o=null,s={show:function(s,l,c){t||(this._init(),i="function"==typeof l?l:null,n.className=c||"success",n.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",n=elCreate("p"),n.addEventListener(WCF_CLICK_EVENT,o),a.appendChild(n),document.body.appendChild(a))},_hide:function(){clearTimeout(r),a.classList.remove("active"),null!==i&&i(),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,i,n,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._dialogs=new i}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.mediaID),this._media=null},_close:function(){this._media=null,this._callbackObject._editorClose()},_keyPress:function(e){13===e.charCode&&(e.preventDefault(),this._saveData())},_saveData:function(){var t=o.getDialog("mediaEditor_"+this._media.mediaID).content,i=elBySel("input[name=altText]",t),n=elBySel("textarea[name=caption]",t),s=elBySel("input[name=title]",t),d=!1,u=a.childByClass(i.parentNode.parentNode,"innerError"),h=a.childByClass(n.parentNode.parentNode,"innerError"),p=a.childByClass(s.parentNode.parentNode,"innerError");if(this._media.isMultilingual=~~elBySel("input[name=isMultilingual]",t).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_"+this._media.mediaID,!0)&&(d=!0,!u)){var f=elCreate("small");f.className="innerError",f.textContent=r.get("wcf.global.form.error.multilingual"),i.parentNode.parentNode.appendChild(f)}if(!c.validate("caption_"+this._media.mediaID,!0)&&(d=!0,!h)){var f=elCreate("small");f.className="innerError",f.textContent=r.get("wcf.global.form.error.multilingual"),n.parentNode.parentNode.appendChild(f)}if(!c.validate("title_"+this._media.mediaID,!0)&&(d=!0,!p)){var f=elCreate("small");f.className="innerError",f.textContent=r.get("wcf.global.form.error.multilingual"),thistitle.parentNode.parentNode.appendChild(f)}this._media.altText=c.getValues("altText_"+this._media.mediaID).toObject(),this._media.caption=c.getValues("caption_"+this._media.mediaID).toObject(),this._media.title=c.getValues("title_"+this._media.mediaID).toObject()}else this._media.altText[this._media.languageID]=i.value,this._media.caption[this._media.languageID]=n.value,this._media.title[this._media.languageID]=s.value;for(var m={allowAll:~~elById("mediaEditor_"+this._media.mediaID+"_aclAllowAll").checked,group:[],user:[]},g=elBySelAll('input[name="aclValues[group][]"]',t),v=0,b=g.length;b>v;v++)m.group.push(~~g[v].value);for(var _=elBySelAll('input[name="aclValues[user][]"]',t),v=0,b=_.length;b>v;v++)m.user.push(~~_[v].value);d||(u&&elRemove(u),h&&elRemove(h),p&&elRemove(p),e.api(this,{actionName:"update",objectIDs:[this._media.mediaID],parameters:{aclValues:m,altText:this._media.altText,caption:this._media.caption,data:{isMultilingual:this._media.isMultilingual,languageID:this._media.languageID},title:this._media.title}}))},_updateLanguageFields:function(e,t){e&&(t=e.currentTarget);var i=elById("mediaEditor_"+this._media.mediaID+"_languageIDContainer").parentNode;t.checked?(c.enable("title_"+this._media.mediaID),c.enable("caption_"+this._media.mediaID),c.enable("altText_"+this._media.mediaID),elHide(i)):(c.disable("title_"+this._media.mediaID),c.disable("caption_"+this._media.mediaID),c.disable("altText_"+this._media.mediaID),elShow(i))},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,this._dialogs.has("mediaEditor_"+e.mediaID)||this._dialogs.set("mediaEditor_"+e.mediaID,{_dialogSetup:function(){return{id:"mediaEditor_"+e.mediaID,options:{backdropCloseOnClick:!1,onClose:this._close.bind(this),title:r.get("wcf.media.edit")},source:{after:function(e,t){setTimeout(function(){l.setLanguageId("languageID",this._media.languageID||LANGUAGE_ID),this._media.isMultilingual&&(c.setValues("altText_"+this._media.mediaID,i.fromObject(this._media.altText||{})),c.setValues("caption_"+this._media.mediaID,i.fromObject(this._media.caption||{})),c.setValues("title_"+this._media.mediaID,i.fromObject(this._media.title||{})));var t=elBySel("input[name=isMultilingual]",e);t.addEventListener("change",this._updateLanguageFields.bind(this)),this._updateLanguageFields(null,t);var a=this._keyPress.bind(this);elBySel("input[name=altText]",e).addEventListener("keypress",a),elBySel("input[name=title]",e).addEventListener("keypress",a),elBySel("button[data-type=submit]",e).addEventListener(WCF_CLICK_EVENT,this._saveData.bind(this)),document.activeElement.blur(),elById("mediaEditor_"+this._media.mediaID).parentNode.scrollTop=0,n.trigger()}.bind(this),0)}.bind(this),data:{actionName:"getEditorDialog",className:"wcf\\data\\media\\MediaAction",objectIDs:[e.mediaID]}}}}.bind(this)}),o.open(this._dialogs.get("mediaEditor_"+e.mediaID))}},u}),define("WoltLab/WCF/Media/Search",["Ajax","Dom/Traverse","Dom/Util","Language","Ui/SimpleDropdown"],function(e,t,i,n,a){"use strict";function r(e){this._fileType="all";var i=a.getDropdownMenu(this._getIdPrefix()+"Search");if(i){this._fileTypes=t.childrenBySel(i,"li:not(.dropdownDivider)");for(var n=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,n)}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 i=a.getDropdown(this._getIdPrefix()+"Search"),r=t.childBySel(t.childByClass(i,"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=n.get("wcf.media.search.filetype")},_updateFileTypeDropdown:function(){for(var e=0,t=this._fileTypes.length;t>e;e++){var i=this._fileTypes[e];i.classList[elData(i,"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,i,n,a,r,o,s,l){"use strict";function c(t,i,n){n=n||{},this._mediaManager=null,n.mediaManager&&(this._mediaManager=n.mediaManager,delete n.mediaManager),s.call(this,t,i,e.extend({className:"wcf\\data\\media\\MediaAction",multiple:this._mediaManager?!0:!1,singleFileRequests:!0},n))}return e.inherit(c,s,{_createFileElement:function(e){var i;i="OL"===this._target.nodeName||"UL"===this._target.nodeName?elCreate("li"):elCreate("p");var a=elCreate("div");a.className="mediaThumbnail",i.appendChild(a);var r=elCreate("span");r.className="icon icon144 fa-spinner",a.appendChild(r);var o=elCreate("div");o.className="mediaInformation",i.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),n.prepend(i,this._target),t.trigger(),i},_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,n){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=n.returnValues.media[u];if(elRemove(i.childByTag(i.childByClass(d,"mediaInformation"),"PROGRESS")),h){var p=i.childByTag(i.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=n.returnValues.errors[u];g||(g={errorType:"uploadFailed",filename:elData(d,"filename")});var p=i.childByTag(i.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=i.childByClass(i.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:n.returnValues.media,upload:this})}}),c}),define("WoltLab/WCF/Ui/Suggestion",["Ajax","Core","Ui/SimpleDropdown"],function(e,t,i){"use strict";function n(e,t){this.init(e,t)}return n.prototype={init:function(e,i){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},i),"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||!i.isOpen(this._element.id))return!0;if(13!==e.keyCode&&27!==e.keyCode&&38!==e.keyCode&&40!==e.keyCode)return!0;for(var t,n=0,a=this._dropdownMenu.childElementCount;a>n&&(t=this._dropdownMenu.children[n],!t.classList.contains("active"));)n++;if(13===e.keyCode)i.close(this._element.id),this._select(t);else if(27===e.keyCode){if(!i.isOpen(this._element.id))return!0;i.close(this._element.id)}else{var r=0;38===e.keyCode?r=(0===n?a:n)-1:40===e.keyCode&&(r=n+1,r===a&&(r=0)),r!==n&&(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 n=t.currentTarget.value.trim();if(this._value!==n){if(n.length<this._options.treshold)return null!==this._dropdownMenu&&i.close(this._element.id),void(this._value=n);this._value=n,e.api(this,{parameters:{data:{excludedSearchValues:this._options.excludedSearchValues,searchString:n}}})}},_ajaxSetup:function(){return{data:this._options.ajax}},_ajaxSuccess:function(e){if(null===this._dropdownMenu?(this._dropdownMenu=elCreate("div"),this._dropdownMenu.className="dropdownMenu",i.initFragment(this._element,this._dropdownMenu)):this._dropdownMenu.innerHTML="",e.returnValues.length){for(var t,n,a,r=0,o=e.returnValues.length;o>r;r++)n=e.returnValues[r],t=elCreate("a"),t.textContent=n.label,elData(t,"object-id",n.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);i.open(this._element.id)}else i.close(this._element.id)}},n}),define("WoltLab/WCF/Ui/ItemList",["Core","Dictionary","Language","Dom/Traverse","WoltLab/WCF/Ui/Suggestion"],function(e,t,i,n,a){"use strict";var r="",o=new t,s=!1,l=null,c=null,d=null,u=null;return{init:function(t,i,r){var s=elById(t);if(null===s)throw new Error("Expected a valid element id, '"+t+"' is invalid.");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=n.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 i,n=0,a=e.length;a>n;n++)i=elCreate("input"),i.type="hidden",i.name=r.submitFieldName.replace(/{$objectId}/,e[n].objectId),i.value=e[n].value,l.appendChild(i);else r.callbackSubmit(l,e)}.bind(this))}this._setup();var c=this._createUI(s,r),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}),i=c.values.length?c.values:i,Array.isArray(i))for(var u,h=0,p=i.length;p>h;h++)u=i[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,i,a=o.get(e),r=n.childrenByClass(a.list,"item"),s=[],l=0,c=r.length;c>l;l++)i=r[l],t={objectId:elData(i,"object-id"),value:n.childByTag(i,"SPAN").textContent},s.push(t);return s},setValues:function(e,t){if(!o.has(e))throw new Error("Element id '"+e+"' is unknown.");var i,a,r=o.get(e),s=n.childrenByClass(r.list,"item");for(i=0,a=s.length;a>i;i++)this._removeItem(null,s[i],!0);for(i=0,a=t.length;a>i;i++)this._addItem(e,t[i])},_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 i=elCreate("ol");i.className="inputItemList",elData(i,"element-id",e.id),i.addEventListener(WCF_CLICK_EVENT,function(t){t.target===i&&e.focus()});var n=elCreate("li");n.className="input",i.appendChild(n),e.addEventListener("keydown",l),e.addEventListener("keypress",c),e.addEventListener("keyup",d),e.parentNode.insertBefore(i,e),n.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"),i.parentNode.insertBefore(a,i),"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:i,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",i.get("wcf.global.form.input.maxItems"))))},_keyDown:function(e){var t=e.currentTarget,i=t.parentNode.previousElementSibling;r=t.id,8===e.keyCode?0===t.value.length&&null!==i&&(i.classList.contains("active")?this._removeItem(null,i):i.classList.add("active")):27===e.keyCode&&null!==i&&i.classList.contains("active")&&i.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 i=t.parentNode.previousElementSibling;null!==i&&i.classList.remove("active")}},_addItem:function(e,t){var i=o.get(e),n=elCreate("li");n.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),n.appendChild(a),n.appendChild(r),i.list.insertBefore(n,i.listItem),i.suggestion.addExcludedValue(t.value),i.element.value="",this._handleLimit(e);var s=this._syncShadow(i);"function"==typeof i.options.callbackChange&&(null===s&&(s=this.getValues(e)),i.options.callbackChange(e,s))},_removeItem:function(e,t,i){t=null===e?t:e.currentTarget.parentNode;var n=t.parentNode,a=elData(n,"element-id"),r=o.get(a);r.suggestion.removeExcludedValue(t.children[0].textContent),n.removeChild(t),i||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="",i=this.getValues(e.element.id),n=0,a=i.length;a>n;n++)t+=(t.length?",":"")+i[n].value;return e.shadow.value=t,i}}}),define("WoltLab/WCF/Ui/Page/JumpTo",["Language","ObjectMap","Ui/Dialog"],function(e,t,i){"use strict";var n=null,a=null,r=null,o=new t,s=null,l={init:function(e,t){if(t=t||null,null===t){var i=elData(e,"link");t=i?function(e){window.location=i.replace(/pageNo=%d/,"pageNo="+e)}:function(){}}else if("function"!=typeof t)throw new TypeError("Expected a valid function for parameter 'callback'.");o.has(e)||elBySelAll(".jumpTo",e,function(i){i.addEventListener(WCF_CLICK_EVENT,this._click.bind(this,e)),o.set(e,{callback:t})}.bind(this))},_click:function(t,a){n=t,"object"==typeof a&&a.preventDefault(),i.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(n).callback(~~s.value),i.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,i,n,a){"use strict";function r(e,t){this.init(e,t)}return r.prototype={SHOW_LINKS:11,init:function(t,i){this._element=t,this._options=e.extend({activePage:1,maxPage:1,callbackShouldSwitch:null,callbackSwitch:null},i),"function"!=typeof this._options.callbackShouldSwitch&&(this._options.callbackShouldSwitch=null),"function"!=typeof this._options.callbackSwitch&&(this._options.callbackSwitch=null),this._element.classList.add("pagination"),this._rebuild(this._element)},_rebuild:function(){var e=!1;this._element.innerHTML="";var i,n=elCreate("ul"),r=elCreate("li");r.className="skip",n.appendChild(r);var o="icon icon16 fa-chevron-left";this._options.activePage>1?(i=elCreate("a"),i.className=o+" jsTooltip",i.href="#",i.title=t.get("wcf.global.page.previous"),r.appendChild(i),i.addEventListener(WCF_CLICK_EVENT,this.switchPage.bind(this,this._options.activePage-1))):(r.innerHTML='<span class="'+o+'"></span>',r.classList.add("disabled")),n.appendChild(this._createLink(1));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>';u>1&&(2>u-1?n.appendChild(this._createLink(2)):(r=elCreate("li"),r.className="jumpTo",r.innerHTML=p,n.appendChild(r),e=!0));for(var f=u+1;h>f;f++)n.appendChild(this._createLink(f));h<this._options.maxPage&&(this._options.maxPage-h<2?n.appendChild(this._createLink(this._options.maxPage-1)):(r=elCreate("li"),r.className="jumpTo",r.innerHTML=p,n.appendChild(r),e=!0)),n.appendChild(this._createLink(this._options.maxPage)),r=elCreate("li"),r.className="skip",n.appendChild(r),o="icon icon16 fa-chevron-right",this._options.activePage<this._options.maxPage?(i=elCreate("a"),i.className=o+" jsTooltip",i.href="#",i.title=t.get("wcf.global.page.next"),r.appendChild(i),i.addEventListener(WCF_CLICK_EVENT,this.switchPage.bind(this,this._options.activePage+1))):(r.innerHTML='<span class="'+o+'"></span>',r.classList.add("disabled")),e&&(elData(n,"pages",this._options.maxPage),a.init(n,this.switchPage.bind(this))),this._element.appendChild(n)},_createLink:function(e){var i=elCreate("li");if(e!==this._options.activePage){var a=elCreate("a");a.textContent=n.addThousandsSeparator(e),a.addEventListener(WCF_CLICK_EVENT,this.switchPage.bind(this,e)),i.appendChild(a)}else i.classList.add("active"),i.innerHTML="<span>"+n.addThousandsSeparator(e)+'</span><span class="invisible">'+t.get("wcf.page.pagePosition",{pageNo:e,pages:this._options.maxPage})+"</span>";return i},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,i=null,n=null;return{element:function(n,a){if(!(n 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(n))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===i&&(i=this._onScroll.bind(this)),window.addEventListener("scroll",i));var r=e.offset(n).top;50>=r?r=0:r-=50,window.scrollTo({left:0,top:r,behavior:"smooth"})},_onScroll:function(){null!==n&&window.clearTimeout(n),n=window.setTimeout(function(){t(),window.removeEventListener("scroll",i),t=null,n=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),i=0,n=e.length;n>i;i++)e[i].addEventListener(WCF_CLICK_EVENT,t)},_click:function(t){var i=t.currentTarget;e.apiOnce({data:{actionName:"dismiss",className:"wcf\\data\\notice\\NoticeAction",objectIDs:[elData(i,"object-id")]},success:function(){var e=i.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,i,n,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=i.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.searchStringThreshold"),n.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,i,n,a,r,o,s,l,c,d,u,h,p,f){"use strict";function m(n){this._options=e.extend({dialogTitle:o.get("wcf.media.manager"),fileTypeFilters:{}},n),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)),i.add("WoltLab/WCF/Media/Manager",this._addButtonEventListeners.bind(this))}return m.prototype={_addButtonEventListeners:function(){if(this._mediaManagerMediaList)for(var e=n.childrenByTag(this._mediaManagerMediaList,"LI"),t=0,i=e.length;i>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("com.woltlab.wcf.media.delete"===e.data.actionName&&null===e.responseData){for(var t=e.responseData.objectIDs,i=0,n=t.length;n>i;i++)this.removeMedia(~~t[i],!0);d.show()}},_dialogClose:function(){u.hideEditor("com.woltlab.wcf.media")},_dialogInit:function(e,t){var i=t.returnValues.media||{};for(var a in i)objOwns(i,a)&&this._mediaData.set(~~a,i[a]);this._mediaManagerMediaList=elById("mediaManagerMediaList");for(var o=n.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(),this._dialogShow()},_dialogSetup:function(){return{id:"mediaManager",options:{onClose:this._dialogClose.bind(this),onShow:this._dialogShow.bind(this),title:this._options.dialogTitle},source:{after:this._dialogInit.bind(this),data:{actionName:"getManagementDialog",className:"wcf\\data\\media\\MediaAction",parameters:{mode:this.getMode(),fileTypeFilters:this._options.fileTypeFilters}}}}},_dialogShow:function(){this._mediaManagerMediaList&&u.showEditor("com.woltlab.wcf.media")},_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),i=elByClass("mediaTitle",t)[0];e.isMultilingual?i.textContent=e.title[LANGUAGE_ID]||e.filename:i.textContent=e.title[e.languageID]||e.filename},_setMedia:function(r){e.isPlainObject(r)?this._media=t.fromObject(r):this._media=r;var s=n.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=n.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)}i.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 i=!1;for(var a in e)objOwns(e,a)&&(i=!0);if(i){var r=elCreate("ul");r.innerHTML=t;for(var o=n.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 i=n.childByClass(t,"mediaInformation"),a=elCreate("nav");a.className="buttonGroupNavigation",i.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","Dictionary","Dom/Traverse","Language","Ui/Dialog","WoltLab/WCF/Media/Manager/Base"],function(e,t,i,n,a,r){"use strict";function o(i){i=e.extend({callbackInsert:null},i),r.call(this,i),this._activeButton=null,this._buttons=elByClass(this._options.buttonClass||"jsMediaEditorButton");for(var n=0,a=this._buttons.length;a>n;n++)this._buttons[n].addEventListener(WCF_CLICK_EVENT,this._click.bind(this));this._mediaToInsert=new t,this._mediaToInsertByClipboard=!1}return e.inherit(o,r,{_addButtonEventListeners:function(){if(o._super.prototype._addButtonEventListeners.call(this),this._mediaManagerMediaList)for(var e=i.childrenByTag(this._mediaManagerMediaList,"LI"),t=0,n=e.length;n>t;t++){var a=e[t],r=elByClass("jsMediaInsertIcon",a)[0];r&&(r.classList.remove("jsMediaInsertIcon"),r.addEventListener(WCF_CLICK_EVENT,this._openInsertDialog.bind(this)))}},_buildInsertDialog:function(){var e,t="",i=["small","medium","large"];e:for(var r=0,o=i.length;o>r;r++){e=i[r];for(var s=0,l=this._mediaToInsert.length;l>s;s++)if(!this._mediaToInsert[r][e+"ThumbnailType"])continue e;t+='<option value="'+e+'">'+n.get("wcf.media.insert.imageSize."+e)+"</option>"}t+='<option value="original">'+n.get("wcf.media.insert.imageSize.original")+"</option>";var c='<div class="section">'+(this._mediaToInsert.size>1?"<dl><dt>"+n.get("wcf.media.insert.type")+'</dt><dd><select name="insertType"><option value="separate">'+n.get("wcf.media.insert.type.separate")+'</option><option value="gallery">'+n.get("wcf.media.insert.type.gallery")+"</option></select></dd></dl>":"")+'<dl class="thumbnailSizeSelection"><dt>'+n.get("wcf.media.insert.imageSize")+'</dt><dd><select name="thumbnailSize">'+t+'</select></dd></dl></div><div class="formSubmit"><button class="buttonPrimary">'+n.get("wcf.global.button.insert")+"</button></div>";a.open({_dialogSetup:function(){return{id:this._getInsertDialogId(),options:{onClose:this._editorClose.bind(this),onSetup:function(e){elByClass("buttonPrimary",e)[0].addEventListener(WCF_CLICK_EVENT,this._insertMedia.bind(this));var t=elBySel("select[name=insertType]",e);if(null!==t){var i=elByClass("thumbnailSizeSelection",e)[0];t.addEventListener("change",function(e){"gallery"===e.currentTarget.value?elHide(i):elShow(i)})}}.bind(this),title:n.get("wcf.media.insert")},source:c}}.bind(this)})},_click:function(e){this._activeButton=e.currentTarget,o._super.prototype._click.call(this,e)},_clipboardAction:function(e){o._super.prototype._clipboardAction.call(this,e),"com.woltlab.wcf.media.insert"===e.data.actionName&&this.insertMedia(e.data.parameters.objectIDs,!0)},_getInsertDialogId:function(){var e="mediaInsert";return this._mediaToInsert.forEach(function(t,i){e+="-"+i}),e},_insertMedia:function(e){var i,n="separate";if(e){a.close(this._getInsertDialogId());var r=e.currentTarget.closest(".dialogContent");this._mediaToInsert.size>1&&(n=elBySel("select[name=insertType]",r).value),i=elBySel("select[name=thumbnailSize]",r).value}null!==this._options.callbackInsert?this._options.callbackInsert(this._mediaToInsert,n,i):"separate"===n?(this._options.editor.buffer.set(),this._mediaToInsert.forEach(this._insertMediaItem.bind(this,i))):this._insertMediaGallery(),this._mediaToInsertByClipboard,this._mediaToInsert=new t,this._mediaToInsertByClipboard=!1,a.close(this)},_insertMediaGallery:function(){var e=[];this._mediaToInsert.forEach(function(t){e.push(t.mediaID)}),this._options.editor.buffer.set(),this._options.editor.insert.text("[wsmg='"+e.join(",")+"'][/wsmg]")},_insertMediaItem:function(e,t){if(t.isImage){for(var i,n=["small","medium","large","original"],a="",r=0;4>r&&(i=n[r],!t[i+"ThumbnailHeight"]||(a=i,e!=i));r++);e=a,this._options.editor.insert.html('<img src="'+t[e+"ThumbnailLink"]+'" class="woltlabSuiteMedia" data-media-id="'+t.mediaID+'" data-media-size="'+e+'">')}else this._options.editor.insert.text("[wsm='"+t.mediaID+"'][/wsm]")},_openInsertDialog:function(e){this.insertMedia([~~elData(e.currentTarget,"object-id")])},insertMedia:function(e,i){this._mediaToInsert=new t,this._mediaToInsertByClipboard=i||!1;for(var n,r=!0,o=0,s=e.length;s>o;o++)n=this._mediaData.get(e[o]),this._mediaToInsert.set(n.mediaID,n),n.isImage||(r=!1);if(r){a.close(this);var l=this._getInsertDialogId();a.getDialog(l)?a.openStatic(l):this._buildInsertDialog()}else this._insertMedia()},getMode:function(){return"editor"},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-plus jsTooltip jsMediaInsertIcon",elData(s,"object-id",e.mediaID),elAttr(s,"title",n.get("wcf.media.button.insert")),r.appendChild(s)}}),o}),define("WoltLab/WCF/Media/Manager/Select",["Core","Dom/Traverse","Language","ObjectMap","Ui/Dialog","WoltLab/WCF/Media/Manager/Base"],function(e,t,i,n,a,r){"use strict";function o(e){r.call(this,e),this._activeButton=null,this._buttons=elByClass(this._options.buttonClass||"jsMediaSelectButton"),this._storeElements=new n;for(var t=0,i=this._buttons.length;i>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"),i=0,n=e.length;n>i;i++){var a=e[i],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 i=elData(this._activeButton,"display");if(i){var n=elById(i);n&&t.isImage&&(n.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 i,n=this._storeElements.get(this._activeButton),a=t.childrenByTag(this._mediaManagerMediaList,"LI"),r=0,s=a.length;s>r;r++)i=a[r],n.value&&n.value==elData(i,"object-id")?i.classList.add("jsSelected"):i.classList.remove("jsSelected")},getMode:function(){return"select"},setupMediaElement:function(e,t){o._super.prototype.setupMediaElement.call(this,e,t);var n=elBySel("nav.buttonGroupNavigation > ul.smallButtons",t),a=elCreate("li");n.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",i.get("wcf.media.button.choose")),r.appendChild(s)}}),o}),define("WoltLab/WCF/Ui/Search/Input",["Ajax","Core","EventKey","Dom/Util","Ui/SimpleDropdown"],function(e,t,i,n,a){"use strict";function r(e,t){this.init(e,t)}return r.prototype={init:function(e,i){if(this._element=e,!(this._element instanceof Element))throw new TypeError("Expected a valid DOM element.");if("INPUT"!==this._element.nodeName||"search"!==this._element.type&&"text"!==this._element.type)throw new Error('Expected an input[type="text"].');this._activeItem=null,this._dropdownContainerId="",this._lastValue="",this._list=null,this._request=null,this._timerDelay=null,this._options=t.extend({ajax:{actionName:"getSearchResultList",className:"",interfaceName:"wcf\\data\\ISearchAction"},callbackDropdownInit:null,callbackSelect:null,delay:500,minLength:3,noResultPlaceholder:"",preventSubmit:!1},i),elAttr(this._element,"autocomplete","off"),this._element.addEventListener("keydown",this._keydown.bind(this)),this._element.addEventListener("keyup",this._keyup.bind(this))},_keydown:function(e){(null!==this._activeItem&&a.isOpen(this._dropdownContainerId)||this._options.preventSubmit)&&i.Enter(e)&&e.preventDefault(),(i.ArrowUp(e)||i.ArrowDown(e)||i.Escape(e))&&e.preventDefault()},_keyup:function(e){if(null!==this._activeItem){if(!a.isOpen(this._dropdownContainerId))return;if(i.ArrowUp(e))return e.preventDefault(),this._keyboardPreviousItem();if(i.ArrowDown(e))return e.preventDefault(),this._keyboardNextItem();if(i.Enter(e))return e.preventDefault(),this._keyboardSelectItem()}if(i.Escape(e))return void a.close(this._dropdownContainerId);var t=this._element.value.trim();if(this._lastValue!==t)return this._lastValue=t,t.length<this._options.minLength?void(this._dropdownContainerId&&a.close(this._dropdownContainerId)):void(this._options.delay?(null!==this._timerDelay&&window.clearTimeout(this._timerDelay),this._timerDelay=window.setTimeout(function(){this._search(t)}.bind(this),this._options.delay)):this._search(t))},_search:function(t){this._request&&this._request.abortPrevious(),this._request=e.api(this,this._getParameters(t))},_getParameters:function(e){return{parameters:{data:{searchString:e}}}},_keyboardNextItem:function(){this._activeItem.classList.remove("active"),this._activeItem.nextElementSibling?this._activeItem=this._activeItem.nextElementSibling:this._activeItem=this._list.children[0],this._activeItem.classList.add("active")},_keyboardPreviousItem:function(){this._activeItem.classList.remove("active"),this._activeItem.previousElementSibling?this._activeItem=this._activeItem.previousElementSibling:this._activeItem=this._list.children[this._list.childElementCount-1],this._activeItem.classList.add("active")},_keyboardSelectItem:function(){this._selectItem(this._activeItem)},_clickSelectItem:function(e){this._selectItem(e.currentTarget)},_selectItem:function(e){this._options.callbackSelect&&this._options.callbackSelect(e)===!1?this._element.value="":this._element.value=elData(e,"label"),this._activeItem=null,a.close(this._dropdownContainerId)},_ajaxSuccess:function(e){var t=!1;if(null===this._list?(this._list=elCreate("ul"),this._list.className="dropdownMenu",t=!0,"function"==typeof this._options.callbackDropdownInit&&this._options.callbackDropdownInit(this._list)):this._list.innerHTML="","object"==typeof e.returnValues){var i,r=this._clickSelectItem.bind(this);for(var o in e.returnValues)e.returnValues.hasOwnProperty(o)&&(i=this._createListItem(e.returnValues[o]),i.addEventListener(WCF_CLICK_EVENT,r),this._list.appendChild(i))}t&&(n.insertAfter(this._list,this._element),a.initFragment(this._element.parentNode,this._list),this._dropdownContainerId=n.identify(this._element.parentNode)),this._dropdownContainerId&&(this._activeItem=null,this._list.childElementCount||this._handleEmptyResult()!==!1?(a.open(this._dropdownContainerId),this._list.childElementCount&&~~elData(this._list.children[0],"object-id")&&(this._activeItem=this._list.children[0],this._activeItem.classList.add("active"))):a.close(this._dropdownContainerId))},_handleEmptyResult:function(){if(!this._options.noResultPlaceholder)return!1;var e=elCreate("li");e.className="dropdownText";var t=elCreate("span");return t.textContent=this._options.noResultPlaceholder,e.appendChild(t),this._list.appendChild(e),!0},_createListItem:function(e){var t=elCreate("li");elData(t,"object-id",e.objectID),elData(t,"label",e.label);var i=elCreate("span");return i.textContent=e.label,t.appendChild(i),t},_ajaxSetup:function(){return{data:this._options.ajax}}},r}),define("WoltLab/WCF/Ui/User/Search/Input",["Core","WoltLab/WCF/Ui/Search/Input"],function(e,t){"use strict";function i(e,t){this.init(e,t)}return e.inherit(i,t,{init:function(t,n){var a=e.isPlainObject(n)&&n.includeUserGroups===!0;n=e.extend({ajax:{className:"wcf\\data\\user\\UserAction",parameters:{data:{includeUserGroups:a?1:0}}}},n),i._super.prototype.init.call(this,t,n)},_createListItem:function(e){var t=i._super.prototype._createListItem.call(this,e);elData(t,"type",e.type);var n=elCreate("div");return n.className="box16",n.innerHTML="group"===e.type?'<span class="icon icon16 fa-users"></span>':e.icon,n.appendChild(t.children[0]),t.appendChild(n),t}}),i}),define("WoltLab/WCF/Ui/Acl/Simple",["Language","Dom/ChangeListener","WoltLab/WCF/Ui/User/Search/Input"],function(e,t,i){"use strict";function n(e){this.init(e)}return n.prototype={init:function(e){this._prefix=e||"",this._build()},_build:function(){var e=elById(this._prefix+"aclInputContainer");elById(this._prefix+"aclAllowAll").addEventListener("change",function(){elHide(e)}),elById(this._prefix+"aclAllowAll_no").addEventListener("change",function(){elShow(e)}),new i(elById(this._prefix+"aclSearchInput"),{callbackSelect:this._select.bind(this),includeUserGroups:!0,preventSubmit:!0}),this._aclListContainer=elById(this._prefix+"aclListContainer"),this._list=elById(this._prefix+"aclAccessList"),this._list.addEventListener(WCF_CLICK_EVENT,this._removeItem.bind(this)),t.trigger()},_select:function(i){var n=elData(i,"type"),a='<span class="icon icon16 fa-'+("group"===n?"users":"user")+'"></span>';a+='<span class="aclLabel">'+elData(i,"label")+"</span>",a+='<span class="icon icon16 fa-times pointer jsTooltip" title="'+e.get("wcf.global.button.delete")+'"></span>',a+='<input type="hidden" name="aclValues['+n+'][]" value="'+elData(i,"object-id")+'">';var r=elCreate("li");r.innerHTML=a;var o=elBySel(".fa-user",this._list);return null===o?this._list.appendChild(r):this._list.insertBefore(r,o.parentNode),elShow(this._aclListContainer),t.trigger(),!1},_removeItem:function(e){e.target.classList.contains("fa-times")&&(elRemove(e.target.parentNode),0===this._list.childElementCount&&elHide(this._aclListContainer))}},n}),define("WoltLab/WCF/Ui/Dropdown/Reusable",["Dictionary","Ui/SimpleDropdown"],function(e,t){"use strict";function i(e){if(!n.has(e))throw new Error("Unknown dropdown identifier '"+e+"'");return n.get(e)}var n=new e,a=0;return{init:function(e,i){if(!n.has(e)){var r=elCreate("div");r.id="reusableDropdownGhost"+a++,t.initFragment(r,i),n.set(e,r.id)}},getDropdownMenu:function(e){return t.getDropdownMenu(i(e))},registerCallback:function(e,n){t.registerCallback(i(e),n)},toggleDropdown:function(e,n){t.toggleDropdown(i(e),n)}}}),define("WoltLab/WCF/Ui/ItemList/Filter",["EventKey","Language","List","StringUtil","Dom/Util"],function(e,t,i,n,a){"use strict";function r(e){this.init(e)}return r.prototype={init:function(i){this._value="";var n=elById(i);if(null===n)throw new Error("Expected a valid element id, '"+i+"' does not match anything.");if(!n.classList.contains("scrollableCheckboxList"))throw new Error("Filter only works with elements with the CSS class 'scrollableCheckboxList'.");var a=elCreate("div");a.className="itemListFilter",n.parentNode.insertBefore(a,n),a.appendChild(n);var r=elCreate("div");r.className="inputAddon";var o=elCreate("input");o.className="long",o.type="text",o.placeholder=t.get("wcf.global.filter.placeholder"),o.addEventListener("keydown",function(t){e.Enter(t)&&t.preventDefault()}),o.addEventListener("keyup",this._keyup.bind(this));var s=elCreate("a");s.href="#",s.className="button inputSuffix jsTooltip",s.title=t.get("wcf.global.filter.button.clear"),s.innerHTML='<span class="icon icon16 fa-times"></span>',s.addEventListener("click",function(e){e.preventDefault(),this._input.value="",this._keyup()}.bind(this)),r.appendChild(o),r.appendChild(s),a.appendChild(r),this._container=a,this._element=n,this._input=o,this._items=null,this._fragment=null},_buildItems:function(){this._items=new i;for(var e,t=0,n=this._element.childElementCount;n>t;t++){e=this._element.children[t];for(var a=e.children[0],r=a.textContent.trim(),o=a.children[0];o.nextSibling;)a.removeChild(o.nextSibling);a.appendChild(document.createTextNode(" "));var s=elCreate("span");s.textContent=r,a.appendChild(s),this._items.add({item:e,span:s,text:r})}},_keyup:function(){var e=this._input.value.trim();if(this._value!==e){null===this._fragment&&(this._fragment=document.createDocumentFragment(),this._element.style.setProperty("height",this._element.offsetHeight+"px","")),this._fragment.appendChild(this._element),null===this._items&&this._buildItems();var i=new RegExp("("+n.escapeRegExp(e)+")","i"),r=""===e;this._items.forEach(function(t){""===e?(t.span.textContent=t.text,elShow(t.item)):i.test(t.text)?(t.span.innerHTML=t.text.replace(i,"<u>$1</u>"),elShow(t.item),r=!0):elHide(t.item)}),this._container.insertBefore(this._fragment.firstChild,this._container.firstChild),this._value=e;var o=this._container.nextElementSibling;o&&!o.classList.contains("innerError")&&(o=null),r?o&&elRemove(o):o||(o=elCreate("small"),o.className="innerError",o.textContent=t.get("wcf.global.filter.error.noMatches"),a.insertAfter(o,this._container))}}},r}),define("WoltLab/WCF/Ui/ItemList/User",["WoltLab/WCF/Ui/ItemList"],function(e){"use strict";var t={init:function(t,i){e.init(t,[],{ajax:{className:"wcf\\data\\user\\UserAction",parameters:{data:{includeUserGroups:~~i.includeUserGroups}}},callbackChange:"function"==typeof i.callbackChange?i.callbackChange:null,excludedSearchValues:Array.isArray(i.excludedSearchValues)?i.excludedSearchValues:[],isCSV:!0,maxItems:~~i.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,i,n,a,r){"use strict";function o(e){this.init(e)}return o.prototype={init:function(e){this._cache=new i,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 i=a.open(this,this._cache.get(this._pageNo));if(this._pageCount>1){var n=elBySel(".jsPagination",i.content);null!==n&&new r(n,{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:n.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,i,n,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,i){if(""===i.containerSelector)throw new Error("[WoltLab/WCF/Ui/Like/Handler] Expected a non-empty 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"},i),this.initContainers(i,e),o.add("WoltLab/WCF/Ui/Like/Handler-"+e,this.initContainers.bind(this))},initContainers:function(){for(var e,t,i=elBySelAll(this._options.containerSelector),n=!1,a=0,r=i.length;r>a;a++)e=i[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),n=!0);n&&o.trigger()},_buildWidget:function(e,t){if(this._options.canViewSummary){var i,n,a,r=this._options.isSingleItem?elBySel(this._options.summarySelector):elBySel(this._options.summarySelector,e);null!==r&&(i=elCreate("div"),i.className="likesSummary",this._options.summaryUseIcon&&(a=elCreate("span"),a.className="icon icon16 fa-thumbs-o-up",i.appendChild(a)),n=elCreate("span"),n.className="likesSummaryContent",n.addEventListener(WCF_CLICK_EVENT,this._showSummary.bind(this,e)),i.appendChild(n),this._options.summaryPrepend?s.prepend(i,r):r.appendChild(i),t.summary=n,this._updateSummary(e))}var o,l,c=this._options.isSingleItem?elBySel(this._options.badgeContainerSelector):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)),this._options.canLike&&(WCF.User.userID!=elData(e,"user-id")||this._options.canLikeOwnContent)){var d=this._options.buttonAppendToSelector?this._options.isSingleItem?elBySel(this._options.buttonAppendToSelector):elBySel(this._options.buttonAppendToSelector,e):null,u=this._options.buttonBeforeSelector?this._options.isSingleItem?elBySel(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,i,a){var r=n.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> <span class="invisible">'+r+"</span>",s.addEventListener(WCF_CLICK_EVENT,this._like.bind(this,e)),elData(s,"type",t?"like":"dislike"),o.appendChild(s),i?i.parentNode.insertBefore(o,i):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:n.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 i=t.likes-t.dislikes,a='<span class="icon icon16 fa-thumbs-o-'+(0>i?"down":"up")+'"></span><span class="wcfLikeValue">';i>0?(a+="+"+r.addThousandsSeparator(i),t.badge.classList.add("likeCounterLiked")):0>i?(a+="−"+r.addThousandsSeparator(Math.abs(i)),t.badge.classList.add("likeCounterDisliked")):a+="±0",t.badge.innerHTML=a+"</span>",t.badge.setAttribute("data-tooltip",n.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 i=[],a=Object.keys(t.users),r=0,o=a.length;o>r;r++)i.push(t.users[a[r]]);var s=t.likes-i.length;t.summary.innerHTML=n.get("wcf.like.summary",{users:i,others:s})}else elHide(t.summary.parentNode)},_updateActiveState:function(e){var t=this._containers.get(e),i=this._options.markListItemAsActive?t.dislikeButton.parentNode:t.dislikeButton,n=this._options.markListItemAsActive?t.likeButton.parentNode:t.likeButton;null!==t.dislikeButton&&i.classList.remove("active"),n.classList.remove("active"),1===t.liked?n.classList.add("active"):-1===t.liked&&null!==t.dislikeButton&&i.classList.add("active")},_like:function(t,i){i.preventDefault(),u||(u=!0,e.api(this,{actionName:elData(i.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),i=this._containers.get(t);if(void 0!==i){i.dislikes=~~e.returnValues.dislikes,i.likes=~~e.returnValues.likes;var n=e.returnValues.users;i.users=[];for(var a=Object.keys(n),o=0,s=a.length;s>o;o++)i.users.push(r.escapeHTML(n[a[o]].username));1==e.returnValues.isLiked?i.liked=1:1==e.returnValues.isDisliked?i.liked=-1:i.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","WoltLab/WCF/Ui/Scroll"],function(e,t,i,n,a,r,o,s,l,c,d,u){"use strict";function h(e){this.init(e)}return h.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",quoteManager:null},e),this.rebuild()},rebuild:function(){for(var e,t,i,n=elBySelAll(this._options.messageSelector),a=0,r=n.length;r>a;a++)if(i=n[a],!this._elements.has(i)){e=elBySel(".jsMessageEditButton",i),null!==e&&(t=elDataBool(i,"can-edit"),this._options.canEditInline?(e.addEventListener(WCF_CLICK_EVENT,this._clickDropdown.bind(this,i)),e.classList.add("jsDropdownEnabled"),t&&e.addEventListener("dblclick",this._click.bind(this,i))):t&&e.addEventListener(WCF_CLICK_EVENT,this._click.bind(this,i)));var o=elBySel(".messageBody",i),s=elBySel(".messageFooter",i),l=elBySel(".messageHeader",i);this._elements.set(i,{button:e,messageBody:o,messageBodyEditor:null,messageFooter:s,messageFooterButtons:elBySel(".messageFooterButtons",s),messageHeader:l,messageText:elBySel(".messageText",o)})}},_click:function(t,i){null===t&&(t=this._activeDropdownElement),i&&i.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,i){i.preventDefault();var n=i.currentTarget;if(!n.classList.contains("dropdownToggle")){if(n.classList.add("dropdownToggle"),n.parentNode.classList.add("dropdown"),function(e,t){e.addEventListener(WCF_CLICK_EVENT,function(i){i.preventDefault(),i.stopPropagation(),this._activeDropdownElement=t,d.toggleDropdown(this._options.dropdownIdentifier,e)}.bind(this))}.bind(this)(n,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(n,WCF_CLICK_EVENT)},10)}},_dropdownBuild:function(e){for(var t,i,n,a=this._clickDropdownItem.bind(this),o=0,s=e.length;s>o;o++)t=e[o],n=elCreate("li"),elData(n,"item",t.item),"divider"===t.item?n.className="dropdownDivider":(i=elCreate("span"),i.textContent=r.get(t.label),n.appendChild(i),"editItem"===t.item?n.addEventListener(WCF_CLICK_EVENT,this._click.bind(this,null)):n.addEventListener(WCF_CLICK_EVENT,a)),this._dropdownMenu.appendChild(n)},_dropdownToggle:function(e,t){var i=this._elements.get(this._activeDropdownElement);if(i.button.parentNode.classList["open"===t?"add":"remove"]("dropdownOpen"),i.messageFooterButtons.classList["open"===t?"add":"remove"]("forceVisible"),"open"===t){var n=this._dropdownOpen();a.fire("com.woltlab.wcf.inlineEditor","dropdownOpen_"+this._options.dropdownIdentifier,{element:this._activeDropdownElement,visibility:n});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(n,r)&&n[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 i=elCreate("span");i.className="icon icon48 fa-spinner",t.appendChild(i),l.insertAfter(t,e.messageBody),elHide(e.messageBody)},_showEditor:function(e){var t=this._getEditorId(),i=this._elements.get(this._activeElement);this._activeElement.classList.add("jsInvalidQuoteTarget");var r=s.childByClass(i.messageBodyEditor,"icon");elRemove(r);var o=i.messageBodyEditor,c=elCreate("div");c.className="editorContainer",l.setInnerHtml(c,e.returnValues.template),o.appendChild(c);var d=elBySel(".formSubmit",c),h=elBySel('button[data-type="save"]',d);h.addEventListener(WCF_CLICK_EVENT,this._save.bind(this));var p=elBySel('button[data-type="cancel"]',d);p.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(i.messageHeader),elHide(i.messageFooter);var f=elById(t);"redactor"===n.editor()?window.setTimeout(function(){
 this._options.quoteManager&&this._options.quoteManager.setAlternativeEditor(t),u.element(this._activeElement)}.bind(this),250):f.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._options.quoteManager&&this._options.quoteManager.clearAlternativeEditor()},_save:function(){var t={containerID:this._options.containerId,data:{message:""},objectID:this._getObjectId(this._activeElement),removeQuoteIDs:this._options.quoteManager?this._options.quoteManager.getQuotesMarkedForRemoval():[]},i=this._getEditorId();a.fire("com.woltlab.wcf.redactor2","getText_"+i,t.data),this._validate(t)&&(a.fire("com.woltlab.wcf.redactor2","submit_"+i,t),e.api(this,{actionName:"save",parameters:t}),this._hideEditor())},_validate:function(e){for(var t=elByClass("innerError",this._activeElement);t.length;)elRemove(t[0]);var i={api:this,parameters:e,valid:!0};return a.fire("com.woltlab.wcf.redactor2","validate_"+this._getEditorId(),i),i.valid!==!1},throwError:function(e,t){var i=elCreate("small");i.className="innerError",i.textContent=t,l.insertAfter(i,e)},_showMessage:function(e){var t=this._elements.get(this._activeElement),i=elBySelAll(".attachmentThumbnailList, .attachmentFileList",t.messageBody);if(l.setInnerHtml(t.messageBody,e.returnValues.message),"string"==typeof e.returnValues.attachmentList){for(var n=0,a=i.length;a>n;n++)elRemove(i[n]);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(),this._options.quoteManager&&(this._options.quoteManager.clearAlternativeEditor(),this._options.quoteManager.countQuotes())},_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 i=s.childByClass(e.messageBodyEditor,"editorContainer");null!==i&&elShow(i)},_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),i=elBySel(".redactor-editor",t.messageBodyEditor);if(null===i)return this._restoreMessage(),!0;if(this._restoreEditor(),!e||void 0===e.returnValues||void 0===e.returnValues.errorType)return!0;var n=elBySel(".innerError",t.messageBodyEditor);return null===n&&(n=elCreate("small"),n.className="innerError",l.insertAfter(n,i)),n.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)}},h}),define("WoltLab/WCF/Ui/Message/Manager",["Ajax","Core","Dictionary","Language","Dom/Util"],function(e,t,i,n,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 i;for(var e,t=elBySelAll(this._options.selector),n=0,a=t.length;a>n;n++)e=t[n],this._elements.set(elData(e,"object-id"),e)},getPermission:function(e,t){t="can-"+this._getAttributeName(t);var i=this._elements.get(e);if(void 0===i)throw new Error("Unknown object id '"+e+"' for selector '"+this._options.selector+"'");return elDataBool(i,t)},getPropertyValue:function(e,t,i){var n=this._elements.get(e);if(void 0===n)throw new Error("Unknown object id '"+e+"' for selector '"+this._options.selector+"'");return window[i?"elDataBool":"elData"](n,this._getAttributeName(t))},update:function(t,i,n){e.api(this,{actionName:i,parameters:n||{},objectIDs:[t]})},updateItems:function(e,t){Array.isArray(e)||(e=[e]);for(var i,n=0,a=e.length;a>n;n++)if(i=this._elements.get(e[n]),void 0!==i)for(var r in t)t.hasOwnProperty(r)&&this._update(i,r,t[r])},updateAllItems:function(e){var t=[];this._elements.forEach(function(e,i){t.push(i)}.bind(this)),this.updateItems(t,e)},_update:function(e,t,i){elData(e,this._getAttributeName(t),i);var n=1==i||i===!0||"true"===i;this._updateState(e,t,i,n)},_updateState:function(e,t,i,n){switch(t){case"isDeleted":e.classList[n?"add":"remove"]("messageDeleted"),this._toggleMessageStatus(e,"jsIconDeleted","wcf.message.status.deleted","red",n);break;case"isDisabled":e.classList[n?"add":"remove"]("messageDisabled"),this._toggleMessageStatus(e,"jsIconDisabled","wcf.message.status.disabled","green",n)}},_toggleMessageStatus:function(e,t,i,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=n.get(i);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,i="",n=e.split(/([A-Z][a-z]+)/),a=0,r=n.length;r>a;a++)t=n[a],t.length&&(i.length&&(i+="-"),i+=t.toLowerCase());return i},_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,i,n,a,r,o){"use strict";function s(e){this.init(e)}return s.prototype={init:function(e){this._options=t.extend({ajax:{className:""},quoteManager:null,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 i=this._submit.bind(this),n=elBySel('button[data-type="save"]');n.addEventListener(WCF_CLICK_EVENT,i);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 n=a.getDataAttributes(this._container,"data-",!0,!0);n.data={message:this._getEditor().code.get()},n.removeQuoteIDs=this._options.quoteManager?this._options.quoteManager.getQuotesMarkedForRemoval():[],i.fire("com.woltlab.wcf.redactor2","submit_text",n.data),e.api(this,{parameters:n})}},_validate:function(){for(var e=elByClass("innerError",this._container);e.length;)elRemove(e[0]);if(this._getEditor().utils.isEmpty())return this.throwError(this._textarea,n.get("wcf.global.form.error.empty")),!1;var t={api:this,editor:this._getEditor(),message:this._getEditor().code.get(),valid:!0};return i.fire("com.woltlab.wcf.redactor2","validate_text",t),t.valid!==!1},throwError:function(e,t){var i=elCreate("small");i.className="innerError",i.textContent=t,a.insertAfter(i,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>"),i.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(n.get(this._options.successMessage)),this._options.quoteManager&&this._options.quoteManager.countQuotes()}},_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/Message/Share",["EventHandler"],function(e){"use strict";return{_pageDescription:"",_pageUrl:"",init:function(){var t=elBySel(".messageShareButtons"),i={facebook:{link:elBySel(".jsShareFacebook",t),share:function(){this._share("facebook","https://www.facebook.com/sharer.php?u={pageURL}&t={text}",!0)}.bind(this)},google:{link:elBySel(".jsShareGoogle",t),share:function(){this._share("google","https://plus.google.com/share?url={pageURL}",!1)}.bind(this)},reddit:{link:elBySel(".jsShareReddit",t),share:function(){this._share("reddit","https://ssl.reddit.com/submit?url={pageURL}",!1)}.bind(this)},twitter:{link:elBySel(".jsShareTwitter",t),share:function(){this._share("twitter","https://twitter.com/share?url={pageURL}&text={text}",!1)}.bind(this)},linkedIn:{link:elBySel(".jsShareLinkedIn",t),share:function(){this._share("linkedIn","https://www.linkedin.com/cws/share?url={pageURL}",!1)}.bind(this)},pinterest:{link:elBySel(".jsSharePinterest",t),share:function(){this._share("pinterest","https://www.pinterest.com/pin/create/link/?url={pageURL}&description={text}",!1)}.bind(this)},xing:{link:elBySel(".jsShareXing",t),share:function(){this._share("xing","https://www.xing.com/social_plugins/share?url={pageURL}",!1)}.bind(this)},whatsApp:{link:elBySel(".jsShareWhatsApp",t),share:function(){window.location.href="whatsapp://send?text="+this._pageDescription+"%20"+this._pageUrl}.bind(this)}},n=elBySel('meta[property="og:title"]');null!==n&&(this._pageDescription=encodeURIComponent(n.content));var a=elBySel('meta[property="og:url"]');null!==a&&(this._pageUrl=encodeURIComponent(a.content)),e.fire("com.woltlab.wcf.message.share","shareProvider",{container:t,providers:i,pageDescription:this._pageDescription,pageUrl:this._pageUrl});for(var r in i)i.hasOwnProperty(r)&&null!==i[r].link&&i[r].link.addEventListener(WCF_CLICK_EVENT,i[r].share)},_share:function(e,t,i){window.open(t.replace(/\{pageURL}/,this._pageUrl).replace(/\{text}/,this._pageDescription+(i?"%20"+this._pageUrl:"")),e,"height=600,width=600")}}}),define("WoltLab/WCF/Ui/Page/Search",["Ajax","EventKey","Language","StringUtil","Dom/Util","Ui/Dialog"],function(e,t,i,n,a,r){"use strict";var o,s,l,c=null;return{open:function(e){o=e,r.open(this)},_search:function(t){t.preventDefault();var n=c.parentNode,r=n.nextSibling;r&&"SMALL"===r.nodeName&&elRemove(r);var o=c.value.trim();return o.length<3?(r=elCreate("small"),r.className="innerError",r.textContent=i.get("wcf.page.search.error.tooShort"),void a.insertAfter(r,n)):void e.api(this,{parameters:{searchString:o}})},_click:function(e){e.preventDefault(),o(elData(e.currentTarget,"page-id")),r.close(this)},_ajaxSuccess:function(e){for(var t,r="",o=0,d=e.returnValues.length;d>o;o++)t=e.returnValues[o],r+='<li><div class="containerHeadline pointer" data-page-id="'+t.pageID+'"><h3>'+n.escapeHTML(t.name)+"</h3><small>"+n.escapeHTML(t.displayLink)+"</small></div></li>";if(l.innerHTML=r,window[r?"elShow":"elHide"](s),r)elBySelAll(".containerHeadline",l,function(e){e.addEventListener(WCF_CLICK_EVENT,this._click.bind(this))}.bind(this));else{var u=elCreate("small");u.className="innerError",u.textContent=i.get("wcf.page.search.error.noResults"),a.insertAfter(u,c.parentNode)}},_ajaxSetup:function(){return{data:{actionName:"search",className:"wcf\\data\\page\\PageAction"}}},_dialogSetup:function(){return{id:"wcfUiPageSearch",options:{onSetup:function(){var e=this._search.bind(this);c=elById("wcfUiPageSearchInput"),c.addEventListener("keydown",function(i){t.Enter(i)&&e(i)}),c.nextElementSibling.addEventListener(WCF_CLICK_EVENT,e),s=elById("wcfUiPageSearchResultContainer"),l=elById("wcfUiPageSearchResultList")}.bind(this),onShow:function(){c.focus()},title:i.get("wcf.page.search")},source:'<div class="section"><dl><dt><label for="wcfUiPageSearchInput">'+i.get("wcf.page.search.name")+'</label></dt><dd><div class="inputAddon"><input type="text" id="wcfUiPageSearchInput" class="long"><a href="#" class="inputSuffix"><span class="icon icon16 fa-search"></span></a></div></dd></dl></div><section id="wcfUiPageSearchResultContainer" class="section" style="display: none;"><header class="sectionHeader"><h2 class="sectionTitle">'+i.get("wcf.page.search.results")+'</h2><p class="sectionDescription">'+i.get("wcf.page.search.results.description")+'</p></header><ol id="wcfUiPageSearchResultList" class="containerList"></ol></section>'}}}}),define("WoltLab/WCF/Ui/Redactor/Code",["EventHandler","EventKey","Language","StringUtil","Dom/Util","Ui/Dialog"],function(e,t,i,n,a,r){"use strict";function o(e){this.init(e)}var s=0;return o.prototype={init:function(t){this._editor=t,this._elementId=this._editor.$element[0].id,this._pre=null,e.add("com.woltlab.wcf.redactor2","bbcode_code_"+this._elementId,this._bbcodeCode.bind(this)),e.add("com.woltlab.wcf.redactor2","observe_load_"+this._elementId,this._observeLoad.bind(this)),this._editor.opts.activeButtonsStates.pre="code",this._callbackEdit=this._edit.bind(this),this._observeLoad()},_bbcodeCode:function(e){e.cancel=!0,this._editor.button.toggle({},"pre","func","block.format");var t=this._editor.selection.block();t&&"PRE"===t.nodeName&&(this._setTitle(t),t.addEventListener(WCF_CLICK_EVENT,this._callbackEdit))},_observeLoad:function(){elBySelAll("pre",this._editor.$editor[0],function(e){e.addEventListener(WCF_CLICK_EVENT,this._callbackEdit),this._setTitle(e)}.bind(this))},_edit:function(e){var t=e.currentTarget;if(0===s){s=~~window.getComputedStyle(t).paddingTop.replace(/px$/,"");var i=window.getComputedStyle(t,"::before");s+=~~i.paddingTop.replace(/px$/,""),s+=~~i.height.replace(/px$/,""),s+=~~i.paddingBottom.replace(/px$/,"")}var n=a.offset(t);e.pageY>n.top&&e.pageY<n.top+s&&(e.preventDefault(),this._pre=t,r.open(this))},_save:function(e){e.preventDefault();var t="redactor-code-"+this._elementId;["file","highlighter","line"].forEach(function(e){elData(this._pre,e,elById(t+"-"+e).value)}.bind(this)),this._setTitle(this._pre),this._editor.caret.after(this._pre),r.close(this)},_setTitle:function(e){var t=elData(e,"file"),n=elData(e,"highlighter");n=this._editor.opts.woltlab.highlighters.hasOwnProperty(n)?this._editor.opts.woltlab.highlighters[n]:"";var a=i.get("wcf.editor.code.title",{file:t,highlighter:n});elData(e,"title")!==a&&elData(e,"title",a)},_dialogSetup:function(){var e="redactor-code-"+this._elementId,t=e+"-button-save",a=e+"-file",r=e+"-highlighter",o=e+"-line";return{id:e,options:{onSetup:function(){elById(t).addEventListener(WCF_CLICK_EVENT,this._save.bind(this));var e='<option value="">'+i.get("wcf.editor.code.highlighter.detect")+"</option>",a=[];for(var o in this._editor.opts.woltlab.highlighters)this._editor.opts.woltlab.highlighters.hasOwnProperty(o)&&a.push([o,this._editor.opts.woltlab.highlighters[o]]);a.sort(function(e,t){return e[1]<t[1]?-1:e[1]>t[1]?1:0}),a.forEach(function(t){e+='<option value="'+t[0]+'">'+n.escapeHTML(t[1])+"</option>"}.bind(this)),elById(r).innerHTML=e}.bind(this),onShow:function(){elById(r).value=elData(this._pre,"highlighter");var e=elData(this._pre,"line");elById(o).value=""===e?1:~~e,elById(a).value=elData(this._pre,"file")}.bind(this),title:i.get("wcf.editor.code.edit")},source:'<div class="section"><dl><dt><label for="'+r+'">'+i.get("wcf.editor.code.highlighter")+'</label></dt><dd><select id="'+r+'"></select><small>'+i.get("wcf.editor.code.highlighter.description")+'</small></dd></dl><dl><dt><label for="'+o+'">'+i.get("wcf.editor.code.line")+'</label></dt><dd><input type="number" id="'+o+'" min="0" value="1" class="long"><small>'+i.get("wcf.editor.code.line.description")+'</small></dd></dl><dl><dt><label for="'+a+'">'+i.get("wcf.editor.code.file")+'</label></dt><dd><input type="text" id="'+a+'" class="long"><small>'+i.get("wcf.editor.code.file.description")+'</small></dd></dl></div><div class="formSubmit"><button id="'+t+'" class="buttonPrimary">'+i.get("wcf.global.button.save")+"</button></div>"}}},o}),define("WoltLab/WCF/Ui/Redactor/Format",["Dom/Util"],function(e){"use strict";return{format:function(t,i,n,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(i),n&&(r.className=n),"object"==typeof a)for(o in a)a.hasOwnProperty(o)&&elAttr(r,key,a[key]);e.replaceElement(s,r)}},removeFormat:function(t,i){i=i.toUpperCase();for(var n=elByTag("strike",t);n.length;)e.unwrapChildNodes(n[0]);document.execCommand("strikethrough");for(var a,r,o;n.length;){for(o=n[0],r=this._getLastMatchingParent(o,t,i),null!==r&&this._handleParentNodes(o,r,i),a=elByTag(i.toLowerCase(),o);a.length;)e.unwrapChildNodes(a[0]);e.unwrapChildNodes(o)}},_handleParentNodes:function(t,i,n){var a;if(!e.isAtNodeStart(t,i)){a=document.createRange(),a.setStartBefore(i),a.setEndBefore(t);var r=a.extractContents();i.parentNode.insertBefore(r,i)}e.isAtNodeEnd(t,i)||(a=document.createRange(),a.setStartAfter(t),a.setEndAfter(i),r=a.extractContents(),i.parentNode.insertBefore(r,i.nextSibling));for(var o=elByTag(n,i);o.length;)e.unwrapChildNodes(o[0]);e.unwrapChildNodes(i)},_getLastMatchingParent:function(e,t,i){for(var n=e.parentNode,a=null;n!==t;)n.nodeName===i&&(a=n),n=n.parentNode;return a}}}),define("WoltLab/WCF/Ui/Redactor/Link",["Language","Ui/Dialog"],function(e,t){"use strict";var i=!1,n=null;return{showDialog:function(a){t.open(this),t.setTitle(this,e.get("wcf.editor.link."+(a.insert?"add":"edit")));var r=elById("redactor-modal-button-action");r.textContent=e.get("wcf.global.button."+(a.insert?"insert":"save")),n=a.submitCallback,i||(i=!0,r.addEventListener(WCF_CLICK_EVENT,this._submit.bind(this)))},_submit:function(){if(n())t.close(this);else{var i=elById("redactor-link-url"),a=i.nextElementSibling&&"SMALL"===i.nextElementSibling.nodeName?i.nextElementSibling:null;null===a&&(a=elCreate("small"),a.className="innerError",a.textContent=e.get("wcf.global.form.error.empty"),i.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.editor.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.editor.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,i,n){"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 i=t.event;if(13===i.which)return void(this._active=!1);var n=this._getTextLineInFrontOfCaret();if(n.length){var a=n.match(/@([^,]{3,})$/);a?(!a.index||n[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);var i=window.getSelection();i.removeAllRanges(),i.addRange(this._caret);var n=i.getRangeAt(0).cloneRange();this._redactor.buffer.set();var a=n.startContainer,r=n.startOffset-(this._mentionStart.length+1);0>r&&(a=a.previousSibling,r=a.length-(this._mentionStart.length+1)-(n.startOffset-1));var o=document.createRange();o.setStart(a,r),o.setEnd(n.startContainer,n.startOffset),i.removeAllRanges(),i.addRange(o);var s=getSelection().getRangeAt(0);s.deleteContents(),s.collapse(!0);var l=elCreate("woltlab-mention");elAttr(l,"contenteditable","false"),elData(l,"user-id",elData(t,"user-id")),elData(l,"username",elData(t,"username")),l.textContent=elData(t,"username");var c=document.createTextNode("‌");s.insertNode(c),s.insertNode(l),o=document.createRange(),o.selectNode(c),o.collapse(!1),i.removeAllRanges(),i.addRange(o),this._redactor.selection.save(),this._hideDropdown()},_getTextLineInFrontOfCaret:function(){var e=window.getSelection().getRangeAt(0);if(!e.collapsed)return"";"firefox"===t.browser()&&e.startContainer.nodeType===Node.TEXT_NODE&&e.startContainer.parentNode.normalize();var i=e.startContainer.textContent.substr(0,e.startOffset),n=i;i="";for(var a=!1,r=0;r<n.length;r++){var o=n.charCodeAt(r).toString(16);"200b"===o||/\s/.test(n[r])&&("a0"!==o&&"20"!==o||a)?(a=!1,i=""):(("a0"===o||"20"===o)&&(a=!0),"@"===n[r]&&r&&/\s/.test(n[r-1])&&(a=!1,i=""),i+=n[r])}return i},_ajaxSetup:function(){return{data:{actionName:"getSearchResultList",className:"wcf\\data\\user\\UserAction",interfaceName:"wcf\\data\\ISearchAction",parameters:{data:{includeUserGroups:!1}}}}},_ajaxSuccess:function(e){if(!Array.isArray(e.returnValues)||!e.returnValues.length)return void this._hideDropdown();null===this._dropdownMenu&&(this._dropdownMenu=elCreate("ol"),this._dropdownMenu.className="dropdownMenu",elById("dropdownMenuContainer").appendChild(this._dropdownMenu)),this._dropdownMenu.innerHTML="";for(var t,i,n,a=this._setUsername.bind(this),r=0,o=e.returnValues.length;o>r;r++)n=e.returnValues[r],i=elCreate("li"),t=elCreate("a"),t.addEventListener(WCF_CLICK_EVENT,a),t.className="box16",t.innerHTML="<span>"+n.icon+"</span> <span>"+n.label+"</span>",elData(t,"user-id",n.objectID),elData(t,"username",n.label),i.appendChild(t),this._dropdownMenu.appendChild(i);this._dropdownMenu.classList.add("dropdownOpen"),this._dropdownActive=!0,this._updateDropdownPosition()},_getDropdownMenuPosition:function(){this._redactor.selection.save();var e=window.getSelection(),t=e.getRangeAt(0).cloneRange(),i=document.createRange();i.setStart(t.startContainer,t.startOffset-(this._mentionStart.length+1)),i.setEnd(t.startContainer,t.startOffset),e.removeAllRanges(),e.addRange(i);var n=e.getRangeAt(0).getBoundingClientRect(),a={top:Math.round(n.bottom)+window.scrollY,left:Math.round(n.left)+document.body.scrollLeft};return null===this._lineHeight&&(this._lineHeight=Math.round(n.bottom-n.top-window.scrollY)),this._redactor.selection.restore(),this._caret=t,a},_updateDropdownPosition:function(){try{var e=this._getDropdownMenuPosition();e.top+=7,this._dropdownMenu.style.setProperty("left",e.left+"px",""),this._dropdownMenu.style.setProperty("top",e.top+"px",""),this._selectItem(0),e.top+this._dropdownMenu.offsetHeight+10>window.innerHeight+window.scrollY?(this._dropdownMenu.classList.add("dropdownArrowBottom"),this._dropdownMenu.style.setProperty("top",e.top-this._dropdownMenu.offsetHeight-2*this._lineHeight+7+"px","")):this._dropdownMenu.classList.remove("dropdownArrowBottom")}catch(t){console.debug(t)}},_selectItem:function(e){var t=elBySel(".active",this._dropdownMenu);null!==t&&t.classList.remove("active"),this._itemIndex+=e,-1===this._itemIndex?this._itemIndex=this._dropdownMenu.childElementCount-1:this._itemIndex===this._dropdownMenu.childElementCount&&(this._itemIndex=0),this._dropdownMenu.children[this._itemIndex].classList.add("active")},_hideDropdown:function(){null!==this._dropdownMenu&&this._dropdownMenu.classList.remove("dropdownOpen"),this._dropdownActive=!1}},a}),define("WoltLab/WCF/Ui/Redactor/Metacode",["Dom/Util"],function(e){"use strict";return{convert:function(t){var i=elCreate("div");i.innerHTML=t.textContent;for(var n,a,r,o,s,l=elByTag("woltlab-metacode",i);l.length;)a=l[0],r=elData(a,"name"),n=elData(a,"attributes"),s=this._getOpeningTag(r,n),o=this._getClosingTag(r),a.parentNode===i?(e.prepend(s,this._getFirstParagraph(a)),this._getLastParagraph(a).appendChild(o)):(e.prepend(s,a),a.appendChild(o)),e.unwrapChildNodes(a);t.textContent=i.innerHTML},_getOpeningTag:function(e,t){try{t=JSON.parse(atob(t))}catch(i){}Array.isArray(t)||(t=[]);var n="["+e;if(t.length){for(var a=0,r=t.length;r>a;a++)/^'.*'$/.test(t[a])||(t[a]="'"+t[a]+"'");n+="="+t.join(",")}return document.createTextNode(n+"]")},_getClosingTag:function(e){return document.createTextNode("[/"+e+"]")},_getFirstParagraph:function(e){var t,i;return 0===e.childElementCount?(i=elCreate("p"),e.appendChild(i)):(t=e.children[0],"P"===t.nodeName?i=t:(i=elCreate("p"),e.insertBefore(i,t))),i},_getLastParagraph:function(e){var t,i,n=e.childElementCount;return 0===n?(i=elCreate("p"),e.appendChild(i)):(t=e.children[n-1],"P"===t.nodeName?i=t:(i=elCreate("p"),e.appendChild(i))),i}}}),define("WoltLab/WCF/Ui/Redactor/Page",["WoltLab/WCF/Ui/Page/Search"],function(e){"use strict";function t(e,t){this.init(e,t)}return t.prototype={init:function(e,t){this._editor=e,t.addEventListener(WCF_CLICK_EVENT,this._click.bind(this))},_click:function(t){t.preventDefault(),e.open(this._insert.bind(this))},_insert:function(e){this._editor.buffer.set(),this._editor.insert.text("[wsp='"+e+"'][/wsp]")}},t}),define("WoltLab/WCF/Ui/Redactor/Quote",["Core","EventHandler","EventKey","Language","StringUtil","Dom/Util","Ui/Dialog"],function(e,t,i,n,a,r,o){"use strict";function s(e,t){this.init(e,t)}var l=0;return s.prototype={init:function(e,i){this._blockquote=null,this._editor=e,this._elementId=this._editor.$element[0].id,t.add("com.woltlab.wcf.redactor2","observe_load_"+this._elementId,this._observeLoad.bind(this)),this._editor.button.addCallback(i,this._click.bind(this)),this._editor.opts.activeButtonsStates.blockquote="woltlabQuote",this._callbackEdit=this._edit.bind(this),this._observeLoad(),t.add("com.woltlab.wcf.redactor2","insertQuote_"+this._elementId,this._insertQuote.bind(this))},_insertQuote:function(t){this._editor.buffer.set();var i=this._editor.selection.block();if(i===!1&&(this._editor.selection.restore(),i=this._editor.selection.block()),"P"!==i.nodeName){for(var n=this._editor.core.editor()[0];i.parentNode!==n;)i=i.parentNode;var a=this._editor.caret.next(i);if(void 0===a||"P"!==a.nodeName){var o=elCreate("p");o.textContent="​",r.insertAfter(o,i)}this._editor.caret.after(i)}var s="";s=t.isText?this._editor.marker.html():t.content;var l=e.getUuid();this._editor.insert.html('<blockquote id="'+l+'">'+s+"</blockquote>");var c=elById(l);elData(c,"author",t.author),elData(c,"link",t.link),t.isText&&this.insert.text(t.content),c.removeAttribute("id"),this._editor.caret.after(c),this._editor.selection.save()},_click:function(){this._editor.button.toggle({},"blockquote","func","block.format");var e=this._editor.selection.block();e&&"BLOCKQUOTE"===e.nodeName&&(this._setTitle(e),e.addEventListener(WCF_CLICK_EVENT,this._callbackEdit))},_observeLoad:function(){elBySelAll("blockquote",this._editor.$editor[0],function(e){e.addEventListener(WCF_CLICK_EVENT,this._callbackEdit),this._setTitle(e)}.bind(this))},_edit:function(e){var t=e.currentTarget;if(0===l){l=~~window.getComputedStyle(t).paddingTop.replace(/px$/,"");var i=window.getComputedStyle(t,"::before");l+=~~i.paddingTop.replace(/px$/,""),l+=~~i.height.replace(/px$/,""),l+=~~i.paddingBottom.replace(/px$/,"")}var n=r.offset(t);e.pageY>n.top&&e.pageY<n.top+l&&(e.preventDefault(),this._blockquote=t,o.open(this))},_save:function(e){e.preventDefault();var t="redactor-quote-"+this._elementId;["author","url"].forEach(function(e){elData(this._blockquote,e,elById(t+"-"+e).value)}.bind(this)),this._setTitle(this._blockquote),this._editor.caret.after(this._blockquote),o.close(this)},_setTitle:function(e){var t=n.get("wcf.editor.quote.title",{author:elData(e,"author"),url:elData(e,"url")});elData(e,"title")!==t&&elData(e,"title",t)},_dialogSetup:function(){var e="redactor-quote-"+this._elementId,t=e+"-author",i=e+"-button-save",a=e+"-url";return{id:e,options:{onSetup:function(){elById(i).addEventListener(WCF_CLICK_EVENT,this._save.bind(this))}.bind(this),onShow:function(){elById(t).value=elData(this._blockquote,"author"),elById(a).value=elData(this._blockquote,"url")}.bind(this),title:n.get("wcf.editor.quote.edit")},source:'<div class="section"><dl><dt><label for="'+t+'">'+n.get("wcf.editor.quote.author")+'</label></dt><dd><input type="text" id="'+t+'" class="long"></dd></dl><dl><dt><label for="'+a+'">'+n.get("wcf.editor.quote.url")+'</label></dt><dd><input type="text" id="'+a+'" class="long"><small>'+n.get("wcf.editor.quote.url.description")+'</small></dd></dl></div><div class="formSubmit"><button id="'+i+'" class="buttonPrimary">'+n.get("wcf.global.button.save")+"</button></div>"}}},s}),define("WoltLab/WCF/Ui/Redactor/Spoiler",["EventHandler","EventKey","Language","StringUtil","Dom/Util","Ui/Dialog"],function(e,t,i,n,a,r){"use strict";function o(e){this.init(e)}var s=0;return o.prototype={init:function(t){this._editor=t,this._elementId=this._editor.$element[0].id,this._spoiler=null,e.add("com.woltlab.wcf.redactor2","bbcode_spoiler_"+this._elementId,this._bbcodeSpoiler.bind(this)),e.add("com.woltlab.wcf.redactor2","observe_load_"+this._elementId,this._observeLoad.bind(this)),this._editor.WoltLabBlock.register("woltlab-spoiler"),this._editor.block.tags.push("woltlab-spoiler"),this._editor.opts.activeButtonsStates["woltlab-spoiler"]="woltlabSpoiler",this._callbackEdit=this._edit.bind(this),this._observeLoad()},_bbcodeSpoiler:function(e){e.cancel=!0,this._editor.button.toggle({},"woltlab-spoiler","func","block.format");var t=this._editor.selection.block();t&&"WOLTLAB-SPOILER"===t.nodeName&&(this._setTitle(t),
 t.addEventListener(WCF_CLICK_EVENT,this._callbackEdit))},_observeLoad:function(){elBySelAll("woltlab-spoiler",this._editor.$editor[0],function(e){e.addEventListener(WCF_CLICK_EVENT,this._callbackEdit),this._setTitle(e)}.bind(this))},_edit:function(e){var t=e.currentTarget;if(0===s){s=~~window.getComputedStyle(t).paddingTop.replace(/px$/,"");var i=window.getComputedStyle(t,"::before");s+=~~i.paddingTop.replace(/px$/,""),s+=~~i.height.replace(/px$/,""),s+=~~i.paddingBottom.replace(/px$/,"")}var n=a.offset(t);e.pageY>n.top&&e.pageY<n.top+s&&(e.preventDefault(),this._spoiler=t,r.open(this))},_save:function(e){e.preventDefault(),elData(this._spoiler,"label",elById("redactor-spoiler-"+this._elementId+"-label").value),this._setTitle(this._spoiler),this._editor.caret.after(this._spoiler),r.close(this)},_setTitle:function(e){var t=i.get("wcf.editor.spoiler.title",{label:elData(e,"label")});elData(e,"title")!==t&&elData(e,"title",t)},_dialogSetup:function(){var e="redactor-spoiler-"+this._elementId,t=e+"-button-save",n=e+"-label";return{id:e,options:{onSetup:function(){elById(t).addEventListener(WCF_CLICK_EVENT,this._save.bind(this))}.bind(this),onShow:function(){elById(n).value=elData(this._spoiler,"label")}.bind(this),title:i.get("wcf.editor.spoiler.edit")},source:'<div class="section"><dl><dt><label for="'+n+'">'+i.get("wcf.editor.spoiler.label")+'</label></dt><dd><input type="text" id="'+n+'" class="long"><small>'+i.get("wcf.editor.spoiler.label.description")+'</small></dd></dl></div><div class="formSubmit"><button id="'+t+'" class="buttonPrimary">'+i.get("wcf.global.button.save")+"</button></div>"}}},o}),define("WoltLab/WCF/Ui/Search/Page",["Core","Dom/Util","Ui/SimpleDropdown","./Input"],function(e,t,i,n){"use strict";return{init:function(a){var r=elById("pageHeaderSearchInput");new n(r,{ajax:{className:"wcf\\data\\search\\keyword\\SearchKeywordAction"},callbackDropdownInit:function(e){e.classList.add("dropdownMenuPageSearch"),elData(e,"dropdown-alignment-horizontal","right");var i=r.clientWidth;e.style.setProperty("min-width",i+"px","");var n=r.parentNode,a=t.offset(n).left+n.clientWidth-(t.offset(r).left+i),o=t.styleAsInt(window.getComputedStyle(n),"padding-bottom");e.style.setProperty("transform","translateX(-"+Math.ceil(a)+"px) translateY(-"+o+"px)","")}});var o=i.getDropdownMenu(t.identify(elBySel(".pageHeaderSearchType"))),s=this._click.bind(this);elBySelAll("a[data-object-type]",o,function(e){e.addEventListener(WCF_CLICK_EVENT,s)});var l=elBySel('a[data-object-type="'+a+'"]',o);e.triggerEvent(l,WCF_CLICK_EVENT)},_click:function(e){e.preventDefault();var t=elData(e.currentTarget,"object-type"),i=elById("pageHeaderSearchParameters");i.innerHTML="";var n=elData(e.currentTarget,"parameters");n=n?JSON.parse(n):{},t&&(n["types[]"]=t);for(var a in n)if(n.hasOwnProperty(a)){var r=elCreate("input");r.type="hidden",r.name=a,r.value=n[a],i.appendChild(r)}var o=elBySel(".pageHeaderSearchType > .button",elById("pageHeaderSearchInputContainer"));o.textContent=e.currentTarget.textContent}}}),define("WoltLab/WCF/Ui/Toggle/Input",["Core"],function(e){"use strict";function t(e,t){this.init(e,t)}return t.prototype={init:function(t,i){if(this._element=elBySel(t),null===this._element)throw new Error("Unable to find element by selector '"+t+"'.");var n="INPUT"===this._element.nodeName?elAttr(this._element,"type"):"";if("checkbox"!==n&&"radio"!==n)throw new Error("Illegal element, expected input[type='checkbox'] or input[type='radio'].");this._options=e.extend({hide:[],show:[]},i),["hide","show"].forEach(function(e){var t,i,n;for(i=0,n=this._options[e].length;n>i;i++)if(t=this._options[e][i],"string"!=typeof t&&!(t instanceof Element))throw new TypeError("The array '"+e+"' may only contain string selectors or DOM elements.")}.bind(this)),this._element.addEventListener("change",this._change.bind(this))},_change:function(e){var t=e.currentTarget.checked;this._handleElements(this._options.show,t),this._handleElements(this._options.hide,!t)},_handleElements:function(e,t){for(var i,n,a=0,r=e.length;r>a;a++){if(i=e[a],"string"==typeof i){if(n=elBySel(i),null===n)throw new Error("Unable to find element by selector '"+i+"'.");e[a]=i=n}window[t?"elShow":"elHide"](i)}}},t}),define("WoltLab/WCF/Ui/User/Editor",["Ajax","Language","StringUtil","Dom/Util","Ui/Dialog","Ui/Notification"],function(e,t,i,n,a,r){"use strict";var o="",s=null;return{init:function(){s=elBySel(".userProfileUser"),["ban","disableAvatar","disableSignature","enable"].forEach(function(e){var t=elBySel(".jsButtonUser"+i.ucfirst(e),s);t&&(elData(t,"action",e),t.addEventListener(WCF_CLICK_EVENT,this._click.bind(this)))}.bind(this))},_click:function(t){t.preventDefault();var i=elData(t.currentTarget,"action"),n="";switch(i){case"ban":elDataBool(s,"banned")&&(n="unban");break;case"disableAvatar":elDataBool(s,"disable-avatar")&&(n="enableAvatar");break;case"disableSignature":elDataBool(s,"disable-signature")&&(n="enableSignature");break;case"enable":n=elDataBool(s,"is-disabled")?"enable":"disable"}""===n?(o=i,a.open(this)):e.api(this,{actionName:n})},_submit:function(i){i.preventDefault();var n=elById("wcfUiUserEditorExpiresLabel"),a=n.previousElementSibling;a.classList.contains("innerError")&&elRemove(a);var r="";elById("wcfUiUserEditorNeverExpires").checked||(r=elById("wcfUiUserEditorExpiresDatePicker").value,""===r&&(a=elCreate("small"),a.className="innerError",a.textContent=t.get("wcf.global.form.error.empty"),n.parentNode.insertBefore(a,n)));var s={};s[o+"Expires"]=r,s[o+"Reason"]=elById("wcfUiUserEditorReason").value.trim(),e.api(this,{actionName:o,parameters:s})},_ajaxSuccess:function(e){switch(e.actionName){case"ban":case"unban":elData(s,"banned","ban"===e.actionName),elBySel(".jsButtonUserBan",s).textContent=t.get("wcf.user."+("ban"===e.actionName?"unban":"ban"));var i=elBySel(".contentTitle",s),n=elBySel(".jsUserBanned",i);"ban"===e.actionName?(n=elCreate("span"),n.className="icon icon16 fa-lock jsUserBanned jsTooltip",n.title=t.get("wcf.user.banned"),i.appendChild(n)):n&&elRemove(n);break;case"disableAvatar":case"enableAvatar":elData(s,"disable-avatar","disableAvatar"===e.actionName),elBySel(".jsButtonUserDisableAvatar",s).textContent=t.get("wcf.user."+("disableAvatar"===e.actionName?"enable":"disable")+"Avatar");break;case"disableSignature":case"enableSignature":elData(s,"disable-signature","disableSignature"===e.actionName),elBySel(".jsButtonUserDisableSignature",s).textContent=t.get("wcf.user."+("disableSignature"===e.actionName?"enable":"disable")+"Signature");break;case"enable":case"disable":elData(s,"is-disabled","disable"===e.actionName),elBySel(".jsButtonUserEnable",s).textContent=t.get("wcf.acp.user."+("enable"===e.actionName?"disable":"enable"))}("ban"===e.actionName||"disableAvatar"===e.actionName||"disableSignature"===e.actionName)&&a.close(this),r.show()},_ajaxSetup:function(){return{data:{className:"wcf\\data\\user\\UserAction",objectIDs:[elData(s,"object-id")]}}},_dialogSetup:function(){return{id:"wcfUiUserEditor",options:{onSetup:function(e){elById("wcfUiUserEditorNeverExpires").addEventListener("change",function(){window[this.checked?"elHide":"elShow"](elById("wcfUiUserEditorExpiresSettings"))}),elBySel("button.buttonPrimary",e).addEventListener(WCF_CLICK_EVENT,this._submit.bind(this))}.bind(this),onShow:function(e){a.setTitle("wcfUiUserEditor",t.get("wcf.user."+o+".confirmMessage"));var i=elById("wcfUiUserEditorReason").nextElementSibling,n="wcf.user."+o+".reason.description";i.textContent=t.get(n),window[i.textContent===n?"elHide":"elShow"](i),i=elById("wcfUiUserEditorNeverExpires").nextElementSibling,i.textContent=t.get("wcf.user."+o+".neverExpires"),i=elBySel('label[for="wcfUiUserEditorExpires"]',e),i.textContent=t.get("wcf.user."+o+".expires"),i=elById("wcfUiUserEditorExpiresLabel"),i.textContent=t.get("wcf.user."+o+".expires.description")}},source:'<div class="section"><dl><dt><label for="wcfUiUserEditorReason">'+t.get("wcf.global.reason")+'</label></dt><dd><textarea id="wcfUiUserEditorReason" cols="40" rows="3"></textarea><small></small></dd></dl><dl><dt></dt><dd><label><input type="checkbox" id="wcfUiUserEditorNeverExpires" checked> <span></span></label></dd></dl><dl id="wcfUiUserEditorExpiresSettings" style="display: none"><dt><label for="wcfUiUserEditorExpires"></label></dt><dd><input type="date" name="wcfUiUserEditorExpires" id="wcfUiUserEditorExpires" class="medium" min="'+new Date(1e3*TIME_NOW).toISOString()+'" data-ignore-timezone="true"><small id="wcfUiUserEditorExpiresLabel"></small></dd></dl></div><div class="formSubmit"><button class="buttonPrimary">'+t.get("wcf.global.button.submit")+"</button></div>"}}}}),define("WoltLab/WCF/Controller/Condition/Page/Dependence",["Dom/Traverse"],function(e){"use strict";function t(t,n){this._dependentElement=t,this._pageIds=n;for(var a=0,r=i.length;r>a;a++)i[a].addEventListener("change",this._checkVisibility.bind(this));e.parentByTag(this._dependentElement,"FORM").addEventListener("submit",function(){"none"===this._dependentElement.style.getPropertyValue("display")&&this._dependentElement.remove()}.bind(this)),this._checkVisibility()}var i=elBySelAll('input[name="pageIDs[]"]');return t.prototype={_checkVisibility:function(){for(var e,t=0,n=i.length;n>t;t++)if(e=i[t],e.checked&&-1!==this._pageIds.indexOf(~~e.value))return void elShow(this._dependentElement);elHide(this._dependentElement)}},t}),define("WoltLab/WCF/Controller/User/Notification/Settings",["Dictionary","Language","Dom/Traverse","Ui/SimpleDropdown"],function(e,t,i,n){"use strict";var a=new e,r=null,o=null,s={setup:function(){r=this._click.bind(this),o=this._selectType.bind(this);for(var e,t,i=elBySelAll("#notificationSettings .flexibleButtonGroup"),n=0,a=i.length;a>n;n++)e=i[n],t=elBySel(".notificationSettingsEmail",e),null!==t&&this._initGroup(e,t)},_initGroup:function(e,t){var n=~~elData(e,"object-id"),o=elById("settings_"+n+"_disabled");o.addEventListener(WCF_CLICK_EVENT,function(){t.classList.remove("active")});var s=elById("settings_"+n+"_enabled");s.addEventListener(WCF_CLICK_EVENT,function(){t.classList.add("active")});var l=i.childByTag(t,"INPUT"),c=i.childByTag(t,"A");elData(c,"object-id",n),c.addEventListener(WCF_CLICK_EVENT,r),a.set(n,{button:c,dropdownMenu:null,mailSetting:t,mailValue:l})},_click:function(e){e.preventDefault();var t=e.currentTarget,r=~~elData(t,"object-id"),o=a.get(r);if(null===o.dropdownMenu)o.dropdownMenu=this._createDropdown(r,o.mailValue.value),t.parentNode.classList.add("dropdown"),t.parentNode.appendChild(o.dropdownMenu),n.init(t,!0);else for(var s=i.childrenByTag(o.dropdownMenu,"LI"),l=o.mailValue.value,c=0;4>c;c++)s[c].classList[elData(s[c],"value")===l?"add":"remove"]("active")},_createDropdown:function(e,i){var n=elCreate("ul");n.className="dropdownMenu",elData(n,"object-id",e);for(var a,r,s,l=["instant","daily","divider","none"],c=0;4>c;c++)s=l[c],r=elCreate("li"),"divider"===s?r.className="dropdownDivider":(a=elCreate("a"),a.textContent=t.get("wcf.user.notification.mailNotificationType."+s),r.appendChild(a),elData(r,"value",s),r.addEventListener(WCF_CLICK_EVENT,o),i===s&&(r.className="active")),n.appendChild(r);return n},_selectType:function(e){var i=elData(e.currentTarget,"value"),n=~~elData(e.currentTarget.parentNode,"object-id"),r=a.get(n);r.mailValue.value=i,elBySel("span.title",r.mailSetting).textContent=t.get("wcf.user.notification.mailNotificationType."+i),r.button.classList["none"===i?"remove":"add"]("yellow"),r.button.classList["none"===i?"remove":"add"]("active")}};return s}),define("WoltLab/WCF/Ui/Page/Header/Fixed",["Core","EventHandler","Ui/Alignment","Ui/CloseOverlay","Ui/Screen","Ui/SimpleDropdown"],function(e,t,i,n,a,r){"use strict";var o,s,l,c,d=!1,u=!1;return{init:function(){o=elById("pageHeader"),s=elById("pageHeaderContainer"),this._initStickyPageHeader(),this._initSearchBar(),a.on("screen-md-down",{match:function(){u=!0},unmatch:function(){u=!1},setup:function(){u=!0}})},_initStickyPageHeader:function(){o.clientHeight&&o.style.setProperty("min-height",o.clientHeight+"px"),c=o.clientHeight-elBySel(".mainMenu",o).clientHeight,this._scroll(),window.addEventListener("scroll",this._scroll.bind(this))},_initSearchBar:function(){var a=elById("pageHeaderSearch");a.addEventListener(WCF_CLICK_EVENT,function(e){e.stopPropagation()});var r=elById("pageHeaderSearchInput"),s=elBySel(".pageHeaderSearchLabel");l=elById("pageHeaderSearchInputContainer");var c=elById("topMenu");s.addEventListener(WCF_CLICK_EVENT,function(){!d&&!u||o.classList.contains("searchBarOpen")||(i.set(l,c,{horizontal:"right"}),o.classList.add("searchBarOpen"),WCF.Dropdown.Interactive.Handler.closeAll(),r.focus())}),n.add("WoltLab/WCF/Ui/Page/Header/Fixed",function(){o.classList.remove("searchBarOpen")}),t.add("com.woltlab.wcf.MainMenuMobile","more",function(t){"com.woltlab.wcf.search"===t.identifier&&(t.handler.close(!0),e.triggerEvent(elById("pageHeaderSearchInput"),WCF_CLICK_EVENT))}.bind(this))},_scroll:function(){var e=d;d=window.scrollY>c,o.classList[d?"add":"remove"]("sticky"),s.classList[d?"add":"remove"]("stickyPageHeader"),!d&&e&&(o.classList.remove("searchBarOpen"),["bottom","left","right","top"].forEach(function(e){l.style.removeProperty(e)}))}}}),define("WoltLab/WCF/Ui/Page/Search/Input",["Core","WoltLab/WCF/Ui/Search/Input"],function(e,t){"use strict";function i(e,t){this.init(e,t)}return e.inherit(i,t,{init:function(t,n){if(n=e.extend({ajax:{className:"wcf\\data\\page\\PageAction"},callbackSuccess:null},n),"function"!=typeof n.callbackSuccess)throw new Error("Expected a valid callback function for 'callbackSuccess'.");i._super.prototype.init.call(this,t,n),this._pageId=0},setPageId:function(e){this._pageId=e},_getParameters:function(e){var t=i._super.prototype._getParameters.call(this,e);return t.objectIDs=[this._pageId],t},_ajaxSuccess:function(e){this._options.callbackSuccess(e)}}),i}),define("WoltLab/WCF/Ui/Page/Search/Handler",["Language","StringUtil","Dom/Util","Ui/Dialog","./Input"],function(e,t,i,n,a){"use strict";var r=null,o=null,s=null,l=null,c=null;return{open:function(e,t,i){r=i,n.open(this),n.setTitle(this,t),this._getSearchInputHandler().setPageId(e)},_buildList:function(n){if(this._resetList(),!Array.isArray(n.returnValues)||0===n.returnValues.length){var a=elCreate("small");return a.className="innerError",a.textContent=e.get("wcf.page.pageObjectID.search.noResults"),void i.insertAfter(a,o)}for(var r,s,d,u=0,h=n.returnValues.length;h>u;u++)s=n.returnValues[u],r=s.image,/^fa-/.test(r)&&(r='<span class="icon icon48 '+r+'"></span>'),d=elCreate("li"),elData(d,"object-id",s.objectID),d.innerHTML='<div class="box48">'+r+'<div><div class="containerHeadline"><h3><a href="'+t.escapeHTML(s.link)+'">'+t.escapeHTML(s.title)+"</a></h3>"+(s.description?"<p>"+s.description+"</p>":"")+"</div></div></div>",d.addEventListener(WCF_CLICK_EVENT,this._click.bind(this)),l.appendChild(d);elShow(c)},_resetList:function(){var e=o.nextElementSibling;e&&e.classList.contains("innerError")&&elRemove(e),l.innerHTML="",elHide(c)},_getSearchInputHandler:function(){if(null===s){var e=this._buildList.bind(this);s=new a(elById("wcfUiPageSearchInput"),{callbackSuccess:e})}return s},_click:function(e){"A"!==e.target.nodeName&&(e.stopPropagation(),r(elData(e.currentTarget,"object-id")),n.close(this))},_dialogSetup:function(){return{id:"wcfUiPageSearchHandler",options:{onShow:function(){null===o&&(o=elById("wcfUiPageSearchInput"),l=elById("wcfUiPageSearchResultList"),c=elById("wcfUiPageSearchResultListContainer")),o.value="",elHide(c),l.innerHTML="",o.focus()},title:""},source:'<div class="section"><dl><dt><label for="wcfUiPageSearchInput">'+e.get("wcf.page.pageObjectID.search.terms")+'</label></dt><dd><input type="text" id="wcfUiPageSearchInput" class="long"><small>'+e.get("wcf.page.pageObjectID.search.terms.description")+'</small></dd></dl></div><section id="wcfUiPageSearchResultListContainer" class="section sectionContainerList"><header class="sectionHeader"><h2 class="sectionTitle">'+e.get("wcf.page.pageObjectID.search.results")+'</h2><p class="sectionDescription">'+e.get("wcf.page.pageObjectID.search.results.description")+'</p></header><ul id="wcfUiPageSearchResultList" class="containerList wcfUiPageSearchResultList"></ul></section>'}}}}),define("WoltLab/WCF/Ui/User/Profile/Menu/Item/Abstract",["Ajax","Dom/Util"],function(e,t){"use strict";function i(e,t){}return i.prototype={init:function(e,t){this._userId=e,this._isActive=t!==!1,this._initButton(),this._updateButton()},_initButton:function(){var e=elCreate("a");e.href="#",e.addEventListener(WCF_CLICK_EVENT,this._toggle.bind(this));var i=elCreate("li");i.appendChild(e);var n=elBySel('.userProfileButtonMenu[data-menu="interaction"]');t.prepend(i,n),this._button=e,this._listItem=i},_toggle:function(t){t.preventDefault(),e.api(this,{actionName:this._getAjaxActionName(),parameters:{data:{userID:this._userId}}})},_updateButton:function(){this._button.textContent=this._getLabel(),this._listItem.classList[this._isActive?"add":"remove"]("active")},_getLabel:function(){throw new Error("Implement me!")},_getAjaxActionName:function(){throw new Error("Implement me!")},_ajaxSuccess:function(){throw new Error("Implement me!")},_ajaxSetup:function(){throw new Error("Implement me!")}},i}),define("WoltLab/WCF/Ui/User/Profile/Menu/Item/Follow",["Core","Language","Ui/Notification","./Abstract"],function(e,t,i,n){"use strict";function a(e,t){this.init(e,t)}return e.inherit(a,n,{_getLabel:function(){return t.get("wcf.user.button."+(this._isActive?"un":"")+"follow")},_getAjaxActionName:function(){return this._isActive?"unfollow":"follow"},_ajaxSuccess:function(e){this._isActive=e.returnValues.following?!0:!1,this._updateButton(),i.show()},_ajaxSetup:function(){return{data:{className:"wcf\\data\\user\\follow\\UserFollowAction"}}}}),a}),define("WoltLab/WCF/Ui/User/Profile/Menu/Item/Ignore",["Core","Language","Ui/Notification","./Abstract"],function(e,t,i,n){"use strict";function a(e,t){this.init(e,t)}return e.inherit(a,n,{_getLabel:function(){return t.get("wcf.user.button."+(this._isActive?"un":"")+"ignore")},_getAjaxActionName:function(){return this._isActive?"unignore":"ignore"},_ajaxSuccess:function(e){this._isActive=e.returnValues.isIgnoredUser?!0:!1,this._updateButton(),i.show()},_ajaxSetup:function(){return{data:{className:"wcf\\data\\user\\ignore\\UserIgnoreAction"}}}}),a}),function(e){function t(){for(;n.length&&"function"==typeof n[0];)n.shift()()}var i=e.require,n=[],a=0;e.require=function(r,o){if(!Array.isArray(r))return i.apply(e,arguments);var s=a++;n.push(s),i(r,function(){var i=arguments;n[n.indexOf(s)]=function(){o.apply(e,i)},t()})},e.require.config=i.config}(window),define("require.linearExecution",function(){});
\ No newline at end of file