diff --git a/wcfsetup/install/files/js/WCF.Combined.min.js b/wcfsetup/install/files/js/WCF.Combined.min.js index cb29f0c4db..2c4fc9b707 100755 --- a/wcfsetup/install/files/js/WCF.Combined.min.js +++ b/wcfsetup/install/files/js/WCF.Combined.min.js @@ -34,7 +34,7 @@ (function (window, undefined) { "use strict";WCF.Message={},WCF.Message.EditHistory=Class.extend({_oldIDInputs:null,_newIDInputs:null,_containerSelector:"",_buttonSelector:".jsRevertButton",init:function(e,t,i,s,n){this._oldIDInputs=e,this._newIDInputs=t,this._containerSelector=i,this._buttonSelector=s||".jsRevertButton",this._options=$.extend({isVersionTracker:!1,versionTrackerObjectType:"",versionTrackerObjectId:0,redirectUrl:""},n),this.proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._initInputs(),this._initElements()},_initInputs:function(){var e=this;this._newIDInputs.change((function(t){var i=parseInt($(this).val());"current"===$(this).val()&&(i=1/0),e._oldIDInputs.each((function(e){var t=parseInt($(this).val());"current"===$(this).val()&&(t=1/0),t>=i?$(this).disable():$(this).enable()}))})),this._oldIDInputs.change((function(t){var i=parseInt($(this).val());"current"===$(this).val()&&(i=1/0),e._newIDInputs.each((function(e){var t=parseInt($(this).val());"current"===$(this).val()&&(t=1/0),t<=i?$(this).disable():$(this).enable()}))})),this._oldIDInputs.filter(":checked").change(),this._newIDInputs.filter(":checked").change()},_initElements:function(){var e=this;$(this._containerSelector).each((function(t,i){$(i).find(e._buttonSelector).click($.proxy(e._click,e))}))},_click:function(e){var t,i=$(e.currentTarget);e.preventDefault(),i.data("confirmMessage")?(t=this,WCF.System.Confirmation.show(i.data("confirmMessage"),(function(e){"cancel"!==e&&t._sendRequest(i)}),void 0,void 0,!0)):this._sendRequest(i)},_sendRequest:function(e){this._options.isVersionTracker?(this.proxy.setOption("url",window.WSC_API_URL+"index.php?ajax-invoke/&t="+window.SECURITY_TOKEN),this.proxy.setOption("data",{actionName:"revert",className:"wcf\\system\\version\\VersionTracker",parameters:{objectType:this._options.versionTrackerObjectType,objectID:this._options.versionTrackerObjectId,versionID:$(e).data("objectID")}})):this.proxy.setOption("data",{actionName:"revert",className:"wcf\\data\\edit\\history\\entry\\EditHistoryEntryAction",objectIDs:[$(e).data("objectID")]}),this.proxy.sendRequest()},_success:function(e,t,i){this._options.redirectUrl?(new WCF.System.Notification).show(function(){window.location=this._options.redirectUrl}.bind(this)):window.location.reload(!0)}}),WCF.Message.FormGuard=Class.extend({init:function(){var e=$("form.jsFormGuard").removeClass("jsFormGuard").submit((function(){$(this).find(".formSubmit input[type=submit]").disable()}));$(window).on("beforeunload",(function(){e.find(".formSubmit input[type=submit]").enable()}))}}),WCF.Message.Preview=Class.extend({_className:"",_messageFieldID:"",_messageField:null,_proxy:null,_previewButton:null,_previewButtonLabel:"",init:function(e,t,i){this._className=e,this._messageFieldID=$.wcfEscapeID(t),this._textarea=$("#"+this._messageFieldID),this._textarea.length?(i=$.wcfEscapeID(i),this._previewButton=$("#"+i),this._previewButton.length?(this._previewButton.click($.proxy(this._click,this)),this._proxy=new WCF.Action.Proxy({failure:$.proxy(this._failure,this),success:$.proxy(this._success,this)}),this._ckeditorApi=void 0,require(["WoltLabSuite/Core/Component/Ckeditor"],(e=>{this._ckeditorApi=e}))):console.debug("[WCF.Message.Preview] Unable to find preview button identified by '"+i+"'")):console.debug("[WCF.Message.Preview] Unable to find message field identified by '"+this._messageFieldID+"'")},_click:function(e){e.preventDefault();var t=this._getMessage();if(null!==t){if(0===t.trim().length){const e=this._textarea[0].parentElement.querySelector(".innerError");return e&&e.remove(),void elInnerError(this._getCkeditor().element,WCF.Language.get("wcf.global.form.error.empty"))}return this._proxy.setOption("data",{actionName:"getMessagePreview",className:this._className,parameters:this._getParameters(t)}),this._proxy.sendRequest(),this._previewButtonLabel=this._previewButton.html(),this._previewButton.html(WCF.Language.get("wcf.global.loading")).disable(),e.stopPropagation(),!1}console.debug("[WCF.Message.Preview] Unable to access Redactor instance of '"+this._messageFieldID+"'")},_getParameters:function(e){var t={};return $("#settings_"+this._messageFieldID).find("input[type=checkbox]").each((function(e,i){var s=$(i);s.is(":checked")&&(t[s.prop("name")]=s.prop("value"))})),{data:{message:e},options:t}},_getMessage:function(){const e=this._getCkeditor();return void 0===e?null:e.getHtml()},_getCkeditor(e){return this._ckeditorApi.getCkeditorById(e||this._messageFieldID)},_success:function(e,t,i){this._previewButton.html(this._previewButtonLabel).enable(),this._textarea.parent().children("small.innerError").remove(),this._handleResponse(e)},_handleResponse:function(e){},_failure:function(e){var t,i;return null===e||void 0===e.returnValues||void 0===e.returnValues.errorType||(this._previewButton.html(this._previewButtonLabel).enable(),(t=this._textarea.parent().children("small.innerError").empty()).length||(t=$('').appendTo(this._textarea.parent())),i="empty"===e.returnValues.errorType?WCF.Language.get("wcf.global.form.error.empty"):e.returnValues.errorMessage,e.returnValues.realErrorMessage&&(i=e.returnValues.realErrorMessage),t.html(i),!1)}}),WCF.Message.DefaultPreview=WCF.Message.Preview.extend({_dialog:null,_options:{},init:function(e){if(arguments.length>1&&"string"==typeof e)throw new Error("Outdated API call, please update your implementation.");if(this._options=$.extend({disallowedBBCodesPermission:"user.message.disallowedBBCodes",messageFieldID:"",previewButtonID:"",messageObjectType:"",messageObjectID:0},e),!this._options.messageObjectType)throw new Error("Field 'messageObjectType' cannot be empty.");this._super("wcf\\data\\bbcode\\MessagePreviewAction",this._options.messageFieldID,this._options.previewButtonID)},_handleResponse:function(e){require(["WoltLabSuite/Core/Ui/Dialog"],function(t){t.open(this,'
Description:
${n.returnValues.description}
`),n.file&&n.line&&(t+=`File:
${n.file} in line ${n.line}
`),n.exception?t+=`Stacktrace:
${n.stacktrace}
`:n.exceptionID&&(t+=`Exception ID: ${n.exceptionID}
${e.message}
`,t+=`Stacktrace
${e.stacktrace}
`}));else if(void 0===n){const e=document.createElement("iframe");return e.classList.add("dialog__iframe"),e.srcdoc=i,e}}if(!i||"undefined"===i){if(!window.ENABLE_DEBUG_MODE)return"";i="fetch() failed without a response body. Check your browser console."}return`${i}
${t}Description:
${e.returnValues.description}
`),e.file&&e.line&&(n+=`File:
${e.file} in line ${e.line}
`),e.extraInformation&&(n+="${e}: ${t.toString()}
Stacktrace:
${e.stacktrace}`:e.exceptionID&&(n+=`
Exception ID: ${e.exceptionID}
${e.message}
`,n+=`Stacktrace
${e.stacktrace}`}));else{if(t.getResponseHeader("content-type")?.startsWith("text/html")){const e=document.createElement("iframe");return e.classList.add("dialog__iframe"),e.srcdoc=t.responseText,e}i=t.responseText}if(!i||"undefined"===i){if(!window.ENABLE_DEBUG_MODE)return null;i="XMLHttpRequest failed without a responseText. Check your browser console."}return`
${i}
${n}')).split("\n\n").map((e=>`
${e=e.replaceAll("\n","
")}
Description:
${n.returnValues.description}
`),n.file&&n.line&&(t+=`File:
${n.file} in line ${n.line}
`),n.exception?t+=`Stacktrace:
${n.stacktrace}
`:n.exceptionID&&(t+=`Exception ID: ${n.exceptionID}
${e.message}
`,t+=`Stacktrace
${e.stacktrace}
`}));else if(void 0===n){const e=document.createElement("iframe");return e.classList.add("dialog__iframe"),e.srcdoc=i,e}}if(!i||"undefined"===i){if(!window.ENABLE_DEBUG_MODE)return"";i="fetch() failed without a response body. Check your browser console."}return`${i}
${t}Description:
${e.returnValues.description}
`),e.file&&e.line&&(n+=`File:
${e.file} in line ${e.line}
`),e.extraInformation&&(n+="${e}: ${t.toString()}
Stacktrace:
${e.stacktrace}`:e.exceptionID&&(n+=`
Exception ID: ${e.exceptionID}
${e.message}
`,n+=`Stacktrace
${e.stacktrace}`}));else{if(t.getResponseHeader("content-type")?.startsWith("text/html")){const e=document.createElement("iframe");return e.classList.add("dialog__iframe"),e.srcdoc=t.responseText,e}i=t.responseText}if(!i||"undefined"===i){if(!window.ENABLE_DEBUG_MODE)return null;i="XMLHttpRequest failed without a responseText. Check your browser console."}return`
${i}
${n}')).split("\n\n").map((e=>`
${e=e.replaceAll("\n","
")}
${e}
`).asConfirmation({primary:o.get("wcf.dialog.button.primary.confirm")});return t.show(this.#X),new Promise((e=>{t.addEventListener("primary",(()=>e(!0))),t.addEventListener("cancel",(()=>e(!1)))}))}async withFormElements(e){const t=(0,n.dialogFactory)().withoutContent().asConfirmation({primary:o.get("wcf.dialog.button.primary.confirm")});return e(t),t.show(this.#X),new Promise((e=>{t.addEventListener("primary",(()=>{e({result:!0,dialog:t})})),t.addEventListener("cancel",(()=>{e({result:!1,dialog:t})}))}))}async withoutMessage(){const e=(0,n.dialogFactory)().withoutContent().asConfirmation({primary:o.get("wcf.dialog.button.primary.confirm")});return e.show(this.#X),new Promise((t=>{e.addEventListener("primary",(()=>t(!0))),e.addEventListener("cancel",(()=>t(!1)))}))}}})),define("WoltLabSuite/Core/Component/Confirmation",["require","exports","tslib","./Dialog","../Language","../Dom/Util","./Confirmation/Custom"],(function(e,t,i,n,o,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.confirmationFactory=function(){return new s},r=i.__importStar(r);class s{custom(e){return new a.ConfirmationCustom(e)}async delete(e){const t=`${(0,o.getPhrase)("wcf.dialog.confirmation.cannotBeUndone")}
`,i=(0,n.dialogFactory)().fromHtml(t).asConfirmation({primary:(0,o.getPhrase)("wcf.dialog.button.primary.delete")});let r;return r=void 0===e?(0,o.getPhrase)("wcf.dialog.confirmation.delete.indeterminate"):(0,o.getPhrase)("wcf.dialog.confirmation.delete",{title:e}),i.show(r),new Promise((e=>{i.addEventListener("primary",(()=>e(!0))),i.addEventListener("cancel",(()=>e(!1)))}))}async restore(e){const t=(0,n.dialogFactory)().withoutContent().asConfirmation();let i;return i=void 0===e?(0,o.getPhrase)("wcf.dialog.confirmation.restore.indeterminate"):(0,o.getPhrase)("wcf.dialog.confirmation.restore",{title:e}),t.show(i),new Promise((e=>{t.addEventListener("primary",(()=>e(!0))),t.addEventListener("cancel",(()=>e(!1)))}))}async softDelete(e,t=!1){let i;if(i=void 0===e?(0,o.getPhrase)("wcf.dialog.confirmation.softDelete.indeterminate"):(0,o.getPhrase)("wcf.dialog.confirmation.softDelete",{title:e}),t)return this.withReason(i,!0);const r=(0,n.dialogFactory)().withoutContent().asConfirmation();return r.show(i),new Promise((e=>{r.addEventListener("primary",(()=>{e({result:!0})})),r.addEventListener("cancel",(()=>{e({result:!1})}))}))}async withReason(e,t){const i=(0,n.dialogFactory)().withoutContent().asConfirmation(),a=r.getUniqueId(),s=(0,o.getPhrase)(t?"wcf.dialog.confirmation.reason.optional":"wcf.dialog.confirmation.reason"),l=document.createElement("dl");l.innerHTML=`\n \n"+i+"
")),o.content=a,o.state=2,this.activeId&&this.elements.get(this.activeId).element.dataset.cacheId===n&&this.show()}resetCache(e,t){const i=`${e}-${t}`;this.cache.has(i)&&this.cache.set(i,{content:null,state:0})}mouseEnter(e){if(this.suspended)return;this.timerEnter&&(window.clearTimeout(this.timerEnter),this.timerEnter=void 0);const t=r.default.identify(e.currentTarget);this.activeId===t&&this.timerLeave&&(window.clearTimeout(this.timerLeave),this.timerLeave=void 0),this.hoverId=t,this.timerEnter=window.setTimeout((()=>{this.timerEnter=void 0,this.hoverId===t&&this.show()}),800)}mouseLeave(){this.hoverId="",this.timerLeave||(this.timerLeave=window.setTimeout((()=>this.hidePopover()),500))}popoverMouseEnter(){this.timerLeave&&(window.clearTimeout(this.timerLeave),this.timerLeave=void 0)}show(){this.timerLeave&&(window.clearTimeout(this.timerLeave),this.timerLeave=void 0);let e=!1;this.popover.classList.contains("active")?this.activeId!==this.hoverId&&(this.hidePopover(),e=!0):this.popoverContent.childElementCount&&(e=!0),e&&(this.popover.classList.add("forceHide"),this.popover.offsetTop,this.clearContent(),this.popover.classList.remove("forceHide")),this.activeId=this.hoverId;const t=this.elements.get(this.activeId);if(void 0===t)return;const i=t.element.dataset.cacheId,n=this.cache.get(i);switch(n.state){case 2:this.popoverContent.appendChild(n.content),this.rebuild();break;case 0:{n.state=1;const e=this.handlers.get(t.identifier);if(e.loadCallback)e.loadCallback(t.objectId,this,t.element);else if(e.dboAction){const i=e=>(this.setContent(t.identifier,t.objectId,e.returnValues.template),!0);this.ajaxApi({actionName:"getPopover",className:e.dboAction,interfaceName:"wcf\\data\\IPopoverAction",objectIDs:[t.objectId]},i,i)}break}}}hidePopover(){this.timerLeave&&(window.clearTimeout(this.timerLeave),this.timerLeave=void 0),this.popover.classList.remove("active")}clearContent(){if(this.activeId&&this.popoverContent.childElementCount&&!this.popover.classList.contains("active")){const e=this.elements.get(this.activeId).element.dataset.cacheId,t=this.cache.get(e);for(;this.popoverContent.childNodes.length;)t.content.appendChild(this.popoverContent.childNodes[0])}}rebuild(){this.popover.classList.contains("active")||(this.popover.classList.remove("forceHide"),this.popover.classList.add("active"),s.set(this.popover,this.elements.get(this.activeId).element,{vertical:"top"}))}_ajaxSuccess(){}_ajaxSetup(){return{ignoreError:!0,silent:!0}}ajaxApi(e,t,i){if("function"!=typeof t)throw new TypeError("Expected a valid callback for parameter 'success'.");n.api(this,e,t,i)}}let d})),define("WoltLabSuite/Core/Event/Key",["require","exports"],(function(e,t){"use strict";function i(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}Object.defineProperty(t,"__esModule",{value:!0}),t.ArrowDown=function(e){return i(e,"ArrowDown",40)},t.ArrowLeft=function(e){return i(e,"ArrowLeft",37)},t.ArrowRight=function(e){return i(e,"ArrowRight",39)},t.ArrowUp=function(e){return i(e,"ArrowUp",38)},t.Comma=function(e){return i(e,",",44)},t.End=function(e){return i(e,"End",35)},t.Enter=function(e){return i(e,"Enter",13)},t.Escape=function(e){return i(e,"Escape",27)},t.Home=function(e){return i(e,"Home",36)},t.Space=function(e){return i(e,"Space",32)},t.Tab=function(e){return i(e,"Tab",9)}})),define("WoltLabSuite/Core/Helper/PromiseMutex",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.promiseMutex=function(e){let t=!1;return function(...i){return!t&&(t=!0,e(...i).finally((()=>{t=!1})),!0)}}})),define("WoltLabSuite/Core/Image/ExifUtil",["require","exports"],(function(e,t){"use strict";function i(e){return e===s||e===l||e===c}function n(...e){let t=0;const i=e.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(i);return e.forEach((e=>{n.set(e,t),t+=e.length})),n}async function o(e){return new Promise(((t,i)=>{const n=new FileReader;n.addEventListener("error",(()=>{n.abort(),n.error?i(n.error):i()})),n.addEventListener("load",(()=>{t(new Uint8Array(n.result))})),n.readAsArrayBuffer(e)}))}async function r(e){if(!(e instanceof Blob||e instanceof File))throw new TypeError("The argument must be a Blob or a File");const t=await o(e);if(255!==t[0]&&t[1]!==a.SOI)throw new Error("Not a JPEG");let r=t;for(let e=2;e${i.formattedFilesize}
\nDescription:
${i.returnValues.description}
`),i.file&&i.line&&(t+=`File:
${i.file} in line ${i.line}
`),i.exception?t+=`Stacktrace:
${i.stacktrace}
`:i.exceptionID&&(t+=`Exception ID: ${i.exceptionID}
${e.message}
`,t+=`Stacktrace
${e.stacktrace}
`}));else if(void 0===i){const e=document.createElement("iframe");return e.classList.add("dialog__iframe"),e.srcdoc=n,e}}if(!n||"undefined"===n){if(!window.ENABLE_DEBUG_MODE)return"";n="fetch() failed without a response body. Check your browser console."}return`${n}
${t}Description:
${e.returnValues.description}
`),e.file&&e.line&&(i+=`File:
${e.file} in line ${e.line}
`),e.extraInformation&&(i+="${e}: ${t.toString()}
Stacktrace:
${e.stacktrace}`:e.exceptionID&&(i+=`
Exception ID: ${e.exceptionID}
${e.message}
`,i+=`Stacktrace
${e.stacktrace}`}));else{if(t.getResponseHeader("content-type")?.startsWith("text/html")){const e=document.createElement("iframe");return e.classList.add("dialog__iframe"),e.srcdoc=t.responseText,e}n=t.responseText}if(!n||"undefined"===n){if(!window.ENABLE_DEBUG_MODE)return null;n="XMLHttpRequest failed without a responseText. Check your browser console."}return`
${n}
${i}${e}
`).asConfirmation({primary:o.get("wcf.dialog.button.primary.confirm")});return t.show(this.#I),new Promise((e=>{t.addEventListener("primary",(()=>e(!0))),t.addEventListener("cancel",(()=>e(!1)))}))}async withFormElements(e){const t=(0,i.dialogFactory)().withoutContent().asConfirmation({primary:o.get("wcf.dialog.button.primary.confirm")});return e(t),t.show(this.#I),new Promise((e=>{t.addEventListener("primary",(()=>{e({result:!0,dialog:t})})),t.addEventListener("cancel",(()=>{e({result:!1,dialog:t})}))}))}async withoutMessage(){const e=(0,i.dialogFactory)().withoutContent().asConfirmation({primary:o.get("wcf.dialog.button.primary.confirm")});return e.show(this.#I),new Promise((t=>{e.addEventListener("primary",(()=>t(!0))),e.addEventListener("cancel",(()=>t(!1)))}))}}})),define("WoltLabSuite/Core/Component/Confirmation",["require","exports","tslib","./Dialog","../Language","../Dom/Util","./Confirmation/Custom"],(function(e,t,n,i,o,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.confirmationFactory=function(){return new s},r=n.__importStar(r);class s{custom(e){return new a.ConfirmationCustom(e)}async delete(e){const t=`${(0,o.getPhrase)("wcf.dialog.confirmation.cannotBeUndone")}
`,n=(0,i.dialogFactory)().fromHtml(t).asConfirmation({primary:(0,o.getPhrase)("wcf.dialog.button.primary.delete")});let r;return r=void 0===e?(0,o.getPhrase)("wcf.dialog.confirmation.delete.indeterminate"):(0,o.getPhrase)("wcf.dialog.confirmation.delete",{title:e}),n.show(r),new Promise((e=>{n.addEventListener("primary",(()=>e(!0))),n.addEventListener("cancel",(()=>e(!1)))}))}async restore(e){const t=(0,i.dialogFactory)().withoutContent().asConfirmation();let n;return n=void 0===e?(0,o.getPhrase)("wcf.dialog.confirmation.restore.indeterminate"):(0,o.getPhrase)("wcf.dialog.confirmation.restore",{title:e}),t.show(n),new Promise((e=>{t.addEventListener("primary",(()=>e(!0))),t.addEventListener("cancel",(()=>e(!1)))}))}async softDelete(e,t=!1){let n;if(n=void 0===e?(0,o.getPhrase)("wcf.dialog.confirmation.softDelete.indeterminate"):(0,o.getPhrase)("wcf.dialog.confirmation.softDelete",{title:e}),t)return this.withReason(n,!0);const r=(0,i.dialogFactory)().withoutContent().asConfirmation();return r.show(n),new Promise((e=>{r.addEventListener("primary",(()=>{e({result:!0})})),r.addEventListener("cancel",(()=>{e({result:!1})}))}))}async withReason(e,t){const n=(0,i.dialogFactory)().withoutContent().asConfirmation(),a=r.getUniqueId(),s=(0,o.getPhrase)(t?"wcf.dialog.confirmation.reason.optional":"wcf.dialog.confirmation.reason"),l=document.createElement("dl");l.innerHTML=`\n \n"+n+"
")),o.content=a,o.state=2,this.activeId&&this.elements.get(this.activeId).element.dataset.cacheId===i&&this.show()}resetCache(e,t){const n=`${e}-${t}`;this.cache.has(n)&&this.cache.set(n,{content:null,state:0})}mouseEnter(e){if(this.suspended)return;this.timerEnter&&(window.clearTimeout(this.timerEnter),this.timerEnter=void 0);const t=r.default.identify(e.currentTarget);this.activeId===t&&this.timerLeave&&(window.clearTimeout(this.timerLeave),this.timerLeave=void 0),this.hoverId=t,this.timerEnter=window.setTimeout((()=>{this.timerEnter=void 0,this.hoverId===t&&this.show()}),800)}mouseLeave(){this.hoverId="",this.timerLeave||(this.timerLeave=window.setTimeout((()=>this.hidePopover()),500))}popoverMouseEnter(){this.timerLeave&&(window.clearTimeout(this.timerLeave),this.timerLeave=void 0)}show(){this.timerLeave&&(window.clearTimeout(this.timerLeave),this.timerLeave=void 0);let e=!1;this.popover.classList.contains("active")?this.activeId!==this.hoverId&&(this.hidePopover(),e=!0):this.popoverContent.childElementCount&&(e=!0),e&&(this.popover.classList.add("forceHide"),this.popover.offsetTop,this.clearContent(),this.popover.classList.remove("forceHide")),this.activeId=this.hoverId;const t=this.elements.get(this.activeId);if(void 0===t)return;const n=t.element.dataset.cacheId,i=this.cache.get(n);switch(i.state){case 2:this.popoverContent.appendChild(i.content),this.rebuild();break;case 0:{i.state=1;const e=this.handlers.get(t.identifier);if(e.loadCallback)e.loadCallback(t.objectId,this,t.element);else if(e.dboAction){const n=e=>(this.setContent(t.identifier,t.objectId,e.returnValues.template),!0);this.ajaxApi({actionName:"getPopover",className:e.dboAction,interfaceName:"wcf\\data\\IPopoverAction",objectIDs:[t.objectId]},n,n)}break}}}hidePopover(){this.timerLeave&&(window.clearTimeout(this.timerLeave),this.timerLeave=void 0),this.popover.classList.remove("active")}clearContent(){if(this.activeId&&this.popoverContent.childElementCount&&!this.popover.classList.contains("active")){const e=this.elements.get(this.activeId).element.dataset.cacheId,t=this.cache.get(e);for(;this.popoverContent.childNodes.length;)t.content.appendChild(this.popoverContent.childNodes[0])}}rebuild(){this.popover.classList.contains("active")||(this.popover.classList.remove("forceHide"),this.popover.classList.add("active"),s.set(this.popover,this.elements.get(this.activeId).element,{vertical:"top"}))}_ajaxSuccess(){}_ajaxSetup(){return{ignoreError:!0,silent:!0}}ajaxApi(e,t,n){if("function"!=typeof t)throw new TypeError("Expected a valid callback for parameter 'success'.");i.api(this,e,t,n)}}let d})),define("WoltLabSuite/Core/Event/Key",["require","exports"],(function(e,t){"use strict";function n(e,t,n){if(!(e instanceof Event))throw new TypeError("Expected a valid event when testing for key '"+t+"'.");return e.key===t||e.which===n}Object.defineProperty(t,"__esModule",{value:!0}),t.ArrowDown=function(e){return n(e,"ArrowDown",40)},t.ArrowLeft=function(e){return n(e,"ArrowLeft",37)},t.ArrowRight=function(e){return n(e,"ArrowRight",39)},t.ArrowUp=function(e){return n(e,"ArrowUp",38)},t.Comma=function(e){return n(e,",",44)},t.End=function(e){return n(e,"End",35)},t.Enter=function(e){return n(e,"Enter",13)},t.Escape=function(e){return n(e,"Escape",27)},t.Home=function(e){return n(e,"Home",36)},t.Space=function(e){return n(e,"Space",32)},t.Tab=function(e){return n(e,"Tab",9)}})),define("WoltLabSuite/Core/Helper/PromiseMutex",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.promiseMutex=function(e){let t=!1;return function(...n){return!t&&(t=!0,e(...n).finally((()=>{t=!1})),!0)}}})),define("WoltLabSuite/Core/Language/Chooser",["require","exports","tslib","../Core","../Language","../Dom/Util","../Ui/Dropdown/Simple"],(function(e,t,n,i,o,r,a){"use strict";function s(e,t,n){const o=u.get(e);if(void 0===n&&void 0===(n=Array.from(o.dropdownMenu.children).find((e=>~~e.dataset.languageId===t))))throw new Error(`The language id '${t}' is unknown`);o.element.value=t.toString(),i.triggerEvent(o.element,"change"),o.dropdownToggle.innerHTML=n.children[0].innerHTML;const r=document.createElement("fa-icon");r.setIcon("caret-down",!0),o.dropdownToggle.append(r),u.set(e,o),"function"==typeof o.callback&&o.callback(n)}function l(e){const t=e.currentTarget;p.get(t).forEach((e=>{const n=document.createElement("input");n.type="hidden",n.name=e,n.value=d(e).toString(),t.appendChild(n)}))}function c(e){const t=u.get(e);if(void 0===t)throw new Error(`Expected a valid language chooser input element, '${e}' is not i18n input field.`);return t}function d(e){return~~c(e).element.value}Object.defineProperty(t,"__esModule",{value:!0}),t.init=function(e,t,n,i,c,d){if(u.has(t))return;const m=document.getElementById(e);if(null===m)throw new Error(`Expected a valid container id, cannot find '${t}'.`);let h=document.getElementById(t);null===h&&(h=document.createElement("input"),h.type="hidden",h.id=t,h.name=t,h.value=n.toString(),m.appendChild(h)),function(e,t,n,i,c,d){function m(t){const n=t.currentTarget,i=~~n.dataset.languageId,o=b.querySelector(".active");null!==o&&o.classList.remove("active"),i&&n.classList.add("active"),s(e,i,n)}let h;const f=t.parentElement;"DD"===f.nodeName?(h=document.createElement("div"),h.className="dropdown",f.insertAdjacentElement("afterbegin",h)):(h=f,h.classList.add("dropdown")),r.default.hide(t);const g=document.createElement("a");g.className="dropdownToggle boxFlag box24 inputPrefix","DD"===f.nodeName&&g.classList.add("button"),h.appendChild(g);const b=document.createElement("ul");b.className="dropdownMenu",h.appendChild(b);const v=document.createElement("fa-icon");if(v.setIcon("caret-down",!0),Object.entries(i).forEach((([e,t])=>{const i=document.createElement("li");i.className="boxFlag",i.addEventListener("click",m),i.dataset.languageId=e,void 0!==t.languageCode&&(i.dataset.languageCode=t.languageCode),b.appendChild(i);const o=document.createElement("a");o.className="box24",o.href="#",o.addEventListener("click",(e=>e.preventDefault())),i.appendChild(o);const r=document.createElement("img");r.src=t.iconPath,r.alt="",r.className="iconFlag",r.height=15,r.width=24,r.loading="eager",o.appendChild(r);const a=document.createElement("span");a.textContent=t.languageName,o.appendChild(a),+e===n&&(g.innerHTML=o.innerHTML,g.append(v))})),d){const e=document.createElement("li");e.className="dropdownDivider",b.appendChild(e);const t=document.createElement("li");t.dataset.languageId="0",t.addEventListener("click",m),b.appendChild(t);const i=document.createElement("a");i.textContent=o.get("wcf.global.language.noSelection"),t.appendChild(i),0===n&&(g.innerHTML=i.innerHTML,g.append(v)),t.addEventListener("click",m)}else if(0===n){g.innerHTML="";const e=document.createElement("div");g.appendChild(e);const t=document.createElement("fa-icon");t.size=24,t.setIcon("question"),e.appendChild(t);const n=document.createElement("span");n.textContent=o.get("wcf.global.language.noSelection"),n.append(t),e.appendChild(n)}a.default.init(g),u.set(e,{callback:c,dropdownMenu:b,dropdownToggle:g,element:t});const w=t.closest("form");if(null!==w){w.addEventListener("submit",l);let t=p.get(w);void 0===t&&(t=[],p.set(w,t)),t.push(e)}}(t,h,n,i,c,d)},t.getChooser=c,t.getLanguageId=d,t.removeChooser=function(e){u.delete(e)},t.setLanguageId=function(e,t){if(void 0===u.get(e))throw new Error(`Expected a valid input element, '${e}' is not i18n input field.`);s(e,t)},i=n.__importStar(i),o=n.__importStar(o),r=n.__importDefault(r),a=n.__importDefault(a);const u=new Map,p=new WeakMap})),define("WoltLabSuite/Core/Language/Input",["require","exports","tslib","../Dom/Util","../Language","../Ui/Dropdown/Simple","../StringUtil"],(function(e,t,n,i,o,r,a){"use strict";function s(e,t,n){const i=d.get(e),o=r.default.getDropdownMenu(i.element.closest(".inputAddon").id).querySelector(`[data-language-id="${t}"]`),a=o?o.textContent:"";if(i.languageId!==t){const o=p.get(e);if(i.languageId){const e=i.callbacks.get("beforeSelect");e&&e(i.element),o.set(i.languageId,i.element.value)}if(0===t?p.set(e,new Map):(i.buttonLabel.classList.contains("active")||n)&&(i.element.value=o.get(t)||""),i.buttonLabel.textContent=a,i.buttonLabel.querySelector("fa-icon")?.remove(),t){i.buttonLabel.classList.add("active");const e=document.createElement("fa-icon");e.setIcon("caret-down",!0),i.buttonLabel.append(e)}else i.buttonLabel.classList.remove("active");i.languageId=t}n||(i.element.blur(),i.element.focus()),i.callbacks.has("select")&&i.callbacks.get("select")(i.element)}function l(e,t){if("open"!==t)return;const n=r.default.getDropdownMenu(e),i=document.getElementById(e).dataset.inputId,o=d.get(i),a=p.get(i);Array.from(n.children).forEach((e=>{const t=~~(e.dataset.languageId||"");if(t){let n=!1;o.languageId&&(n=t===o.languageId?""===o.element.value.trim():!a.get(t));const i=e.querySelector("span");if(i.querySelector("fa-icon")?.remove(),n){e.classList.add("missingValue");const t=document.createElement("fa-icon");t.setIcon("triangle-exclamation"),i.append(t)}else e.classList.remove("missingValue")}}))}function c(e){const t=e.currentTarget;u.get(t).forEach((e=>{const n=d.get(e);if(!n.isEnabled)return;const i=p.get(e);n.callbacks.has("submit")&&n.callbacks.get("submit")(n.element),n.languageId&&i.set(n.languageId,n.element.value),i.size&&(i.forEach((function(n,i){const o=document.createElement("input");o.type="hidden",o.name=`${e}_i18n[${i}]`,o.value=n,t.appendChild(o)})),n.element.removeAttribute("name"))}))}Object.defineProperty(t,"__esModule",{value:!0}),t.init=function(e,t,n,i){if(p.has(e))return;const m=document.getElementById(e);if(null===m)throw new Error(`Expected a valid element id, cannot find '${e}'.`);const h=new Map;Object.entries(t).forEach((([e,t])=>{h.set(+e,a.unescapeHTML(t))})),p.set(e,h),function(e,t,n,i,a){let p=t.parentElement;if(!p.classList.contains("inputAddon")){p=document.createElement("div"),p.className="inputAddon","TEXTAREA"===t.nodeName&&p.classList.add("inputAddonTextarea"),p.dataset.inputId=e;const n=document.activeElement===t;t.insertAdjacentElement("beforebegin",p),p.appendChild(t),n&&t.focus()}p.classList.add("dropdown");const m=document.createElement("span");m.className="button dropdownToggle inputPrefix";const h=document.createElement("span");h.textContent=o.get("wcf.global.button.disabledI18n"),m.appendChild(h),p.insertBefore(m,t);const f=document.createElement("ul");f.className="dropdownMenu",m.insertAdjacentElement("afterend",f);const g=t=>{let n;n=t instanceof HTMLElement?t:t.currentTarget;const i=~~n.dataset.languageId,o=f.querySelector(".active");null!==o&&o.classList.remove("active"),i&&n.classList.add("active");const r=t instanceof HTMLElement;s(e,i,r)};if(Object.entries(i).forEach((([e,t])=>{const n=document.createElement("li");n.dataset.languageId=e;const i=document.createElement("span");i.textContent=t,n.appendChild(i),n.addEventListener("click",g),f.appendChild(n)})),!a){const e=document.createElement("li");e.className="dropdownDivider",f.appendChild(e);const t=document.createElement("li");t.dataset.languageId="0",t.addEventListener("click",g);const n=document.createElement("span");n.textContent=o.get("wcf.global.button.disabledI18n"),t.appendChild(n),f.appendChild(t)}let b;(a||n.size)&&(b=Array.from(f.children).find((e=>+e.dataset.languageId===window.LANGUAGE_ID))),r.default.init(m),r.default.registerCallback(p.id,l),d.set(e,{buttonLabel:h,callbacks:new Map,element:t,languageId:0,isEnabled:!0,forceSelection:a});const v=t.closest("form");if(null!==v){v.addEventListener("submit",c);let t=u.get(v);void 0===t&&(t=[],u.set(v,t)),t.push(e)}b&&g(b)}(e,m,h,n,i)},t.registerCallback=function(e,t,n){if(!p.has(e))throw new Error(`Unknown element id '${e}'.`);d.get(e).callbacks.set(t,n)},t.unregister=function(e){if(!p.has(e))throw new Error(`Unknown element id '${e}'.`);p.delete(e),d.delete(e)},t.getValues=function(e){const t=d.get(e);if(void 0===t)throw new Error(`Expected a valid i18n input element, '${e}' is not i18n input field.`);const n=p.get(e);return n.set(t.languageId,t.element.value),n},t.setValues=function(e,t){const n=d.get(e);if(void 0===n)throw new Error(`Expected a valid i18n input element, '${e}' is not i18n input field.`);n.element.value="";const i=new Map(Object.entries(t).map((([e,t])=>[+e,t])));if(i.has(0))return n.element.value=i.get(0),i.delete(0),p.set(e,i),void s(e,0,!0);p.set(e,i),n.languageId=0,s(e,window.LANGUAGE_ID,!0)},t.disable=function(e){const t=d.get(e);if(void 0===t)throw new Error(`Expected a valid element, '${e}' is not an i18n input field.`);if(!t.isEnabled)return;t.isEnabled=!1;const n=t.buttonLabel.parentElement;i.default.hide(n),n.parentElement.classList.remove("inputAddon","dropdown")},t.enable=function(e){const t=d.get(e);if(void 0===t)throw new Error(`Expected a valid i18n input element, '${e}' is not i18n input field.`);if(t.isEnabled)return;t.isEnabled=!0;const n=t.buttonLabel.parentElement;i.default.show(n),n.parentElement.classList.add("inputAddon","dropdown")},t.isEnabled=function(e){const t=d.get(e);if(void 0===t)throw new Error(`Expected a valid i18n input element, '${e}' is not i18n input field.`);return t.isEnabled},t.validate=function(e,t){const n=d.get(e);if(void 0===n)throw new Error(`Expected a valid i18n input element, '${e}' is not i18n input field.`);if(!n.isEnabled)return!0;const i=p.get(e),o=r.default.getDropdownMenu(n.element.parentElement.id);n.languageId&&i.set(n.languageId,n.element.value);let a=!1,s=!1;return Array.from(o.children).forEach((e=>{const t=~~e.dataset.languageId;if(t)if(i.has(t)&&0!==i.get(t).length){if(a)return!1;s=!0}else{if(s)return!1;a=!0}})),!a||t},i=n.__importDefault(i),o=n.__importStar(o),r=n.__importDefault(r),a=n.__importStar(a);const d=new Map,u=new WeakMap,p=new Map})),define("WoltLabSuite/Core/Component/Ckeditor/Event",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dispatchToCkeditor=function(e){return new n(e)},t.listenToCkeditor=function(e){return new i(e)};class n{#O;constructor(e){this.#O=e}collectMetaData(e){this.#O.dispatchEvent(new CustomEvent("ckeditor5:collect-meta-data",{detail:e}))}changeData(){this.#O.dispatchEvent(new CustomEvent("ckeditor5:change-data"))}destroy(){this.#O.dispatchEvent(new CustomEvent("ckeditor5:destroy"))}discardRecoveredData(){this.#O.dispatchEvent(new CustomEvent("ckeditor5:discard-recovered-data"))}autosave(e){this.#O.dispatchEvent(new CustomEvent("ckeditor5:autosave",{detail:e}))}insertAttachment(e){this.#O.dispatchEvent(new CustomEvent("ckeditor5:insert-attachment",{detail:e}))}insertQuote(e){this.#O.dispatchEvent(new CustomEvent("ckeditor5:insert-quote",{detail:e}))}ready(e){this.#O.dispatchEvent(new CustomEvent("ckeditor5:ready",{detail:e}))}removeAttachment(e){this.#O.dispatchEvent(new CustomEvent("ckeditor5:remove-attachment",{detail:e}))}reset(e){this.#O.dispatchEvent(new CustomEvent("ckeditor5:reset",{detail:e}))}setupConfiguration(e){this.#O.dispatchEvent(new CustomEvent("ckeditor5:setup-configuration",{detail:e}))}setupFeatures(e){this.#O.dispatchEvent(new CustomEvent("ckeditor5:setup-features",{detail:e}))}submitOnEnter(e){this.#O.dispatchEvent(new CustomEvent("ckeditor5:submit-on-enter",{detail:e}))}uploadAttachment(e){this.#O.dispatchEvent(new CustomEvent("ckeditor5:upload-attachment",{detail:e}))}uploadMedia(e){this.#O.dispatchEvent(new CustomEvent("ckeditor5:upload-media",{detail:e}))}}class i{#O;constructor(e){this.#O=e}bbcode(e){return this.#O.addEventListener("ckeditor5:bbcode",(t=>{const n=e(t.detail);if(!0===n)t.preventDefault();else if(!1!==n)throw new Error("An event listener for the bbcode event did not return a boolean to indicate if the BBCode is handled.")})),this}changeData(e){return this.#O.addEventListener("ckeditor5:change-data",(()=>{e()})),this}collectMetaData(e){return this.#O.addEventListener("ckeditor5:collect-meta-data",(t=>{e(t.detail)})),this}destroy(e){return this.#O.addEventListener("ckeditor5:destroy",(()=>{e()})),this}discardRecoveredData(e){return this.#O.addEventListener("ckeditor5:discard-recovered-data",(()=>{e()}),{once:!0}),this}insertAttachment(e){return this.#O.addEventListener("ckeditor5:insert-attachment",(t=>{e(t.detail)})),this}insertQuote(e){return this.#O.addEventListener("ckeditor5:insert-quote",(t=>{e(t.detail)})),this}ready(e){return this.#O.addEventListener("ckeditor5:ready",(t=>{e(t.detail)}),{once:!0}),this}removeAttachment(e){return this.#O.addEventListener("ckeditor5:remove-attachment",(t=>{e(t.detail)})),this}reset(e){return this.#O.addEventListener("ckeditor5:reset",(t=>{e(t.detail)})),this}setupConfiguration(e){return this.#O.addEventListener("ckeditor5:setup-configuration",(t=>{e(t.detail)}),{once:!0}),this}setupFeatures(e){return this.#O.addEventListener("ckeditor5:setup-features",(t=>{e(t.detail)}),{once:!0}),this}submitOnEnter(e){return this.#O.addEventListener("ckeditor5:submit-on-enter",(t=>{e(t.detail)})),this}uploadAttachment(e){return this.#O.addEventListener("ckeditor5:upload-attachment",(t=>{e(t.detail)})),this}uploadMedia(e){return this.#O.addEventListener("ckeditor5:upload-media",(t=>{e(t.detail)})),this}autosave(e){return this.#O.addEventListener("ckeditor5:autosave",(t=>{e(t.detail)})),this}}})),define("WoltLabSuite/Core/Component/Ckeditor/Attachment",["require","exports","./Event"],(function(e,t,n){"use strict";function i(e,t,i){const o={abortController:i,file:t};return(0,n.dispatchToCkeditor)(e).uploadAttachment(o),new Promise((e=>{o.promise.then((({attachmentId:t,url:n})=>{e({"data-attachment-id":t.toString(),urls:{default:n}})})).catch((()=>{}))}))}Object.defineProperty(t,"__esModule",{value:!0}),t.setup=function(e){(0,n.listenToCkeditor)(e).setupConfiguration((({configuration:t,features:o})=>{o.attachment&&(t.woltlabUpload={uploadImage:(t,n)=>i(e,t,n),uploadOther:t=>i(e,t)},(0,n.listenToCkeditor)(e).ready((({ckeditor:e})=>{!function(e){(0,n.listenToCkeditor)(e.sourceElement).insertAttachment((({attachmentId:t,url:n})=>{""===n?e.insertText(`[attach=${t}][/attach]`):e.insertHtml(``)}))}(e),function(e){(0,n.listenToCkeditor)(e.sourceElement).removeAttachment((({attachmentId:t})=>{e.removeAll("imageBlock",{attachmentId:t}),e.removeAll("imageInline",{attachmentId:t})}))}(e)})))}))}})),__createBinding=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,o)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),__importStar=this&&this.__importStar||function(e){var t,n;if(e&&e.__esModule)return e;if(t={},null!=e)for(n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&__createBinding(t,e,n);return __setModuleDefault(t,e),t},define("WoltLabSuite/Core/Component/Ckeditor/Media",["require","exports","./Event"],(function(e,t,n){"use strict";function i(e,t,i){const o={abortController:i,file:t};return(0,n.dispatchToCkeditor)(e).uploadMedia(o),Promise.reject()}Object.defineProperty(t,"__esModule",{value:!0}),t.setup=function(t){(0,n.listenToCkeditor)(t).setupConfiguration((({configuration:e,features:n})=>{!n.attachment&&n.media&&(e.woltlabUpload={uploadImage:(e,n)=>i(t,e,n),uploadOther:e=>i(t,e)})})).ready((({ckeditor:t})=>{t.features.media&&new Promise(((t,n)=>{e(["../../Media/Manager/Editor"],t,n)})).then(__importStar).then((({MediaManagerEditor:e})=>{new e({ckeditor:t})}))}))}})),define("WoltLabSuite/Core/Api/Messages/MentionSuggestions",["require","exports","WoltLabSuite/Core/Ajax/Backend","../Result"],(function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mentionSuggestions=async function(e){const t=new URL(window.WSC_RPC_API_URL+"core/messages/mentionsuggestions");let o;t.searchParams.set("query",e);try{o=await(0,n.prepareRequest)(t).get().allowCaching().disableLoadingIndicator().fetchAsJson()}catch(e){return(0,i.apiResultFromError)(e)}return(0,i.apiResultFromValue)(o)}})),define("WoltLabSuite/Core/Component/Ckeditor/Mention",["require","exports","../../Dom/Util","./Event","WoltLabSuite/Core/Api/Messages/MentionSuggestions"],(function(e,t,n,i,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setup=function(e){(0,i.listenToCkeditor)(e).setupConfiguration((({configuration:e,features:t})=>{t.mention&&(e.mention={feeds:[{feed:e=>async function(e){return e.length>24?[]:(await(0,o.mentionSuggestions)(e)).unwrap().map((e=>"user"===e.type?{id:`@${e.username}`,text:`@${e.username}`,icon:e.avatarTag,objectId:e.userID,type:e.type}:{id:`@${e.name}`,text:`@${e.name}`,icon:'')).split("\n\n").map((e=>`
${e=e.replaceAll("\n","
")}
Description:
${i.returnValues.description}
`),i.file&&i.line&&(t+=`File:
${i.file} in line ${i.line}
`),i.exception?t+=`Stacktrace:
${i.stacktrace}
`:i.exceptionID&&(t+=`Exception ID: ${i.exceptionID}
${e.message}
`,t+=`Stacktrace
${e.stacktrace}
`}));else if(void 0===i){const e=document.createElement("iframe");return e.classList.add("dialog__iframe"),e.srcdoc=n,e}}if(!n||"undefined"===n){if(!window.ENABLE_DEBUG_MODE)return"";n="fetch() failed without a response body. Check your browser console."}return`${n}
${t}Description:
${e.returnValues.description}
`),e.file&&e.line&&(i+=`File:
${e.file} in line ${e.line}
`),e.extraInformation&&(i+="${e}: ${t.toString()}
Stacktrace:
${e.stacktrace}`:e.exceptionID&&(i+=`
Exception ID: ${e.exceptionID}
${e.message}
`,i+=`Stacktrace
${e.stacktrace}`}));else{if(t.getResponseHeader("content-type")?.startsWith("text/html")){const e=document.createElement("iframe");return e.classList.add("dialog__iframe"),e.srcdoc=t.responseText,e}n=t.responseText}if(!n||"undefined"===n){if(!window.ENABLE_DEBUG_MODE)return null;n="XMLHttpRequest failed without a responseText. Check your browser console."}return`
${n}
${i}${e}
`).asConfirmation({primary:o.get("wcf.dialog.button.primary.confirm")});return t.show(this.#I),new Promise((e=>{t.addEventListener("primary",(()=>e(!0))),t.addEventListener("cancel",(()=>e(!1)))}))}async withFormElements(e){const t=(0,i.dialogFactory)().withoutContent().asConfirmation({primary:o.get("wcf.dialog.button.primary.confirm")});return e(t),t.show(this.#I),new Promise((e=>{t.addEventListener("primary",(()=>{e({result:!0,dialog:t})})),t.addEventListener("cancel",(()=>{e({result:!1,dialog:t})}))}))}async withoutMessage(){const e=(0,i.dialogFactory)().withoutContent().asConfirmation({primary:o.get("wcf.dialog.button.primary.confirm")});return e.show(this.#I),new Promise((t=>{e.addEventListener("primary",(()=>t(!0))),e.addEventListener("cancel",(()=>t(!1)))}))}}})),define("WoltLabSuite/Core/Component/Confirmation",["require","exports","tslib","./Dialog","../Language","../Dom/Util","./Confirmation/Custom"],(function(e,t,n,i,o,r,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.confirmationFactory=function(){return new s},r=n.__importStar(r);class s{custom(e){return new a.ConfirmationCustom(e)}async delete(e){const t=`${(0,o.getPhrase)("wcf.dialog.confirmation.cannotBeUndone")}
`,n=(0,i.dialogFactory)().fromHtml(t).asConfirmation({primary:(0,o.getPhrase)("wcf.dialog.button.primary.delete")});let r;return r=void 0===e?(0,o.getPhrase)("wcf.dialog.confirmation.delete.indeterminate"):(0,o.getPhrase)("wcf.dialog.confirmation.delete",{title:e}),n.show(r),new Promise((e=>{n.addEventListener("primary",(()=>e(!0))),n.addEventListener("cancel",(()=>e(!1)))}))}async restore(e){const t=(0,i.dialogFactory)().withoutContent().asConfirmation();let n;return n=void 0===e?(0,o.getPhrase)("wcf.dialog.confirmation.restore.indeterminate"):(0,o.getPhrase)("wcf.dialog.confirmation.restore",{title:e}),t.show(n),new Promise((e=>{t.addEventListener("primary",(()=>e(!0))),t.addEventListener("cancel",(()=>e(!1)))}))}async softDelete(e,t=!1){let n;if(n=void 0===e?(0,o.getPhrase)("wcf.dialog.confirmation.softDelete.indeterminate"):(0,o.getPhrase)("wcf.dialog.confirmation.softDelete",{title:e}),t)return this.withReason(n,!0);const r=(0,i.dialogFactory)().withoutContent().asConfirmation();return r.show(n),new Promise((e=>{r.addEventListener("primary",(()=>{e({result:!0})})),r.addEventListener("cancel",(()=>{e({result:!1})}))}))}async withReason(e,t){const n=(0,i.dialogFactory)().withoutContent().asConfirmation(),a=r.getUniqueId(),s=(0,o.getPhrase)(t?"wcf.dialog.confirmation.reason.optional":"wcf.dialog.confirmation.reason"),l=document.createElement("dl");l.innerHTML=`\n \n"+n+"
")),o.content=a,o.state=2,this.activeId&&this.elements.get(this.activeId).element.dataset.cacheId===i&&this.show()}resetCache(e,t){const n=`${e}-${t}`;this.cache.has(n)&&this.cache.set(n,{content:null,state:0})}mouseEnter(e){if(this.suspended)return;this.timerEnter&&(window.clearTimeout(this.timerEnter),this.timerEnter=void 0);const t=r.default.identify(e.currentTarget);this.activeId===t&&this.timerLeave&&(window.clearTimeout(this.timerLeave),this.timerLeave=void 0),this.hoverId=t,this.timerEnter=window.setTimeout((()=>{this.timerEnter=void 0,this.hoverId===t&&this.show()}),800)}mouseLeave(){this.hoverId="",this.timerLeave||(this.timerLeave=window.setTimeout((()=>this.hidePopover()),500))}popoverMouseEnter(){this.timerLeave&&(window.clearTimeout(this.timerLeave),this.timerLeave=void 0)}show(){this.timerLeave&&(window.clearTimeout(this.timerLeave),this.timerLeave=void 0);let e=!1;this.popover.classList.contains("active")?this.activeId!==this.hoverId&&(this.hidePopover(),e=!0):this.popoverContent.childElementCount&&(e=!0),e&&(this.popover.classList.add("forceHide"),this.popover.offsetTop,this.clearContent(),this.popover.classList.remove("forceHide")),this.activeId=this.hoverId;const t=this.elements.get(this.activeId);if(void 0===t)return;const n=t.element.dataset.cacheId,i=this.cache.get(n);switch(i.state){case 2:this.popoverContent.appendChild(i.content),this.rebuild();break;case 0:{i.state=1;const e=this.handlers.get(t.identifier);if(e.loadCallback)e.loadCallback(t.objectId,this,t.element);else if(e.dboAction){const n=e=>(this.setContent(t.identifier,t.objectId,e.returnValues.template),!0);this.ajaxApi({actionName:"getPopover",className:e.dboAction,interfaceName:"wcf\\data\\IPopoverAction",objectIDs:[t.objectId]},n,n)}break}}}hidePopover(){this.timerLeave&&(window.clearTimeout(this.timerLeave),this.timerLeave=void 0),this.popover.classList.remove("active")}clearContent(){if(this.activeId&&this.popoverContent.childElementCount&&!this.popover.classList.contains("active")){const e=this.elements.get(this.activeId).element.dataset.cacheId,t=this.cache.get(e);for(;this.popoverContent.childNodes.length;)t.content.appendChild(this.popoverContent.childNodes[0])}}rebuild(){this.popover.classList.contains("active")||(this.popover.classList.remove("forceHide"),this.popover.classList.add("active"),s.set(this.popover,this.elements.get(this.activeId).element,{vertical:"top"}))}_ajaxSuccess(){}_ajaxSetup(){return{ignoreError:!0,silent:!0}}ajaxApi(e,t,n){if("function"!=typeof t)throw new TypeError("Expected a valid callback for parameter 'success'.");i.api(this,e,t,n)}}let d})),define("WoltLabSuite/Core/Event/Key",["require","exports"],(function(e,t){"use strict";function n(e,t,n){if(!(e instanceof Event))throw new TypeError("Expected a valid event when testing for key '"+t+"'.");return e.key===t||e.which===n}Object.defineProperty(t,"__esModule",{value:!0}),t.ArrowDown=function(e){return n(e,"ArrowDown",40)},t.ArrowLeft=function(e){return n(e,"ArrowLeft",37)},t.ArrowRight=function(e){return n(e,"ArrowRight",39)},t.ArrowUp=function(e){return n(e,"ArrowUp",38)},t.Comma=function(e){return n(e,",",44)},t.End=function(e){return n(e,"End",35)},t.Enter=function(e){return n(e,"Enter",13)},t.Escape=function(e){return n(e,"Escape",27)},t.Home=function(e){return n(e,"Home",36)},t.Space=function(e){return n(e,"Space",32)},t.Tab=function(e){return n(e,"Tab",9)}})),define("WoltLabSuite/Core/Helper/PromiseMutex",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.promiseMutex=function(e){let t=!1;return function(...n){return!t&&(t=!0,e(...n).finally((()=>{t=!1})),!0)}}})),define("WoltLabSuite/Core/Language/Chooser",["require","exports","tslib","../Core","../Language","../Dom/Util","../Ui/Dropdown/Simple"],(function(e,t,n,i,o,r,a){"use strict";function s(e,t,n){const o=u.get(e);if(void 0===n&&void 0===(n=Array.from(o.dropdownMenu.children).find((e=>~~e.dataset.languageId===t))))throw new Error(`The language id '${t}' is unknown`);o.element.value=t.toString(),i.triggerEvent(o.element,"change"),o.dropdownToggle.innerHTML=n.children[0].innerHTML;const r=document.createElement("fa-icon");r.setIcon("caret-down",!0),o.dropdownToggle.append(r),u.set(e,o),"function"==typeof o.callback&&o.callback(n)}function l(e){const t=e.currentTarget;p.get(t).forEach((e=>{const n=document.createElement("input");n.type="hidden",n.name=e,n.value=d(e).toString(),t.appendChild(n)}))}function c(e){const t=u.get(e);if(void 0===t)throw new Error(`Expected a valid language chooser input element, '${e}' is not i18n input field.`);return t}function d(e){return~~c(e).element.value}Object.defineProperty(t,"__esModule",{value:!0}),t.init=function(e,t,n,i,c,d){if(u.has(t))return;const m=document.getElementById(e);if(null===m)throw new Error(`Expected a valid container id, cannot find '${t}'.`);let h=document.getElementById(t);null===h&&(h=document.createElement("input"),h.type="hidden",h.id=t,h.name=t,h.value=n.toString(),m.appendChild(h)),function(e,t,n,i,c,d){function m(t){const n=t.currentTarget,i=~~n.dataset.languageId,o=b.querySelector(".active");null!==o&&o.classList.remove("active"),i&&n.classList.add("active"),s(e,i,n)}let h;const f=t.parentElement;"DD"===f.nodeName?(h=document.createElement("div"),h.className="dropdown",f.insertAdjacentElement("afterbegin",h)):(h=f,h.classList.add("dropdown")),r.default.hide(t);const g=document.createElement("a");g.className="dropdownToggle boxFlag box24 inputPrefix","DD"===f.nodeName&&g.classList.add("button"),h.appendChild(g);const b=document.createElement("ul");b.className="dropdownMenu",h.appendChild(b);const v=document.createElement("fa-icon");if(v.setIcon("caret-down",!0),Object.entries(i).forEach((([e,t])=>{const i=document.createElement("li");i.className="boxFlag",i.addEventListener("click",m),i.dataset.languageId=e,void 0!==t.languageCode&&(i.dataset.languageCode=t.languageCode),b.appendChild(i);const o=document.createElement("a");o.className="box24",o.href="#",o.addEventListener("click",(e=>e.preventDefault())),i.appendChild(o);const r=document.createElement("img");r.src=t.iconPath,r.alt="",r.className="iconFlag",r.height=15,r.width=24,r.loading="eager",o.appendChild(r);const a=document.createElement("span");a.textContent=t.languageName,o.appendChild(a),+e===n&&(g.innerHTML=o.innerHTML,g.append(v))})),d){const e=document.createElement("li");e.className="dropdownDivider",b.appendChild(e);const t=document.createElement("li");t.dataset.languageId="0",t.addEventListener("click",m),b.appendChild(t);const i=document.createElement("a");i.textContent=o.get("wcf.global.language.noSelection"),t.appendChild(i),0===n&&(g.innerHTML=i.innerHTML,g.append(v)),t.addEventListener("click",m)}else if(0===n){g.innerHTML="";const e=document.createElement("div");g.appendChild(e);const t=document.createElement("fa-icon");t.size=24,t.setIcon("question"),e.appendChild(t);const n=document.createElement("span");n.textContent=o.get("wcf.global.language.noSelection"),n.append(t),e.appendChild(n)}a.default.init(g),u.set(e,{callback:c,dropdownMenu:b,dropdownToggle:g,element:t});const w=t.closest("form");if(null!==w){w.addEventListener("submit",l);let t=p.get(w);void 0===t&&(t=[],p.set(w,t)),t.push(e)}}(t,h,n,i,c,d)},t.getChooser=c,t.getLanguageId=d,t.removeChooser=function(e){u.delete(e)},t.setLanguageId=function(e,t){if(void 0===u.get(e))throw new Error(`Expected a valid input element, '${e}' is not i18n input field.`);s(e,t)},i=n.__importStar(i),o=n.__importStar(o),r=n.__importDefault(r),a=n.__importDefault(a);const u=new Map,p=new WeakMap})),define("WoltLabSuite/Core/Language/Input",["require","exports","tslib","../Dom/Util","../Language","../Ui/Dropdown/Simple","../StringUtil"],(function(e,t,n,i,o,r,a){"use strict";function s(e,t,n){const i=d.get(e),o=r.default.getDropdownMenu(i.element.closest(".inputAddon").id).querySelector(`[data-language-id="${t}"]`),a=o?o.textContent:"";if(i.languageId!==t){const o=p.get(e);if(i.languageId){const e=i.callbacks.get("beforeSelect");e&&e(i.element),o.set(i.languageId,i.element.value)}if(0===t?p.set(e,new Map):(i.buttonLabel.classList.contains("active")||n)&&(i.element.value=o.get(t)||""),i.buttonLabel.textContent=a,i.buttonLabel.querySelector("fa-icon")?.remove(),t){i.buttonLabel.classList.add("active");const e=document.createElement("fa-icon");e.setIcon("caret-down",!0),i.buttonLabel.append(e)}else i.buttonLabel.classList.remove("active");i.languageId=t}n||(i.element.blur(),i.element.focus()),i.callbacks.has("select")&&i.callbacks.get("select")(i.element)}function l(e,t){if("open"!==t)return;const n=r.default.getDropdownMenu(e),i=document.getElementById(e).dataset.inputId,o=d.get(i),a=p.get(i);Array.from(n.children).forEach((e=>{const t=~~(e.dataset.languageId||"");if(t){let n=!1;o.languageId&&(n=t===o.languageId?""===o.element.value.trim():!a.get(t));const i=e.querySelector("span");if(i.querySelector("fa-icon")?.remove(),n){e.classList.add("missingValue");const t=document.createElement("fa-icon");t.setIcon("triangle-exclamation"),i.append(t)}else e.classList.remove("missingValue")}}))}function c(e){const t=e.currentTarget;u.get(t).forEach((e=>{const n=d.get(e);if(!n.isEnabled)return;const i=p.get(e);n.callbacks.has("submit")&&n.callbacks.get("submit")(n.element),n.languageId&&i.set(n.languageId,n.element.value),i.size&&(i.forEach((function(n,i){const o=document.createElement("input");o.type="hidden",o.name=`${e}_i18n[${i}]`,o.value=n,t.appendChild(o)})),n.element.removeAttribute("name"))}))}Object.defineProperty(t,"__esModule",{value:!0}),t.init=function(e,t,n,i){if(p.has(e))return;const m=document.getElementById(e);if(null===m)throw new Error(`Expected a valid element id, cannot find '${e}'.`);const h=new Map;Object.entries(t).forEach((([e,t])=>{h.set(+e,a.unescapeHTML(t))})),p.set(e,h),function(e,t,n,i,a){let p=t.parentElement;if(!p.classList.contains("inputAddon")){p=document.createElement("div"),p.className="inputAddon","TEXTAREA"===t.nodeName&&p.classList.add("inputAddonTextarea"),p.dataset.inputId=e;const n=document.activeElement===t;t.insertAdjacentElement("beforebegin",p),p.appendChild(t),n&&t.focus()}p.classList.add("dropdown");const m=document.createElement("span");m.className="button dropdownToggle inputPrefix";const h=document.createElement("span");h.textContent=o.get("wcf.global.button.disabledI18n"),m.appendChild(h),p.insertBefore(m,t);const f=document.createElement("ul");f.className="dropdownMenu",m.insertAdjacentElement("afterend",f);const g=t=>{let n;n=t instanceof HTMLElement?t:t.currentTarget;const i=~~n.dataset.languageId,o=f.querySelector(".active");null!==o&&o.classList.remove("active"),i&&n.classList.add("active");const r=t instanceof HTMLElement;s(e,i,r)};if(Object.entries(i).forEach((([e,t])=>{const n=document.createElement("li");n.dataset.languageId=e;const i=document.createElement("span");i.textContent=t,n.appendChild(i),n.addEventListener("click",g),f.appendChild(n)})),!a){const e=document.createElement("li");e.className="dropdownDivider",f.appendChild(e);const t=document.createElement("li");t.dataset.languageId="0",t.addEventListener("click",g);const n=document.createElement("span");n.textContent=o.get("wcf.global.button.disabledI18n"),t.appendChild(n),f.appendChild(t)}let b;(a||n.size)&&(b=Array.from(f.children).find((e=>+e.dataset.languageId===window.LANGUAGE_ID))),r.default.init(m),r.default.registerCallback(p.id,l),d.set(e,{buttonLabel:h,callbacks:new Map,element:t,languageId:0,isEnabled:!0,forceSelection:a});const v=t.closest("form");if(null!==v){v.addEventListener("submit",c);let t=u.get(v);void 0===t&&(t=[],u.set(v,t)),t.push(e)}b&&g(b)}(e,m,h,n,i)},t.registerCallback=function(e,t,n){if(!p.has(e))throw new Error(`Unknown element id '${e}'.`);d.get(e).callbacks.set(t,n)},t.unregister=function(e){if(!p.has(e))throw new Error(`Unknown element id '${e}'.`);p.delete(e),d.delete(e)},t.getValues=function(e){const t=d.get(e);if(void 0===t)throw new Error(`Expected a valid i18n input element, '${e}' is not i18n input field.`);const n=p.get(e);return n.set(t.languageId,t.element.value),n},t.setValues=function(e,t){const n=d.get(e);if(void 0===n)throw new Error(`Expected a valid i18n input element, '${e}' is not i18n input field.`);n.element.value="";const i=new Map(Object.entries(t).map((([e,t])=>[+e,t])));if(i.has(0))return n.element.value=i.get(0),i.delete(0),p.set(e,i),void s(e,0,!0);p.set(e,i),n.languageId=0,s(e,window.LANGUAGE_ID,!0)},t.disable=function(e){const t=d.get(e);if(void 0===t)throw new Error(`Expected a valid element, '${e}' is not an i18n input field.`);if(!t.isEnabled)return;t.isEnabled=!1;const n=t.buttonLabel.parentElement;i.default.hide(n),n.parentElement.classList.remove("inputAddon","dropdown")},t.enable=function(e){const t=d.get(e);if(void 0===t)throw new Error(`Expected a valid i18n input element, '${e}' is not i18n input field.`);if(t.isEnabled)return;t.isEnabled=!0;const n=t.buttonLabel.parentElement;i.default.show(n),n.parentElement.classList.add("inputAddon","dropdown")},t.isEnabled=function(e){const t=d.get(e);if(void 0===t)throw new Error(`Expected a valid i18n input element, '${e}' is not i18n input field.`);return t.isEnabled},t.validate=function(e,t){const n=d.get(e);if(void 0===n)throw new Error(`Expected a valid i18n input element, '${e}' is not i18n input field.`);if(!n.isEnabled)return!0;const i=p.get(e),o=r.default.getDropdownMenu(n.element.parentElement.id);n.languageId&&i.set(n.languageId,n.element.value);let a=!1,s=!1;return Array.from(o.children).forEach((e=>{const t=~~e.dataset.languageId;if(t)if(i.has(t)&&0!==i.get(t).length){if(a)return!1;s=!0}else{if(s)return!1;a=!0}})),!a||t},i=n.__importDefault(i),o=n.__importStar(o),r=n.__importDefault(r),a=n.__importStar(a);const d=new Map,u=new WeakMap,p=new Map})),define("WoltLabSuite/Core/Component/Ckeditor/Event",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dispatchToCkeditor=function(e){return new n(e)},t.listenToCkeditor=function(e){return new i(e)};class n{#O;constructor(e){this.#O=e}collectMetaData(e){this.#O.dispatchEvent(new CustomEvent("ckeditor5:collect-meta-data",{detail:e}))}changeData(){this.#O.dispatchEvent(new CustomEvent("ckeditor5:change-data"))}destroy(){this.#O.dispatchEvent(new CustomEvent("ckeditor5:destroy"))}discardRecoveredData(){this.#O.dispatchEvent(new CustomEvent("ckeditor5:discard-recovered-data"))}autosave(e){this.#O.dispatchEvent(new CustomEvent("ckeditor5:autosave",{detail:e}))}insertAttachment(e){this.#O.dispatchEvent(new CustomEvent("ckeditor5:insert-attachment",{detail:e}))}insertQuote(e){this.#O.dispatchEvent(new CustomEvent("ckeditor5:insert-quote",{detail:e}))}ready(e){this.#O.dispatchEvent(new CustomEvent("ckeditor5:ready",{detail:e}))}removeAttachment(e){this.#O.dispatchEvent(new CustomEvent("ckeditor5:remove-attachment",{detail:e}))}reset(e){this.#O.dispatchEvent(new CustomEvent("ckeditor5:reset",{detail:e}))}setupConfiguration(e){this.#O.dispatchEvent(new CustomEvent("ckeditor5:setup-configuration",{detail:e}))}setupFeatures(e){this.#O.dispatchEvent(new CustomEvent("ckeditor5:setup-features",{detail:e}))}submitOnEnter(e){this.#O.dispatchEvent(new CustomEvent("ckeditor5:submit-on-enter",{detail:e}))}uploadAttachment(e){this.#O.dispatchEvent(new CustomEvent("ckeditor5:upload-attachment",{detail:e}))}uploadMedia(e){this.#O.dispatchEvent(new CustomEvent("ckeditor5:upload-media",{detail:e}))}}class i{#O;constructor(e){this.#O=e}bbcode(e){return this.#O.addEventListener("ckeditor5:bbcode",(t=>{const n=e(t.detail);if(!0===n)t.preventDefault();else if(!1!==n)throw new Error("An event listener for the bbcode event did not return a boolean to indicate if the BBCode is handled.")})),this}changeData(e){return this.#O.addEventListener("ckeditor5:change-data",(()=>{e()})),this}collectMetaData(e){return this.#O.addEventListener("ckeditor5:collect-meta-data",(t=>{e(t.detail)})),this}destroy(e){return this.#O.addEventListener("ckeditor5:destroy",(()=>{e()})),this}discardRecoveredData(e){return this.#O.addEventListener("ckeditor5:discard-recovered-data",(()=>{e()}),{once:!0}),this}insertAttachment(e){return this.#O.addEventListener("ckeditor5:insert-attachment",(t=>{e(t.detail)})),this}insertQuote(e){return this.#O.addEventListener("ckeditor5:insert-quote",(t=>{e(t.detail)})),this}ready(e){return this.#O.addEventListener("ckeditor5:ready",(t=>{e(t.detail)}),{once:!0}),this}removeAttachment(e){return this.#O.addEventListener("ckeditor5:remove-attachment",(t=>{e(t.detail)})),this}reset(e){return this.#O.addEventListener("ckeditor5:reset",(t=>{e(t.detail)})),this}setupConfiguration(e){return this.#O.addEventListener("ckeditor5:setup-configuration",(t=>{e(t.detail)}),{once:!0}),this}setupFeatures(e){return this.#O.addEventListener("ckeditor5:setup-features",(t=>{e(t.detail)}),{once:!0}),this}submitOnEnter(e){return this.#O.addEventListener("ckeditor5:submit-on-enter",(t=>{e(t.detail)})),this}uploadAttachment(e){return this.#O.addEventListener("ckeditor5:upload-attachment",(t=>{e(t.detail)})),this}uploadMedia(e){return this.#O.addEventListener("ckeditor5:upload-media",(t=>{e(t.detail)})),this}autosave(e){return this.#O.addEventListener("ckeditor5:autosave",(t=>{e(t.detail)})),this}}})),define("WoltLabSuite/Core/Component/Ckeditor/Attachment",["require","exports","./Event"],(function(e,t,n){"use strict";function i(e,t,i){const o={abortController:i,file:t};return(0,n.dispatchToCkeditor)(e).uploadAttachment(o),new Promise((e=>{o.promise.then((({attachmentId:t,url:n})=>{e({"data-attachment-id":t.toString(),urls:{default:n}})})).catch((()=>{}))}))}Object.defineProperty(t,"__esModule",{value:!0}),t.setup=function(e){(0,n.listenToCkeditor)(e).setupConfiguration((({configuration:t,features:o})=>{o.attachment&&(t.woltlabUpload={uploadImage:(t,n)=>i(e,t,n),uploadOther:t=>i(e,t)},(0,n.listenToCkeditor)(e).ready((({ckeditor:e})=>{!function(e){(0,n.listenToCkeditor)(e.sourceElement).insertAttachment((({attachmentId:t,url:n})=>{""===n?e.insertText(`[attach=${t}][/attach]`):e.insertHtml(``)}))}(e),function(e){(0,n.listenToCkeditor)(e.sourceElement).removeAttachment((({attachmentId:t})=>{e.removeAll("imageBlock",{attachmentId:t}),e.removeAll("imageInline",{attachmentId:t})}))}(e)})))}))}})),__createBinding=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,o)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),__importStar=this&&this.__importStar||function(e){var t,n;if(e&&e.__esModule)return e;if(t={},null!=e)for(n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&__createBinding(t,e,n);return __setModuleDefault(t,e),t},define("WoltLabSuite/Core/Component/Ckeditor/Media",["require","exports","./Event"],(function(e,t,n){"use strict";function i(e,t,i){const o={abortController:i,file:t};return(0,n.dispatchToCkeditor)(e).uploadMedia(o),Promise.reject()}Object.defineProperty(t,"__esModule",{value:!0}),t.setup=function(t){(0,n.listenToCkeditor)(t).setupConfiguration((({configuration:e,features:n})=>{!n.attachment&&n.media&&(e.woltlabUpload={uploadImage:(e,n)=>i(t,e,n),uploadOther:e=>i(t,e)})})).ready((({ckeditor:t})=>{t.features.media&&new Promise(((t,n)=>{e(["../../Media/Manager/Editor"],t,n)})).then(__importStar).then((({MediaManagerEditor:e})=>{new e({ckeditor:t})}))}))}})),define("WoltLabSuite/Core/Api/Messages/MentionSuggestions",["require","exports","WoltLabSuite/Core/Ajax/Backend","../Result"],(function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mentionSuggestions=async function(e){const t=new URL(window.WSC_RPC_API_URL+"core/messages/mentionsuggestions");let o;t.searchParams.set("query",e);try{o=await(0,n.prepareRequest)(t).get().allowCaching().disableLoadingIndicator().fetchAsJson()}catch(e){return(0,i.apiResultFromError)(e)}return(0,i.apiResultFromValue)(o)}})),define("WoltLabSuite/Core/Component/Ckeditor/Mention",["require","exports","../../Dom/Util","./Event","WoltLabSuite/Core/Api/Messages/MentionSuggestions"],(function(e,t,n,i,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setup=function(e){(0,i.listenToCkeditor)(e).setupConfiguration((({configuration:e,features:t})=>{t.mention&&(e.mention={feeds:[{feed:e=>async function(e){return e.length>24?[]:(await(0,o.mentionSuggestions)(e)).unwrap().map((e=>"user"===e.type?{id:`@${e.username}`,text:`@${e.username}`,icon:e.avatarTag,objectId:e.userID,type:e.type}:{id:`@${e.name}`,text:`@${e.name}`,icon:'')).split("\n\n").map((e=>`
${e=e.replaceAll("\n","
")}