(()=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t,i){for(var a=0;a0?(this.createButton.setDisabled(!0),this.pageExists(t).then((function(i){if(i)e.createButton.setDisabled(!1),e.setError(mw.message("isekai-createpage-page-exists").parse());else{var a=mw.util.getUrl(t,{veaction:"edit"});e.inputGroup.setSuccess([mw.message("isekai-createpage-redirecting").parse()]),location.href=a}}))):this.setError(mw.message("isekai-createpage-title-empty").parse())}},{key:"onPageNameChange",value:function(){this.hasError&&this.clearError();var e=this.pageNameInput.getValue();if(-1!==e.indexOf(":")||-1!==e.indexOf("`")){var t=this.pageNameInput.getRange();e=e.replace(/:/g,":").replace(/`/g,"·"),this.pageNameInput.setValue(e),this.pageNameInput.selectRange(t.from,t.to)}}},{key:"onNamespaceChange",value:function(){this.pageNameInput.setPagePrefix(this.selectNamespaceDropdown.getValue())}},{key:"setError",value:function(e){this.inputGroup.setErrors([e]),this.hasError=!0}},{key:"clearError",value:function(){this.inputGroup.setErrors([]),this.hasError=!1}},{key:"pageExists",value:function(e){var t=this;return new Promise((function(i,a){t.api.get({action:"query",titles:e}).done((function(e){e.query&&e.query.pages?e.query.pages[-1]?i(!1):i(!0):i(!1)})).fail(a)}))}},{key:"setTitle",value:function(e){this.title.text(e)}}])&&t(i.prototype,a),Object.defineProperty(i,"prototype",{writable:!1}),e}())})();