From 8a529d375328cebdad095155898239a6896b0976 Mon Sep 17 00:00:00 2001 From: KyrneDev Date: Wed, 28 Apr 2021 15:57:42 -0700 Subject: [PATCH] Updates --- js/CustomLoader.js | 62 +- js/dist/admin/flarum-core.js | 2 +- js/dist/admin/flarum-core.js.map | 2 +- js/dist/admin/runtime.js | 2 +- js/dist/admin/runtime.js.map | 2 +- js/dist/common/common.js | 2 +- js/dist/common/common.js.map | 2 +- js/dist/common/components/TextEditor.js | 2 +- js/dist/common/components/TextEditor.js.map | 2 +- js/dist/forum/components/ChangeEmailModal.js | 2 + .../forum/components/ChangeEmailModal.js.map | 1 + .../forum/components/ChangePasswordModal.js | 2 + .../components/ChangePasswordModal.js.map | 1 + .../forum/components/DiscussionComposer.js | 2 +- .../components/DiscussionComposer.js.map | 2 +- .../forum/components/DiscussionsUserPage.js | 2 +- .../components/DiscussionsUserPage.js.map | 2 +- js/dist/forum/components/EditPostComposer.js | 2 +- .../forum/components/EditPostComposer.js.map | 2 +- js/dist/forum/components/EditUserModal.js | 2 +- js/dist/forum/components/EditUserModal.js.map | 2 +- .../forum/components/ForgotPasswordModal.js | 2 +- .../components/ForgotPasswordModal.js.map | 2 +- js/dist/forum/components/IndexPage.js | 2 +- js/dist/forum/components/IndexPage.js.map | 2 +- js/dist/forum/components/LogInModal.js | 2 +- js/dist/forum/components/LogInModal.js.map | 2 +- js/dist/forum/components/NotificationList.js | 2 +- .../forum/components/NotificationList.js.map | 2 +- .../forum/components/NotificationsDropdown.js | 2 + .../components/NotificationsDropdown.js.map | 1 + js/dist/forum/components/Post.js | 2 +- js/dist/forum/components/Post.js.map | 2 +- js/dist/forum/components/PostStream.js | 2 +- js/dist/forum/components/PostStream.js.map | 2 +- js/dist/forum/components/PostUser.js | 2 +- js/dist/forum/components/PostUser.js.map | 2 +- js/dist/forum/components/PostsUserPage.js | 2 +- js/dist/forum/components/PostsUserPage.js.map | 2 +- .../forum/components/RenameDiscussionModal.js | 2 + .../components/RenameDiscussionModal.js.map | 1 + js/dist/forum/components/SessionDropdown.js | 2 + .../forum/components/SessionDropdown.js.map | 1 + js/dist/forum/components/SettingsPage.js | 2 +- js/dist/forum/components/SettingsPage.js.map | 2 +- js/dist/forum/components/SignUpModal.js | 2 +- js/dist/forum/components/SignUpModal.js.map | 2 +- js/dist/forum/components/UserPage.js | 2 + js/dist/forum/components/UserPage.js.map | 1 + js/dist/forum/flarum-core.js | 2 +- js/dist/forum/flarum-core.js.map | 2 +- js/dist/forum/runtime.js | 2 +- js/dist/forum/runtime.js.map | 2 +- js/dist/forum/vendor.js | 2 +- js/dist/forum/vendor.js.map | 2 +- js/package-lock.json | 1267 ++++++++++++----- js/package.json | 7 +- js/src/admin/components/UploadImageButton.js | 2 +- js/src/common/FlarumRegistry.ts | 4 +- js/src/common/components/TextEditor.js | 1 - js/src/common/utils/Drawer.js | 2 +- js/src/common/utils/affix.js | 162 +++ js/src/forum/ForumApplication.js | 2 +- js/src/forum/components/AvatarEditor.js | 2 +- js/src/forum/components/CommentPost.js | 4 +- js/src/forum/components/Composer.js | 6 +- js/src/forum/components/DiscussionComposer.js | 1 - .../forum/components/DiscussionsUserPage.js | 4 +- js/src/forum/components/EditUserModal.js | 1 - js/src/forum/components/EventPost.js | 4 +- .../forum/components/ForgotPasswordModal.js | 1 - js/src/forum/components/HeaderSecondary.js | 26 +- js/src/forum/components/IndexPage.js | 2 - js/src/forum/components/LogInModal.js | 1 - js/src/forum/components/NotificationList.js | 1 - js/src/forum/components/PostStream.js | 1 - js/src/forum/components/PostStreamScrubber.js | 4 +- js/src/forum/components/PostsUserPage.js | 4 +- js/src/forum/components/SettingsPage.js | 9 +- js/src/forum/components/SignUpModal.js | 1 - js/src/forum/utils/DiscussionControls.js | 3 +- js/src/forum/utils/slidable.js | 2 +- js/webpack.config.js | 36 +- 83 files changed, 1200 insertions(+), 524 deletions(-) create mode 100644 js/dist/forum/components/ChangeEmailModal.js create mode 100644 js/dist/forum/components/ChangeEmailModal.js.map create mode 100644 js/dist/forum/components/ChangePasswordModal.js create mode 100644 js/dist/forum/components/ChangePasswordModal.js.map create mode 100644 js/dist/forum/components/NotificationsDropdown.js create mode 100644 js/dist/forum/components/NotificationsDropdown.js.map create mode 100644 js/dist/forum/components/RenameDiscussionModal.js create mode 100644 js/dist/forum/components/RenameDiscussionModal.js.map create mode 100644 js/dist/forum/components/SessionDropdown.js create mode 100644 js/dist/forum/components/SessionDropdown.js.map create mode 100644 js/dist/forum/components/UserPage.js create mode 100644 js/dist/forum/components/UserPage.js.map create mode 100644 js/src/common/utils/affix.js diff --git a/js/CustomLoader.js b/js/CustomLoader.js index 5e20bdc08..1962f8882 100644 --- a/js/CustomLoader.js +++ b/js/CustomLoader.js @@ -3,44 +3,38 @@ const loaderUtils = require('loader-utils'); +// Custom loader logic module.exports = function (source) { - // Custom loader logic - // Exclude asynchronous modules - if (!source.includes('//Flarum Asynchronous Module')) { + // Get the type of the module to be exported + const location = loaderUtils.interpolateName(this, '[folder]/', { + context: this.rootContext || this.context, + }); - // Get the type of the module to be exported - const location = loaderUtils.interpolateName(this, '[folder]/', { - context: this.rootContext || this.context, - }); + // Get the name of module to be exported + const moduleName = loaderUtils.interpolateName(this, '[name]', { + context: this.rootContext || this.context, + }); - // Get the name of module to be exported - const moduleName = loaderUtils.interpolateName(this, '[name]', { - context: this.rootContext || this.context, - }); - - // Don't export low level files - if (/.*\/(admin|forum)$/.test(location) || /(index|app|compat|FlarumRegistry)$/.test(moduleName)) { - return source; - } - - let addition = ""; - - // Find the export names - const matches = [...source.matchAll(/export\s+?(?:default\s?|function|abstract\s?|class)+?\s([^(\s<;]*)/gm)]; - matches.map(match => { - let name = match[1] - - if (!name || name === 'interface') { - return; - } - - // Add code at the end of the file to add the file to registry - addition += `\nwindow.flreg.add('${location}${name}', ${name})` - }); - - return source + addition; - } else { + // Don't export low level files + if (/.*\/(admin|forum)$/.test(location) || /(index|app|compat|FlarumRegistry)$/.test(moduleName)) { return source; } + + let addition = ""; + + // Find the export names + const matches = [...source.matchAll(/export\s+?(?:default\s?|function|abstract\s?|class)+?\s([^(\s<;]*)/gm)]; + matches.map(match => { + let name = match[1] + + if (!name || name === 'interface') { + return; + } + + // Add code at the end of the file to add the file to registry + addition += `\nwindow.flreg.add('${location}${name}', ${name})` + }); + + return source + addition; } diff --git a/js/dist/admin/flarum-core.js b/js/dist/admin/flarum-core.js index 2d4941230..487a5b630 100644 --- a/js/dist/admin/flarum-core.js +++ b/js/dist/admin/flarum-core.js @@ -1,2 +1,2 @@ -(self.webpackChunk_flarum_core=self.webpackChunk_flarum_core||[]).push([[328],{7540:(t,n,e)=>{"use strict";e.r(n),e.d(n,{Extend:()=>a.U,app:()=>yt});var a=e(6920),s=e(3349),i=e(1788),r=e(6156),o=e(8931),l=e(4594),p=e(7473),c=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.view=function(){return m("ul",{className:"Header-controls"},(0,p.Z)(this.items().toArray()))},e.config=function(t,n){n.retain=!0},e.items=function(){return new l.Z},n}(o.Z);window.flreg.add("components/HeaderPrimary",c);var d=e(2558),u=e(2122),h=e(9908),f=e(507),g=e(9657),v=e(2587),b=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t),n.initAttrs=function(n){t.initAttrs.call(this,n),n.className="SessionDropdown",n.buttonClassName="Button Button--user Button--flat",n.menuClassName="Dropdown-menu--right"};var e=n.prototype;return e.view=function(n){return t.prototype.view.call(this,(0,u.Z)({},n,{children:this.items().toArray()}))},e.getButtonContent=function(){var t=app.session.user;return[(0,h.Z)(t)," ",m("span",{className:"Button-label"},(0,f.Z)(t))]},e.items=function(){var t=new l.Z;return t.add("logOut",v.Z.component({icon:"fas fa-sign-out-alt",onclick:app.session.logout.bind(app.session)},app.translator.trans("core.admin.header.log_out_button")),-100),t},n}(g.Z);window.flreg.add("components/SessionDropdown",b);var _=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.view=function(){return m("ul",{className:"Header-controls"},(0,p.Z)(this.items().toArray()))},e.items=function(){var t=new l.Z;return t.add("help",m(d.Z,{href:"https://docs.flarum.org/troubleshoot.html",icon:"fas fa-question-circle",external:!0,target:"_blank"},app.translator.trans("core.admin.header.get_help"))),t.add("session",b.component()),t},n}(o.Z);window.flreg.add("components/HeaderSecondary",_);var w=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.view=function(){return m("div",{className:"DashboardWidget Widget "+this.className()},this.content())},e.className=function(){return""},e.content=function(){return[]},n}(o.Z);window.flreg.add("components/DashboardWidget",w);var y=e(5556),x=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.className=function(){return"LoadingModal Modal--small"},e.title=function(){return app.translator.trans("core.admin.loading.title")},e.content=function(){return""},n}(y.Z);(0,r.Z)(x,"isDismissible",!1),window.flreg.add("components/LoadingModal",x);var Z=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.className=function(){return"StatusWidget"},e.content=function(){return m("ul",null,(0,p.Z)(this.items().toArray()))},e.items=function(){var t=new l.Z;return t.add("tools",m(g.Z,{label:app.translator.trans("core.admin.dashboard.tools_button"),icon:"fas fa-cog",buttonClassName:"Button",menuClassName:"Dropdown-menu--right"},m(v.Z,{onclick:this.handleClearCache.bind(this)},app.translator.trans("core.admin.dashboard.clear_cache_button")))),t.add("version-flarum",[m("strong",null,"Flarum"),m("br",null),app.forum.attribute("version")]),t.add("version-php",[m("strong",null,"PHP"),m("br",null),app.data.phpVersion]),t.add("version-mysql",[m("strong",null,"MySQL"),m("br",null),app.data.mysqlVersion]),t},e.handleClearCache=function(t){app.modal.show(x),app.request({method:"DELETE",url:app.forum.attribute("apiUrl")+"/cache"}).then((function(){return window.location.reload()}))},n}(w);function N(t){return JSON.parse(app.data.settings.extensions_enabled).includes(t)}function E(){var t={};return Object.keys(app.data.extensions).map((function(n){var e=app.data.extensions[n],a=e.extra["flarum-extension"].category;e.extra["flarum-locale"]&&(a="language"),a in app.extensionCategories?(t[a]=t[a]||[],t[a].push(e)):(t.feature=t.feature||[],t.feature.push(e))})),t}window.flreg.add("components/StatusWidget",Z),window.flreg.add("utils/isExtensionEnabled",N),window.flreg.add("utils/getCategorizedExtensions",E);var I=e(8046),P=e(9100),D=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.oninit=function(n){t.prototype.oninit.call(this,n),this.categorizedExtensions=E()},e.className=function(){return"ExtensionsWidget"},e.content=function(){var t=this,n=app.extensionCategories;return m("div",{className:"ExtensionsWidget-list"},Object.keys(n).map((function(n){return t.categorizedExtensions[n]?t.extensionCategory(n):""})))},e.extensionCategory=function(t){var n=this;return m("div",{className:"ExtensionList-Category"},m("h4",{className:"ExtensionList-Label"},app.translator.trans("core.admin.nav.categories."+t)),m("ul",{className:"ExtensionList"},this.categorizedExtensions[t].map((function(t){return n.extensionWidget(t)}))))},e.extensionWidget=function(t){return m("li",{className:"ExtensionListItem "+(N(t.id)?"":"disabled")},m(I.Z,{href:app.route("extension",{id:t.id})},m("div",{className:"ExtensionListItem-content"},m("span",{className:"ExtensionListItem-icon ExtensionIcon",style:t.icon},t.icon?(0,P.Z)(t.icon.name):""),m("span",{className:"ExtensionListItem-title"},t.extra["flarum-extension"].title))))},n}(w);window.flreg.add("components/ExtensionsWidget",D);var S=e(9756),C=e(453),k=e(833),A=e(1017),B=function(t){function n(){return t.apply(this,arguments)||this}return(0,i.Z)(n,t),n.prototype.view=function(){var t=this.attrs,n=t.options,e=t.onchange,a=t.value,s=t.disabled;return m("span",{className:"Select"},m("select",{className:"Select-input FormControl",onchange:e?(0,A.Z)("value",e.bind(this)):void 0,value:a,disabled:s},Object.keys(n).map((function(t){return m("option",{value:t},n[t])}))),(0,P.Z)("fas fa-sort",{className:"Select-caret"}))},n}(o.Z);window.flreg.add("components/Select",B);var T=e(1650),M=e(1024);function O(t){var n=JSON.parse(JSON.stringify(app.data.settings));return(0,u.Z)(app.data.settings,t),app.request({method:"POST",url:app.forum.attribute("apiUrl")+"/settings",body:t}).catch((function(t){throw app.data.settings=n,t}))}window.flreg.add("utils/saveSettings",O);var G=function(t){function n(){return t.apply(this,arguments)||this}return(0,i.Z)(n,t),n.prototype.view=function(t){return[m("div",{className:(0,T.Z)(["AdminHeader",this.attrs.className])},m("div",{className:"container"},m("h2",null,(0,P.Z)(this.attrs.icon),t.children),m("div",{className:"AdminHeader-description"},this.attrs.description)))]},n}(o.Z);window.flreg.add("components/AdminHeader",G);var F=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.oninit=function(n){t.prototype.oninit.call(this,n),this.settings={},this.loading=!1},e.view=function(){var t=(0,T.Z)(["AdminPage",this.headerInfo().className]);return m("div",{className:t},this.header(),m("div",{className:"container"},this.content()))},e.content=function(){return""},e.submitButton=function(){return m(v.Z,{onclick:this.saveSettings.bind(this),className:"Button Button--primary",loading:this.loading,disabled:!this.isChanged()},app.translator.trans("core.admin.settings.submit_button"))},e.header=function(){var t=this.headerInfo();return m(G,{icon:t.icon,description:t.description,className:t.className+"-header"},t.title)},e.headerInfo=function(){return{className:"",icon:"",title:"",description:""}},e.buildSettingComponent=function(t){if("function"==typeof t)return t.call(this);var n=t.setting,e=t.help,a=(0,S.Z)(t,["setting","help"]);delete a.help;var s=this.setting([n])();return["bool","checkbox","switch","boolean"].includes(a.type)?m("div",{className:"Form-group"},m(k.Z,(0,u.Z)({state:!!s&&"0"!==s,onchange:this.settings[n]},a),a.label),m("div",{className:"helpText"},e)):["select","dropdown","selectdropdown"].includes(a.type)?m("div",{className:"Form-group"},m("label",null,a.label),m("div",{className:"helpText"},e),m(B,(0,u.Z)({value:s||a.default,options:a.options,buttonClassName:"Button",onchange:this.settings[n]},a))):(a.className=(0,T.Z)(["FormControl",a.className]),m("div",{className:"Form-group"},a.label?m("label",null,a.label):"",m("div",{className:"helpText"},e),m("input",(0,u.Z)({type:a.type,bidi:this.setting(n)},a))))},e.onsaved=function(){this.loading=!1,app.alerts.show({type:"success"},app.translator.trans("core.admin.settings.saved_message"))},e.setting=function(t,n){return void 0===n&&(n=""),this.settings[t]=this.settings[t]||(0,M.Z)(app.data.settings[t]||n),this.settings[t]},e.dirty=function(){var t=this,n={};return Object.keys(this.settings).forEach((function(e){var a=t.settings[e]();a!==app.data.settings[e]&&(n[e]=a)})),n},e.isChanged=function(){return Object.keys(this.dirty()).length},e.saveSettings=function(t){return t.preventDefault(),app.alerts.clear(),this.loading=!0,O(this.dirty()).then(this.onsaved.bind(this))},n}(C.Z);window.flreg.add("components/AdminPage",F);var U=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.headerInfo=function(){return{className:"DashboardPage",icon:"fas fa-chart-bar",title:app.translator.trans("core.admin.dashboard.title"),description:app.translator.trans("core.admin.dashboard.description")}},e.content=function(){return this.availableWidgets().toArray()},e.availableWidgets=function(){var t=new l.Z;return t.add("status",m(Z,null),30),t.add("extensions",m(D,null),10),t},n}(F);window.flreg.add("components/DashboardPage",U);var H=e(4926),L=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.oninit=function(n){var e=this;t.prototype.oninit.call(this,n),this.localeOptions={};var a=app.data.locales;for(var s in a)this.localeOptions[s]=a[s]+" ("+s+")";this.displayNameOptions={},app.data.displayNameDrivers.forEach((function(t){this.displayNameOptions[t]=t}),this),this.slugDriverOptions={},Object.keys(app.data.slugDrivers).forEach((function(t){e.slugDriverOptions[t]={},app.data.slugDrivers[t].forEach((function(n){e.slugDriverOptions[t][n]=n}))}))},e.headerInfo=function(){return{className:"BasicsPage",icon:"fas fa-pencil-alt",title:app.translator.trans("core.admin.basics.title"),description:app.translator.trans("core.admin.basics.description")}},e.content=function(){var t=this;return[m("div",{className:"Form"},this.buildSettingComponent({type:"text",setting:"forum_title",label:app.translator.trans("core.admin.basics.forum_title_heading")}),this.buildSettingComponent({type:"text",setting:"forum_description",label:app.translator.trans("core.admin.basics.forum_description_heading"),help:app.translator.trans("core.admin.basics.forum_description_text")}),Object.keys(this.localeOptions).length>1?[this.buildSettingComponent({type:"select",setting:"default_locale",options:this.localeOptions,label:app.translator.trans("core.admin.basics.default_language_heading")}),this.buildSettingComponent({type:"switch",setting:"show_language_selector",label:app.translator.trans("core.admin.basics.show_language_selector_label")})]:"",m(H.Z,{className:"BasicsPage-homePage Form-group",label:app.translator.trans("core.admin.basics.home_page_heading")},m("div",{className:"helpText"},app.translator.trans("core.admin.basics.home_page_text")),this.homePageItems().toArray().map((function(n){var e=n.path,a=n.label;return m("label",{className:"checkbox"},m("input",{type:"radio",name:"homePage",value:e,bidi:t.setting("default_route")}),a)}))),m("div",{className:"Form-group BasicsPage-welcomeBanner-input"},m("label",null,app.translator.trans("core.admin.basics.welcome_banner_heading")),m("div",{className:"helpText"},app.translator.trans("core.admin.basics.welcome_banner_text")),m("input",{type:"text",className:"FormControl",bidi:this.setting("welcome_title")}),m("textarea",{className:"FormControl",bidi:this.setting("welcome_message")})),Object.keys(this.displayNameOptions).length>1?this.buildSettingComponent({type:"select",setting:"display_name_driver",options:this.displayNameOptions,label:app.translator.trans("core.admin.basics.display_name_heading"),help:app.translator.trans("core.admin.basics.display_name_text")}):"",Object.keys(this.slugDriverOptions).map((function(n){var e=t.slugDriverOptions[n];if(Object.keys(e).length>1)return t.buildSettingComponent({type:"select",setting:"slug_driver_"+n,options:e,label:app.translator.trans("core.admin.basics.slug_driver_heading",{model:n}),help:app.translator.trans("core.admin.basics.slug_driver_text",{model:n})})})),this.submitButton())]},e.homePageItems=function(){var t=new l.Z;return t.add("allDiscussions",{path:"/all",label:app.translator.trans("core.admin.basics.all_discussions_label")}),t},n}(F);window.flreg.add("components/BasicsPage",L);var R=e(7880),j=e(9048),q=e(4032),W=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.oninit=function(n){t.prototype.oninit.call(this,n),this.group=this.attrs.group||app.store.createRecord("groups"),this.nameSingular=(0,M.Z)(this.group.nameSingular()||""),this.namePlural=(0,M.Z)(this.group.namePlural()||""),this.icon=(0,M.Z)(this.group.icon()||""),this.color=(0,M.Z)(this.group.color()||""),this.isHidden=(0,M.Z)(this.group.isHidden()||!1)},e.className=function(){return"EditGroupModal Modal--small"},e.title=function(){return[this.color()||this.icon()?j.Z.component({icon:this.icon(),style:{backgroundColor:this.color()}}):""," ",this.namePlural()||app.translator.trans("core.admin.edit_group.title")]},e.content=function(){return m("div",{className:"Modal-body"},m("div",{className:"Form"},this.fields().toArray()))},e.fields=function(){var t=new l.Z;return t.add("name",m("div",{className:"Form-group"},m("label",null,app.translator.trans("core.admin.edit_group.name_label")),m("div",{className:"EditGroupModal-name-input"},m("input",{className:"FormControl",placeholder:app.translator.trans("core.admin.edit_group.singular_placeholder"),bidi:this.nameSingular}),m("input",{className:"FormControl",placeholder:app.translator.trans("core.admin.edit_group.plural_placeholder"),bidi:this.namePlural}))),30),t.add("color",m("div",{className:"Form-group"},m("label",null,app.translator.trans("core.admin.edit_group.color_label")),m("input",{className:"FormControl",placeholder:"#aaaaaa",bidi:this.color})),20),t.add("icon",m("div",{className:"Form-group"},m("label",null,app.translator.trans("core.admin.edit_group.icon_label")),m("div",{className:"helpText"},app.translator.trans("core.admin.edit_group.icon_text",{a:m("a",{href:"https://fontawesome.com/icons?m=free",tabindex:"-1"})})),m("input",{className:"FormControl",placeholder:"fas fa-bolt",bidi:this.icon})),10),t.add("hidden",m("div",{className:"Form-group"},k.Z.component({state:!!Number(this.isHidden()),onchange:this.isHidden},app.translator.trans("core.admin.edit_group.hide_label"))),10),t.add("submit",m("div",{className:"Form-group"},v.Z.component({type:"submit",className:"Button Button--primary EditGroupModal-save",loading:this.loading},app.translator.trans("core.admin.edit_group.submit_button")),this.group.exists&&this.group.id()!==q.Z.ADMINISTRATOR_ID?m("button",{type:"button",className:"Button EditGroupModal-delete",onclick:this.deleteGroup.bind(this)},app.translator.trans("core.admin.edit_group.delete_button")):""),-10),t},e.submitData=function(){return{nameSingular:this.nameSingular(),namePlural:this.namePlural(),color:this.color(),icon:this.icon(),isHidden:this.isHidden()}},e.onsubmit=function(t){var n=this;t.preventDefault(),this.loading=!0,this.group.save(this.submitData(),{errorHandler:this.onerror.bind(this)}).then(this.hide.bind(this)).catch((function(){n.loading=!1,m.redraw()}))},e.deleteGroup=function(){confirm(app.translator.trans("core.admin.edit_group.delete_confirmation"))&&(this.group.delete().then((function(){return m.redraw()})),this.hide())},n}(y.Z);window.flreg.add("components/EditGroupModal",W);var z=e(5128);function V(t){var n=app.store.getById("groups",t);return n?R.Z.component({group:n,label:null}):""}function J(t,n){return app.getRequiredPermissions(n).forEach((function(n){var e=app.data.permissions[n]||[];-1!==e.indexOf(q.Z.GUEST_ID)||(t=-1!==e.indexOf(q.Z.MEMBER_ID)?t.filter((function(t){return t!==q.Z.GUEST_ID})):-1!==t.indexOf(q.Z.MEMBER_ID)?e:e.filter((function(n){return-1!==t.indexOf(n)}))),t=J(t,n)})),t}var K=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t),n.initAttrs=function(n){t.initAttrs.call(this,n),n.className="PermissionDropdown",n.buttonClassName="Button Button--text"};var e=n.prototype;return e.view=function(n){var e=this,a=[],s=app.data.permissions[this.attrs.permission]||[],i=-1!==(s=J(s,this.attrs.permission)).indexOf(q.Z.GUEST_ID),r=-1!==s.indexOf(q.Z.MEMBER_ID),o=app.store.getById("groups",q.Z.ADMINISTRATOR_ID);return this.attrs.label=i?j.Z.component({icon:"fas fa-globe"}):r?j.Z.component({icon:"fas fa-user"}):[V(q.Z.ADMINISTRATOR_ID),s.map(V)],this.showing&&(this.attrs.allowGuest&&a.push(v.Z.component({icon:!i||"fas fa-check",onclick:function(){return e.save([q.Z.GUEST_ID])},disabled:this.isGroupDisabled(q.Z.GUEST_ID)},[j.Z.component({icon:"fas fa-globe"})," ",app.translator.trans("core.admin.permissions_controls.everyone_button")])),a.push(v.Z.component({icon:!r||"fas fa-check",onclick:function(){return e.save([q.Z.MEMBER_ID])},disabled:this.isGroupDisabled(q.Z.MEMBER_ID)},[j.Z.component({icon:"fas fa-user"})," ",app.translator.trans("core.admin.permissions_controls.members_button")]),z.Z.component(),v.Z.component({icon:!(!i&&!r)||"fas fa-check",disabled:!i&&!r,onclick:function(t){t.shiftKey&&t.stopPropagation(),e.save([])}},[V(o.id())," ",o.namePlural()])),[].push.apply(a,app.store.all("groups").filter((function(t){return-1===[q.Z.ADMINISTRATOR_ID,q.Z.GUEST_ID,q.Z.MEMBER_ID].indexOf(t.id())})).map((function(t){return v.Z.component({icon:-1===s.indexOf(t.id())||"fas fa-check",onclick:function(n){n.shiftKey&&n.stopPropagation(),e.toggle(t.id())},disabled:e.isGroupDisabled(t.id())&&e.isGroupDisabled(q.Z.MEMBER_ID)&&e.isGroupDisabled(q.Z.GUEST_ID)},[V(t.id())," ",t.namePlural()])})))),t.prototype.view.call(this,(0,u.Z)({},n,{children:a}))},e.save=function(t){var n=this.attrs.permission;app.data.permissions[n]=t,app.request({method:"POST",url:app.forum.attribute("apiUrl")+"/permission",body:{permission:n,groupIds:t}})},e.toggle=function(t){var n=this.attrs.permission,e=app.data.permissions[n]||[],a=e.indexOf(t);-1!==a?e.splice(a,1):(e.push(t),e=e.filter((function(t){return-1===[q.Z.GUEST_ID,q.Z.MEMBER_ID].indexOf(t)}))),this.save(e)},e.isGroupDisabled=function(t){return-1===J([t],this.attrs.permission).indexOf(t)},n}(g.Z);window.flreg.add("components/PermissionDropdown",K);var Q=e(9349),X=function(t){function n(){return t.apply(this,arguments)||this}return(0,i.Z)(n,t),n.initAttrs=function(n){t.initAttrs.call(this,n),n.className="SettingDropdown",n.buttonClassName="Button Button--text",n.caretIcon="fas fa-caret-down",n.defaultLabel="Custom"},n.prototype.view=function(n){var e=this;return t.prototype.view.call(this,(0,u.Z)({},n,{children:this.attrs.options.map((function(t){var n,a=t.value,s=t.label,i=app.data.settings[e.attrs.key]===a;return v.Z.component({icon:!i||"fas fa-check",onclick:O.bind(e,(n={},n[e.attrs.key]=a,n)),active:i},s)}))}))},n}(Q.Z);window.flreg.add("components/SettingDropdown",X);var Y=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.view=function(){var t=this.scopeItems().toArray(),n=function(n){return t.map((function(t){return m("td",null,t.render(n))}))};return m("table",{className:"PermissionGrid"},m("thead",null,m("tr",null,m("td",null),t.map((function(t){return m("th",null,t.label," ",t.onremove?v.Z.component({icon:"fas fa-times",className:"Button Button--text PermissionGrid-removeScope",onclick:t.onremove}):"")})),m("th",null,this.scopeControlItems().toArray()))),this.permissionItems().toArray().map((function(t){return m("tbody",null,m("tr",{className:"PermissionGrid-section"},m("th",null,t.label),n(t),m("td",null)),t.children.map((function(t){return m("tr",{className:"PermissionGrid-child"},m("th",null,(0,P.Z)(t.icon),t.label),n(t),m("td",null))})))})))},e.permissionItems=function(){var t=new l.Z;return t.add("view",{label:app.translator.trans("core.admin.permissions.read_heading"),children:this.viewItems().toArray()},100),t.add("start",{label:app.translator.trans("core.admin.permissions.create_heading"),children:this.startItems().toArray()},90),t.add("reply",{label:app.translator.trans("core.admin.permissions.participate_heading"),children:this.replyItems().toArray()},80),t.add("moderate",{label:app.translator.trans("core.admin.permissions.moderate_heading"),children:this.moderateItems().toArray()},70),t},e.viewItems=function(){var t=new l.Z;return t.add("viewDiscussions",{icon:"fas fa-eye",label:app.translator.trans("core.admin.permissions.view_discussions_label"),permission:"viewDiscussions",allowGuest:!0},100),t.add("viewHiddenGroups",{icon:"fas fa-users",label:app.translator.trans("core.admin.permissions.view_hidden_groups_label"),permission:"viewHiddenGroups"},100),t.add("viewUserList",{icon:"fas fa-users",label:app.translator.trans("core.admin.permissions.view_user_list_label"),permission:"viewUserList",allowGuest:!0},100),t.add("signUp",{icon:"fas fa-user-plus",label:app.translator.trans("core.admin.permissions.sign_up_label"),setting:function(){return X.component({key:"allow_sign_up",options:[{value:"1",label:app.translator.trans("core.admin.permissions_controls.signup_open_button")},{value:"0",label:app.translator.trans("core.admin.permissions_controls.signup_closed_button")}]})}},90),t.add("viewLastSeenAt",{icon:"far fa-clock",label:app.translator.trans("core.admin.permissions.view_last_seen_at_label"),permission:"user.viewLastSeenAt"}),t.merge(app.extensionData.getAllExtensionPermissions("view")),t},e.startItems=function(){var t=new l.Z;return t.add("start",{icon:"fas fa-edit",label:app.translator.trans("core.admin.permissions.start_discussions_label"),permission:"startDiscussion"},100),t.add("allowRenaming",{icon:"fas fa-i-cursor",label:app.translator.trans("core.admin.permissions.allow_renaming_label"),setting:function(){var t=parseInt(app.data.settings.allow_renaming,10);return X.component({defaultLabel:t?app.translator.transChoice("core.admin.permissions_controls.allow_some_minutes_button",t,{count:t}):app.translator.trans("core.admin.permissions_controls.allow_indefinitely_button"),key:"allow_renaming",options:[{value:"-1",label:app.translator.trans("core.admin.permissions_controls.allow_indefinitely_button")},{value:"10",label:app.translator.trans("core.admin.permissions_controls.allow_ten_minutes_button")},{value:"reply",label:app.translator.trans("core.admin.permissions_controls.allow_until_reply_button")}]})}},90),t.merge(app.extensionData.getAllExtensionPermissions("start")),t},e.replyItems=function(){var t=new l.Z;return t.add("reply",{icon:"fas fa-reply",label:app.translator.trans("core.admin.permissions.reply_to_discussions_label"),permission:"discussion.reply"},100),t.add("allowPostEditing",{icon:"fas fa-pencil-alt",label:app.translator.trans("core.admin.permissions.allow_post_editing_label"),setting:function(){var t=parseInt(app.data.settings.allow_post_editing,10);return X.component({defaultLabel:t?app.translator.transChoice("core.admin.permissions_controls.allow_some_minutes_button",t,{count:t}):app.translator.trans("core.admin.permissions_controls.allow_indefinitely_button"),key:"allow_post_editing",options:[{value:"-1",label:app.translator.trans("core.admin.permissions_controls.allow_indefinitely_button")},{value:"10",label:app.translator.trans("core.admin.permissions_controls.allow_ten_minutes_button")},{value:"reply",label:app.translator.trans("core.admin.permissions_controls.allow_until_reply_button")}]})}},90),t.merge(app.extensionData.getAllExtensionPermissions("reply")),t},e.moderateItems=function(){var t=new l.Z;return t.add("viewIpsPosts",{icon:"fas fa-bullseye",label:app.translator.trans("core.admin.permissions.view_post_ips_label"),permission:"discussion.viewIpsPosts"},110),t.add("renameDiscussions",{icon:"fas fa-i-cursor",label:app.translator.trans("core.admin.permissions.rename_discussions_label"),permission:"discussion.rename"},100),t.add("hideDiscussions",{icon:"far fa-trash-alt",label:app.translator.trans("core.admin.permissions.delete_discussions_label"),permission:"discussion.hide"},90),t.add("deleteDiscussions",{icon:"fas fa-times",label:app.translator.trans("core.admin.permissions.delete_discussions_forever_label"),permission:"discussion.delete"},80),t.add("postWithoutThrottle",{icon:"fas fa-swimmer",label:app.translator.trans("core.admin.permissions.post_without_throttle_label"),permission:"postWithoutThrottle"},70),t.add("editPosts",{icon:"fas fa-pencil-alt",label:app.translator.trans("core.admin.permissions.edit_posts_label"),permission:"discussion.editPosts"},70),t.add("hidePosts",{icon:"far fa-trash-alt",label:app.translator.trans("core.admin.permissions.delete_posts_label"),permission:"discussion.hidePosts"},60),t.add("deletePosts",{icon:"fas fa-times",label:app.translator.trans("core.admin.permissions.delete_posts_forever_label"),permission:"discussion.deletePosts"},60),t.add("userEditCredentials",{icon:"fas fa-user-cog",label:app.translator.trans("core.admin.permissions.edit_users_credentials_label"),permission:"user.editCredentials"},60),t.add("userEditGroups",{icon:"fas fa-users-cog",label:app.translator.trans("core.admin.permissions.edit_users_groups_label"),permission:"user.editGroups"},60),t.add("userEdit",{icon:"fas fa-address-card",label:app.translator.trans("core.admin.permissions.edit_users_label"),permission:"user.edit"},60),t.merge(app.extensionData.getAllExtensionPermissions("moderate")),t},e.scopeItems=function(){var t=new l.Z;return t.add("global",{label:app.translator.trans("core.admin.permissions.global_heading"),render:function(t){return t.setting?t.setting():t.permission?K.component({permission:t.permission,allowGuest:t.allowGuest}):""}},100),t},e.scopeControlItems=function(){return new l.Z},n}(o.Z);window.flreg.add("components/PermissionGrid",Y);var tt=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.headerInfo=function(){return{className:"PermissionsPage",icon:"fas fa-key",title:app.translator.trans("core.admin.permissions.title"),description:app.translator.trans("core.admin.permissions.description")}},e.content=function(){return[m("div",{className:"PermissionsPage-groups"},app.store.all("groups").filter((function(t){return-1===[q.Z.GUEST_ID,q.Z.MEMBER_ID].indexOf(t.id())})).map((function(t){return m("button",{className:"Button Group",onclick:function(){return app.modal.show(W,{group:t})}},R.Z.component({group:t,className:"Group-icon",label:null}),m("span",{className:"Group-name"},t.namePlural()))})),m("button",{className:"Button Group Group--add",onclick:function(){return app.modal.show(W)}},(0,P.Z)("fas fa-plus",{className:"Group-icon"}),m("span",{className:"Group-name"},app.translator.trans("core.admin.permissions.new_group_button")))),m("div",{className:"PermissionsPage-permissions"},Y.component())]},n}(F);window.flreg.add("components/PermissionsPage",tt);var nt=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.oninit=function(n){t.prototype.oninit.call(this,n),this.settings={},this.loading=!1},e.form=function(){return""},e.content=function(){return m("div",{className:"Modal-body"},m("div",{className:"Form"},this.form(),m("div",{className:"Form-group"},this.submitButton())))},e.submitButton=function(){return m(v.Z,{type:"submit",className:"Button Button--primary",loading:this.loading,disabled:!this.changed()},app.translator.trans("core.admin.settings.submit_button"))},e.setting=function(t,n){return void 0===n&&(n=""),this.settings[t]=this.settings[t]||(0,M.Z)(app.data.settings[t]||n),this.settings[t]},e.dirty=function(){var t=this,n={};return Object.keys(this.settings).forEach((function(e){var a=t.settings[e]();a!==app.data.settings[e]&&(n[e]=a)})),n},e.changed=function(){return Object.keys(this.dirty()).length},e.onsubmit=function(t){t.preventDefault(),this.loading=!0,O(this.dirty()).then(this.onsaved.bind(this),this.loaded.bind(this))},e.onsaved=function(){this.hide()},n}(y.Z);window.flreg.add("components/SettingsModal",nt);var et=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.className=function(){return"EditCustomCssModal Modal--large"},e.title=function(){return app.translator.trans("core.admin.edit_css.title")},e.form=function(){return[m("p",null,app.translator.trans("core.admin.edit_css.customize_text",{a:m("a",{href:"https://github.com/flarum/core/tree/master/less",target:"_blank"})})),m("div",{className:"Form-group"},m("textarea",{className:"FormControl",rows:"30",bidi:this.setting("custom_less")}))]},e.onsaved=function(){window.location.reload()},n}(nt);window.flreg.add("components/EditCustomCssModal",et);var at=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.className=function(){return"EditCustomHeaderModal Modal--large"},e.title=function(){return app.translator.trans("core.admin.edit_header.title")},e.form=function(){return[m("p",null,app.translator.trans("core.admin.edit_header.customize_text")),m("div",{className:"Form-group"},m("textarea",{className:"FormControl",rows:"30",bidi:this.setting("custom_header")}))]},e.onsaved=function(){window.location.reload()},n}(nt);window.flreg.add("components/EditCustomHeaderModal",at);var st=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.className=function(){return"EditCustomFooterModal Modal--large"},e.title=function(){return app.translator.trans("core.admin.edit_footer.title")},e.form=function(){return[m("p",null,app.translator.trans("core.admin.edit_footer.customize_text")),m("div",{className:"Form-group"},m("textarea",{className:"FormControl",rows:"30",bidi:this.setting("custom_footer")}))]},e.onsaved=function(){window.location.reload()},n}(nt);window.flreg.add("components/EditCustomFooterModal",st);var it=function(t){function n(){for(var n,e=arguments.length,a=new Array(e),i=0;i').appendTo("body").hide().click().on("change",(function(n){var e=new FormData;e.append(t.attrs.name,$(n.target)[0].files[0]),t.loading=!0,m.redraw(),app.request({method:"POST",url:t.resourceUrl(),serialize:function(t){return t},body:e}).then(t.success.bind(t),t.failure.bind(t))}))},e.remove=function(){this.loading=!0,m.redraw(),app.request({method:"DELETE",url:this.resourceUrl()}).then(this.success.bind(this),this.failure.bind(this))},e.resourceUrl=function(){return app.forum.attribute("apiUrl")+"/"+this.attrs.name},e.success=function(t){window.location.reload()},e.failure=function(t){this.loading=!1,m.redraw()},n}(v.Z);window.flreg.add("components/UploadImageButton",it);var rt=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.headerInfo=function(){return{className:"AppearancePage",icon:"fas fa-paint-brush",title:app.translator.trans("core.admin.appearance.title"),description:app.translator.trans("core.admin.appearance.description")}},e.content=function(){return[m("div",{className:"Form"},m("fieldset",{className:"AppearancePage-colors"},m("legend",null,app.translator.trans("core.admin.appearance.colors_heading")),m("div",{className:"helpText"},app.translator.trans("core.admin.appearance.colors_text")),m("div",{className:"AppearancePage-colors-input"},this.buildSettingComponent({type:"text",setting:"theme_primary_color",placeholder:"#aaaaaa"}),this.buildSettingComponent({type:"text",setting:"theme_secondary_color",placeholder:"#aaaaaa"})),this.buildSettingComponent({type:"switch",setting:"theme_dark_mode",label:app.translator.trans("core.admin.appearance.dark_mode_label")}),this.buildSettingComponent({type:"switch",setting:"theme_colored_header",label:app.translator.trans("core.admin.appearance.colored_header_label")}),this.submitButton())),m("fieldset",null,m("legend",null,app.translator.trans("core.admin.appearance.logo_heading")),m("div",{className:"helpText"},app.translator.trans("core.admin.appearance.logo_text")),m(it,{name:"logo"})),m("fieldset",null,m("legend",null,app.translator.trans("core.admin.appearance.favicon_heading")),m("div",{className:"helpText"},app.translator.trans("core.admin.appearance.favicon_text")),m(it,{name:"favicon"})),m("fieldset",null,m("legend",null,app.translator.trans("core.admin.appearance.custom_header_heading")),m("div",{className:"helpText"},app.translator.trans("core.admin.appearance.custom_header_text")),v.Z.component({className:"Button",onclick:function(){return app.modal.show(at)}},app.translator.trans("core.admin.appearance.edit_header_button"))),m("fieldset",null,m("legend",null,app.translator.trans("core.admin.appearance.custom_footer_heading")),m("div",{className:"helpText"},app.translator.trans("core.admin.appearance.custom_footer_text")),v.Z.component({className:"Button",onclick:function(){return app.modal.show(st)}},app.translator.trans("core.admin.appearance.edit_footer_button"))),m("fieldset",null,m("legend",null,app.translator.trans("core.admin.appearance.custom_styles_heading")),m("div",{className:"helpText"},app.translator.trans("core.admin.appearance.custom_styles_text")),v.Z.component({className:"Button",onclick:function(){return app.modal.show(et)}},app.translator.trans("core.admin.appearance.edit_css_button")))]},e.onsaved=function(){window.location.reload()},e.saveSettings=function(n){n.preventDefault();var e=/^#[0-9a-f]{3}([0-9a-f]{3})?$/i;e.test(this.settings.theme_primary_color())&&e.test(this.settings.theme_secondary_color())?t.prototype.saveSettings.call(this,n):alert(app.translator.trans("core.admin.appearance.enter_hex_message"))},n}(F);window.flreg.add("components/AppearancePage",rt);var ot=e(7607),lt=e(8726),pt=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.oninit=function(n){t.prototype.oninit.call(this,n),this.sendingTest=!1,this.refresh()},e.headerInfo=function(){return{className:"MailPage",icon:"fas fa-envelope",title:app.translator.trans("core.admin.email.title"),description:app.translator.trans("core.admin.email.description")}},e.refresh=function(){var t=this;this.loading=!0,this.status={sending:!1,errors:{}},app.request({method:"GET",url:app.forum.attribute("apiUrl")+"/mail/settings"}).then((function(n){t.driverFields=n.data.attributes.fields,t.status.sending=n.data.attributes.sending,t.status.errors=n.data.attributes.errors,t.loading=!1,m.redraw()}))},e.content=function(){var t=this;if(this.loading)return m(lt.Z,null);var n=this.driverFields[this.setting("mail_driver")()],e=Object.keys(n);return m("div",{className:"Form"},this.buildSettingComponent({type:"text",setting:"mail_from",label:app.translator.trans("core.admin.email.addresses_heading"),className:"MailPage-MailSettings"}),this.buildSettingComponent({type:"select",setting:"mail_driver",options:Object.keys(this.driverFields).reduce((function(t,n){var e;return(0,u.Z)({},t,((e={})[n]=n,e))}),{}),label:app.translator.trans("core.admin.email.driver_heading"),className:"MailPage-MailSettings"}),this.status.sending||ot.Z.component({dismissible:!1},app.translator.trans("core.admin.email.not_sending_message")),e.length>0&&m(H.Z,{label:app.translator.trans("core.admin.email."+this.setting("mail_driver")()+"_heading"),className:"MailPage-MailSettings"},m("div",{className:"MailPage-MailSettings-input"},e.map((function(e){var a=n[e];return[t.buildSettingComponent({type:"string"==typeof t.setting(e)()?"text":"select",label:app.translator.trans("core.admin.email."+e+"_label"),setting:e,options:a}),t.status.errors[e]&&m("p",{className:"ValidationError"},t.status.errors[e])]})))),this.submitButton(),m(H.Z,{label:app.translator.trans("core.admin.email.send_test_mail_heading"),className:"MailPage-MailSettings"},m("div",{className:"helpText"},app.translator.trans("core.admin.email.send_test_mail_text",{email:app.session.user.email()})),v.Z.component({className:"Button Button--primary",disabled:this.sendingTest||this.isChanged(),onclick:function(){return t.sendTestEmail()}},app.translator.trans("core.admin.email.send_test_mail_button"))))},e.sendTestEmail=function(){var t=this;this.saving||this.sendingTest||(this.sendingTest=!0,app.alerts.dismiss(this.testEmailSuccessAlert),app.request({method:"POST",url:app.forum.attribute("apiUrl")+"/mail/test"}).then((function(n){t.sendingTest=!1,t.testEmailSuccessAlert=app.alerts.show({type:"success"},app.translator.trans("core.admin.email.send_test_mail_success"))})).catch((function(n){throw t.sendingTest=!1,m.redraw(),n})))},e.saveSettings=function(n){t.prototype.saveSettings.call(this,n).then(this.refresh())},n}(F);function ct(t){if(2===t.length)return app.translator.trans("core.lib.series.two_text",{first:t[0],second:t[1]});if(t.length>=3){var n=t.slice(1,t.length-1).reduce((function(t,n){return t.concat([n,app.translator.trans("core.lib.series.glue_text")])}),[]).slice(0,-1);return app.translator.trans("core.lib.series.three_text",{first:t[0],second:n,third:t[t.length-1]})}return t}window.flreg.add("components/MailPage",pt),window.flreg.add("helpers/punctuateSeries",ct);var dt=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.oninit=function(n){t.prototype.oninit.call(this,n),this.extensionId=this.attrs.extensionId},e.permissionItems=function(){var n=t.prototype.permissionItems.call(this);return n.items=Object.entries(n.items).filter((function(t){return t[0],t[1].content.children.length>0})).reduce((function(t,n){var e=n[0],a=n[1];return t[e]=a,t}),{}),n},e.viewItems=function(){return app.extensionData.getExtensionPermissions(this.extensionId,"view")||new l.Z},e.startItems=function(){return app.extensionData.getExtensionPermissions(this.extensionId,"start")||new l.Z},e.replyItems=function(){return app.extensionData.getExtensionPermissions(this.extensionId,"reply")||new l.Z},e.moderateItems=function(){return app.extensionData.getExtensionPermissions(this.extensionId,"moderate")||new l.Z},e.scopeControlItems=function(){var t=new l.Z;return t.add("configureScopes",m(v.Z,{className:"Button Button--text",onclick:function(){return m.route.set(app.route("permissions"))}},app.translator.trans("core.admin.extension.configure_scopes"))),t},n}(Y);window.flreg.add("components/ExtensionPermissionGrid",dt);var ut=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.oninit=function(n){if(t.prototype.oninit.call(this,n),this.extension=app.data.extensions[this.attrs.id],this.changingState=!1,this.infoFields={discuss:"fas fa-comment-alt",documentation:"fas fa-book",support:"fas fa-life-ring",website:"fas fa-link",donate:"fas fa-donate",source:"fas fa-code"},!this.extension)return m.route.set(app.route("dashboard"))},e.className=function(){return this.extension?this.extension.id+"-Page":""},e.view=function(){return this.extension?m("div",{className:"ExtensionPage "+this.className()},this.header(),this.isEnabled()?m("div",{className:"ExtensionPage-body"},this.sections().toArray()):m("div",{className:"container"},m("h3",{className:"ExtensionPage-subHeader"},app.translator.trans("core.admin.extension.enable_to_see")))):null},e.header=function(){var t=this.isEnabled();return[m("div",{className:"ExtensionPage-header"},m("div",{className:"container"},m("div",{className:"ExtensionTitle"},m("span",{className:"ExtensionIcon",style:this.extension.icon},this.extension.icon?(0,P.Z)(this.extension.icon.name):""),m("div",{className:"ExtensionName"},m("h2",null,this.extension.extra["flarum-extension"].title)),m("div",{className:"ExtensionPage-headerTopItems"},m("ul",null,(0,p.Z)(this.topItems().toArray())))),m("div",{className:"helpText"},this.extension.description),m("div",{className:"ExtensionPage-headerItems"},m(k.Z,{state:this.changingState?!t:t,loading:this.changingState,onchange:this.toggle.bind(this,this.extension.id)},t?app.translator.trans("core.admin.extension.enabled"):app.translator.trans("core.admin.extension.disabled")),m("aside",{className:"ExtensionInfo"},m("ul",null,(0,p.Z)(this.infoItems().toArray()))))))]},e.sections=function(){var t=new l.Z;return t.add("content",this.content()),t.add("permissions",[m("div",{className:"ExtensionPage-permissions"},m("div",{className:"ExtensionPage-permissions-header"},m("div",{className:"container"},m("h2",{className:"ExtensionTitle"},app.translator.trans("core.admin.extension.permissions_title")))),m("div",{className:"container"},app.extensionData.extensionHasPermissions(this.extension.id)?dt.component({extensionId:this.extension.id}):m("h3",{className:"ExtensionPage-subHeader"},app.translator.trans("core.admin.extension.no_permissions"))))]),t},e.content=function(){var t=app.extensionData.getSettings(this.extension.id);return m("div",{className:"ExtensionPage-settings"},m("div",{className:"container"},t?m("div",{className:"Form"},t.map(this.buildSettingComponent.bind(this)),m("div",{className:"Form-group"},this.submitButton())):m("h3",{className:"ExtensionPage-subHeader"},app.translator.trans("core.admin.extension.no_settings"))))},e.topItems=function(){var t=this,n=new l.Z;return n.add("version",m("span",{className:"ExtensionVersion"},this.extension.version)),this.isEnabled()||n.add("uninstall",m(v.Z,{icon:"fas fa-trash-alt",className:"Button Button--primary",onclick:function(){confirm(app.translator.trans("core.admin.extension.confirm_uninstall"))&&(app.request({url:app.forum.attribute("apiUrl")+"/extensions/"+t.extension.id,method:"DELETE"}).then((function(){return window.location.reload()})),app.modal.show(x))}.bind(this)},app.translator.trans("core.admin.extension.uninstall_button"))),n},e.infoItems=function(){var t=this,n=new l.Z,e=this.extension.links;if(e.authors.length){var a=[];e.authors.map((function(t){a.push(m(I.Z,{href:t.link,external:!0,target:"_blank"},t.name))})),n.add("authors",[(0,P.Z)("fas fa-user"),m("span",null,ct(a))])}return Object.keys(this.infoFields).map((function(a){e[a]&&n.add(a,m(d.Z,{href:e[a],icon:t.infoFields[a],external:!0,target:"_blank"},app.translator.trans("core.admin.extension.info_links."+a)))})),n},e.toggle=function(){var t=this,n=this.isEnabled();this.changingState=!0,app.request({url:app.forum.attribute("apiUrl")+"/extensions/"+this.extension.id,method:"PATCH",body:{enabled:!n},errorHandler:this.onerror.bind(this)}).then((function(){n||localStorage.setItem("enabledExtension",t.extension.id),window.location.reload()})),app.modal.show(x)},e.isEnabled=function(){return N(this.extension.id)},e.onerror=function(t){if(setTimeout((function(){app.modal.close()}),300),this.changingState=!1,409!==t.status)throw t;var n=t.response.errors[0];app.alerts.show({type:"error"},app.translator.trans("core.lib.error."+n.code+"_message",{extension:n.extension,extensions:n.extensions.join(", ")}))},n}(F);window.flreg.add("components/ExtensionPage",ut);var mt=function(t){function n(){return t.apply(this,arguments)||this}return(0,i.Z)(n,t),n.prototype.onmatch=function(n,e,a){return app.extensionData.getPage(n.id)||t.prototype.onmatch.call(this,n,e,a)},n}(e(2231).Z);(0,r.Z)(mt,"extension",null),window.flreg.add("resolvers/ExtensionPageResolver",mt);var ht=e(188),ft=e(4807),gt=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.getButtonContent=function(n){var e=t.prototype.getButtonContent.call(this,n),a=app.data.extensions[this.attrs.extensionId],s=this.statusItems(a.id).toArray();return e.unshift(m("span",{className:"ExtensionListItem-icon ExtensionIcon",style:a.icon},a.icon?(0,P.Z)(a.icon.name):"")),e.push(s),e},e.statusItems=function(t){var n=new l.Z;return n.add("enabled",m("span",{class:"ExtensionListItem-Dot "+(N(t)?"enabled":"disabled")})),n},n}(d.Z);window.flreg.add("components/ExtensionLinkButton",gt);var vt=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.oninit=function(n){t.prototype.oninit.call(this,n),this.query=(0,M.Z)("")},e.view=function(){return m(Q.Z,{className:"AdminNav App-titleControl AdminNav-Main",buttonClassName:"Button"},this.items().toArray().concat(this.extensionItems().toArray()))},e.oncreate=function(n){t.prototype.oncreate.call(this,n),this.scrollToActive()},e.onupdate=function(){this.scrollToActive()},e.scrollToActive=function(){var t=$(".Dropdown-menu").children(".active"),n=$("#admin-navigation"),e=app.previous.type?250:0;t.length>0&&(t[0].offsetTop>n.scrollTop()+n.outerHeight()||t[0].offsetTop+t[0].offsetHeight{"use strict";e.d(n,{l:()=>s});var a=e(2122);function s(t,n,e){var s=t[n];t[n]=function(){for(var t=arguments.length,n=new Array(t),a=0;a{"use strict";function a(t){var n=t.replace(/(<\/p>|
)/g,"$1  ").replace(/]*>/gi," "),e=$("
").html(n);return e.find(a.removeSelectors.join(",")).remove(),e.text().replace(/\s+/g," ").trim()}e.d(n,{AH:()=>a}),a.removeSelectors=["blockquote","script"],window.flreg.add("utils/truncate",(function(t,n,e){return void 0===e&&(e=0),(e>0?"...":"")+t.substring(e,e+n)+(t.length>e+n?"...":"")})),window.flreg.add("utils/slug",(function(t){return t.toLowerCase().replace(/[^a-z0-9]/gi,"-").replace(/-+/g,"-").replace(/-$|^-/g,"")})),window.flreg.add("utils/getPlainContent",a),window.flreg.add("utils/ucfirst",(function(t){return t.substr(0,1).toUpperCase()+t.substr(1)}))}},t=>{t.O(0,[358,997],(()=>(7540,t(t.s=7540))));var n=t.O();flarum.core=n}]); +(self.webpackChunk_flarum_core=self.webpackChunk_flarum_core||[]).push([[328],{7540:(t,n,e)=>{e.r(n),e.d(n,{Extend:()=>a.U,app:()=>yt});var a=e(6920),s=e(3349),i=e(1788),r=e(6156),o=e(8931),l=e(4594),p=e(7473),c=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.view=function(){return m("ul",{className:"Header-controls"},(0,p.Z)(this.items().toArray()))},e.config=function(t,n){n.retain=!0},e.items=function(){return new l.Z},n}(o.Z);window.flreg.add("components/HeaderPrimary",c);var d=e(2558),u=e(2122),h=e(9908),f=e(507),g=e(9657),b=e(2587),v=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t),n.initAttrs=function(n){t.initAttrs.call(this,n),n.className="SessionDropdown",n.buttonClassName="Button Button--user Button--flat",n.menuClassName="Dropdown-menu--right"};var e=n.prototype;return e.view=function(n){return t.prototype.view.call(this,(0,u.Z)({},n,{children:this.items().toArray()}))},e.getButtonContent=function(){var t=app.session.user;return[(0,h.Z)(t)," ",m("span",{className:"Button-label"},(0,f.Z)(t))]},e.items=function(){var t=new l.Z;return t.add("logOut",b.Z.component({icon:"fas fa-sign-out-alt",onclick:app.session.logout.bind(app.session)},app.translator.trans("core.admin.header.log_out_button")),-100),t},n}(g.Z);window.flreg.add("components/SessionDropdown",v);var _=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.view=function(){return m("ul",{className:"Header-controls"},(0,p.Z)(this.items().toArray()))},e.items=function(){var t=new l.Z;return t.add("help",m(d.Z,{href:"https://docs.flarum.org/troubleshoot.html",icon:"fas fa-question-circle",external:!0,target:"_blank"},app.translator.trans("core.admin.header.get_help"))),t.add("session",v.component()),t},n}(o.Z);window.flreg.add("components/HeaderSecondary",_);var w=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.view=function(){return m("div",{className:"DashboardWidget Widget "+this.className()},this.content())},e.className=function(){return""},e.content=function(){return[]},n}(o.Z);window.flreg.add("components/DashboardWidget",w);var y=e(5556),x=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.className=function(){return"LoadingModal Modal--small"},e.title=function(){return app.translator.trans("core.admin.loading.title")},e.content=function(){return""},n}(y.Z);(0,r.Z)(x,"isDismissible",!1),window.flreg.add("components/LoadingModal",x);var Z=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.className=function(){return"StatusWidget"},e.content=function(){return m("ul",null,(0,p.Z)(this.items().toArray()))},e.items=function(){var t=new l.Z;return t.add("tools",m(g.Z,{label:app.translator.trans("core.admin.dashboard.tools_button"),icon:"fas fa-cog",buttonClassName:"Button",menuClassName:"Dropdown-menu--right"},m(b.Z,{onclick:this.handleClearCache.bind(this)},app.translator.trans("core.admin.dashboard.clear_cache_button")))),t.add("version-flarum",[m("strong",null,"Flarum"),m("br",null),app.forum.attribute("version")]),t.add("version-php",[m("strong",null,"PHP"),m("br",null),app.data.phpVersion]),t.add("version-mysql",[m("strong",null,"MySQL"),m("br",null),app.data.mysqlVersion]),t},e.handleClearCache=function(t){app.modal.show(x),app.request({method:"DELETE",url:app.forum.attribute("apiUrl")+"/cache"}).then((function(){return window.location.reload()}))},n}(w);function N(t){return JSON.parse(app.data.settings.extensions_enabled).includes(t)}function E(){var t={};return Object.keys(app.data.extensions).map((function(n){var e=app.data.extensions[n],a=e.extra["flarum-extension"].category;e.extra["flarum-locale"]&&(a="language"),a in app.extensionCategories?(t[a]=t[a]||[],t[a].push(e)):(t.feature=t.feature||[],t.feature.push(e))})),t}window.flreg.add("components/StatusWidget",Z),window.flreg.add("utils/isExtensionEnabled",N),window.flreg.add("utils/getCategorizedExtensions",E);var I=e(8046),P=e(9100),D=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.oninit=function(n){t.prototype.oninit.call(this,n),this.categorizedExtensions=E()},e.className=function(){return"ExtensionsWidget"},e.content=function(){var t=this,n=app.extensionCategories;return m("div",{className:"ExtensionsWidget-list"},Object.keys(n).map((function(n){return t.categorizedExtensions[n]?t.extensionCategory(n):""})))},e.extensionCategory=function(t){var n=this;return m("div",{className:"ExtensionList-Category"},m("h4",{className:"ExtensionList-Label"},app.translator.trans("core.admin.nav.categories."+t)),m("ul",{className:"ExtensionList"},this.categorizedExtensions[t].map((function(t){return n.extensionWidget(t)}))))},e.extensionWidget=function(t){return m("li",{className:"ExtensionListItem "+(N(t.id)?"":"disabled")},m(I.Z,{href:app.route("extension",{id:t.id})},m("div",{className:"ExtensionListItem-content"},m("span",{className:"ExtensionListItem-icon ExtensionIcon",style:t.icon},t.icon?(0,P.Z)(t.icon.name):""),m("span",{className:"ExtensionListItem-title"},t.extra["flarum-extension"].title))))},n}(w);window.flreg.add("components/ExtensionsWidget",D);var S=e(9756),C=e(453),k=e(833),B=e(1017),A=function(t){function n(){return t.apply(this,arguments)||this}return(0,i.Z)(n,t),n.prototype.view=function(){var t=this.attrs,n=t.options,e=t.onchange,a=t.value,s=t.disabled;return m("span",{className:"Select"},m("select",{className:"Select-input FormControl",onchange:e?(0,B.Z)("value",e.bind(this)):void 0,value:a,disabled:s},Object.keys(n).map((function(t){return m("option",{value:t},n[t])}))),(0,P.Z)("fas fa-sort",{className:"Select-caret"}))},n}(o.Z);window.flreg.add("components/Select",A);var T=e(1650),M=e(1024);function O(t){var n=JSON.parse(JSON.stringify(app.data.settings));return(0,u.Z)(app.data.settings,t),app.request({method:"POST",url:app.forum.attribute("apiUrl")+"/settings",body:t}).catch((function(t){throw app.data.settings=n,t}))}window.flreg.add("utils/saveSettings",O);var G=function(t){function n(){return t.apply(this,arguments)||this}return(0,i.Z)(n,t),n.prototype.view=function(t){return[m("div",{className:(0,T.Z)(["AdminHeader",this.attrs.className])},m("div",{className:"container"},m("h2",null,(0,P.Z)(this.attrs.icon),t.children),m("div",{className:"AdminHeader-description"},this.attrs.description)))]},n}(o.Z);window.flreg.add("components/AdminHeader",G);var F=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.oninit=function(n){t.prototype.oninit.call(this,n),this.settings={},this.loading=!1},e.view=function(){var t=(0,T.Z)(["AdminPage",this.headerInfo().className]);return m("div",{className:t},this.header(),m("div",{className:"container"},this.content()))},e.content=function(){return""},e.submitButton=function(){return m(b.Z,{onclick:this.saveSettings.bind(this),className:"Button Button--primary",loading:this.loading,disabled:!this.isChanged()},app.translator.trans("core.admin.settings.submit_button"))},e.header=function(){var t=this.headerInfo();return m(G,{icon:t.icon,description:t.description,className:t.className+"-header"},t.title)},e.headerInfo=function(){return{className:"",icon:"",title:"",description:""}},e.buildSettingComponent=function(t){if("function"==typeof t)return t.call(this);var n=t.setting,e=t.help,a=(0,S.Z)(t,["setting","help"]);delete a.help;var s=this.setting([n])();return["bool","checkbox","switch","boolean"].includes(a.type)?m("div",{className:"Form-group"},m(k.Z,(0,u.Z)({state:!!s&&"0"!==s,onchange:this.settings[n]},a),a.label),m("div",{className:"helpText"},e)):["select","dropdown","selectdropdown"].includes(a.type)?m("div",{className:"Form-group"},m("label",null,a.label),m("div",{className:"helpText"},e),m(A,(0,u.Z)({value:s||a.default,options:a.options,buttonClassName:"Button",onchange:this.settings[n]},a))):(a.className=(0,T.Z)(["FormControl",a.className]),m("div",{className:"Form-group"},a.label?m("label",null,a.label):"",m("div",{className:"helpText"},e),m("input",(0,u.Z)({type:a.type,bidi:this.setting(n)},a))))},e.onsaved=function(){this.loading=!1,app.alerts.show({type:"success"},app.translator.trans("core.admin.settings.saved_message"))},e.setting=function(t,n){return void 0===n&&(n=""),this.settings[t]=this.settings[t]||(0,M.Z)(app.data.settings[t]||n),this.settings[t]},e.dirty=function(){var t=this,n={};return Object.keys(this.settings).forEach((function(e){var a=t.settings[e]();a!==app.data.settings[e]&&(n[e]=a)})),n},e.isChanged=function(){return Object.keys(this.dirty()).length},e.saveSettings=function(t){return t.preventDefault(),app.alerts.clear(),this.loading=!0,O(this.dirty()).then(this.onsaved.bind(this))},n}(C.Z);window.flreg.add("components/AdminPage",F);var U=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.headerInfo=function(){return{className:"DashboardPage",icon:"fas fa-chart-bar",title:app.translator.trans("core.admin.dashboard.title"),description:app.translator.trans("core.admin.dashboard.description")}},e.content=function(){return this.availableWidgets().toArray()},e.availableWidgets=function(){var t=new l.Z;return t.add("status",m(Z,null),30),t.add("extensions",m(D,null),10),t},n}(F);window.flreg.add("components/DashboardPage",U);var H=e(4926),L=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.oninit=function(n){var e=this;t.prototype.oninit.call(this,n),this.localeOptions={};var a=app.data.locales;for(var s in a)this.localeOptions[s]=a[s]+" ("+s+")";this.displayNameOptions={},app.data.displayNameDrivers.forEach((function(t){this.displayNameOptions[t]=t}),this),this.slugDriverOptions={},Object.keys(app.data.slugDrivers).forEach((function(t){e.slugDriverOptions[t]={},app.data.slugDrivers[t].forEach((function(n){e.slugDriverOptions[t][n]=n}))}))},e.headerInfo=function(){return{className:"BasicsPage",icon:"fas fa-pencil-alt",title:app.translator.trans("core.admin.basics.title"),description:app.translator.trans("core.admin.basics.description")}},e.content=function(){var t=this;return[m("div",{className:"Form"},this.buildSettingComponent({type:"text",setting:"forum_title",label:app.translator.trans("core.admin.basics.forum_title_heading")}),this.buildSettingComponent({type:"text",setting:"forum_description",label:app.translator.trans("core.admin.basics.forum_description_heading"),help:app.translator.trans("core.admin.basics.forum_description_text")}),Object.keys(this.localeOptions).length>1?[this.buildSettingComponent({type:"select",setting:"default_locale",options:this.localeOptions,label:app.translator.trans("core.admin.basics.default_language_heading")}),this.buildSettingComponent({type:"switch",setting:"show_language_selector",label:app.translator.trans("core.admin.basics.show_language_selector_label")})]:"",m(H.Z,{className:"BasicsPage-homePage Form-group",label:app.translator.trans("core.admin.basics.home_page_heading")},m("div",{className:"helpText"},app.translator.trans("core.admin.basics.home_page_text")),this.homePageItems().toArray().map((function(n){var e=n.path,a=n.label;return m("label",{className:"checkbox"},m("input",{type:"radio",name:"homePage",value:e,bidi:t.setting("default_route")}),a)}))),m("div",{className:"Form-group BasicsPage-welcomeBanner-input"},m("label",null,app.translator.trans("core.admin.basics.welcome_banner_heading")),m("div",{className:"helpText"},app.translator.trans("core.admin.basics.welcome_banner_text")),m("input",{type:"text",className:"FormControl",bidi:this.setting("welcome_title")}),m("textarea",{className:"FormControl",bidi:this.setting("welcome_message")})),Object.keys(this.displayNameOptions).length>1?this.buildSettingComponent({type:"select",setting:"display_name_driver",options:this.displayNameOptions,label:app.translator.trans("core.admin.basics.display_name_heading"),help:app.translator.trans("core.admin.basics.display_name_text")}):"",Object.keys(this.slugDriverOptions).map((function(n){var e=t.slugDriverOptions[n];if(Object.keys(e).length>1)return t.buildSettingComponent({type:"select",setting:"slug_driver_"+n,options:e,label:app.translator.trans("core.admin.basics.slug_driver_heading",{model:n}),help:app.translator.trans("core.admin.basics.slug_driver_text",{model:n})})})),this.submitButton())]},e.homePageItems=function(){var t=new l.Z;return t.add("allDiscussions",{path:"/all",label:app.translator.trans("core.admin.basics.all_discussions_label")}),t},n}(F);window.flreg.add("components/BasicsPage",L);var R=e(7880),j=e(9048),q=e(4032),W=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.oninit=function(n){t.prototype.oninit.call(this,n),this.group=this.attrs.group||app.store.createRecord("groups"),this.nameSingular=(0,M.Z)(this.group.nameSingular()||""),this.namePlural=(0,M.Z)(this.group.namePlural()||""),this.icon=(0,M.Z)(this.group.icon()||""),this.color=(0,M.Z)(this.group.color()||""),this.isHidden=(0,M.Z)(this.group.isHidden()||!1)},e.className=function(){return"EditGroupModal Modal--small"},e.title=function(){return[this.color()||this.icon()?j.Z.component({icon:this.icon(),style:{backgroundColor:this.color()}}):""," ",this.namePlural()||app.translator.trans("core.admin.edit_group.title")]},e.content=function(){return m("div",{className:"Modal-body"},m("div",{className:"Form"},this.fields().toArray()))},e.fields=function(){var t=new l.Z;return t.add("name",m("div",{className:"Form-group"},m("label",null,app.translator.trans("core.admin.edit_group.name_label")),m("div",{className:"EditGroupModal-name-input"},m("input",{className:"FormControl",placeholder:app.translator.trans("core.admin.edit_group.singular_placeholder"),bidi:this.nameSingular}),m("input",{className:"FormControl",placeholder:app.translator.trans("core.admin.edit_group.plural_placeholder"),bidi:this.namePlural}))),30),t.add("color",m("div",{className:"Form-group"},m("label",null,app.translator.trans("core.admin.edit_group.color_label")),m("input",{className:"FormControl",placeholder:"#aaaaaa",bidi:this.color})),20),t.add("icon",m("div",{className:"Form-group"},m("label",null,app.translator.trans("core.admin.edit_group.icon_label")),m("div",{className:"helpText"},app.translator.trans("core.admin.edit_group.icon_text",{a:m("a",{href:"https://fontawesome.com/icons?m=free",tabindex:"-1"})})),m("input",{className:"FormControl",placeholder:"fas fa-bolt",bidi:this.icon})),10),t.add("hidden",m("div",{className:"Form-group"},k.Z.component({state:!!Number(this.isHidden()),onchange:this.isHidden},app.translator.trans("core.admin.edit_group.hide_label"))),10),t.add("submit",m("div",{className:"Form-group"},b.Z.component({type:"submit",className:"Button Button--primary EditGroupModal-save",loading:this.loading},app.translator.trans("core.admin.edit_group.submit_button")),this.group.exists&&this.group.id()!==q.Z.ADMINISTRATOR_ID?m("button",{type:"button",className:"Button EditGroupModal-delete",onclick:this.deleteGroup.bind(this)},app.translator.trans("core.admin.edit_group.delete_button")):""),-10),t},e.submitData=function(){return{nameSingular:this.nameSingular(),namePlural:this.namePlural(),color:this.color(),icon:this.icon(),isHidden:this.isHidden()}},e.onsubmit=function(t){var n=this;t.preventDefault(),this.loading=!0,this.group.save(this.submitData(),{errorHandler:this.onerror.bind(this)}).then(this.hide.bind(this)).catch((function(){n.loading=!1,m.redraw()}))},e.deleteGroup=function(){confirm(app.translator.trans("core.admin.edit_group.delete_confirmation"))&&(this.group.delete().then((function(){return m.redraw()})),this.hide())},n}(y.Z);window.flreg.add("components/EditGroupModal",W);var z=e(5128);function V(t){var n=app.store.getById("groups",t);return n?R.Z.component({group:n,label:null}):""}function J(t,n){return app.getRequiredPermissions(n).forEach((function(n){var e=app.data.permissions[n]||[];-1!==e.indexOf(q.Z.GUEST_ID)||(t=-1!==e.indexOf(q.Z.MEMBER_ID)?t.filter((function(t){return t!==q.Z.GUEST_ID})):-1!==t.indexOf(q.Z.MEMBER_ID)?e:e.filter((function(n){return-1!==t.indexOf(n)}))),t=J(t,n)})),t}var K=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t),n.initAttrs=function(n){t.initAttrs.call(this,n),n.className="PermissionDropdown",n.buttonClassName="Button Button--text"};var e=n.prototype;return e.view=function(n){var e=this,a=[],s=app.data.permissions[this.attrs.permission]||[],i=-1!==(s=J(s,this.attrs.permission)).indexOf(q.Z.GUEST_ID),r=-1!==s.indexOf(q.Z.MEMBER_ID),o=app.store.getById("groups",q.Z.ADMINISTRATOR_ID);return this.attrs.label=i?j.Z.component({icon:"fas fa-globe"}):r?j.Z.component({icon:"fas fa-user"}):[V(q.Z.ADMINISTRATOR_ID),s.map(V)],this.showing&&(this.attrs.allowGuest&&a.push(b.Z.component({icon:!i||"fas fa-check",onclick:function(){return e.save([q.Z.GUEST_ID])},disabled:this.isGroupDisabled(q.Z.GUEST_ID)},[j.Z.component({icon:"fas fa-globe"})," ",app.translator.trans("core.admin.permissions_controls.everyone_button")])),a.push(b.Z.component({icon:!r||"fas fa-check",onclick:function(){return e.save([q.Z.MEMBER_ID])},disabled:this.isGroupDisabled(q.Z.MEMBER_ID)},[j.Z.component({icon:"fas fa-user"})," ",app.translator.trans("core.admin.permissions_controls.members_button")]),z.Z.component(),b.Z.component({icon:!(!i&&!r)||"fas fa-check",disabled:!i&&!r,onclick:function(t){t.shiftKey&&t.stopPropagation(),e.save([])}},[V(o.id())," ",o.namePlural()])),[].push.apply(a,app.store.all("groups").filter((function(t){return-1===[q.Z.ADMINISTRATOR_ID,q.Z.GUEST_ID,q.Z.MEMBER_ID].indexOf(t.id())})).map((function(t){return b.Z.component({icon:-1===s.indexOf(t.id())||"fas fa-check",onclick:function(n){n.shiftKey&&n.stopPropagation(),e.toggle(t.id())},disabled:e.isGroupDisabled(t.id())&&e.isGroupDisabled(q.Z.MEMBER_ID)&&e.isGroupDisabled(q.Z.GUEST_ID)},[V(t.id())," ",t.namePlural()])})))),t.prototype.view.call(this,(0,u.Z)({},n,{children:a}))},e.save=function(t){var n=this.attrs.permission;app.data.permissions[n]=t,app.request({method:"POST",url:app.forum.attribute("apiUrl")+"/permission",body:{permission:n,groupIds:t}})},e.toggle=function(t){var n=this.attrs.permission,e=app.data.permissions[n]||[],a=e.indexOf(t);-1!==a?e.splice(a,1):(e.push(t),e=e.filter((function(t){return-1===[q.Z.GUEST_ID,q.Z.MEMBER_ID].indexOf(t)}))),this.save(e)},e.isGroupDisabled=function(t){return-1===J([t],this.attrs.permission).indexOf(t)},n}(g.Z);window.flreg.add("components/PermissionDropdown",K);var Q=e(9349),X=function(t){function n(){return t.apply(this,arguments)||this}return(0,i.Z)(n,t),n.initAttrs=function(n){t.initAttrs.call(this,n),n.className="SettingDropdown",n.buttonClassName="Button Button--text",n.caretIcon="fas fa-caret-down",n.defaultLabel="Custom"},n.prototype.view=function(n){var e=this;return t.prototype.view.call(this,(0,u.Z)({},n,{children:this.attrs.options.map((function(t){var n,a=t.value,s=t.label,i=app.data.settings[e.attrs.key]===a;return b.Z.component({icon:!i||"fas fa-check",onclick:O.bind(e,(n={},n[e.attrs.key]=a,n)),active:i},s)}))}))},n}(Q.Z);window.flreg.add("components/SettingDropdown",X);var Y=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.view=function(){var t=this.scopeItems().toArray(),n=function(n){return t.map((function(t){return m("td",null,t.render(n))}))};return m("table",{className:"PermissionGrid"},m("thead",null,m("tr",null,m("td",null),t.map((function(t){return m("th",null,t.label," ",t.onremove?b.Z.component({icon:"fas fa-times",className:"Button Button--text PermissionGrid-removeScope",onclick:t.onremove}):"")})),m("th",null,this.scopeControlItems().toArray()))),this.permissionItems().toArray().map((function(t){return m("tbody",null,m("tr",{className:"PermissionGrid-section"},m("th",null,t.label),n(t),m("td",null)),t.children.map((function(t){return m("tr",{className:"PermissionGrid-child"},m("th",null,(0,P.Z)(t.icon),t.label),n(t),m("td",null))})))})))},e.permissionItems=function(){var t=new l.Z;return t.add("view",{label:app.translator.trans("core.admin.permissions.read_heading"),children:this.viewItems().toArray()},100),t.add("start",{label:app.translator.trans("core.admin.permissions.create_heading"),children:this.startItems().toArray()},90),t.add("reply",{label:app.translator.trans("core.admin.permissions.participate_heading"),children:this.replyItems().toArray()},80),t.add("moderate",{label:app.translator.trans("core.admin.permissions.moderate_heading"),children:this.moderateItems().toArray()},70),t},e.viewItems=function(){var t=new l.Z;return t.add("viewDiscussions",{icon:"fas fa-eye",label:app.translator.trans("core.admin.permissions.view_discussions_label"),permission:"viewDiscussions",allowGuest:!0},100),t.add("viewHiddenGroups",{icon:"fas fa-users",label:app.translator.trans("core.admin.permissions.view_hidden_groups_label"),permission:"viewHiddenGroups"},100),t.add("viewUserList",{icon:"fas fa-users",label:app.translator.trans("core.admin.permissions.view_user_list_label"),permission:"viewUserList",allowGuest:!0},100),t.add("signUp",{icon:"fas fa-user-plus",label:app.translator.trans("core.admin.permissions.sign_up_label"),setting:function(){return X.component({key:"allow_sign_up",options:[{value:"1",label:app.translator.trans("core.admin.permissions_controls.signup_open_button")},{value:"0",label:app.translator.trans("core.admin.permissions_controls.signup_closed_button")}]})}},90),t.add("viewLastSeenAt",{icon:"far fa-clock",label:app.translator.trans("core.admin.permissions.view_last_seen_at_label"),permission:"user.viewLastSeenAt"}),t.merge(app.extensionData.getAllExtensionPermissions("view")),t},e.startItems=function(){var t=new l.Z;return t.add("start",{icon:"fas fa-edit",label:app.translator.trans("core.admin.permissions.start_discussions_label"),permission:"startDiscussion"},100),t.add("allowRenaming",{icon:"fas fa-i-cursor",label:app.translator.trans("core.admin.permissions.allow_renaming_label"),setting:function(){var t=parseInt(app.data.settings.allow_renaming,10);return X.component({defaultLabel:t?app.translator.transChoice("core.admin.permissions_controls.allow_some_minutes_button",t,{count:t}):app.translator.trans("core.admin.permissions_controls.allow_indefinitely_button"),key:"allow_renaming",options:[{value:"-1",label:app.translator.trans("core.admin.permissions_controls.allow_indefinitely_button")},{value:"10",label:app.translator.trans("core.admin.permissions_controls.allow_ten_minutes_button")},{value:"reply",label:app.translator.trans("core.admin.permissions_controls.allow_until_reply_button")}]})}},90),t.merge(app.extensionData.getAllExtensionPermissions("start")),t},e.replyItems=function(){var t=new l.Z;return t.add("reply",{icon:"fas fa-reply",label:app.translator.trans("core.admin.permissions.reply_to_discussions_label"),permission:"discussion.reply"},100),t.add("allowPostEditing",{icon:"fas fa-pencil-alt",label:app.translator.trans("core.admin.permissions.allow_post_editing_label"),setting:function(){var t=parseInt(app.data.settings.allow_post_editing,10);return X.component({defaultLabel:t?app.translator.transChoice("core.admin.permissions_controls.allow_some_minutes_button",t,{count:t}):app.translator.trans("core.admin.permissions_controls.allow_indefinitely_button"),key:"allow_post_editing",options:[{value:"-1",label:app.translator.trans("core.admin.permissions_controls.allow_indefinitely_button")},{value:"10",label:app.translator.trans("core.admin.permissions_controls.allow_ten_minutes_button")},{value:"reply",label:app.translator.trans("core.admin.permissions_controls.allow_until_reply_button")}]})}},90),t.merge(app.extensionData.getAllExtensionPermissions("reply")),t},e.moderateItems=function(){var t=new l.Z;return t.add("viewIpsPosts",{icon:"fas fa-bullseye",label:app.translator.trans("core.admin.permissions.view_post_ips_label"),permission:"discussion.viewIpsPosts"},110),t.add("renameDiscussions",{icon:"fas fa-i-cursor",label:app.translator.trans("core.admin.permissions.rename_discussions_label"),permission:"discussion.rename"},100),t.add("hideDiscussions",{icon:"far fa-trash-alt",label:app.translator.trans("core.admin.permissions.delete_discussions_label"),permission:"discussion.hide"},90),t.add("deleteDiscussions",{icon:"fas fa-times",label:app.translator.trans("core.admin.permissions.delete_discussions_forever_label"),permission:"discussion.delete"},80),t.add("postWithoutThrottle",{icon:"fas fa-swimmer",label:app.translator.trans("core.admin.permissions.post_without_throttle_label"),permission:"postWithoutThrottle"},70),t.add("editPosts",{icon:"fas fa-pencil-alt",label:app.translator.trans("core.admin.permissions.edit_posts_label"),permission:"discussion.editPosts"},70),t.add("hidePosts",{icon:"far fa-trash-alt",label:app.translator.trans("core.admin.permissions.delete_posts_label"),permission:"discussion.hidePosts"},60),t.add("deletePosts",{icon:"fas fa-times",label:app.translator.trans("core.admin.permissions.delete_posts_forever_label"),permission:"discussion.deletePosts"},60),t.add("userEditCredentials",{icon:"fas fa-user-cog",label:app.translator.trans("core.admin.permissions.edit_users_credentials_label"),permission:"user.editCredentials"},60),t.add("userEditGroups",{icon:"fas fa-users-cog",label:app.translator.trans("core.admin.permissions.edit_users_groups_label"),permission:"user.editGroups"},60),t.add("userEdit",{icon:"fas fa-address-card",label:app.translator.trans("core.admin.permissions.edit_users_label"),permission:"user.edit"},60),t.merge(app.extensionData.getAllExtensionPermissions("moderate")),t},e.scopeItems=function(){var t=new l.Z;return t.add("global",{label:app.translator.trans("core.admin.permissions.global_heading"),render:function(t){return t.setting?t.setting():t.permission?K.component({permission:t.permission,allowGuest:t.allowGuest}):""}},100),t},e.scopeControlItems=function(){return new l.Z},n}(o.Z);window.flreg.add("components/PermissionGrid",Y);var tt=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.headerInfo=function(){return{className:"PermissionsPage",icon:"fas fa-key",title:app.translator.trans("core.admin.permissions.title"),description:app.translator.trans("core.admin.permissions.description")}},e.content=function(){return[m("div",{className:"PermissionsPage-groups"},app.store.all("groups").filter((function(t){return-1===[q.Z.GUEST_ID,q.Z.MEMBER_ID].indexOf(t.id())})).map((function(t){return m("button",{className:"Button Group",onclick:function(){return app.modal.show(W,{group:t})}},R.Z.component({group:t,className:"Group-icon",label:null}),m("span",{className:"Group-name"},t.namePlural()))})),m("button",{className:"Button Group Group--add",onclick:function(){return app.modal.show(W)}},(0,P.Z)("fas fa-plus",{className:"Group-icon"}),m("span",{className:"Group-name"},app.translator.trans("core.admin.permissions.new_group_button")))),m("div",{className:"PermissionsPage-permissions"},Y.component())]},n}(F);window.flreg.add("components/PermissionsPage",tt);var nt=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.oninit=function(n){t.prototype.oninit.call(this,n),this.settings={},this.loading=!1},e.form=function(){return""},e.content=function(){return m("div",{className:"Modal-body"},m("div",{className:"Form"},this.form(),m("div",{className:"Form-group"},this.submitButton())))},e.submitButton=function(){return m(b.Z,{type:"submit",className:"Button Button--primary",loading:this.loading,disabled:!this.changed()},app.translator.trans("core.admin.settings.submit_button"))},e.setting=function(t,n){return void 0===n&&(n=""),this.settings[t]=this.settings[t]||(0,M.Z)(app.data.settings[t]||n),this.settings[t]},e.dirty=function(){var t=this,n={};return Object.keys(this.settings).forEach((function(e){var a=t.settings[e]();a!==app.data.settings[e]&&(n[e]=a)})),n},e.changed=function(){return Object.keys(this.dirty()).length},e.onsubmit=function(t){t.preventDefault(),this.loading=!0,O(this.dirty()).then(this.onsaved.bind(this),this.loaded.bind(this))},e.onsaved=function(){this.hide()},n}(y.Z);window.flreg.add("components/SettingsModal",nt);var et=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.className=function(){return"EditCustomCssModal Modal--large"},e.title=function(){return app.translator.trans("core.admin.edit_css.title")},e.form=function(){return[m("p",null,app.translator.trans("core.admin.edit_css.customize_text",{a:m("a",{href:"https://github.com/flarum/core/tree/master/less",target:"_blank"})})),m("div",{className:"Form-group"},m("textarea",{className:"FormControl",rows:"30",bidi:this.setting("custom_less")}))]},e.onsaved=function(){window.location.reload()},n}(nt);window.flreg.add("components/EditCustomCssModal",et);var at=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.className=function(){return"EditCustomHeaderModal Modal--large"},e.title=function(){return app.translator.trans("core.admin.edit_header.title")},e.form=function(){return[m("p",null,app.translator.trans("core.admin.edit_header.customize_text")),m("div",{className:"Form-group"},m("textarea",{className:"FormControl",rows:"30",bidi:this.setting("custom_header")}))]},e.onsaved=function(){window.location.reload()},n}(nt);window.flreg.add("components/EditCustomHeaderModal",at);var st=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.className=function(){return"EditCustomFooterModal Modal--large"},e.title=function(){return app.translator.trans("core.admin.edit_footer.title")},e.form=function(){return[m("p",null,app.translator.trans("core.admin.edit_footer.customize_text")),m("div",{className:"Form-group"},m("textarea",{className:"FormControl",rows:"30",bidi:this.setting("custom_footer")}))]},e.onsaved=function(){window.location.reload()},n}(nt);window.flreg.add("components/EditCustomFooterModal",st);var it=function(t){function n(){for(var n,e=arguments.length,a=new Array(e),i=0;i').appendTo("body").hide().trigger("click").on("change",(function(n){var e=new FormData;e.append(t.attrs.name,$(n.target)[0].files[0]),t.loading=!0,m.redraw(),app.request({method:"POST",url:t.resourceUrl(),serialize:function(t){return t},body:e}).then(t.success.bind(t),t.failure.bind(t))}))},e.remove=function(){this.loading=!0,m.redraw(),app.request({method:"DELETE",url:this.resourceUrl()}).then(this.success.bind(this),this.failure.bind(this))},e.resourceUrl=function(){return app.forum.attribute("apiUrl")+"/"+this.attrs.name},e.success=function(t){window.location.reload()},e.failure=function(t){this.loading=!1,m.redraw()},n}(b.Z);window.flreg.add("components/UploadImageButton",it);var rt=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.headerInfo=function(){return{className:"AppearancePage",icon:"fas fa-paint-brush",title:app.translator.trans("core.admin.appearance.title"),description:app.translator.trans("core.admin.appearance.description")}},e.content=function(){return[m("div",{className:"Form"},m("fieldset",{className:"AppearancePage-colors"},m("legend",null,app.translator.trans("core.admin.appearance.colors_heading")),m("div",{className:"helpText"},app.translator.trans("core.admin.appearance.colors_text")),m("div",{className:"AppearancePage-colors-input"},this.buildSettingComponent({type:"text",setting:"theme_primary_color",placeholder:"#aaaaaa"}),this.buildSettingComponent({type:"text",setting:"theme_secondary_color",placeholder:"#aaaaaa"})),this.buildSettingComponent({type:"switch",setting:"theme_dark_mode",label:app.translator.trans("core.admin.appearance.dark_mode_label")}),this.buildSettingComponent({type:"switch",setting:"theme_colored_header",label:app.translator.trans("core.admin.appearance.colored_header_label")}),this.submitButton())),m("fieldset",null,m("legend",null,app.translator.trans("core.admin.appearance.logo_heading")),m("div",{className:"helpText"},app.translator.trans("core.admin.appearance.logo_text")),m(it,{name:"logo"})),m("fieldset",null,m("legend",null,app.translator.trans("core.admin.appearance.favicon_heading")),m("div",{className:"helpText"},app.translator.trans("core.admin.appearance.favicon_text")),m(it,{name:"favicon"})),m("fieldset",null,m("legend",null,app.translator.trans("core.admin.appearance.custom_header_heading")),m("div",{className:"helpText"},app.translator.trans("core.admin.appearance.custom_header_text")),b.Z.component({className:"Button",onclick:function(){return app.modal.show(at)}},app.translator.trans("core.admin.appearance.edit_header_button"))),m("fieldset",null,m("legend",null,app.translator.trans("core.admin.appearance.custom_footer_heading")),m("div",{className:"helpText"},app.translator.trans("core.admin.appearance.custom_footer_text")),b.Z.component({className:"Button",onclick:function(){return app.modal.show(st)}},app.translator.trans("core.admin.appearance.edit_footer_button"))),m("fieldset",null,m("legend",null,app.translator.trans("core.admin.appearance.custom_styles_heading")),m("div",{className:"helpText"},app.translator.trans("core.admin.appearance.custom_styles_text")),b.Z.component({className:"Button",onclick:function(){return app.modal.show(et)}},app.translator.trans("core.admin.appearance.edit_css_button")))]},e.onsaved=function(){window.location.reload()},e.saveSettings=function(n){n.preventDefault();var e=/^#[0-9a-f]{3}([0-9a-f]{3})?$/i;e.test(this.settings.theme_primary_color())&&e.test(this.settings.theme_secondary_color())?t.prototype.saveSettings.call(this,n):alert(app.translator.trans("core.admin.appearance.enter_hex_message"))},n}(F);window.flreg.add("components/AppearancePage",rt);var ot=e(7607),lt=e(8726),pt=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.oninit=function(n){t.prototype.oninit.call(this,n),this.sendingTest=!1,this.refresh()},e.headerInfo=function(){return{className:"MailPage",icon:"fas fa-envelope",title:app.translator.trans("core.admin.email.title"),description:app.translator.trans("core.admin.email.description")}},e.refresh=function(){var t=this;this.loading=!0,this.status={sending:!1,errors:{}},app.request({method:"GET",url:app.forum.attribute("apiUrl")+"/mail/settings"}).then((function(n){t.driverFields=n.data.attributes.fields,t.status.sending=n.data.attributes.sending,t.status.errors=n.data.attributes.errors,t.loading=!1,m.redraw()}))},e.content=function(){var t=this;if(this.loading)return m(lt.Z,null);var n=this.driverFields[this.setting("mail_driver")()],e=Object.keys(n);return m("div",{className:"Form"},this.buildSettingComponent({type:"text",setting:"mail_from",label:app.translator.trans("core.admin.email.addresses_heading"),className:"MailPage-MailSettings"}),this.buildSettingComponent({type:"select",setting:"mail_driver",options:Object.keys(this.driverFields).reduce((function(t,n){var e;return(0,u.Z)({},t,((e={})[n]=n,e))}),{}),label:app.translator.trans("core.admin.email.driver_heading"),className:"MailPage-MailSettings"}),this.status.sending||ot.Z.component({dismissible:!1},app.translator.trans("core.admin.email.not_sending_message")),e.length>0&&m(H.Z,{label:app.translator.trans("core.admin.email."+this.setting("mail_driver")()+"_heading"),className:"MailPage-MailSettings"},m("div",{className:"MailPage-MailSettings-input"},e.map((function(e){var a=n[e];return[t.buildSettingComponent({type:"string"==typeof t.setting(e)()?"text":"select",label:app.translator.trans("core.admin.email."+e+"_label"),setting:e,options:a}),t.status.errors[e]&&m("p",{className:"ValidationError"},t.status.errors[e])]})))),this.submitButton(),m(H.Z,{label:app.translator.trans("core.admin.email.send_test_mail_heading"),className:"MailPage-MailSettings"},m("div",{className:"helpText"},app.translator.trans("core.admin.email.send_test_mail_text",{email:app.session.user.email()})),b.Z.component({className:"Button Button--primary",disabled:this.sendingTest||this.isChanged(),onclick:function(){return t.sendTestEmail()}},app.translator.trans("core.admin.email.send_test_mail_button"))))},e.sendTestEmail=function(){var t=this;this.saving||this.sendingTest||(this.sendingTest=!0,app.alerts.dismiss(this.testEmailSuccessAlert),app.request({method:"POST",url:app.forum.attribute("apiUrl")+"/mail/test"}).then((function(n){t.sendingTest=!1,t.testEmailSuccessAlert=app.alerts.show({type:"success"},app.translator.trans("core.admin.email.send_test_mail_success"))})).catch((function(n){throw t.sendingTest=!1,m.redraw(),n})))},e.saveSettings=function(n){t.prototype.saveSettings.call(this,n).then(this.refresh())},n}(F);function ct(t){if(2===t.length)return app.translator.trans("core.lib.series.two_text",{first:t[0],second:t[1]});if(t.length>=3){var n=t.slice(1,t.length-1).reduce((function(t,n){return t.concat([n,app.translator.trans("core.lib.series.glue_text")])}),[]).slice(0,-1);return app.translator.trans("core.lib.series.three_text",{first:t[0],second:n,third:t[t.length-1]})}return t}window.flreg.add("components/MailPage",pt),window.flreg.add("helpers/punctuateSeries",ct);var dt=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.oninit=function(n){t.prototype.oninit.call(this,n),this.extensionId=this.attrs.extensionId},e.permissionItems=function(){var n=t.prototype.permissionItems.call(this);return n.items=Object.entries(n.items).filter((function(t){t[0];return t[1].content.children.length>0})).reduce((function(t,n){var e=n[0],a=n[1];return t[e]=a,t}),{}),n},e.viewItems=function(){return app.extensionData.getExtensionPermissions(this.extensionId,"view")||new l.Z},e.startItems=function(){return app.extensionData.getExtensionPermissions(this.extensionId,"start")||new l.Z},e.replyItems=function(){return app.extensionData.getExtensionPermissions(this.extensionId,"reply")||new l.Z},e.moderateItems=function(){return app.extensionData.getExtensionPermissions(this.extensionId,"moderate")||new l.Z},e.scopeControlItems=function(){var t=new l.Z;return t.add("configureScopes",m(b.Z,{className:"Button Button--text",onclick:function(){return m.route.set(app.route("permissions"))}},app.translator.trans("core.admin.extension.configure_scopes"))),t},n}(Y);window.flreg.add("components/ExtensionPermissionGrid",dt);var ut=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.oninit=function(n){if(t.prototype.oninit.call(this,n),this.extension=app.data.extensions[this.attrs.id],this.changingState=!1,this.infoFields={discuss:"fas fa-comment-alt",documentation:"fas fa-book",support:"fas fa-life-ring",website:"fas fa-link",donate:"fas fa-donate",source:"fas fa-code"},!this.extension)return m.route.set(app.route("dashboard"))},e.className=function(){return this.extension?this.extension.id+"-Page":""},e.view=function(){return this.extension?m("div",{className:"ExtensionPage "+this.className()},this.header(),this.isEnabled()?m("div",{className:"ExtensionPage-body"},this.sections().toArray()):m("div",{className:"container"},m("h3",{className:"ExtensionPage-subHeader"},app.translator.trans("core.admin.extension.enable_to_see")))):null},e.header=function(){var t=this.isEnabled();return[m("div",{className:"ExtensionPage-header"},m("div",{className:"container"},m("div",{className:"ExtensionTitle"},m("span",{className:"ExtensionIcon",style:this.extension.icon},this.extension.icon?(0,P.Z)(this.extension.icon.name):""),m("div",{className:"ExtensionName"},m("h2",null,this.extension.extra["flarum-extension"].title)),m("div",{className:"ExtensionPage-headerTopItems"},m("ul",null,(0,p.Z)(this.topItems().toArray())))),m("div",{className:"helpText"},this.extension.description),m("div",{className:"ExtensionPage-headerItems"},m(k.Z,{state:this.changingState?!t:t,loading:this.changingState,onchange:this.toggle.bind(this,this.extension.id)},t?app.translator.trans("core.admin.extension.enabled"):app.translator.trans("core.admin.extension.disabled")),m("aside",{className:"ExtensionInfo"},m("ul",null,(0,p.Z)(this.infoItems().toArray()))))))]},e.sections=function(){var t=new l.Z;return t.add("content",this.content()),t.add("permissions",[m("div",{className:"ExtensionPage-permissions"},m("div",{className:"ExtensionPage-permissions-header"},m("div",{className:"container"},m("h2",{className:"ExtensionTitle"},app.translator.trans("core.admin.extension.permissions_title")))),m("div",{className:"container"},app.extensionData.extensionHasPermissions(this.extension.id)?dt.component({extensionId:this.extension.id}):m("h3",{className:"ExtensionPage-subHeader"},app.translator.trans("core.admin.extension.no_permissions"))))]),t},e.content=function(){var t=app.extensionData.getSettings(this.extension.id);return m("div",{className:"ExtensionPage-settings"},m("div",{className:"container"},t?m("div",{className:"Form"},t.map(this.buildSettingComponent.bind(this)),m("div",{className:"Form-group"},this.submitButton())):m("h3",{className:"ExtensionPage-subHeader"},app.translator.trans("core.admin.extension.no_settings"))))},e.topItems=function(){var t=this,n=new l.Z;if(n.add("version",m("span",{className:"ExtensionVersion"},this.extension.version)),!this.isEnabled()){n.add("uninstall",m(b.Z,{icon:"fas fa-trash-alt",className:"Button Button--primary",onclick:function(){confirm(app.translator.trans("core.admin.extension.confirm_uninstall"))&&(app.request({url:app.forum.attribute("apiUrl")+"/extensions/"+t.extension.id,method:"DELETE"}).then((function(){return window.location.reload()})),app.modal.show(x))}.bind(this)},app.translator.trans("core.admin.extension.uninstall_button")))}return n},e.infoItems=function(){var t=this,n=new l.Z,e=this.extension.links;if(e.authors.length){var a=[];e.authors.map((function(t){a.push(m(I.Z,{href:t.link,external:!0,target:"_blank"},t.name))})),n.add("authors",[(0,P.Z)("fas fa-user"),m("span",null,ct(a))])}return Object.keys(this.infoFields).map((function(a){e[a]&&n.add(a,m(d.Z,{href:e[a],icon:t.infoFields[a],external:!0,target:"_blank"},app.translator.trans("core.admin.extension.info_links."+a)))})),n},e.toggle=function(){var t=this,n=this.isEnabled();this.changingState=!0,app.request({url:app.forum.attribute("apiUrl")+"/extensions/"+this.extension.id,method:"PATCH",body:{enabled:!n},errorHandler:this.onerror.bind(this)}).then((function(){n||localStorage.setItem("enabledExtension",t.extension.id),window.location.reload()})),app.modal.show(x)},e.isEnabled=function(){return N(this.extension.id)},e.onerror=function(t){if(setTimeout((function(){app.modal.close()}),300),this.changingState=!1,409!==t.status)throw t;var n=t.response.errors[0];app.alerts.show({type:"error"},app.translator.trans("core.lib.error."+n.code+"_message",{extension:n.extension,extensions:n.extensions.join(", ")}))},n}(F);window.flreg.add("components/ExtensionPage",ut);var mt=function(t){function n(){return t.apply(this,arguments)||this}return(0,i.Z)(n,t),n.prototype.onmatch=function(n,e,a){var s=app.extensionData.getPage(n.id);return s||t.prototype.onmatch.call(this,n,e,a)},n}(e(2231).Z);(0,r.Z)(mt,"extension",null),window.flreg.add("resolvers/ExtensionPageResolver",mt);var ht=e(2065),ft=e(4807),gt=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.getButtonContent=function(n){var e=t.prototype.getButtonContent.call(this,n),a=app.data.extensions[this.attrs.extensionId],s=this.statusItems(a.id).toArray();return e.unshift(m("span",{className:"ExtensionListItem-icon ExtensionIcon",style:a.icon},a.icon?(0,P.Z)(a.icon.name):"")),e.push(s),e},e.statusItems=function(t){var n=new l.Z;return n.add("enabled",m("span",{class:"ExtensionListItem-Dot "+(N(t)?"enabled":"disabled")})),n},n}(d.Z);window.flreg.add("components/ExtensionLinkButton",gt);var bt=function(t){function n(){return t.apply(this,arguments)||this}(0,i.Z)(n,t);var e=n.prototype;return e.oninit=function(n){t.prototype.oninit.call(this,n),this.query=(0,M.Z)("")},e.view=function(){return m(Q.Z,{className:"AdminNav App-titleControl AdminNav-Main",buttonClassName:"Button"},this.items().toArray().concat(this.extensionItems().toArray()))},e.oncreate=function(n){t.prototype.oncreate.call(this,n),this.scrollToActive()},e.onupdate=function(){this.scrollToActive()},e.scrollToActive=function(){var t=$(".Dropdown-menu").children(".active"),n=$("#admin-navigation"),e=app.previous.type?250:0;t.length>0&&(t[0].offsetTop>n.scrollTop()+n.outerHeight()||t[0].offsetTop+t[0].offsetHeight{function a(t){var n=t.replace(/(<\/p>|
)/g,"$1  ").replace(/]*>/gi," "),e=$("
").html(n);return e.find(a.removeSelectors.join(",")).remove(),e.text().replace(/\s+/g," ").trim()}e.d(n,{AH:()=>a}),a.removeSelectors=["blockquote","script"],window.flreg.add("utils/truncate",(function(t,n,e){return void 0===e&&(e=0),(e>0?"...":"")+t.substring(e,e+n)+(t.length>e+n?"...":"")})),window.flreg.add("utils/slug",(function(t){return t.toLowerCase().replace(/[^a-z0-9]/gi,"-").replace(/-+/g,"-").replace(/-$|^-/g,"")})),window.flreg.add("utils/getPlainContent",a),window.flreg.add("utils/ucfirst",(function(t){return t.substr(0,1).toUpperCase()+t.substr(1)}))}},t=>{t.O(0,[358,997],(()=>{return n=7540,t(t.s=n);var n}));var n=t.O();flarum.core=n}]); //# sourceMappingURL=flarum-core.js.map \ No newline at end of file diff --git a/js/dist/admin/flarum-core.js.map b/js/dist/admin/flarum-core.js.map index 8f4c90dcc..36085ad04 100644 --- a/js/dist/admin/flarum-core.js.map +++ b/js/dist/admin/flarum-core.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://@flarum/core/./src/admin/components/HeaderPrimary.js","webpack://@flarum/core/./src/admin/components/SessionDropdown.js","webpack://@flarum/core/./src/admin/components/HeaderSecondary.js","webpack://@flarum/core/./src/admin/components/DashboardWidget.js","webpack://@flarum/core/./src/admin/components/LoadingModal.js","webpack://@flarum/core/./src/admin/components/StatusWidget.js","webpack://@flarum/core/./src/admin/utils/isExtensionEnabled.js","webpack://@flarum/core/./src/admin/utils/getCategorizedExtensions.js","webpack://@flarum/core/./src/admin/components/ExtensionsWidget.js","webpack://@flarum/core/./src/common/components/Select.js","webpack://@flarum/core/./src/admin/utils/saveSettings.js","webpack://@flarum/core/./src/admin/components/AdminHeader.js","webpack://@flarum/core/./src/admin/components/AdminPage.js","webpack://@flarum/core/./src/admin/components/DashboardPage.js","webpack://@flarum/core/./src/admin/components/BasicsPage.js","webpack://@flarum/core/./src/admin/components/EditGroupModal.js","webpack://@flarum/core/./src/admin/components/PermissionDropdown.js","webpack://@flarum/core/./src/admin/components/SettingDropdown.js","webpack://@flarum/core/./src/admin/components/PermissionGrid.js","webpack://@flarum/core/./src/admin/components/PermissionsPage.js","webpack://@flarum/core/./src/admin/components/SettingsModal.js","webpack://@flarum/core/./src/admin/components/EditCustomCssModal.js","webpack://@flarum/core/./src/admin/components/EditCustomHeaderModal.js","webpack://@flarum/core/./src/admin/components/EditCustomFooterModal.js","webpack://@flarum/core/./src/admin/components/UploadImageButton.js","webpack://@flarum/core/./src/admin/components/AppearancePage.js","webpack://@flarum/core/./src/admin/components/MailPage.js","webpack://@flarum/core/./src/common/helpers/punctuateSeries.js","webpack://@flarum/core/./src/admin/components/ExtensionPermissionGrid.js","webpack://@flarum/core/./src/admin/components/ExtensionPage.js","webpack://@flarum/core/./src/admin/resolvers/ExtensionPageResolver.ts","webpack://@flarum/core/./src/admin/components/ExtensionLinkButton.js","webpack://@flarum/core/./src/admin/components/AdminNav.js","webpack://@flarum/core/./src/admin/utils/ExtensionData.js","webpack://@flarum/core/./src/admin/AdminApplication.js","webpack://@flarum/core/./src/admin/routes.js","webpack://@flarum/core/./src/admin/app.ts","webpack://@flarum/core/./admin.js","webpack://@flarum/core/./src/common/extend.js","webpack://@flarum/core/./src/common/utils/string.ts"],"names":["HeaderPrimary","view","className","listItems","this","items","toArray","config","isInitialized","context","retain","ItemList","Component","window","flreg","add","SessionDropdown","initAttrs","attrs","buttonClassName","menuClassName","vnode","children","getButtonContent","user","app","session","avatar","username","Button","icon","onclick","logout","bind","translator","trans","Dropdown","HeaderSecondary","LinkButton","href","external","target","component","DashboardWidget","content","LoadingModal","title","Modal","StatusWidget","label","handleClearCache","forum","attribute","data","phpVersion","mysqlVersion","e","modal","show","request","method","url","then","location","reload","isExtensionEnabled","name","JSON","parse","settings","extensions_enabled","includes","getCategorizedExtensions","extensions","Object","keys","map","id","extension","category","extra","extensionCategories","push","feature","ExtensionsWidget","oninit","categorizedExtensions","categories","extensionCategory","extensionWidget","Link","route","style","Select","options","onchange","value","disabled","withAttr","undefined","key","saveSettings","oldSettings","stringify","body","error","AdminHeader","classList","description","AdminPage","loading","headerInfo","header","submitButton","isChanged","buildSettingComponent","entry","call","setting","help","componentAttrs","type","Switch","state","bidi","onsaved","alerts","fallback","Stream","dirty","forEach","length","preventDefault","clear","Page","DashboardPage","availableWidgets","BasicsPage","localeOptions","locales","i","displayNameOptions","displayNameDrivers","identifier","slugDriverOptions","slugDrivers","model","option","FieldSet","homePageItems","path","EditGroupModal","group","store","createRecord","nameSingular","namePlural","color","isHidden","Badge","backgroundColor","fields","placeholder","a","tabindex","Number","exists","Group","deleteGroup","submitData","onsubmit","save","errorHandler","onerror","hide","m","redraw","confirm","badgeForId","getById","GroupBadge","filterByRequiredPermissions","groupIds","permission","getRequiredPermissions","required","restrictToGroupIds","permissions","indexOf","filter","PermissionDropdown","everyone","members","adminGroup","showing","allowGuest","isGroupDisabled","Separator","shiftKey","stopPropagation","apply","all","toggle","groupId","index","splice","SettingDropdown","caretIcon","defaultLabel","active","SelectDropdown","PermissionGrid","scopes","scopeItems","permissionCells","scope","render","onremove","scopeControlItems","permissionItems","section","child","viewItems","startItems","replyItems","moderateItems","merge","extensionData","getAllExtensionPermissions","minutes","parseInt","allow_renaming","transChoice","count","allow_post_editing","item","PermissionsPage","SettingsModal","form","changed","loaded","EditCustomCssModal","rows","EditCustomHeaderModal","EditCustomFooterModal","UploadImageButton","remove","src","alt","upload","$","appendTo","click","on","FormData","append","files","resourceUrl","serialize","raw","success","failure","response","AppearancePage","hex","test","alert","MailPage","sendingTest","refresh","status","sending","errors","driverFields","LoadingIndicator","fieldKeys","reduce","memo","val","Alert","dismissible","field","fieldInfo","email","sendTestEmail","saving","dismiss","testEmailSuccessAlert","punctuateSeries","first","second","slice","list","concat","third","ExtensionPermissionGrid","extensionId","permissionCategories","entries","obj","info","getExtensionPermissions","set","ExtensionPage","changingState","infoFields","discuss","documentation","support","website","donate","source","isEnabled","sections","topItems","infoItems","extensionHasPermissions","getSettings","version","links","authors","author","link","enabled","localStorage","setItem","setTimeout","close","code","join","ExtensionPageResolver","onmatch","args","requestedPath","getPage","DefaultResolver","ExtensionLinkButton","statuses","statusItems","unshift","class","AdminNav","query","extensionItems","oncreate","scrollToActive","onupdate","nav","time","previous","offsetTop","scrollTop","outerHeight","offsetHeight","animate","height","toUpperCase","ExtensionData","currentExtension","registerSetting","priority","Math","random","toString","registerPermission","permissionType","registerPage","page","AdminApplication","theme","language","canGoBack","getPrevious","backUrl","back","routes","dashboard","basics","appearance","mail","resolverClass","mount","document","hash","prefix","getElementById","Navigation","drawer","Application","Admin","flarum","exports","extend","object","callback","original","newMethod","getPlainContent","string","html","replace","dom","find","removeSelectors","text","trim","start","substring","toLowerCase","substr"],"mappings":"+NAQqBA,E,sGACnBC,KAAA,WACE,OAAO,QAAIC,UAAU,oBAAmBC,OAAUC,KAAKC,QAAQC,a,EAGjEC,OAAA,SAAOC,EAAeC,GAIpBA,EAAQC,QAAS,G,EAQnBL,MAAA,WACE,OAAO,IAAIM,K,GAlB4BC,KAsB3CC,OAAOC,MAAMC,IAAI,2BAA4Bf,G,+DCpBxBgB,E,6EACZC,UAAP,SAAiBC,GACf,EAAMD,UAAN,UAAgBC,GAEhBA,EAAMhB,UAAY,kBAClBgB,EAAMC,gBAAkB,mCACxBD,EAAME,cAAgB,wB,2BAGxBnB,KAAA,SAAKoB,GACH,mBAAapB,KAAb,qBAAuBoB,EAAvB,CAA8BC,SAAUlB,KAAKC,QAAQC,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T,OAAcyS,EAAO7U,GAAS+U,GAmChC9X,OAAOC,MAAMC,IAAI,gBAAiByX,GAClC3X,OAAOC,MAAMC,IAAI,mBAXV,SAAkB0X,EAAQ7U,EAAQgV,GACvC,IAAMD,EAAWF,EAAO7U,GAExB6U,EAAO7U,GAAU,WAAmB,2BAANgR,EAAM,yBAANA,EAAM,gBAClC,OAAOgE,EAAUpM,MAAMpM,KAAM,CAACuY,EAAS1W,KAAK7B,OAAOiS,OAAOuC,MAG5D,OAAc6D,EAAO7U,GAAS+U,O,4BCpCzB,SAASE,EAAgBC,GAC9B,IAAMC,EAAOD,EAAOE,QAAQ,gBAAiB,aAAaA,QAAQ,iBAAkB,KAE9EC,EAAMvJ,EAAE,UAAUqJ,KAAKA,GAI7B,OAFAE,EAAIC,KAAKL,EAAgBM,gBAAgB1E,KAAK,MAAMnF,SAE7C2J,EAAIG,OAAOJ,QAAQ,OAAQ,KAAKK,O,kBAQzCR,EAAgBM,gBAAkB,CAAC,aAAc,UASjDtY,OAAOC,MAAMC,IAAI,kBAhDV,SAAkB+X,EAAgB3Q,EAAgBmR,GACvD,YADkF,IAA3BA,MAAgB,IAC/DA,EAAQ,EAAI,MAAQ,IAAMR,EAAOS,UAAUD,EAAOA,EAAQnR,IAAW2Q,EAAO3Q,OAASmR,EAAQnR,EAAS,MAAQ,OAgDxHtH,OAAOC,MAAMC,IAAI,cArCV,SAAc+X,GACnB,OAAOA,EACJU,cACAR,QAAQ,cAAe,KACvBA,QAAQ,MAAO,KACfA,QAAQ,SAAU,OAiCvBnY,OAAOC,MAAMC,IAAI,wBAAyB8X,GAC1ChY,OAAOC,MAAMC,IAAI,iBAPV,SAAiB+X,GACtB,OAAOA,EAAOW,OAAO,EAAG,GAAGrD,cAAgB0C,EAAOW,OAAO,Q","file":"admin/flarum-core.js","sourcesContent":["import Component from '../../common/Component';\nimport ItemList from '../../common/utils/ItemList';\nimport listItems from '../../common/helpers/listItems';\n\n/**\n * The `HeaderPrimary` component displays primary header controls. On the\n * default skin, these are shown just to the right of the forum title.\n */\nexport default class HeaderPrimary extends Component {\n view() {\n return
    {listItems(this.items().toArray())}
;\n }\n\n config(isInitialized, context) {\n // Since this component is 'above' the content of the page (that is, it is a\n // part of the global UI that persists between routes), we will flag the DOM\n // to be retained across route changes.\n context.retain = true;\n }\n\n /**\n * Build an item list for the controls.\n *\n * @return {ItemList}\n */\n items() {\n return new ItemList();\n }\n}\n\nwindow.flreg.add('components/HeaderPrimary', HeaderPrimary)","import avatar from '../../common/helpers/avatar';\nimport username from '../../common/helpers/username';\nimport Dropdown from '../../common/components/Dropdown';\nimport Button from '../../common/components/Button';\nimport ItemList from '../../common/utils/ItemList';\n\n/**\n * The `SessionDropdown` component shows a button with the current user's\n * avatar/name, with a dropdown of session controls.\n */\nexport default class SessionDropdown extends Dropdown {\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n\n attrs.className = 'SessionDropdown';\n attrs.buttonClassName = 'Button Button--user Button--flat';\n attrs.menuClassName = 'Dropdown-menu--right';\n }\n\n view(vnode) {\n return super.view({ ...vnode, children: this.items().toArray() });\n }\n\n getButtonContent() {\n const user = app.session.user;\n\n return [avatar(user), ' ', {username(user)}];\n }\n\n /**\n * Build an item list for the contents of the dropdown menu.\n *\n * @return {ItemList}\n */\n items() {\n const items = new ItemList();\n\n items.add(\n 'logOut',\n Button.component(\n {\n icon: 'fas fa-sign-out-alt',\n onclick: app.session.logout.bind(app.session),\n },\n app.translator.trans('core.admin.header.log_out_button')\n ),\n -100\n );\n\n return items;\n }\n}\n\nwindow.flreg.add('components/SessionDropdown', SessionDropdown)","import Component from '../../common/Component';\nimport LinkButton from '../../common/components/LinkButton';\nimport SessionDropdown from './SessionDropdown';\nimport ItemList from '../../common/utils/ItemList';\nimport listItems from '../../common/helpers/listItems';\n\n/**\n * The `HeaderSecondary` component displays secondary header controls.\n */\nexport default class HeaderSecondary extends Component {\n view() {\n return
    {listItems(this.items().toArray())}
;\n }\n\n /**\n * Build an item list for the controls.\n *\n * @return {ItemList}\n */\n items() {\n const items = new ItemList();\n\n items.add(\n 'help',\n \n {app.translator.trans('core.admin.header.get_help')}\n \n );\n\n items.add('session', SessionDropdown.component());\n\n return items;\n }\n}\n\nwindow.flreg.add('components/HeaderSecondary', HeaderSecondary)","import Component from '../../common/Component';\n\nexport default class DashboardWidget extends Component {\n view() {\n return
{this.content()}
;\n }\n\n /**\n * Get the class name to apply to the widget.\n *\n * @return {String}\n */\n className() {\n return '';\n }\n\n /**\n * Get the content of the widget.\n *\n * @return {VirtualElement}\n */\n content() {\n return [];\n }\n}\n\nwindow.flreg.add('components/DashboardWidget', DashboardWidget)","import Modal from '../../common/components/Modal';\n\nexport default class LoadingModal extends Modal {\n /**\n * @inheritdoc\n */\n static isDismissible = false;\n\n className() {\n return 'LoadingModal Modal--small';\n }\n\n title() {\n return app.translator.trans('core.admin.loading.title');\n }\n\n content() {\n return '';\n }\n}\n\nwindow.flreg.add('components/LoadingModal', LoadingModal)","/*\n * This file is part of Flarum.\n *\n * (c) Toby Zerner \n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport DashboardWidget from './DashboardWidget';\nimport listItems from '../../common/helpers/listItems';\nimport ItemList from '../../common/utils/ItemList';\nimport Dropdown from '../../common/components/Dropdown';\nimport Button from '../../common/components/Button';\nimport LoadingModal from './LoadingModal';\n\nexport default class StatusWidget extends DashboardWidget {\n className() {\n return 'StatusWidget';\n }\n\n content() {\n return
    {listItems(this.items().toArray())}
;\n }\n\n items() {\n const items = new ItemList();\n\n items.add(\n 'tools',\n \n \n \n );\n\n items.add('version-flarum', [Flarum,
, app.forum.attribute('version')]);\n items.add('version-php', [PHP,
, app.data.phpVersion]);\n items.add('version-mysql', [MySQL,
, app.data.mysqlVersion]);\n\n return items;\n }\n\n handleClearCache(e) {\n app.modal.show(LoadingModal);\n\n app\n .request({\n method: 'DELETE',\n url: app.forum.attribute('apiUrl') + '/cache',\n })\n .then(() => window.location.reload());\n }\n}\n\nwindow.flreg.add('components/StatusWidget', StatusWidget)","export default function isExtensionEnabled(name) {\n const enabled = JSON.parse(app.data.settings.extensions_enabled);\n\n return enabled.includes(name);\n}\n\nwindow.flreg.add('utils/isExtensionEnabled', isExtensionEnabled)","export default function getCategorizedExtensions() {\n let extensions = {};\n\n Object.keys(app.data.extensions).map((id) => {\n const extension = app.data.extensions[id];\n let category = extension.extra['flarum-extension'].category;\n\n // Wrap languages packs into new system\n if (extension.extra['flarum-locale']) {\n category = 'language';\n }\n\n if (category in app.extensionCategories) {\n extensions[category] = extensions[category] || [];\n\n extensions[category].push(extension);\n } else {\n extensions.feature = extensions.feature || [];\n\n extensions.feature.push(extension);\n }\n });\n\n return extensions;\n}\n\nwindow.flreg.add('utils/getCategorizedExtensions', getCategorizedExtensions)","import DashboardWidget from './DashboardWidget';\nimport isExtensionEnabled from '../utils/isExtensionEnabled';\nimport getCategorizedExtensions from '../utils/getCategorizedExtensions';\nimport Link from '../../common/components/Link';\nimport icon from '../../common/helpers/icon';\n\nexport default class ExtensionsWidget extends DashboardWidget {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.categorizedExtensions = getCategorizedExtensions();\n }\n\n className() {\n return 'ExtensionsWidget';\n }\n\n content() {\n const categories = app.extensionCategories;\n\n return (\n
\n {Object.keys(categories).map((category) => (this.categorizedExtensions[category] ? this.extensionCategory(category) : ''))}\n
\n );\n }\n\n extensionCategory(category) {\n return (\n
\n

{app.translator.trans(`core.admin.nav.categories.${category}`)}

\n
    {this.categorizedExtensions[category].map((extension) => this.extensionWidget(extension))}
\n
\n );\n }\n\n extensionWidget(extension) {\n return (\n
  • \n \n
    \n \n {extension.icon ? icon(extension.icon.name) : ''}\n \n {extension.extra['flarum-extension'].title}\n
    \n \n
  • \n );\n }\n}\n\nwindow.flreg.add('components/ExtensionsWidget', ExtensionsWidget)","import Component from '../Component';\nimport icon from '../helpers/icon';\nimport withAttr from '../utils/withAttr';\n\n/**\n * The `Select` component displays a \n {icon('fas fa-sort', { className: 'Select-caret' })}\n \n );\n }\n}\n\nwindow.flreg.add('components/Select', Select)","export default function saveSettings(settings) {\n const oldSettings = JSON.parse(JSON.stringify(app.data.settings));\n\n Object.assign(app.data.settings, settings);\n\n return app\n .request({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/settings',\n body: settings,\n })\n .catch((error) => {\n app.data.settings = oldSettings;\n throw error;\n });\n}\n\nwindow.flreg.add('utils/saveSettings', saveSettings)","import Component from '../../common/Component';\nimport classList from '../../common/utils/classList';\nimport icon from '../../common/helpers/icon';\n\nexport default class AdminHeader extends Component {\n view(vnode) {\n return [\n
    \n
    \n

    \n {icon(this.attrs.icon)}\n {vnode.children}\n

    \n
    {this.attrs.description}
    \n
    \n
    ,\n ];\n }\n}\n\nwindow.flreg.add('components/AdminHeader', AdminHeader)","import Page from '../../common/components/Page';\nimport Button from '../../common/components/Button';\nimport Switch from '../../common/components/Switch';\nimport Select from '../../common/components/Select';\nimport classList from '../../common/utils/classList';\nimport Stream from '../../common/utils/Stream';\nimport saveSettings from '../utils/saveSettings';\nimport AdminHeader from './AdminHeader';\n\nexport default class AdminPage extends Page {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.settings = {};\n\n this.loading = false;\n }\n\n view() {\n const className = classList(['AdminPage', this.headerInfo().className]);\n\n return (\n
    \n {this.header()}\n
    {this.content()}
    \n
    \n );\n }\n\n content() {\n return '';\n }\n\n submitButton() {\n return (\n \n );\n }\n\n header() {\n const headerInfo = this.headerInfo();\n\n return (\n \n {headerInfo.title}\n \n );\n }\n\n headerInfo() {\n return {\n className: '',\n icon: '',\n title: '',\n description: '',\n };\n }\n\n /**\n * buildSettingComponent takes a settings object and turns it into a component.\n * Depending on the type of input, you can set the type to 'bool', 'select', or\n * any standard type. Any values inside the 'extra' object will be added\n * to the component as an attribute.\n *\n * Alternatively, you can pass a callback that will be executed in ExtensionPage's\n * context to include custom JSX elements.\n *\n * @example\n *\n * {\n * setting: 'acme.checkbox',\n * label: app.translator.trans('acme.admin.setting_label'),\n * type: 'bool',\n * help: app.translator.trans('acme.admin.setting_help'),\n * className: 'Setting-item'\n * }\n *\n * @example\n *\n * {\n * setting: 'acme.select',\n * label: app.translator.trans('acme.admin.setting_label'),\n * type: 'select',\n * options: {\n * 'option1': 'Option 1 label',\n * 'option2': 'Option 2 label',\n * },\n * default: 'option1',\n * }\n *\n * @param setting\n * @returns {JSX.Element}\n */\n buildSettingComponent(entry) {\n if (typeof entry === 'function') {\n return entry.call(this);\n }\n\n const { setting, help, ...componentAttrs } = entry;\n\n delete componentAttrs.help;\n\n const value = this.setting([setting])();\n if (['bool', 'checkbox', 'switch', 'boolean'].includes(componentAttrs.type)) {\n return (\n
    \n \n {componentAttrs.label}\n \n
    {help}
    \n
    \n );\n } else if (['select', 'dropdown', 'selectdropdown'].includes(componentAttrs.type)) {\n return (\n
    \n \n
    {help}
    \n \n
    \n );\n } else {\n componentAttrs.className = classList(['FormControl', componentAttrs.className]);\n return (\n
    \n {componentAttrs.label ? : ''}\n
    {help}
    \n \n
    \n );\n }\n }\n\n onsaved() {\n this.loading = false;\n\n app.alerts.show({ type: 'success' }, app.translator.trans('core.admin.settings.saved_message'));\n }\n\n setting(key, fallback = '') {\n this.settings[key] = this.settings[key] || Stream(app.data.settings[key] || fallback);\n\n return this.settings[key];\n }\n\n dirty() {\n const dirty = {};\n\n Object.keys(this.settings).forEach((key) => {\n const value = this.settings[key]();\n\n if (value !== app.data.settings[key]) {\n dirty[key] = value;\n }\n });\n\n return dirty;\n }\n\n isChanged() {\n return Object.keys(this.dirty()).length;\n }\n\n saveSettings(e) {\n e.preventDefault();\n\n app.alerts.clear();\n\n this.loading = true;\n\n return saveSettings(this.dirty()).then(this.onsaved.bind(this));\n }\n}\n\nwindow.flreg.add('components/AdminPage', AdminPage)","import StatusWidget from './StatusWidget';\nimport ExtensionsWidget from './ExtensionsWidget';\nimport ItemList from '../../common/utils/ItemList';\nimport AdminPage from './AdminPage';\n\nexport default class DashboardPage extends AdminPage {\n headerInfo() {\n return {\n className: 'DashboardPage',\n icon: 'fas fa-chart-bar',\n title: app.translator.trans('core.admin.dashboard.title'),\n description: app.translator.trans('core.admin.dashboard.description'),\n };\n }\n\n content() {\n return this.availableWidgets().toArray();\n }\n\n availableWidgets() {\n const items = new ItemList();\n\n items.add('status', , 30);\n\n items.add('extensions', , 10);\n\n return items;\n }\n}\n\nwindow.flreg.add('components/DashboardPage', DashboardPage)","import FieldSet from '../../common/components/FieldSet';\nimport ItemList from '../../common/utils/ItemList';\nimport AdminPage from './AdminPage';\n\nexport default class BasicsPage extends AdminPage {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.localeOptions = {};\n const locales = app.data.locales;\n for (const i in locales) {\n this.localeOptions[i] = `${locales[i]} (${i})`;\n }\n\n this.displayNameOptions = {};\n const displayNameDrivers = app.data.displayNameDrivers;\n displayNameDrivers.forEach(function (identifier) {\n this.displayNameOptions[identifier] = identifier;\n }, this);\n\n this.slugDriverOptions = {};\n Object.keys(app.data.slugDrivers).forEach((model) => {\n this.slugDriverOptions[model] = {};\n\n app.data.slugDrivers[model].forEach((option) => {\n this.slugDriverOptions[model][option] = option;\n });\n });\n }\n\n headerInfo() {\n return {\n className: 'BasicsPage',\n icon: 'fas fa-pencil-alt',\n title: app.translator.trans('core.admin.basics.title'),\n description: app.translator.trans('core.admin.basics.description'),\n };\n }\n\n content() {\n return [\n
    \n {this.buildSettingComponent({\n type: 'text',\n setting: 'forum_title',\n label: app.translator.trans('core.admin.basics.forum_title_heading'),\n })}\n {this.buildSettingComponent({\n type: 'text',\n setting: 'forum_description',\n label: app.translator.trans('core.admin.basics.forum_description_heading'),\n help: app.translator.trans('core.admin.basics.forum_description_text'),\n })}\n\n {Object.keys(this.localeOptions).length > 1\n ? [\n this.buildSettingComponent({\n type: 'select',\n setting: 'default_locale',\n options: this.localeOptions,\n label: app.translator.trans('core.admin.basics.default_language_heading'),\n }),\n this.buildSettingComponent({\n type: 'switch',\n setting: 'show_language_selector',\n label: app.translator.trans('core.admin.basics.show_language_selector_label'),\n }),\n ]\n : ''}\n\n
    \n
    {app.translator.trans('core.admin.basics.home_page_text')}
    \n {this.homePageItems()\n .toArray()\n .map(({ path, label }) => (\n \n ))}\n
    \n\n
    \n \n
    {app.translator.trans('core.admin.basics.welcome_banner_text')}
    \n \n ",g.noCloneChecked=!!ht.cloneNode(!0).lastChild.defaultValue,ht.innerHTML="",g.option=!!ht.lastChild;var bt={thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};function xt(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&N(t,e)?S.merge([t],n):n}function wt(t,e){for(var n=0,r=t.length;n",""]);var Tt=/<|&#?\w+;/;function Ct(t,e,n,r,o){for(var i,a,s,l,u,c,f=e.createDocumentFragment(),d=[],p=0,h=t.length;p-1)o&&o.push(i);else if(u=st(i),a=xt(f.appendChild(i),"script"),u&&wt(a),n)for(c=0;i=a[c++];)yt.test(i.type||"")&&n.push(i);return f}var St=/^([^.]*)(?:\.(.+)|)/;function kt(){return!0}function Et(){return!1}function $t(t,e){return t===function(){try{return b.activeElement}catch(t){}}()==("focus"===e)}function At(t,e,n,r,o,i){var a,s;if("object"==typeof e){for(s in"string"!=typeof n&&(r=r||n,n=void 0),e)At(t,s,n,r,e[s],i);return t}if(null==r&&null==o?(o=n,r=n=void 0):null==o&&("string"==typeof n?(o=r,r=void 0):(o=r,r=n,n=void 0)),!1===o)o=Et;else if(!o)return t;return 1===i&&(a=o,(o=function(t){return S().off(t),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),t.each((function(){S.event.add(this,e,o,r,n)}))}function Dt(t,e,n){n?(Q.set(t,e,!1),S.event.add(t,e,{namespace:!1,handler:function(t){var r,o,i=Q.get(this,e);if(1&t.isTrigger&&this[e]){if(i.length)(S.event.special[e]||{}).delegateType&&t.stopPropagation();else if(i=s.call(arguments),Q.set(this,e,i),r=n(this,e),this[e](),i!==(o=Q.get(this,e))||r?Q.set(this,e,!1):o={},i!==o)return t.stopImmediatePropagation(),t.preventDefault(),o&&o.value}else i.length&&(Q.set(this,e,{value:S.event.trigger(S.extend(i[0],S.Event.prototype),i.slice(1),this)}),t.stopImmediatePropagation())}})):void 0===Q.get(t,e)&&S.event.add(t,e,kt)}S.event={global:{},add:function(t,e,n,r,o){var i,a,s,l,u,c,f,d,p,h,m,g=Q.get(t);if(X(t))for(n.handler&&(n=(i=n).handler,o=i.selector),o&&S.find.matchesSelector(at,o),n.guid||(n.guid=S.guid++),(l=g.events)||(l=g.events=Object.create(null)),(a=g.handle)||(a=g.handle=function(e){return void 0!==S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),u=(e=(e||"").match(R)||[""]).length;u--;)p=m=(s=St.exec(e[u])||[])[1],h=(s[2]||"").split(".").sort(),p&&(f=S.event.special[p]||{},p=(o?f.delegateType:f.bindType)||p,f=S.event.special[p]||{},c=S.extend({type:p,origType:m,data:r,handler:n,guid:n.guid,selector:o,needsContext:o&&S.expr.match.needsContext.test(o),namespace:h.join(".")},i),(d=l[p])||((d=l[p]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(p,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),o?d.splice(d.delegateCount++,0,c):d.push(c),S.event.global[p]=!0)},remove:function(t,e,n,r,o){var i,a,s,l,u,c,f,d,p,h,m,g=Q.hasData(t)&&Q.get(t);if(g&&(l=g.events)){for(u=(e=(e||"").match(R)||[""]).length;u--;)if(p=m=(s=St.exec(e[u])||[])[1],h=(s[2]||"").split(".").sort(),p){for(f=S.event.special[p]||{},d=l[p=(r?f.delegateType:f.bindType)||p]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=i=d.length;i--;)c=d[i],!o&&m!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(d.splice(i,1),c.selector&&d.delegateCount--,f.remove&&f.remove.call(t,c));a&&!d.length&&(f.teardown&&!1!==f.teardown.call(t,h,g.handle)||S.removeEvent(t,p,g.handle),delete l[p])}else for(p in l)S.event.remove(t,p+e[u],n,r,!0);S.isEmptyObject(l)&&Q.remove(t,"handle events")}},dispatch:function(t){var e,n,r,o,i,a,s=new Array(arguments.length),l=S.event.fix(t),u=(Q.get(this,"events")||Object.create(null))[l.type]||[],c=S.event.special[l.type]||{};for(s[0]=l,e=1;e=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==t.type||!0!==u.disabled)){for(i=[],a={},n=0;n-1:S.find(o,this,null,[u]).length),a[o]&&i.push(r);i.length&&s.push({elem:u,handlers:i})}return u=this,l\s*$/g;function Lt(t,e){return N(t,"table")&&N(11!==e.nodeType?e:e.firstChild,"tr")&&S(t).children("tbody")[0]||t}function Mt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function It(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Pt(t,e){var n,r,o,i,a,s;if(1===e.nodeType){if(Q.hasData(t)&&(s=Q.get(t).events))for(o in Q.remove(e,"handle events"),s)for(n=0,r=s[o].length;n1&&"string"==typeof h&&!g.checkClone&&jt.test(h))return t.each((function(o){var i=t.eq(o);m&&(e[0]=h.call(this,o,i.html())),Rt(i,e,n,r)}));if(d&&(i=(o=Ct(e,t[0].ownerDocument,!1,t,r)).firstChild,1===o.childNodes.length&&(o=i),i||r)){for(s=(a=S.map(xt(o,"script"),Mt)).length;f0&&wt(a,!l&&xt(t,"script")),s},cleanData:function(t){for(var e,n,r,o=S.event.special,i=0;void 0!==(n=t[i]);i++)if(X(n)){if(e=n[Q.expando]){if(e.events)for(r in e.events)o[r]?S.event.remove(n,r):S.removeEvent(n,r,e.handle);n[Q.expando]=void 0}n[J.expando]&&(n[J.expando]=void 0)}}}),S.fn.extend({detach:function(t){return Ht(this,t,!0)},remove:function(t){return Ht(this,t)},text:function(t){return U(this,(function(t){return void 0===t?S.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return Rt(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Lt(this,t).appendChild(t)}))},prepend:function(){return Rt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Lt(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return Rt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return Rt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(S.cleanData(xt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return S.clone(this,t,e)}))},html:function(t){return U(this,(function(t){var e=this[0]||{},n=0,r=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Nt.test(t)&&!bt[(vt.exec(t)||["",""])[1].toLowerCase()]){t=S.htmlPrefilter(t);try{for(;n=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-i-l-s-.5))||0),l}function ne(t,e,n){var r=Ft(t),o=(!g.boxSizingReliable()||n)&&"border-box"===S.css(t,"boxSizing",!1,r),i=o,a=Bt(t,e,r),s="offset"+e[0].toUpperCase()+e.slice(1);if(qt.test(a)){if(!n)return a;a="auto"}return(!g.boxSizingReliable()&&o||!g.reliableTrDimensions()&&N(t,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(t,"display",!1,r))&&t.getClientRects().length&&(o="border-box"===S.css(t,"boxSizing",!1,r),(i=s in t)&&(a=t[s])),(a=parseFloat(a)||0)+ee(t,e,n||(o?"border":"content"),i,r,a)+"px"}function re(t,e,n,r,o){return new re.prototype.init(t,e,n,r,o)}S.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=Bt(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(t,e,n,r){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var o,i,a,s=K(e),l=Gt.test(e),u=t.style;if(l||(e=Kt(s)),a=S.cssHooks[e]||S.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(o=a.get(t,!1,r))?o:u[e];"string"==(i=typeof n)&&(o=ot.exec(n))&&o[1]&&(n=ct(t,e,o),i="number"),null!=n&&n==n&&("number"!==i||l||(n+=o&&o[3]||(S.cssNumber[s]?"":"px")),g.clearCloneStyle||""!==n||0!==e.indexOf("background")||(u[e]="inherit"),a&&"set"in a&&void 0===(n=a.set(t,n,r))||(l?u.setProperty(e,n):u[e]=n))}},css:function(t,e,n,r){var o,i,a,s=K(e);return Gt.test(e)||(e=Kt(s)),(a=S.cssHooks[e]||S.cssHooks[s])&&"get"in a&&(o=a.get(t,!0,n)),void 0===o&&(o=Bt(t,e,r)),"normal"===o&&e in Jt&&(o=Jt[e]),""===n||n?(i=parseFloat(o),!0===n||isFinite(i)?i||0:o):o}}),S.each(["height","width"],(function(t,e){S.cssHooks[e]={get:function(t,n,r){if(n)return!Xt.test(S.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?ne(t,e,r):zt(t,Qt,(function(){return ne(t,e,r)}))},set:function(t,n,r){var o,i=Ft(t),a=!g.scrollboxSize()&&"absolute"===i.position,s=(a||r)&&"border-box"===S.css(t,"boxSizing",!1,i),l=r?ee(t,e,r,s,i):0;return s&&a&&(l-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(i[e])-ee(t,e,"border",!1,i)-.5)),l&&(o=ot.exec(n))&&"px"!==(o[3]||"px")&&(t.style[e]=n,n=S.css(t,e)),te(0,n,l)}}})),S.cssHooks.marginLeft=Ut(g.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(Bt(t,"marginLeft"))||t.getBoundingClientRect().left-zt(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),S.each({margin:"",padding:"",border:"Width"},(function(t,e){S.cssHooks[t+e]={expand:function(n){for(var r=0,o={},i="string"==typeof n?n.split(" "):[n];r<4;r++)o[t+it[r]+e]=i[r]||i[r-2]||i[0];return o}},"margin"!==t&&(S.cssHooks[t+e].set=te)})),S.fn.extend({css:function(t,e){return U(this,(function(t,e,n){var r,o,i={},a=0;if(Array.isArray(e)){for(r=Ft(t),o=e.length;a1)}}),S.Tween=re,re.prototype={constructor:re,init:function(t,e,n,r,o,i){this.elem=t,this.prop=n,this.easing=o||S.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=r,this.unit=i||(S.cssNumber[n]?"":"px")},cur:function(){var t=re.propHooks[this.prop];return t&&t.get?t.get(this):re.propHooks._default.get(this)},run:function(t){var e,n=re.propHooks[this.prop];return this.options.duration?this.pos=e=S.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):re.propHooks._default.set(this),this}},re.prototype.init.prototype=re.prototype,re.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=S.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){S.fx.step[t.prop]?S.fx.step[t.prop](t):1!==t.elem.nodeType||!S.cssHooks[t.prop]&&null==t.elem.style[Kt(t.prop)]?t.elem[t.prop]=t.now:S.style(t.elem,t.prop,t.now+t.unit)}}},re.propHooks.scrollTop=re.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},S.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},S.fx=re.prototype.init,S.fx.step={};var oe,ie,ae=/^(?:toggle|show|hide)$/,se=/queueHooks$/;function le(){ie&&(!1===b.hidden&&r.requestAnimationFrame?r.requestAnimationFrame(le):r.setTimeout(le,S.fx.interval),S.fx.tick())}function ue(){return r.setTimeout((function(){oe=void 0})),oe=Date.now()}function ce(t,e){var n,r=0,o={height:t};for(e=e?1:0;r<4;r+=2-e)o["margin"+(n=it[r])]=o["padding"+n]=t;return e&&(o.opacity=o.width=t),o}function fe(t,e,n){for(var r,o=(de.tweeners[e]||[]).concat(de.tweeners["*"]),i=0,a=o.length;i1)},removeAttr:function(t){return this.each((function(){S.removeAttr(this,t)}))}}),S.extend({attr:function(t,e,n){var r,o,i=t.nodeType;if(3!==i&&8!==i&&2!==i)return void 0===t.getAttribute?S.prop(t,e,n):(1===i&&S.isXMLDoc(t)||(o=S.attrHooks[e.toLowerCase()]||(S.expr.match.bool.test(e)?pe:void 0)),void 0!==n?null===n?void S.removeAttr(t,e):o&&"set"in o&&void 0!==(r=o.set(t,n,e))?r:(t.setAttribute(e,n+""),n):o&&"get"in o&&null!==(r=o.get(t,e))?r:null==(r=S.find.attr(t,e))?void 0:r)},attrHooks:{type:{set:function(t,e){if(!g.radioValue&&"radio"===e&&N(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,r=0,o=e&&e.match(R);if(o&&1===t.nodeType)for(;n=o[r++];)t.removeAttribute(n)}}),pe={set:function(t,e,n){return!1===e?S.removeAttr(t,n):t.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),(function(t,e){var n=he[e]||S.find.attr;he[e]=function(t,e,r){var o,i,a=e.toLowerCase();return r||(i=he[a],he[a]=o,o=null!=n(t,e,r)?a:null,he[a]=i),o}}));var me=/^(?:input|select|textarea|button)$/i,ge=/^(?:a|area)$/i;function ve(t){return(t.match(R)||[]).join(" ")}function ye(t){return t.getAttribute&&t.getAttribute("class")||""}function be(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(R)||[]}S.fn.extend({prop:function(t,e){return U(this,S.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[S.propFix[t]||t]}))}}),S.extend({prop:function(t,e,n){var r,o,i=t.nodeType;if(3!==i&&8!==i&&2!==i)return 1===i&&S.isXMLDoc(t)||(e=S.propFix[e]||e,o=S.propHooks[e]),void 0!==n?o&&"set"in o&&void 0!==(r=o.set(t,n,e))?r:t[e]=n:o&&"get"in o&&null!==(r=o.get(t,e))?r:t[e]},propHooks:{tabIndex:{get:function(t){var e=S.find.attr(t,"tabindex");return e?parseInt(e,10):me.test(t.nodeName)||ge.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(S.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){S.propFix[this.toLowerCase()]=this})),S.fn.extend({addClass:function(t){var e,n,r,o,i,a,s,l=0;if(v(t))return this.each((function(e){S(this).addClass(t.call(this,e,ye(this)))}));if((e=be(t)).length)for(;n=this[l++];)if(o=ye(n),r=1===n.nodeType&&" "+ve(o)+" "){for(a=0;i=e[a++];)r.indexOf(" "+i+" ")<0&&(r+=i+" ");o!==(s=ve(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,o,i,a,s,l=0;if(v(t))return this.each((function(e){S(this).removeClass(t.call(this,e,ye(this)))}));if(!arguments.length)return this.attr("class","");if((e=be(t)).length)for(;n=this[l++];)if(o=ye(n),r=1===n.nodeType&&" "+ve(o)+" "){for(a=0;i=e[a++];)for(;r.indexOf(" "+i+" ")>-1;)r=r.replace(" "+i+" "," ");o!==(s=ve(r))&&n.setAttribute("class",s)}return this},toggleClass:function(t,e){var n=typeof t,r="string"===n||Array.isArray(t);return"boolean"==typeof e&&r?e?this.addClass(t):this.removeClass(t):v(t)?this.each((function(n){S(this).toggleClass(t.call(this,n,ye(this),e),e)})):this.each((function(){var e,o,i,a;if(r)for(o=0,i=S(this),a=be(t);e=a[o++];)i.hasClass(e)?i.removeClass(e):i.addClass(e);else void 0!==t&&"boolean"!==n||((e=ye(this))&&Q.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":Q.get(this,"__className__")||""))}))},hasClass:function(t){var e,n,r=0;for(e=" "+t+" ";n=this[r++];)if(1===n.nodeType&&(" "+ve(ye(n))+" ").indexOf(e)>-1)return!0;return!1}});var xe=/\r/g;S.fn.extend({val:function(t){var e,n,r,o=this[0];return arguments.length?(r=v(t),this.each((function(n){var o;1===this.nodeType&&(null==(o=r?t.call(this,n,S(this).val()):t)?o="":"number"==typeof o?o+="":Array.isArray(o)&&(o=S.map(o,(function(t){return null==t?"":t+""}))),(e=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,o,"value")||(this.value=o))}))):o?(e=S.valHooks[o.type]||S.valHooks[o.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(o,"value"))?n:"string"==typeof(n=o.value)?n.replace(xe,""):null==n?"":n:void 0}}),S.extend({valHooks:{option:{get:function(t){var e=S.find.attr(t,"value");return null!=e?e:ve(S.text(t))}},select:{get:function(t){var e,n,r,o=t.options,i=t.selectedIndex,a="select-one"===t.type,s=a?null:[],l=a?i+1:o.length;for(r=i<0?l:a?i:0;r-1)&&(n=!0);return n||(t.selectedIndex=-1),i}}}}),S.each(["radio","checkbox"],(function(){S.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=S.inArray(S(t).val(),e)>-1}},g.checkOn||(S.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})})),g.focusin="onfocusin"in r;var we=/^(?:focusinfocus|focusoutblur)$/,Te=function(t){t.stopPropagation()};S.extend(S.event,{trigger:function(t,e,n,o){var i,a,s,l,u,c,f,d,h=[n||b],m=p.call(t,"type")?t.type:t,g=p.call(t,"namespace")?t.namespace.split("."):[];if(a=d=s=n=n||b,3!==n.nodeType&&8!==n.nodeType&&!we.test(m+S.event.triggered)&&(m.indexOf(".")>-1&&(g=m.split("."),m=g.shift(),g.sort()),u=m.indexOf(":")<0&&"on"+m,(t=t[S.expando]?t:new S.Event(m,"object"==typeof t&&t)).isTrigger=o?2:3,t.namespace=g.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=n),e=null==e?[t]:S.makeArray(e,[t]),f=S.event.special[m]||{},o||!f.trigger||!1!==f.trigger.apply(n,e))){if(!o&&!f.noBubble&&!y(n)){for(l=f.delegateType||m,we.test(l+m)||(a=a.parentNode);a;a=a.parentNode)h.push(a),s=a;s===(n.ownerDocument||b)&&h.push(s.defaultView||s.parentWindow||r)}for(i=0;(a=h[i++])&&!t.isPropagationStopped();)d=a,t.type=i>1?l:f.bindType||m,(c=(Q.get(a,"events")||Object.create(null))[t.type]&&Q.get(a,"handle"))&&c.apply(a,e),(c=u&&a[u])&&c.apply&&X(a)&&(t.result=c.apply(a,e),!1===t.result&&t.preventDefault());return t.type=m,o||t.isDefaultPrevented()||f._default&&!1!==f._default.apply(h.pop(),e)||!X(n)||u&&v(n[m])&&!y(n)&&((s=n[u])&&(n[u]=null),S.event.triggered=m,t.isPropagationStopped()&&d.addEventListener(m,Te),n[m](),t.isPropagationStopped()&&d.removeEventListener(m,Te),S.event.triggered=void 0,s&&(n[u]=s)),t.result}},simulate:function(t,e,n){var r=S.extend(new S.Event,n,{type:t,isSimulated:!0});S.event.trigger(r,null,e)}}),S.fn.extend({trigger:function(t,e){return this.each((function(){S.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var n=this[0];if(n)return S.event.trigger(t,e,n,!0)}}),g.focusin||S.each({focus:"focusin",blur:"focusout"},(function(t,e){var n=function(t){S.event.simulate(e,t.target,S.event.fix(t))};S.event.special[e]={setup:function(){var r=this.ownerDocument||this.document||this,o=Q.access(r,e);o||r.addEventListener(t,n,!0),Q.access(r,e,(o||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,o=Q.access(r,e)-1;o?Q.access(r,e,o):(r.removeEventListener(t,n,!0),Q.remove(r,e))}}}));var Ce=r.location,Se={guid:Date.now()},ke=/\?/;S.parseXML=function(t){var e,n;if(!t||"string"!=typeof t)return null;try{e=(new r.DOMParser).parseFromString(t,"text/xml")}catch(t){}return n=e&&e.getElementsByTagName("parsererror")[0],e&&!n||S.error("Invalid XML: "+(n?S.map(n.childNodes,(function(t){return t.textContent})).join("\n"):t)),e};var Ee=/\[\]$/,$e=/\r?\n/g,Ae=/^(?:submit|button|image|reset|file)$/i,De=/^(?:input|select|textarea|keygen)/i;function Ne(t,e,n,r){var o;if(Array.isArray(e))S.each(e,(function(e,o){n||Ee.test(t)?r(t,o):Ne(t+"["+("object"==typeof o&&null!=o?e:"")+"]",o,n,r)}));else if(n||"object"!==T(e))r(t,e);else for(o in e)Ne(t+"["+o+"]",e[o],n,r)}S.param=function(t,e){var n,r=[],o=function(t,e){var n=v(e)?e():e;r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!S.isPlainObject(t))S.each(t,(function(){o(this.name,this.value)}));else for(n in t)Ne(n,t[n],e,o);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=S.prop(this,"elements");return t?S.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!S(this).is(":disabled")&&De.test(this.nodeName)&&!Ae.test(t)&&(this.checked||!gt.test(t))})).map((function(t,e){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,(function(t){return{name:e.name,value:t.replace($e,"\r\n")}})):{name:e.name,value:n.replace($e,"\r\n")}})).get()}});var je=/%20/g,Oe=/#.*$/,Le=/([?&])_=[^&]*/,Me=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ie=/^(?:GET|HEAD)$/,Pe=/^\/\//,_e={},Re={},He="*/".concat("*"),qe=b.createElement("a");function Fe(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var r,o=0,i=e.toLowerCase().match(R)||[];if(v(n))for(;r=i[o++];)"+"===r[0]?(r=r.slice(1)||"*",(t[r]=t[r]||[]).unshift(n)):(t[r]=t[r]||[]).push(n)}}function ze(t,e,n,r){var o={},i=t===Re;function a(s){var l;return o[s]=!0,S.each(t[s]||[],(function(t,s){var u=s(e,n,r);return"string"!=typeof u||i||o[u]?i?!(l=u):void 0:(e.dataTypes.unshift(u),a(u),!1)})),l}return a(e.dataTypes[0])||!o["*"]&&a("*")}function We(t,e){var n,r,o=S.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((o[n]?t:r||(r={}))[n]=e[n]);return r&&S.extend(!0,t,r),t}qe.href=Ce.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ce.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Ce.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":He,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?We(We(t,S.ajaxSettings),e):We(S.ajaxSettings,t)},ajaxPrefilter:Fe(_e),ajaxTransport:Fe(Re),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var n,o,i,a,s,l,u,c,f,d,p=S.ajaxSetup({},e),h=p.context||p,m=p.context&&(h.nodeType||h.jquery)?S(h):S.event,g=S.Deferred(),v=S.Callbacks("once memory"),y=p.statusCode||{},x={},w={},T="canceled",C={readyState:0,getResponseHeader:function(t){var e;if(u){if(!a)for(a={};e=Me.exec(i);)a[e[1].toLowerCase()+" "]=(a[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=a[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return u?i:null},setRequestHeader:function(t,e){return null==u&&(t=w[t.toLowerCase()]=w[t.toLowerCase()]||t,x[t]=e),this},overrideMimeType:function(t){return null==u&&(p.mimeType=t),this},statusCode:function(t){var e;if(t)if(u)C.always(t[C.status]);else for(e in t)y[e]=[y[e],t[e]];return this},abort:function(t){var e=t||T;return n&&n.abort(e),k(0,e),this}};if(g.promise(C),p.url=((t||p.url||Ce.href)+"").replace(Pe,Ce.protocol+"//"),p.type=e.method||e.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(R)||[""],null==p.crossDomain){l=b.createElement("a");try{l.href=p.url,l.href=l.href,p.crossDomain=qe.protocol+"//"+qe.host!=l.protocol+"//"+l.host}catch(t){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=S.param(p.data,p.traditional)),ze(_e,p,e,C),u)return C;for(f in(c=S.event&&p.global)&&0==S.active++&&S.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Ie.test(p.type),o=p.url.replace(Oe,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(je,"+")):(d=p.url.slice(o.length),p.data&&(p.processData||"string"==typeof p.data)&&(o+=(ke.test(o)?"&":"?")+p.data,delete p.data),!1===p.cache&&(o=o.replace(Le,"$1"),d=(ke.test(o)?"&":"?")+"_="+Se.guid+++d),p.url=o+d),p.ifModified&&(S.lastModified[o]&&C.setRequestHeader("If-Modified-Since",S.lastModified[o]),S.etag[o]&&C.setRequestHeader("If-None-Match",S.etag[o])),(p.data&&p.hasContent&&!1!==p.contentType||e.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+He+"; q=0.01":""):p.accepts["*"]),p.headers)C.setRequestHeader(f,p.headers[f]);if(p.beforeSend&&(!1===p.beforeSend.call(h,C,p)||u))return C.abort();if(T="abort",v.add(p.complete),C.done(p.success),C.fail(p.error),n=ze(Re,p,e,C)){if(C.readyState=1,c&&m.trigger("ajaxSend",[C,p]),u)return C;p.async&&p.timeout>0&&(s=r.setTimeout((function(){C.abort("timeout")}),p.timeout));try{u=!1,n.send(x,k)}catch(t){if(u)throw t;k(-1,t)}}else k(-1,"No Transport");function k(t,e,a,l){var f,d,b,x,w,T=e;u||(u=!0,s&&r.clearTimeout(s),n=void 0,i=l||"",C.readyState=t>0?4:0,f=t>=200&&t<300||304===t,a&&(x=function(t,e,n){for(var r,o,i,a,s=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=t.mimeType||e.getResponseHeader("Content-Type"));if(r)for(o in s)if(s[o]&&s[o].test(r)){l.unshift(o);break}if(l[0]in n)i=l[0];else{for(o in n){if(!l[0]||t.converters[o+" "+l[0]]){i=o;break}a||(a=o)}i=i||a}if(i)return i!==l[0]&&l.unshift(i),n[i]}(p,C,a)),!f&&S.inArray("script",p.dataTypes)>-1&&S.inArray("json",p.dataTypes)<0&&(p.converters["text script"]=function(){}),x=function(t,e,n,r){var o,i,a,s,l,u={},c=t.dataTypes.slice();if(c[1])for(a in t.converters)u[a.toLowerCase()]=t.converters[a];for(i=c.shift();i;)if(t.responseFields[i]&&(n[t.responseFields[i]]=e),!l&&r&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=i,i=c.shift())if("*"===i)i=l;else if("*"!==l&&l!==i){if(!(a=u[l+" "+i]||u["* "+i]))for(o in u)if((s=o.split(" "))[1]===i&&(a=u[l+" "+s[0]]||u["* "+s[0]])){!0===a?a=u[o]:!0!==u[o]&&(i=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&t.throws)e=a(e);else try{e=a(e)}catch(t){return{state:"parsererror",error:a?t:"No conversion from "+l+" to "+i}}}return{state:"success",data:e}}(p,x,C,f),f?(p.ifModified&&((w=C.getResponseHeader("Last-Modified"))&&(S.lastModified[o]=w),(w=C.getResponseHeader("etag"))&&(S.etag[o]=w)),204===t||"HEAD"===p.type?T="nocontent":304===t?T="notmodified":(T=x.state,d=x.data,f=!(b=x.error))):(b=T,!t&&T||(T="error",t<0&&(t=0))),C.status=t,C.statusText=(e||T)+"",f?g.resolveWith(h,[d,T,C]):g.rejectWith(h,[C,T,b]),C.statusCode(y),y=void 0,c&&m.trigger(f?"ajaxSuccess":"ajaxError",[C,p,f?d:b]),v.fireWith(h,[C,T]),c&&(m.trigger("ajaxComplete",[C,p]),--S.active||S.event.trigger("ajaxStop")))}return C},getJSON:function(t,e,n){return S.get(t,e,n,"json")},getScript:function(t,e){return S.get(t,void 0,e,"script")}}),S.each(["get","post"],(function(t,e){S[e]=function(t,n,r,o){return v(n)&&(o=o||r,r=n,n=void 0),S.ajax(S.extend({url:t,type:e,dataType:o,data:n,success:r},S.isPlainObject(t)&&t))}})),S.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),S._evalUrl=function(t,e,n){return S.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){S.globalEval(t,e,n)}})},S.fn.extend({wrapAll:function(t){var e;return this[0]&&(v(t)&&(t=t.call(this[0])),e=S(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return v(t)?this.each((function(e){S(this).wrapInner(t.call(this,e))})):this.each((function(){var e=S(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=v(t);return this.each((function(n){S(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){S(this).replaceWith(this.childNodes)})),this}}),S.expr.pseudos.hidden=function(t){return!S.expr.pseudos.visible(t)},S.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new r.XMLHttpRequest}catch(t){}};var Be={0:200,1223:204},Ue=S.ajaxSettings.xhr();g.cors=!!Ue&&"withCredentials"in Ue,g.ajax=Ue=!!Ue,S.ajaxTransport((function(t){var e,n;if(g.cors||Ue&&!t.crossDomain)return{send:function(o,i){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];for(a in t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest"),o)s.setRequestHeader(a,o[a]);e=function(t){return function(){e&&(e=n=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===t?s.abort():"error"===t?"number"!=typeof s.status?i(0,"error"):i(s.status,s.statusText):i(Be[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=e(),n=s.onerror=s.ontimeout=e("error"),void 0!==s.onabort?s.onabort=n:s.onreadystatechange=function(){4===s.readyState&&r.setTimeout((function(){e&&n()}))},e=e("abort");try{s.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}})),S.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return S.globalEval(t),t}}}),S.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),S.ajaxTransport("script",(function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(r,o){e=S("