diff --git a/js/dist/admin.js b/js/dist/admin.js
index 29695ef..09f87ce 100644
--- a/js/dist/admin.js
+++ b/js/dist/admin.js
@@ -1,2 +1,2 @@
-(()=>{var t={n:a=>{var s=a&&a.__esModule?()=>a.default:()=>a;return t.d(s,{a:s}),s},d:(a,s)=>{for(var n in s)t.o(s,n)&&!t.o(a,n)&&Object.defineProperty(a,n,{enumerable:!0,get:s[n]})},o:(t,a)=>Object.prototype.hasOwnProperty.call(t,a),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},a={};(()=>{"use strict";t.r(a);const s=flarum.core.compat["admin/app"];var n=t.n(s);const e=flarum.core.compat["common/Model"];var i=t.n(e);function o(t,a){return o=Object.setPrototypeOf||function(t,a){return t.__proto__=a,t},o(t,a)}function r(t,a){t.prototype=Object.create(a.prototype),t.prototype.constructor=t,o(t,a)}const p=flarum.core.compat["common/utils/mixin"];var d=function(t){function a(){return t.apply(this,arguments)||this}return r(a,t),a.prototype.apiEndpoint=function(){return"/fof/ban-ips"+(this.exists?"/"+this.id():"")},a}(t.n(p)()(i(),{creator:i().hasOne("creator"),user:i().hasOne("user"),address:i().attribute("address"),reason:i().attribute("reason"),createdAt:i().attribute("createdAt",i().transformDate),deletedAt:i().attribute("deletedAt",i().transformDate)}));const l=flarum.core.compat["common/components/Button"];var u=t.n(l);const h=flarum.core.compat["common/components/LoadingIndicator"];var c=t.n(h);const b=flarum.core.compat["common/components/Placeholder"];var f=t.n(b);const g=flarum.core.compat["admin/components/ExtensionPage"];var v=t.n(g);const _=flarum.core.compat["common/components/Modal"];var y=t.n(_);const N=flarum.core.compat["common/components/Alert"];var O=t.n(N);const A=flarum.core.compat["common/helpers/punctuateSeries"];var P=t.n(A);const B=flarum.core.compat["common/helpers/username"];var F=t.n(B);const x=flarum.core.compat["common/utils/Stream"];var I=t.n(x),U=function(t){function a(){return t.apply(this,arguments)||this}r(a,t);var s=a.prototype;return s.oninit=function(a){t.prototype.oninit.call(this,a),this.address=I()(""),this.reason=I()(""),this.usersBanned={},this.loading=!1},s.className=function(){return"Modal--medium"},s.title=function(){return app.translator.trans("fof-ban-ips.lib.modal.title")},s.content=function(){var t=this.usersBanned[this.address()],a=t&&t.map(F());return m("div",{className:"Modal-body"},m("p",null,app.translator.trans("fof-ban-ips.lib.modal.ban_ip_confirmation")),m("div",{className:"Form-group"},m("label",{className:"label"},app.translator.trans("fof-ban-ips.lib.modal.address_label")),m("input",{type:"text",className:"FormControl",bidi:this.address,required:!0,pattern:"^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$|^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\\-]*[A-Za-z0-9])$|^\\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?\\s*$"})),m("div",{className:"Form-group"},m("label",{className:"label"},app.translator.trans("fof-ban-ips.lib.modal.reason_label")),m("input",{type:"text",className:"FormControl",bidi:this.reason})),t?t.length?O().component({dismissible:!1},app.translator.transChoice("fof-ban-ips.lib.modal.ban_ip_users",a.length,{users:P()(a)})):O().component({dismissible:!1,type:"success"},app.translator.trans("fof-ban-ips.admin.modal.ban_ip_no_users")):"",t&&m("br",null),m("div",{className:"Form-group"},m(u(),{className:"Button Button--primary",type:"submit",loading:this.loading,disabled:app.store.getBy("banned_ips","address",this.address())},a?app.translator.trans("fof-ban-ips.lib.modal.ban_button"):app.translator.trans("fof-ban-ips.lib.modal.check_button"))))},s.onsubmit=function(t){if(t.preventDefault(),this.address()){if(this.loading=!0,void 0===this.usersBanned[this.address()])return this.getOtherUsers();var a={address:this.address(),reason:this.reason()};app.store.createRecord("banned_ips").save(a).then(this.hide.bind(this),this.onerror.bind(this),this.loaded.bind(this))}},s.getOtherUsers=function(){var t=this,a={ip:this.address()};app.request({params:a,url:app.forum.attribute("apiUrl")+"/fof/ban-ips/check-users",method:"GET"}).then((function(a){t.usersBanned[t.address()]=a.data.map((function(t){return app.store.pushObject(t)})),m.redraw()})).then(this.loaded.bind(this)).catch((function(a){t.onerror(a),t.loading=!1}))},a}(y());const k=flarum.core.compat["common/Component"];var M=t.n(k),S=function(t){function a(){return t.apply(this,arguments)||this}r(a,t);var s=a.prototype;return s.oninit=function(a){if(t.prototype.oninit.call(this,a),this.address=this.attrs.address,this.post=this.attrs.post,this.user=this.attrs.user||this.post&&this.post.user(),!this.user&&this.address){var s=app.store.getBy("banned_ips","address",this.address);s&&(this.user=s.user())}this.banOptions=[],(this.post&&this.post.ipAddress()||this.address)&&this.banOptions.push("only"),this.user&&this.banOptions.push("all"),this.banOption=I()(this.banOptions[0]),this.reason=I()(""),this.otherUsers={},this.loading=!1},s.className=function(){return"Modal--medium"},s.title=function(){return app.translator.trans("fof-ban-ips.lib.modal.title")},s.content=function(){var t=this,a=this.otherUsers[this.banOption()],s=a&&a.map((function(t){return t&&t.displayName()||app.translator.trans("core.lib.username.deleted_text")}));return m("div",{className:"Modal-body"},m("p",null,app.translator.trans("fof-ban-ips.lib.modal.ban_ip_confirmation")),m("div",{className:"Form-group"},this.banOptions.map((function(a){return m("div",null,m("input",{type:"radio",name:"ban-option",id:"ban-option-"+a,checked:t.banOption()===a,onclick:t.banOption.bind(t,a)})," ",m("label",{htmlFor:"ban-option-"+a},app.translator.trans("fof-ban-ips.forum.modal.ban_options_"+a+"_ip",{user:t.user,ip:t.address||t.post&&t.post.ipAddress()})))}))),m("div",{className:"Form-group"},m("label",{className:"label"},app.translator.trans("fof-ban-ips.lib.modal.reason_label")),m("input",{type:"text",className:"FormControl",bidi:this.reason})),a?a.length?O().component({dismissible:!1},app.translator.transChoice("fof-ban-ips.lib.modal.ban_ip_users",s.length,{users:P()(s)})):O().component({dismissible:!1,type:"success"},app.translator.trans("fof-ban-ips.forum.modal.ban_ip_no_users")):"",a&&m("br",null),m("div",{className:"Form-group"},m(u(),{className:"Button Button--primary",type:"submit",loading:this.loading},s?app.translator.trans("fof-ban-ips.lib.modal.ban_button"):app.translator.trans("fof-ban-ips.lib.modal.check_button"))))},s.onsubmit=function(t){var a=this;if(t.preventDefault(),this.loading=!0,void 0===this.otherUsers[this.banOption()])return this.getOtherUsers();var s={reason:this.reason(),userId:this.user.id()};"only"===this.banOption()?(s.address=this.post.ipAddress(),app.store.createRecord("banned_ips").save(s).then(this.hide.bind(this)).catch(this.onerror.bind(this)).then(this.loaded.bind(this))):"all"===this.banOption()&&app.request({body:{data:{attributes:s}},url:""+app.forum.attribute("apiUrl")+this.user.apiEndpoint()+"/ban",method:"POST",errorHandler:this.onerror.bind(this)}).then((function(t){return app.store.pushPayload(t).forEach(a.done.bind(a))})).then(this.hide.bind(this)).catch((function(){})).then(this.loaded.bind(this))},s.getOtherUsers=function(){var t=this,a={};"only"===this.banOption()&&(a.ip=this.address||this.post.ipAddress()),app.request({params:a,url:app.forum.attribute("apiUrl")+"/fof/ban-ips/check-users/"+this.user.id(),method:"GET",errorHandler:this.onerror.bind(this)}).then((function(a){t.otherUsers[t.banOption()]=a.data.map((function(t){return app.store.pushObject(t)})).filter((function(t){return 0===t.bannedIPs().length})),t.loading=!1})).catch((function(){})).then(this.loaded.bind(this))},s.done=function(t){var a={type:"banned_ips",id:t.id()};this.post&&(this.post.data.relationships.banned_ip={data:a}),this.user.data.relationships.banned_ips||(this.user.data.relationships.banned_ips={data:[]}),this.user.data.relationships.banned_ips.data.push(a),this.user.data.attributes.isBanned=!0,app.store.pushObject(this.user.data)},a}(y()),w=function(t){function a(){return t.apply(this,arguments)||this}r(a,t);var s=a.prototype;return s.title=function(){return app.translator.trans("fof-ban-ips.lib.modal.unban_title")},s.content=function(){var t=this,a=this.otherUsers[this.banOption()],s=a&&a.map((function(t){return t&&t.displayName()||app.translator.trans("core.lib.username.deleted_text")}));return this.bannedIPs?m("div",{className:"Modal-body"},O().component({dismissible:!1,type:"success"},app.translator.trans("fof-ban-ips.lib.modal.unbanned_ips",{ips:P()(this.bannedIPs)}))):m("div",{className:"Modal-body"},m("p",null,app.translator.trans("fof-ban-ips.lib.modal.unban_ip_confirmation")),m("div",{className:"Form-group"},this.banOptions.map((function(a){return m("div",null,m("input",{type:"radio",name:"ban-option",id:"ban-option-"+a,checked:t.banOption()===a,onclick:t.banOption.bind(t,a)})," ",m("label",{htmlFor:"ban-option-"+a},app.translator.trans("fof-ban-ips.lib.modal.unban_options_"+a+"_ip",{user:t.user,ip:t.address||t.post&&t.post.ipAddress()})))}))),a?a.length?O().component({dismissible:!1},app.translator.transChoice("fof-ban-ips.lib.modal.unban_ip_users",s.length,{users:P()(s)})):O().component({dismissible:!1,type:"success"},app.translator.trans("fof-ban-ips.lib.modal.unban_ip_no_users")):"",a&&m("br",null),m("div",{className:"Form-group"},m(u(),{className:"Button Button--primary",type:"submit",loading:this.loading},s?app.translator.trans("fof-ban-ips.lib.modal.unban_button"):app.translator.trans("fof-ban-ips.lib.modal.check_button"))))},s.onsubmit=function(t){if(t.preventDefault(),this.loading=!0,void 0===this.otherUsers[this.banOption()])return this.getOtherUsers();var a={};if("only"===this.banOption()){a.address=this.address||this.post.ipAddress();var s=this.post?this.post.bannedIP():app.store.getBy("banned_ips","address",this.address);s.delete().then(this.done.bind(this,s)).catch(this.onerror.bind(this)).then(this.hide.bind(this))}else"all"===this.banOption()&&app.request({body:{data:{attributes:a}},url:""+app.forum.attribute("apiUrl")+this.user.apiEndpoint()+"/unban",method:"POST",errorHandler:this.onerror.bind(this)}).then(this.done.bind(this)).catch(this.onerror.bind(this)).then(this.hide.bind(this))},s.getOtherUsers=function(){var t=this,a={};"only"===this.banOption()&&(a.ip=this.address||this.post.ipAddress(),a.skipValidation=!0);var s=app.forum.attribute("apiUrl")+"/fof/ban-ips/check-users";this.user&&(s+="/"+this.user.id()),app.request({params:a,url:s,method:"GET",errorHandler:this.onerror.bind(this)}).then((function(a){var s=app.store.pushPayload(a);t.otherUsers[t.banOption()]=s.filter((function(t){return 1===t.bannedIPs().length})),t.loading=!1,m.redraw()})).catch((function(){})).then(this.loaded.bind(this))},s.done=function(t){this.loading=!1,this.post&&delete this.post.data.relationships.banned_ip,!this.user||this.user.data.relationships||t?this.user&&t instanceof app.store.models.banned_ips&&(this.user.data.relationships.banned_ips={data:this.user.data.relationships.banned_ips.data.filter((function(a){return a.id!==t.id()}))},this.user.data.attributes.isBanned=0!==this.user.data.relationships.banned_ips.data.length):(this.user.data.relationships.banned_ips.data=[],this.user.data.attributes.isBanned=!1),t&&Array.isArray(t.data)&&(this.bannedIPs=t.data.map((function(t){return t.attributes.address})),this.loading=!1,m.redraw())},s.hide=function(){t.prototype.hide.call(this),this.attrs.redraw||location.reload()},a}(S),z=function(t){function a(){return t.apply(this,arguments)||this}r(a,t);var s=a.prototype;return s.oninit=function(a){t.prototype.oninit.call(this,a),this.item=this.attrs.item,this.reason=I()(this.item.reason())},s.className=function(){return"Modal--medium"},s.title=function(){return app.translator.trans("fof-ban-ips.admin.modal.update_title")},s.content=function(){return m("div",{className:"Modal-body"},m("div",{className:"Form-group"},m("label",{className:"label"},app.translator.trans("fof-ban-ips.lib.modal.reason_label")),m("input",{type:"text",className:"FormControl",bidi:this.reason})),m("div",{className:"Form-group"},m(u(),{className:"Button Button--primary",type:"submit",loading:this.loading,disabled:this.reason()===this.item.reason()},app.translator.trans("fof-ban-ips.lib.modal.save_button"))))},s.onsubmit=function(t){t.preventDefault(),this.reason()&&(this.loading=!0,this.item.save({reason:this.reason()}).then(this.hide.bind(this)).catch(this.onerror.bind(this)).then(this.loaded.bind(this)))},a}(y()),R=function(t){function a(){return t.apply(this,arguments)||this}r(a,t);var s=a.prototype;return s.oninit=function(a){t.prototype.oninit.call(this,a),this.item=this.attrs.bannedIP},s.view=function(){var t=this;return m("tr",null,m("td",null,this.item.id()),m("td",null,F()(this.item.creator())),m("td",null,this.item.user()&&F()(this.item.user())),m("td",null,this.item.address()),m("td",null,this.item.reason()),m("td",null,this.item.createdAt().toLocaleDateString()),m("td",null,m("div",{className:"Button--group"},u().component({className:"Button Button--warning",icon:"fas fa-pencil-alt",disabled:this.item.creator()!==app.session.user,onclick:function(){return app.modal.show(z,{item:t.item})}}),u().component({className:"Button Button--danger",icon:"fas fa-times",onclick:function(){return app.modal.show(w,{address:t.item.address(),redraw:!0})}}))))},a}(M()),j=function(t){function a(){return t.apply(this,arguments)||this}r(a,t);var s=a.prototype;return s.oninit=function(a){t.prototype.oninit.call(this,a),this.loading=!0,this.page=0,this.pageSize=20},s.oncreate=function(a){t.prototype.oncreate.call(this,a),this.refresh()},s.content=function(){var t,a;return!0===this.nextResults&&(t=u().component({className:"Button Button--PageList-next",icon:"fas fa-angle-right",onclick:this.loadNext.bind(this)})),!0===this.prevResults&&(a=u().component({className:"Button Button--PageList-prev",icon:"fas fa-angle-left",onclick:this.loadPrev.bind(this)})),m("div",{className:"BannedIPsPage"},m("div",{className:"BannedIPsPage-header"},m("div",{className:"container"},u().component({className:"Button Button--primary",icon:"fas fa-plus",onclick:function(){return app.modal.show(U)}},app.translator.trans("fof-ban-ips.admin.page.create_button")))),m("br",null),m("div",{className:"BannedIpsPage-table"},m("div",{className:"container"},this.loading?c().component():app.store.all("banned_ips").length?m("table",{style:{width:"100%",textAlign:"left"},className:"table"},m("thead",null,m("tr",null,m("th",null,"#"),m("th",null,app.translator.trans("fof-ban-ips.admin.page.creator_label")),m("th",null,app.translator.trans("fof-ban-ips.admin.page.user_label")),m("th",null,app.translator.trans("fof-ban-ips.admin.page.address_label")),m("th",null,app.translator.trans("fof-ban-ips.admin.page.reason_label")),m("th",null,app.translator.trans("fof-ban-ips.admin.page.date_label")),m("th",null))),m("tbody",null,app.store.all("banned_ips").slice(this.page,this.page+this.pageSize).map((function(t){return R.component({bannedIP:t})})))):m("div",null,f().component({text:app.translator.trans("fof-ban-ips.admin.empty_text")})))),m("div",null,t,a))},s.refresh=function(){return this.loadResults().then(this.parseResults.bind(this))},s.loadResults=function(){var t=this.page*this.pageSize;return app.store.find("fof/ban-ips",{page:{offset:t,limit:this.pageSize}})},s.loadNext=function(){!0===this.nextResults&&(this.page++,this.refresh())},s.loadPrev=function(){!0===this.prevResults&&(this.page--,this.refresh())},s.parseResults=function(t){this.loading=!1,this.nextResults=!!t.payload.links.next,this.prevResults=!!t.payload.links.prev,m.redraw()},a}(v());const C={"fof/ban-ips/components/BanIPModal":S,"fof/ban-ips/components/UnbanIPModal":w,"fof/ban-ips/models/BannedIP":d},D=Object.assign(C,{"fof/ban-ips/components/BanIPModal":U,"fof/ban-ips/components/ChangeReasonModal":z,"fof/ban-ips/components/SettingsPage":j,"fof/ban-ips/components/SettingsPageItem":R}),E=flarum.core;n().initializers.add("fof/ban-ips",(function(){n().store.models.banned_ips=d,n().store.models.users.prototype.bannedIPs=i().hasMany("banned_ips"),n().extensionData.for("fof-ban-ips").registerPermission({icon:"fas fa-gavel",label:n().translator.trans("fof-ban-ips.admin.permissions.view_banned_ip_list_label"),permission:"fof.ban-ips.viewBannedIPList"},"moderate").registerPermission({icon:"fas fa-gavel",label:n().translator.trans("fof-ban-ips.admin.permissions.ban_ip_label"),permission:"fof.ban-ips.banIP"},"moderate").registerPage(j)})),Object.assign(E.compat,D)})(),module.exports=a})();
+(()=>{var t={n:a=>{var s=a&&a.__esModule?()=>a.default:()=>a;return t.d(s,{a:s}),s},d:(a,s)=>{for(var n in s)t.o(s,n)&&!t.o(a,n)&&Object.defineProperty(a,n,{enumerable:!0,get:s[n]})},o:(t,a)=>Object.prototype.hasOwnProperty.call(t,a),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},a={};(()=>{"use strict";t.r(a);const s=flarum.core.compat["admin/app"];var n=t.n(s);const e=flarum.core.compat["common/Model"];var i=t.n(e);function o(t,a){return o=Object.setPrototypeOf||function(t,a){return t.__proto__=a,t},o(t,a)}function r(t,a){t.prototype=Object.create(a.prototype),t.prototype.constructor=t,o(t,a)}const p=flarum.core.compat["common/utils/mixin"];var d=function(t){function a(){return t.apply(this,arguments)||this}return r(a,t),a.prototype.apiEndpoint=function(){return"/fof/ban-ips"+(this.exists?"/"+this.id():"")},a}(t.n(p)()(i(),{creator:i().hasOne("creator"),user:i().hasOne("user"),address:i().attribute("address"),reason:i().attribute("reason"),createdAt:i().attribute("createdAt",i().transformDate),deletedAt:i().attribute("deletedAt",i().transformDate)}));const l=flarum.core.compat["common/components/Button"];var u=t.n(l);const h=flarum.core.compat["common/components/LoadingIndicator"];var c=t.n(h);const b=flarum.core.compat["common/components/Placeholder"];var f=t.n(b);const g=flarum.core.compat["admin/components/ExtensionPage"];var v=t.n(g);const _=flarum.core.compat["common/components/Modal"];var y=t.n(_);const N=flarum.core.compat["common/components/Alert"];var O=t.n(N);const A=flarum.core.compat["common/helpers/punctuateSeries"];var P=t.n(A);const B=flarum.core.compat["common/helpers/username"];var F=t.n(B);const x=flarum.core.compat["common/utils/Stream"];var I=t.n(x),U=function(t){function a(){return t.apply(this,arguments)||this}r(a,t);var s=a.prototype;return s.oninit=function(a){t.prototype.oninit.call(this,a),this.address=I()(""),this.reason=I()(""),this.usersBanned={},this.loading=!1},s.className=function(){return"Modal--medium"},s.title=function(){return app.translator.trans("fof-ban-ips.lib.modal.title")},s.content=function(){var t=this.usersBanned[this.address()],a=t&&t.map(F());return m("div",{className:"Modal-body"},m("p",null,app.translator.trans("fof-ban-ips.lib.modal.ban_ip_confirmation")),m("div",{className:"Form-group"},m("label",{className:"label"},app.translator.trans("fof-ban-ips.lib.modal.address_label")),m("input",{type:"text",className:"FormControl",bidi:this.address,required:!0,pattern:"^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$|^(([a-zA-Z]|[a-z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-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?\\s*$"})),m("div",{className:"Form-group"},m("label",{className:"label"},app.translator.trans("fof-ban-ips.lib.modal.reason_label")),m("input",{type:"text",className:"FormControl",bidi:this.reason})),t?t.length?O().component({dismissible:!1},app.translator.trans("fof-ban-ips.lib.modal.ban_ip_users",{users:P()(a),count:a.length})):O().component({dismissible:!1,type:"success"},app.translator.trans("fof-ban-ips.admin.modal.ban_ip_no_users")):"",t&&m("br",null),m("div",{className:"Form-group"},m(u(),{className:"Button Button--primary",type:"submit",loading:this.loading,disabled:app.store.getBy("banned_ips","address",this.address())},a?app.translator.trans("fof-ban-ips.lib.modal.ban_button"):app.translator.trans("fof-ban-ips.lib.modal.check_button"))))},s.onsubmit=function(t){if(t.preventDefault(),this.address()){if(this.loading=!0,void 0===this.usersBanned[this.address()])return this.getOtherUsers();var a={address:this.address(),reason:this.reason()};app.store.createRecord("banned_ips").save(a).then(this.hide.bind(this),this.onerror.bind(this),this.loaded.bind(this))}},s.getOtherUsers=function(){var t=this,a={ip:this.address()};app.request({params:a,url:app.forum.attribute("apiUrl")+"/fof/ban-ips/check-users",method:"GET"}).then((function(a){t.usersBanned[t.address()]=a.data.map((function(t){return app.store.pushObject(t)})),m.redraw()})).then(this.loaded.bind(this)).catch((function(a){t.onerror(a),t.loading=!1}))},a}(y());const k=flarum.core.compat["common/Component"];var M=t.n(k),S=function(t){function a(){return t.apply(this,arguments)||this}r(a,t);var s=a.prototype;return s.oninit=function(a){if(t.prototype.oninit.call(this,a),this.address=this.attrs.address,this.post=this.attrs.post,this.user=this.attrs.user||this.post&&this.post.user(),!this.user&&this.address){var s=app.store.getBy("banned_ips","address",this.address);s&&(this.user=s.user())}this.banOptions=[],(this.post&&this.post.ipAddress()||this.address)&&this.banOptions.push("only"),this.user&&this.banOptions.push("all"),this.banOption=I()(this.banOptions[0]),this.reason=I()(""),this.otherUsers={},this.loading=!1},s.className=function(){return"Modal--medium"},s.title=function(){return app.translator.trans("fof-ban-ips.lib.modal.title")},s.content=function(){var t=this,a=this.otherUsers[this.banOption()],s=a&&a.map((function(t){return t&&t.displayName()||app.translator.trans("core.lib.username.deleted_text")}));return m("div",{className:"Modal-body"},m("p",null,app.translator.trans("fof-ban-ips.lib.modal.ban_ip_confirmation")),m("div",{className:"Form-group"},this.banOptions.map((function(a){return m("div",null,m("input",{type:"radio",name:"ban-option",id:"ban-option-"+a,checked:t.banOption()===a,onclick:t.banOption.bind(t,a)})," ",m("label",{htmlFor:"ban-option-"+a},app.translator.trans("fof-ban-ips.forum.modal.ban_options_"+a+"_ip",{user:t.user,ip:t.address||t.post&&t.post.ipAddress()})))}))),m("div",{className:"Form-group"},m("label",{className:"label"},app.translator.trans("fof-ban-ips.lib.modal.reason_label")),m("input",{type:"text",className:"FormControl",bidi:this.reason})),a?a.length?O().component({dismissible:!1},app.translator.trans("fof-ban-ips.lib.modal.ban_ip_users",{users:P()(s),count:s.length})):O().component({dismissible:!1,type:"success"},app.translator.trans("fof-ban-ips.forum.modal.ban_ip_no_users")):"",a&&m("br",null),m("div",{className:"Form-group"},m(u(),{className:"Button Button--primary",type:"submit",loading:this.loading},s?app.translator.trans("fof-ban-ips.lib.modal.ban_button"):app.translator.trans("fof-ban-ips.lib.modal.check_button"))))},s.onsubmit=function(t){var a=this;if(t.preventDefault(),this.loading=!0,void 0===this.otherUsers[this.banOption()])return this.getOtherUsers();var s={reason:this.reason(),userId:this.user.id()};"only"===this.banOption()?(s.address=this.post.ipAddress(),app.store.createRecord("banned_ips").save(s).then(this.hide.bind(this)).catch(this.onerror.bind(this)).then(this.loaded.bind(this))):"all"===this.banOption()&&app.request({body:{data:{attributes:s}},url:""+app.forum.attribute("apiUrl")+this.user.apiEndpoint()+"/ban",method:"POST",errorHandler:this.onerror.bind(this)}).then((function(t){return app.store.pushPayload(t).forEach(a.done.bind(a))})).then(this.hide.bind(this)).catch((function(){})).then(this.loaded.bind(this))},s.getOtherUsers=function(){var t=this,a={};"only"===this.banOption()&&(a.ip=this.address||this.post.ipAddress()),app.request({params:a,url:app.forum.attribute("apiUrl")+"/fof/ban-ips/check-users/"+this.user.id(),method:"GET",errorHandler:this.onerror.bind(this)}).then((function(a){t.otherUsers[t.banOption()]=a.data.map((function(t){return app.store.pushObject(t)})).filter((function(t){return 0===t.bannedIPs().length})),t.loading=!1})).catch((function(){})).then(this.loaded.bind(this))},s.done=function(t){var a={type:"banned_ips",id:t.id()};this.post&&(this.post.data.relationships.banned_ip={data:a}),this.user.data.relationships.banned_ips||(this.user.data.relationships.banned_ips={data:[]}),this.user.data.relationships.banned_ips.data.push(a),this.user.data.attributes.isBanned=!0,app.store.pushObject(this.user.data)},a}(y()),w=function(t){function a(){return t.apply(this,arguments)||this}r(a,t);var s=a.prototype;return s.title=function(){return app.translator.trans("fof-ban-ips.lib.modal.unban_title")},s.content=function(){var t=this,a=this.otherUsers[this.banOption()],s=a&&a.map((function(t){return t&&t.displayName()||app.translator.trans("core.lib.username.deleted_text")}));return this.bannedIPs?m("div",{className:"Modal-body"},O().component({dismissible:!1,type:"success"},app.translator.trans("fof-ban-ips.lib.modal.unbanned_ips",{ips:P()(this.bannedIPs)}))):m("div",{className:"Modal-body"},m("p",null,app.translator.trans("fof-ban-ips.lib.modal.unban_ip_confirmation")),m("div",{className:"Form-group"},this.banOptions.map((function(a){return m("div",null,m("input",{type:"radio",name:"ban-option",id:"ban-option-"+a,checked:t.banOption()===a,onclick:t.banOption.bind(t,a)})," ",m("label",{htmlFor:"ban-option-"+a},app.translator.trans("fof-ban-ips.lib.modal.unban_options_"+a+"_ip",{user:t.user,ip:t.address||t.post&&t.post.ipAddress()})))}))),a?a.length?O().component({dismissible:!1},app.translator.trans("fof-ban-ips.lib.modal.unban_ip_users",{users:P()(s),count:s.length})):O().component({dismissible:!1,type:"success"},app.translator.trans("fof-ban-ips.lib.modal.unban_ip_no_users")):"",a&&m("br",null),m("div",{className:"Form-group"},m(u(),{className:"Button Button--primary",type:"submit",loading:this.loading},s?app.translator.trans("fof-ban-ips.lib.modal.unban_button"):app.translator.trans("fof-ban-ips.lib.modal.check_button"))))},s.onsubmit=function(t){if(t.preventDefault(),this.loading=!0,void 0===this.otherUsers[this.banOption()])return this.getOtherUsers();var a={};if("only"===this.banOption()){a.address=this.address||this.post.ipAddress();var s=this.post?this.post.bannedIP():app.store.getBy("banned_ips","address",this.address);s.delete().then(this.done.bind(this,s)).catch(this.onerror.bind(this)).then(this.hide.bind(this))}else"all"===this.banOption()&&app.request({body:{data:{attributes:a}},url:""+app.forum.attribute("apiUrl")+this.user.apiEndpoint()+"/unban",method:"POST",errorHandler:this.onerror.bind(this)}).then(this.done.bind(this)).catch(this.onerror.bind(this)).then(this.hide.bind(this))},s.getOtherUsers=function(){var t=this,a={};"only"===this.banOption()&&(a.ip=this.address||this.post.ipAddress(),a.skipValidation=!0);var s=app.forum.attribute("apiUrl")+"/fof/ban-ips/check-users";this.user&&(s+="/"+this.user.id()),app.request({params:a,url:s,method:"GET",errorHandler:this.onerror.bind(this)}).then((function(a){var s=app.store.pushPayload(a);t.otherUsers[t.banOption()]=s.filter((function(t){return 1===t.bannedIPs().length})),t.loading=!1,m.redraw()})).catch((function(){})).then(this.loaded.bind(this))},s.done=function(t){this.loading=!1,this.post&&delete this.post.data.relationships.banned_ip,!this.user||this.user.data.relationships||t?this.user&&t instanceof app.store.models.banned_ips&&(this.user.data.relationships.banned_ips={data:this.user.data.relationships.banned_ips.data.filter((function(a){return a.id!==t.id()}))},this.user.data.attributes.isBanned=0!==this.user.data.relationships.banned_ips.data.length):(this.user.data.relationships.banned_ips.data=[],this.user.data.attributes.isBanned=!1),t&&Array.isArray(t.data)&&(this.bannedIPs=t.data.map((function(t){return t.attributes.address})),this.loading=!1,m.redraw())},s.hide=function(){t.prototype.hide.call(this),this.attrs.redraw||location.reload()},a}(S),z=function(t){function a(){return t.apply(this,arguments)||this}r(a,t);var s=a.prototype;return s.oninit=function(a){t.prototype.oninit.call(this,a),this.item=this.attrs.item,this.reason=I()(this.item.reason())},s.className=function(){return"Modal--medium"},s.title=function(){return app.translator.trans("fof-ban-ips.admin.modal.update_title")},s.content=function(){return m("div",{className:"Modal-body"},m("div",{className:"Form-group"},m("label",{className:"label"},app.translator.trans("fof-ban-ips.lib.modal.reason_label")),m("input",{type:"text",className:"FormControl",bidi:this.reason})),m("div",{className:"Form-group"},m(u(),{className:"Button Button--primary",type:"submit",loading:this.loading,disabled:this.reason()===this.item.reason()},app.translator.trans("fof-ban-ips.lib.modal.save_button"))))},s.onsubmit=function(t){t.preventDefault(),this.reason()&&(this.loading=!0,this.item.save({reason:this.reason()}).then(this.hide.bind(this)).catch(this.onerror.bind(this)).then(this.loaded.bind(this)))},a}(y()),R=function(t){function a(){return t.apply(this,arguments)||this}r(a,t);var s=a.prototype;return s.oninit=function(a){t.prototype.oninit.call(this,a),this.item=this.attrs.bannedIP},s.view=function(){var t=this;return m("tr",null,m("td",null,this.item.id()),m("td",null,F()(this.item.creator())),m("td",null,this.item.user()&&F()(this.item.user())),m("td",null,this.item.address()),m("td",null,this.item.reason()),m("td",null,this.item.createdAt().toLocaleDateString()),m("td",null,m("div",{className:"Button--group"},u().component({className:"Button Button--warning",icon:"fas fa-pencil-alt",disabled:this.item.creator()!==app.session.user,onclick:function(){return app.modal.show(z,{item:t.item})}}),u().component({className:"Button Button--danger",icon:"fas fa-times",onclick:function(){return app.modal.show(w,{address:t.item.address(),redraw:!0})}}))))},a}(M()),j=function(t){function a(){return t.apply(this,arguments)||this}r(a,t);var s=a.prototype;return s.oninit=function(a){t.prototype.oninit.call(this,a),this.loading=!0,this.page=0,this.pageSize=20},s.oncreate=function(a){t.prototype.oncreate.call(this,a),this.refresh()},s.content=function(){var t,a;return!0===this.nextResults&&(t=u().component({className:"Button Button--PageList-next",icon:"fas fa-angle-right",onclick:this.loadNext.bind(this)})),!0===this.prevResults&&(a=u().component({className:"Button Button--PageList-prev",icon:"fas fa-angle-left",onclick:this.loadPrev.bind(this)})),m("div",{className:"BannedIPsPage"},m("div",{className:"BannedIPsPage-header"},m("div",{className:"container"},u().component({className:"Button Button--primary",icon:"fas fa-plus",onclick:function(){return app.modal.show(U)}},app.translator.trans("fof-ban-ips.admin.page.create_button")))),m("br",null),m("div",{className:"BannedIpsPage-table"},m("div",{className:"container"},this.loading?c().component():app.store.all("banned_ips").length?m("table",{style:{width:"100%",textAlign:"left"},className:"table"},m("thead",null,m("tr",null,m("th",null,"#"),m("th",null,app.translator.trans("fof-ban-ips.admin.page.creator_label")),m("th",null,app.translator.trans("fof-ban-ips.admin.page.user_label")),m("th",null,app.translator.trans("fof-ban-ips.admin.page.address_label")),m("th",null,app.translator.trans("fof-ban-ips.admin.page.reason_label")),m("th",null,app.translator.trans("fof-ban-ips.admin.page.date_label")),m("th",null))),m("tbody",null,app.store.all("banned_ips").slice(this.page,this.page+this.pageSize).map((function(t){return R.component({bannedIP:t})})))):m("div",null,f().component({text:app.translator.trans("fof-ban-ips.admin.empty_text")})))),m("div",null,t,a))},s.refresh=function(){return this.loadResults().then(this.parseResults.bind(this))},s.loadResults=function(){var t=this.page*this.pageSize;return app.store.find("fof/ban-ips",{page:{offset:t,limit:this.pageSize}})},s.loadNext=function(){!0===this.nextResults&&(this.page++,this.refresh())},s.loadPrev=function(){!0===this.prevResults&&(this.page--,this.refresh())},s.parseResults=function(t){this.loading=!1,this.nextResults=!!t.payload.links.next,this.prevResults=!!t.payload.links.prev,m.redraw()},a}(v());const D={"fof/ban-ips/components/BanIPModal":S,"fof/ban-ips/components/UnbanIPModal":w,"fof/ban-ips/models/BannedIP":d},E=Object.assign(D,{"fof/ban-ips/components/BanIPModal":U,"fof/ban-ips/components/ChangeReasonModal":z,"fof/ban-ips/components/SettingsPage":j,"fof/ban-ips/components/SettingsPageItem":R}),Z=flarum.core;n().initializers.add("fof/ban-ips",(function(){n().store.models.banned_ips=d,n().store.models.users.prototype.bannedIPs=i().hasMany("banned_ips"),n().extensionData.for("fof-ban-ips").registerPermission({icon:"fas fa-gavel",label:n().translator.trans("fof-ban-ips.admin.permissions.view_banned_ip_list_label"),permission:"fof.ban-ips.viewBannedIPList"},"moderate").registerPermission({icon:"fas fa-gavel",label:n().translator.trans("fof-ban-ips.admin.permissions.ban_ip_label"),permission:"fof.ban-ips.banIP"},"moderate").registerPage(j)})),Object.assign(Z.compat,E)})(),module.exports=a})();
//# sourceMappingURL=admin.js.map
\ No newline at end of file
diff --git a/js/dist/admin.js.map b/js/dist/admin.js.map
index 7d4caac..7d60461 100644
--- a/js/dist/admin.js.map
+++ b/js/dist/admin.js.map
@@ -1 +1 @@
-{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLRF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3ER,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,M,+BCLvD,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,gB,aCAzC,SAASC,EAAgBhB,EAAGiB,GAMzC,OALAD,EAAkBf,OAAOiB,gBAAkB,SAAyBlB,EAAG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,KAAKwH,cAAgBgB,EAAQC,QAAQC,MAAMrB,KAE3CxD,EAAEC,U,EA3IeiD,CAAqB4B,KCJ1C,SACE,oCAAqChI,EACrC,sCAAuCgF,EACvC,8BAA+B7F,GCAjC,EAAexB,OAAOsK,OAAOxJ,EAAQ,CACnC,oCAAqCuB,EACrC,2CAA4CyF,EAC5C,sCAAuCW,EACvC,0CAA2CT,ICXvC,EAA+BpH,OAAOC,KCM5CgC,IAAAA,aAAAA,IAAqB,eAAe,WAClCA,IAAAA,MAAAA,OAAAA,WAA8BrB,EAE9BqB,IAAAA,MAAAA,OAAAA,MAAAA,UAAAA,UAA6Cf,IAAAA,QAAc,cAE3De,IAAAA,cAAAA,IACO,eACJ0H,mBACC,CACEnC,KAAM,eACNoC,MAAO3H,IAAAA,WAAAA,MAAqB,2DAC5B4H,WAAY,gCAEd,YAEDF,mBACC,CACEnC,KAAM,eACNoC,MAAO3H,IAAAA,WAAAA,MAAqB,8CAC5B4H,WAAY,qBAEd,YAEDC,aAAajC,MAOlBzI,OAAOsK,OAAOxJ,EAAAA,OAAQ6J,I","sources":["webpack://@fof/ban-ips/webpack/bootstrap","webpack://@fof/ban-ips/webpack/runtime/compat get default export","webpack://@fof/ban-ips/webpack/runtime/define property getters","webpack://@fof/ban-ips/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/ban-ips/webpack/runtime/make namespace object","webpack://@fof/ban-ips/external root \"flarum.core.compat['admin/app']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/ban-ips/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/ban-ips/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/utils/mixin']\"","webpack://@fof/ban-ips/./src/common/models/BannedIP.js","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/components/Placeholder']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['admin/components/ExtensionPage']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/components/Alert']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/helpers/punctuateSeries']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/helpers/username']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@fof/ban-ips/./src/admin/components/BanIPModal.js","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/ban-ips/./src/common/components/BanIPModal.js","webpack://@fof/ban-ips/./src/common/components/UnbanIPModal.js","webpack://@fof/ban-ips/./src/admin/components/ChangeReasonModal.js","webpack://@fof/ban-ips/./src/admin/components/SettingsPageItem.js","webpack://@fof/ban-ips/./src/admin/components/SettingsPage.js","webpack://@fof/ban-ips/./src/common/compat.js","webpack://@fof/ban-ips/./src/admin/compat.js","webpack://@fof/ban-ips/external assign \"flarum.core\"","webpack://@fof/ban-ips/./src/admin/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/mixin'];","import Model from 'flarum/common/Model';\nimport mixin from 'flarum/common/utils/mixin';\n\nexport default class BannedIP extends mixin(Model, {\n creator: Model.hasOne('creator'),\n user: Model.hasOne('user'),\n address: Model.attribute('address'),\n reason: Model.attribute('reason'),\n createdAt: Model.attribute('createdAt', Model.transformDate),\n deletedAt: Model.attribute('deletedAt', Model.transformDate),\n}) {\n apiEndpoint() {\n return `/fof/ban-ips${this.exists ? `/${this.id()}` : ''}`;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Placeholder'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/ExtensionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Alert'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/punctuateSeries'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/username'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","import Modal from 'flarum/common/components/Modal';\nimport Button from 'flarum/common/components/Button';\nimport Alert from 'flarum/common/components/Alert';\nimport punctuateSeries from 'flarum/common/helpers/punctuateSeries';\nimport username from 'flarum/common/helpers/username';\nimport Stream from 'flarum/common/utils/Stream';\n\nexport default class BanIPModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.address = Stream('');\n this.reason = Stream('');\n\n this.usersBanned = {};\n\n this.loading = false;\n }\n\n className() {\n return 'Modal--medium';\n }\n\n title() {\n return app.translator.trans('fof-ban-ips.lib.modal.title');\n }\n\n content() {\n const usersBanned = this.usersBanned[this.address()];\n const usernames = usersBanned && usersBanned.map(username);\n\n return (\n
\n
{app.translator.trans('fof-ban-ips.lib.modal.ban_ip_confirmation')}
\n\n
\n \n \n
\n\n
\n \n \n
\n\n {usersBanned\n ? usersBanned.length\n ? Alert.component(\n {\n dismissible: false,\n },\n app.translator.transChoice('fof-ban-ips.lib.modal.ban_ip_users', usernames.length, {\n users: punctuateSeries(usernames),\n })\n )\n : Alert.component(\n {\n dismissible: false,\n type: 'success',\n },\n app.translator.trans('fof-ban-ips.admin.modal.ban_ip_no_users')\n )\n : ''}\n\n {usersBanned &&
}\n\n
\n \n
\n
\n );\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n if (!this.address()) return;\n\n this.loading = true;\n\n if (typeof this.usersBanned[this.address()] === 'undefined') return this.getOtherUsers();\n\n const attrs = {\n address: this.address(),\n reason: this.reason(),\n };\n\n app.store.createRecord('banned_ips').save(attrs).then(this.hide.bind(this), this.onerror.bind(this), this.loaded.bind(this));\n }\n\n getOtherUsers() {\n const data = {\n ip: this.address(),\n };\n\n app\n .request({\n params: data,\n url: `${app.forum.attribute('apiUrl')}/fof/ban-ips/check-users`,\n method: 'GET',\n })\n .then((res) => {\n this.usersBanned[this.address()] = res.data.map((e) => app.store.pushObject(e));\n\n m.redraw();\n })\n .then(this.loaded.bind(this))\n .catch((e) => {\n this.onerror(e);\n this.loading = false;\n });\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","import Modal from 'flarum/common/components/Modal';\nimport Button from 'flarum/common/components/Button';\nimport Alert from 'flarum/common/components/Alert';\nimport Stream from 'flarum/common/utils/Stream';\nimport punctuateSeries from 'flarum/common/helpers/punctuateSeries';\n\nexport default class BanIPModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.address = this.attrs.address;\n this.post = this.attrs.post;\n this.user = this.attrs.user || (this.post && this.post.user());\n\n if (!this.user && this.address) {\n const bannedIP = app.store.getBy('banned_ips', 'address', this.address);\n\n if (bannedIP) this.user = bannedIP.user();\n }\n\n this.banOptions = [];\n\n if ((this.post && this.post.ipAddress()) || this.address) this.banOptions.push('only');\n if (this.user) this.banOptions.push('all');\n\n this.banOption = Stream(this.banOptions[0]);\n this.reason = Stream('');\n\n this.otherUsers = {};\n\n this.loading = false;\n }\n\n className() {\n return 'Modal--medium';\n }\n\n title() {\n return app.translator.trans('fof-ban-ips.lib.modal.title');\n }\n\n content() {\n const otherUsersBanned = this.otherUsers[this.banOption()];\n const usernames =\n otherUsersBanned && otherUsersBanned.map((u) => (u && u.displayName()) || app.translator.trans('core.lib.username.deleted_text'));\n\n return (\n \n
{app.translator.trans('fof-ban-ips.lib.modal.ban_ip_confirmation')}
\n\n
\n {this.banOptions.map((key) => (\n
\n \n \n \n
\n ))}\n
\n\n
\n \n \n
\n\n {otherUsersBanned\n ? otherUsersBanned.length\n ? Alert.component(\n {\n dismissible: false,\n },\n app.translator.transChoice('fof-ban-ips.lib.modal.ban_ip_users', usernames.length, {\n users: punctuateSeries(usernames),\n })\n )\n : Alert.component(\n {\n dismissible: false,\n type: 'success',\n },\n app.translator.trans('fof-ban-ips.forum.modal.ban_ip_no_users')\n )\n : ''}\n\n {otherUsersBanned &&
}\n\n
\n \n
\n
\n );\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n this.loading = true;\n\n if (typeof this.otherUsers[this.banOption()] === 'undefined') return this.getOtherUsers();\n\n const attrs = {\n reason: this.reason(),\n userId: this.user.id(),\n };\n\n if (this.banOption() === 'only') {\n attrs.address = this.post.ipAddress();\n\n app.store.createRecord('banned_ips').save(attrs).then(this.hide.bind(this)).catch(this.onerror.bind(this)).then(this.loaded.bind(this));\n } else if (this.banOption() === 'all') {\n app\n .request({\n body: {\n data: {\n attributes: attrs,\n },\n },\n url: `${app.forum.attribute('apiUrl')}${this.user.apiEndpoint()}/ban`,\n method: 'POST',\n errorHandler: this.onerror.bind(this),\n })\n .then((res) => app.store.pushPayload(res).forEach(this.done.bind(this)))\n .then(this.hide.bind(this))\n .catch(() => {})\n .then(this.loaded.bind(this));\n }\n }\n\n getOtherUsers() {\n const data = {};\n\n if (this.banOption() === 'only') data.ip = this.address || this.post.ipAddress();\n\n app\n .request({\n params: data,\n url: `${app.forum.attribute('apiUrl')}/fof/ban-ips/check-users/${this.user.id()}`,\n method: 'GET',\n errorHandler: this.onerror.bind(this),\n })\n .then((res) => {\n this.otherUsers[this.banOption()] = res.data.map((e) => app.store.pushObject(e)).filter((e) => e.bannedIPs().length === 0);\n this.loading = false;\n })\n .catch(() => {})\n .then(this.loaded.bind(this));\n }\n\n done(bannedIP) {\n const obj = {\n type: 'banned_ips',\n id: bannedIP.id(),\n };\n\n if (this.post) {\n this.post.data.relationships.banned_ip = {\n data: obj,\n };\n }\n\n if (!this.user.data.relationships.banned_ips)\n this.user.data.relationships.banned_ips = {\n data: [],\n };\n\n this.user.data.relationships.banned_ips.data.push(obj);\n this.user.data.attributes.isBanned = true;\n\n app.store.pushObject(this.user.data);\n }\n}\n","import Button from 'flarum/common/components/Button';\nimport Alert from 'flarum/common/components/Alert';\nimport punctuateSeries from 'flarum/common/helpers/punctuateSeries';\nimport username from 'flarum/common/helpers/username';\n\nimport BanIPModal from './BanIPModal';\n\nexport default class UnbanIPModal extends BanIPModal {\n title() {\n return app.translator.trans('fof-ban-ips.lib.modal.unban_title');\n }\n\n content() {\n const otherUsers = this.otherUsers[this.banOption()];\n const usernames = otherUsers && otherUsers.map((u) => (u && u.displayName()) || app.translator.trans('core.lib.username.deleted_text'));\n\n if (this.bannedIPs) {\n return (\n \n {Alert.component(\n {\n dismissible: false,\n type: 'success',\n },\n app.translator.trans('fof-ban-ips.lib.modal.unbanned_ips', { ips: punctuateSeries(this.bannedIPs) })\n )}\n
\n );\n }\n\n return (\n \n
{app.translator.trans('fof-ban-ips.lib.modal.unban_ip_confirmation')}
\n\n
\n {this.banOptions.map((key) => (\n
\n \n \n \n
\n ))}\n
\n\n {otherUsers\n ? otherUsers.length\n ? Alert.component(\n {\n dismissible: false,\n },\n app.translator.transChoice('fof-ban-ips.lib.modal.unban_ip_users', usernames.length, {\n users: punctuateSeries(usernames),\n })\n )\n : Alert.component(\n {\n dismissible: false,\n type: 'success',\n },\n app.translator.trans('fof-ban-ips.lib.modal.unban_ip_no_users')\n )\n : ''}\n\n {otherUsers &&
}\n\n
\n \n
\n
\n );\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n this.loading = true;\n\n if (typeof this.otherUsers[this.banOption()] === 'undefined') return this.getOtherUsers();\n\n const attrs = {};\n\n if (this.banOption() === 'only') {\n attrs.address = this.address || this.post.ipAddress();\n\n const bannedIP = this.post ? this.post.bannedIP() : app.store.getBy('banned_ips', 'address', this.address);\n\n bannedIP.delete().then(this.done.bind(this, bannedIP)).catch(this.onerror.bind(this)).then(this.hide.bind(this));\n } else if (this.banOption() === 'all') {\n app\n .request({\n body: {\n data: {\n attributes: attrs,\n },\n },\n url: `${app.forum.attribute('apiUrl')}${this.user.apiEndpoint()}/unban`,\n method: 'POST',\n errorHandler: this.onerror.bind(this),\n })\n .then(this.done.bind(this))\n .catch(this.onerror.bind(this))\n .then(this.hide.bind(this));\n }\n }\n\n getOtherUsers() {\n const data = {};\n\n if (this.banOption() === 'only') {\n data.ip = this.address || this.post.ipAddress();\n data.skipValidation = true;\n }\n\n let url = `${app.forum.attribute('apiUrl')}/fof/ban-ips/check-users`;\n\n if (this.user) url += `/${this.user.id()}`;\n\n app\n .request({\n params: data,\n url: url,\n method: 'GET',\n errorHandler: this.onerror.bind(this),\n })\n .then((res) => {\n const data = app.store.pushPayload(res);\n\n this.otherUsers[this.banOption()] = data.filter((e) => e.bannedIPs().length === 1);\n this.loading = false;\n\n m.redraw();\n })\n .catch(() => {})\n .then(this.loaded.bind(this));\n }\n\n done(bannedIP) {\n this.loading = false;\n\n if (this.post) delete this.post.data.relationships.banned_ip;\n\n if (this.user && !this.user.data.relationships && !bannedIP) {\n this.user.data.relationships.banned_ips.data = [];\n this.user.data.attributes.isBanned = false;\n } else if (this.user && bannedIP instanceof app.store.models.banned_ips) {\n this.user.data.relationships.banned_ips = {\n data: this.user.data.relationships.banned_ips.data.filter((e) => e.id !== bannedIP.id()),\n };\n this.user.data.attributes.isBanned = this.user.data.relationships.banned_ips.data.length !== 0;\n }\n\n if (bannedIP && Array.isArray(bannedIP.data)) {\n this.bannedIPs = bannedIP.data.map((b) => b.attributes.address);\n this.loading = false;\n\n m.redraw();\n }\n }\n\n hide() {\n super.hide();\n\n if (!this.attrs.redraw) {\n location.reload();\n }\n }\n}\n","import Modal from 'flarum/common/components/Modal';\nimport Button from 'flarum/common/components/Button';\nimport Stream from 'flarum/common/utils/Stream';\n\nexport default class ChangeReasonModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.item = this.attrs.item;\n\n this.reason = Stream(this.item.reason());\n }\n\n className() {\n return 'Modal--medium';\n }\n\n title() {\n return app.translator.trans('fof-ban-ips.admin.modal.update_title');\n }\n\n content() {\n return (\n \n
\n \n \n
\n\n
\n \n
\n
\n );\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n if (!this.reason()) return;\n\n this.loading = true;\n\n this.item\n .save({\n reason: this.reason(),\n })\n .then(this.hide.bind(this))\n .catch(this.onerror.bind(this))\n .then(this.loaded.bind(this));\n }\n}\n","import Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport username from 'flarum/common/helpers/username';\n\nimport UnbanIPModal from '../../common/components/UnbanIPModal';\nimport ChangeReasonModal from './ChangeReasonModal';\n\nexport default class SettingsPageItem extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.item = this.attrs.bannedIP;\n }\n\n view() {\n return (\n \n {this.item.id()} | \n {username(this.item.creator())} | \n {this.item.user() && username(this.item.user())} | \n {this.item.address()} | \n {this.item.reason()} | \n {this.item.createdAt().toLocaleDateString()} | \n \n \n {Button.component({\n className: 'Button Button--warning',\n icon: 'fas fa-pencil-alt',\n disabled: this.item.creator() !== app.session.user,\n onclick: () => app.modal.show(ChangeReasonModal, { item: this.item }),\n })}\n {Button.component({\n className: 'Button Button--danger',\n icon: 'fas fa-times',\n onclick: () => app.modal.show(UnbanIPModal, { address: this.item.address(), redraw: true }),\n })}\n \n | \n
\n );\n }\n}\n","import Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Placeholder from 'flarum/common/components/Placeholder';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\n\nimport BanIPModal from './BanIPModal';\nimport SettingsPageItem from './SettingsPageItem';\n\nexport default class SettingsPage extends ExtensionPage {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.loading = true;\n\n this.page = 0;\n this.pageSize = 20;\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n this.refresh();\n }\n\n content() {\n let next, prev;\n\n if (this.nextResults === true) {\n next = Button.component({\n className: 'Button Button--PageList-next',\n icon: 'fas fa-angle-right',\n onclick: this.loadNext.bind(this),\n });\n }\n\n if (this.prevResults === true) {\n prev = Button.component({\n className: 'Button Button--PageList-prev',\n icon: 'fas fa-angle-left',\n onclick: this.loadPrev.bind(this),\n });\n }\n\n return (\n \n
\n
\n {Button.component(\n {\n className: 'Button Button--primary',\n icon: 'fas fa-plus',\n onclick: () => app.modal.show(BanIPModal),\n },\n app.translator.trans('fof-ban-ips.admin.page.create_button')\n )}\n
\n
\n
\n
\n
\n {this.loading ? (\n LoadingIndicator.component()\n ) : app.store.all('banned_ips').length ? (\n
\n \n \n # | \n {app.translator.trans('fof-ban-ips.admin.page.creator_label')} | \n {app.translator.trans('fof-ban-ips.admin.page.user_label')} | \n {app.translator.trans('fof-ban-ips.admin.page.address_label')} | \n {app.translator.trans('fof-ban-ips.admin.page.reason_label')} | \n {app.translator.trans('fof-ban-ips.admin.page.date_label')} | \n | \n
\n \n \n {app.store\n .all('banned_ips')\n .slice(this.page, this.page + this.pageSize)\n .map((bannedIP) => SettingsPageItem.component({ bannedIP }))}\n \n
\n ) : (\n
{Placeholder.component({ text: app.translator.trans('fof-ban-ips.admin.empty_text') })}
\n )}\n
\n
\n
\n {next}\n {prev}\n
\n
\n );\n }\n\n refresh() {\n return this.loadResults().then(this.parseResults.bind(this));\n }\n\n /**\n * Load a new page of Pages results.\n *\n * @param {Integer} page number.\n * @return {Promise}\n */\n loadResults() {\n const offset = this.page * this.pageSize;\n\n return app.store.find('fof/ban-ips', { page: { offset, limit: this.pageSize } });\n }\n\n /**\n * Load the next page of results.\n *\n * @public\n */\n loadNext() {\n if (this.nextResults === true) {\n this.page++;\n this.refresh();\n }\n }\n\n /**\n * Load the previous page of results.\n *\n * @public\n */\n loadPrev() {\n if (this.prevResults === true) {\n this.page--;\n this.refresh();\n }\n }\n\n /**\n * Parse results and append them to the page list.\n *\n * @param {Page[]} results\n * @return {Page[]}\n */\n parseResults(results) {\n this.loading = false;\n\n this.nextResults = !!results.payload.links.next;\n this.prevResults = !!results.payload.links.prev;\n\n m.redraw();\n }\n}\n","import BanIPModal from './components/BanIPModal';\nimport UnbanIPModal from './components/UnbanIPModal';\nimport BannedIP from './models/BannedIP';\n\nexport default {\n 'fof/ban-ips/components/BanIPModal': BanIPModal,\n 'fof/ban-ips/components/UnbanIPModal': UnbanIPModal,\n 'fof/ban-ips/models/BannedIP': BannedIP,\n};\n","import compat from '../common/compat';\n\nimport BanIPModal from './components/BanIPModal';\nimport ChangeReasonModal from './components/ChangeReasonModal';\nimport SettingsPage from './components/SettingsPage';\nimport SettingsPageItem from './components/SettingsPageItem';\n\nexport default Object.assign(compat, {\n 'fof/ban-ips/components/BanIPModal': BanIPModal,\n 'fof/ban-ips/components/ChangeReasonModal': ChangeReasonModal,\n 'fof/ban-ips/components/SettingsPage': SettingsPage,\n 'fof/ban-ips/components/SettingsPageItem': SettingsPageItem,\n});\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core;","import app from 'flarum/admin/app';\nimport Model from 'flarum/common/Model';\n\nimport BannedIP from '../common/models/BannedIP';\nimport SettingsPage from './components/SettingsPage';\n\napp.initializers.add('fof/ban-ips', () => {\n app.store.models.banned_ips = BannedIP;\n\n app.store.models.users.prototype.bannedIPs = Model.hasMany('banned_ips');\n\n app.extensionData\n .for('fof-ban-ips')\n .registerPermission(\n {\n icon: 'fas fa-gavel',\n label: app.translator.trans('fof-ban-ips.admin.permissions.view_banned_ip_list_label'),\n permission: 'fof.ban-ips.viewBannedIPList',\n },\n 'moderate'\n )\n .registerPermission(\n {\n icon: 'fas fa-gavel',\n label: app.translator.trans('fof-ban-ips.admin.permissions.ban_ip_label'),\n permission: 'fof.ban-ips.banIP',\n },\n 'moderate'\n )\n .registerPage(SettingsPage);\n});\n\n// Expose compat API\nimport extCompat from './compat';\nimport { compat } from '@flarum/core/admin';\n\nObject.assign(compat, extCompat);\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_setPrototypeOf","p","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","create","constructor","BannedIP","apiEndpoint","this","exists","id","mixin","Model","creator","user","address","reason","createdAt","deletedAt","BanIPModal","oninit","vnode","Stream","usersBanned","loading","className","title","app","translator","trans","content","usernames","map","username","type","bidi","required","pattern","length","Alert","dismissible","transChoice","users","punctuateSeries","disabled","store","getBy","onsubmit","e","preventDefault","getOtherUsers","attrs","createRecord","save","then","hide","bind","onerror","loaded","data","ip","request","params","url","forum","attribute","method","res","pushObject","m","redraw","Modal","post","bannedIP","banOptions","ipAddress","push","banOption","otherUsers","otherUsersBanned","u","displayName","name","checked","onclick","htmlFor","userId","body","attributes","errorHandler","pushPayload","forEach","done","filter","bannedIPs","relationships","banned_ip","banned_ips","isBanned","UnbanIPModal","ips","skipValidation","models","Array","isArray","b","location","reload","ChangeReasonModal","item","SettingsPageItem","view","toLocaleDateString","Button","icon","session","modal","show","Component","SettingsPage","page","pageSize","oncreate","refresh","next","prev","nextResults","loadNext","prevResults","loadPrev","LoadingIndicator","all","style","width","textAlign","slice","component","Placeholder","text","loadResults","parseResults","offset","find","limit","results","payload","links","ExtensionPage","assign","registerPermission","label","permission","registerPage","extCompat"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLRF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3ER,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,M,+BCLvD,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,gB,aCAzC,SAASC,EAA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I,GACXxI,KAAKgB,SAAU,EAEfhB,KAAKsH,cAAgBkB,EAAQC,QAAQC,MAAMtB,KAC3CpH,KAAKwH,cAAgBgB,EAAQC,QAAQC,MAAMrB,KAE3CxD,EAAEC,U,EA3IeiD,CAAqB4B,KCJ1C,SACE,oCAAqChI,EACrC,sCAAuCgF,EACvC,8BAA+B7F,GCAjC,EAAexB,OAAOsK,OAAOxJ,EAAQ,CACnC,oCAAqCuB,EACrC,2CAA4CyF,EAC5C,sCAAuCW,EACvC,0CAA2CT,ICXvC,EAA+BpH,OAAOC,KCM5CgC,IAAAA,aAAAA,IAAqB,eAAe,WAClCA,IAAAA,MAAAA,OAAAA,WAA8BrB,EAE9BqB,IAAAA,MAAAA,OAAAA,MAAAA,UAAAA,UAA6Cf,IAAAA,QAAc,cAE3De,IAAAA,cAAAA,IACO,eACJ0H,mBACC,CACEnC,KAAM,eACNoC,MAAO3H,IAAAA,WAAAA,MAAqB,2DAC5B4H,WAAY,gCAEd,YAEDF,mBACC,CACEnC,KAAM,eACNoC,MAAO3H,IAAAA,WAAAA,MAAqB,8CAC5B4H,WAAY,qBAEd,YAEDC,aAAajC,MAOlBzI,OAAOsK,OAAOxJ,EAAAA,OAAQ6J,I","sources":["webpack://@fof/ban-ips/webpack/bootstrap","webpack://@fof/ban-ips/webpack/runtime/compat get default export","webpack://@fof/ban-ips/webpack/runtime/define property getters","webpack://@fof/ban-ips/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/ban-ips/webpack/runtime/make namespace object","webpack://@fof/ban-ips/external root \"flarum.core.compat['admin/app']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/ban-ips/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/ban-ips/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/utils/mixin']\"","webpack://@fof/ban-ips/./src/common/models/BannedIP.js","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/components/Placeholder']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['admin/components/ExtensionPage']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/components/Alert']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/helpers/punctuateSeries']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/helpers/username']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@fof/ban-ips/./src/admin/components/BanIPModal.js","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/ban-ips/./src/common/components/BanIPModal.js","webpack://@fof/ban-ips/./src/common/components/UnbanIPModal.js","webpack://@fof/ban-ips/./src/admin/components/ChangeReasonModal.js","webpack://@fof/ban-ips/./src/admin/components/SettingsPageItem.js","webpack://@fof/ban-ips/./src/admin/components/SettingsPage.js","webpack://@fof/ban-ips/./src/common/compat.js","webpack://@fof/ban-ips/./src/admin/compat.js","webpack://@fof/ban-ips/external assign \"flarum.core\"","webpack://@fof/ban-ips/./src/admin/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/mixin'];","import Model from 'flarum/common/Model';\nimport mixin from 'flarum/common/utils/mixin';\n\nexport default class BannedIP extends mixin(Model, {\n creator: Model.hasOne('creator'),\n user: Model.hasOne('user'),\n address: Model.attribute('address'),\n reason: Model.attribute('reason'),\n createdAt: Model.attribute('createdAt', Model.transformDate),\n deletedAt: Model.attribute('deletedAt', Model.transformDate),\n}) {\n apiEndpoint() {\n return `/fof/ban-ips${this.exists ? `/${this.id()}` : ''}`;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Placeholder'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/ExtensionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Alert'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/punctuateSeries'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/username'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","import Modal from 'flarum/common/components/Modal';\nimport Button from 'flarum/common/components/Button';\nimport Alert from 'flarum/common/components/Alert';\nimport punctuateSeries from 'flarum/common/helpers/punctuateSeries';\nimport username from 'flarum/common/helpers/username';\nimport Stream from 'flarum/common/utils/Stream';\n\nexport default class BanIPModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.address = Stream('');\n this.reason = Stream('');\n\n this.usersBanned = {};\n\n this.loading = false;\n }\n\n className() {\n return 'Modal--medium';\n }\n\n title() {\n return app.translator.trans('fof-ban-ips.lib.modal.title');\n }\n\n content() {\n const usersBanned = this.usersBanned[this.address()];\n const usernames = usersBanned && usersBanned.map(username);\n\n return (\n \n
{app.translator.trans('fof-ban-ips.lib.modal.ban_ip_confirmation')}
\n\n
\n \n \n
\n\n
\n \n \n
\n\n {usersBanned\n ? usersBanned.length\n ? Alert.component(\n {\n dismissible: false,\n },\n app.translator.trans('fof-ban-ips.lib.modal.ban_ip_users', {\n users: punctuateSeries(usernames),\n count: usernames.length,\n })\n )\n : Alert.component(\n {\n dismissible: false,\n type: 'success',\n },\n app.translator.trans('fof-ban-ips.admin.modal.ban_ip_no_users')\n )\n : ''}\n\n {usersBanned &&
}\n\n
\n \n
\n
\n );\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n if (!this.address()) return;\n\n this.loading = true;\n\n if (typeof this.usersBanned[this.address()] === 'undefined') return this.getOtherUsers();\n\n const attrs = {\n address: this.address(),\n reason: this.reason(),\n };\n\n app.store.createRecord('banned_ips').save(attrs).then(this.hide.bind(this), this.onerror.bind(this), this.loaded.bind(this));\n }\n\n getOtherUsers() {\n const data = {\n ip: this.address(),\n };\n\n app\n .request({\n params: data,\n url: `${app.forum.attribute('apiUrl')}/fof/ban-ips/check-users`,\n method: 'GET',\n })\n .then((res) => {\n this.usersBanned[this.address()] = res.data.map((e) => app.store.pushObject(e));\n\n m.redraw();\n })\n .then(this.loaded.bind(this))\n .catch((e) => {\n this.onerror(e);\n this.loading = false;\n });\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","import Modal from 'flarum/common/components/Modal';\nimport Button from 'flarum/common/components/Button';\nimport Alert from 'flarum/common/components/Alert';\nimport Stream from 'flarum/common/utils/Stream';\nimport punctuateSeries from 'flarum/common/helpers/punctuateSeries';\n\nexport default class BanIPModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.address = this.attrs.address;\n this.post = this.attrs.post;\n this.user = this.attrs.user || (this.post && this.post.user());\n\n if (!this.user && this.address) {\n const bannedIP = app.store.getBy('banned_ips', 'address', this.address);\n\n if (bannedIP) this.user = bannedIP.user();\n }\n\n this.banOptions = [];\n\n if ((this.post && this.post.ipAddress()) || this.address) this.banOptions.push('only');\n if (this.user) this.banOptions.push('all');\n\n this.banOption = Stream(this.banOptions[0]);\n this.reason = Stream('');\n\n this.otherUsers = {};\n\n this.loading = false;\n }\n\n className() {\n return 'Modal--medium';\n }\n\n title() {\n return app.translator.trans('fof-ban-ips.lib.modal.title');\n }\n\n content() {\n const otherUsersBanned = this.otherUsers[this.banOption()];\n const usernames =\n otherUsersBanned && otherUsersBanned.map((u) => (u && u.displayName()) || app.translator.trans('core.lib.username.deleted_text'));\n\n return (\n \n
{app.translator.trans('fof-ban-ips.lib.modal.ban_ip_confirmation')}
\n\n
\n {this.banOptions.map((key) => (\n
\n \n \n \n
\n ))}\n
\n\n
\n \n \n
\n\n {otherUsersBanned\n ? otherUsersBanned.length\n ? Alert.component(\n {\n dismissible: false,\n },\n app.translator.trans('fof-ban-ips.lib.modal.ban_ip_users', {\n users: punctuateSeries(usernames),\n count: usernames.length,\n })\n )\n : Alert.component(\n {\n dismissible: false,\n type: 'success',\n },\n app.translator.trans('fof-ban-ips.forum.modal.ban_ip_no_users')\n )\n : ''}\n\n {otherUsersBanned &&
}\n\n
\n \n
\n
\n );\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n this.loading = true;\n\n if (typeof this.otherUsers[this.banOption()] === 'undefined') return this.getOtherUsers();\n\n const attrs = {\n reason: this.reason(),\n userId: this.user.id(),\n };\n\n if (this.banOption() === 'only') {\n attrs.address = this.post.ipAddress();\n\n app.store.createRecord('banned_ips').save(attrs).then(this.hide.bind(this)).catch(this.onerror.bind(this)).then(this.loaded.bind(this));\n } else if (this.banOption() === 'all') {\n app\n .request({\n body: {\n data: {\n attributes: attrs,\n },\n },\n url: `${app.forum.attribute('apiUrl')}${this.user.apiEndpoint()}/ban`,\n method: 'POST',\n errorHandler: this.onerror.bind(this),\n })\n .then((res) => app.store.pushPayload(res).forEach(this.done.bind(this)))\n .then(this.hide.bind(this))\n .catch(() => {})\n .then(this.loaded.bind(this));\n }\n }\n\n getOtherUsers() {\n const data = {};\n\n if (this.banOption() === 'only') data.ip = this.address || this.post.ipAddress();\n\n app\n .request({\n params: data,\n url: `${app.forum.attribute('apiUrl')}/fof/ban-ips/check-users/${this.user.id()}`,\n method: 'GET',\n errorHandler: this.onerror.bind(this),\n })\n .then((res) => {\n this.otherUsers[this.banOption()] = res.data.map((e) => app.store.pushObject(e)).filter((e) => e.bannedIPs().length === 0);\n this.loading = false;\n })\n .catch(() => {})\n .then(this.loaded.bind(this));\n }\n\n done(bannedIP) {\n const obj = {\n type: 'banned_ips',\n id: bannedIP.id(),\n };\n\n if (this.post) {\n this.post.data.relationships.banned_ip = {\n data: obj,\n };\n }\n\n if (!this.user.data.relationships.banned_ips)\n this.user.data.relationships.banned_ips = {\n data: [],\n };\n\n this.user.data.relationships.banned_ips.data.push(obj);\n this.user.data.attributes.isBanned = true;\n\n app.store.pushObject(this.user.data);\n }\n}\n","import Button from 'flarum/common/components/Button';\nimport Alert from 'flarum/common/components/Alert';\nimport punctuateSeries from 'flarum/common/helpers/punctuateSeries';\nimport username from 'flarum/common/helpers/username';\n\nimport BanIPModal from './BanIPModal';\n\nexport default class UnbanIPModal extends BanIPModal {\n title() {\n return app.translator.trans('fof-ban-ips.lib.modal.unban_title');\n }\n\n content() {\n const otherUsers = this.otherUsers[this.banOption()];\n const usernames = otherUsers && otherUsers.map((u) => (u && u.displayName()) || app.translator.trans('core.lib.username.deleted_text'));\n\n if (this.bannedIPs) {\n return (\n \n {Alert.component(\n {\n dismissible: false,\n type: 'success',\n },\n app.translator.trans('fof-ban-ips.lib.modal.unbanned_ips', { ips: punctuateSeries(this.bannedIPs) })\n )}\n
\n );\n }\n\n return (\n \n
{app.translator.trans('fof-ban-ips.lib.modal.unban_ip_confirmation')}
\n\n
\n {this.banOptions.map((key) => (\n
\n \n \n \n
\n ))}\n
\n\n {otherUsers\n ? otherUsers.length\n ? Alert.component(\n {\n dismissible: false,\n },\n app.translator.trans('fof-ban-ips.lib.modal.unban_ip_users', {\n users: punctuateSeries(usernames),\n count: usernames.length,\n })\n )\n : Alert.component(\n {\n dismissible: false,\n type: 'success',\n },\n app.translator.trans('fof-ban-ips.lib.modal.unban_ip_no_users')\n )\n : ''}\n\n {otherUsers &&
}\n\n
\n \n
\n
\n );\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n this.loading = true;\n\n if (typeof this.otherUsers[this.banOption()] === 'undefined') return this.getOtherUsers();\n\n const attrs = {};\n\n if (this.banOption() === 'only') {\n attrs.address = this.address || this.post.ipAddress();\n\n const bannedIP = this.post ? this.post.bannedIP() : app.store.getBy('banned_ips', 'address', this.address);\n\n bannedIP.delete().then(this.done.bind(this, bannedIP)).catch(this.onerror.bind(this)).then(this.hide.bind(this));\n } else if (this.banOption() === 'all') {\n app\n .request({\n body: {\n data: {\n attributes: attrs,\n },\n },\n url: `${app.forum.attribute('apiUrl')}${this.user.apiEndpoint()}/unban`,\n method: 'POST',\n errorHandler: this.onerror.bind(this),\n })\n .then(this.done.bind(this))\n .catch(this.onerror.bind(this))\n .then(this.hide.bind(this));\n }\n }\n\n getOtherUsers() {\n const data = {};\n\n if (this.banOption() === 'only') {\n data.ip = this.address || this.post.ipAddress();\n data.skipValidation = true;\n }\n\n let url = `${app.forum.attribute('apiUrl')}/fof/ban-ips/check-users`;\n\n if (this.user) url += `/${this.user.id()}`;\n\n app\n .request({\n params: data,\n url: url,\n method: 'GET',\n errorHandler: this.onerror.bind(this),\n })\n .then((res) => {\n const data = app.store.pushPayload(res);\n\n this.otherUsers[this.banOption()] = data.filter((e) => e.bannedIPs().length === 1);\n this.loading = false;\n\n m.redraw();\n })\n .catch(() => {})\n .then(this.loaded.bind(this));\n }\n\n done(bannedIP) {\n this.loading = false;\n\n if (this.post) delete this.post.data.relationships.banned_ip;\n\n if (this.user && !this.user.data.relationships && !bannedIP) {\n this.user.data.relationships.banned_ips.data = [];\n this.user.data.attributes.isBanned = false;\n } else if (this.user && bannedIP instanceof app.store.models.banned_ips) {\n this.user.data.relationships.banned_ips = {\n data: this.user.data.relationships.banned_ips.data.filter((e) => e.id !== bannedIP.id()),\n };\n this.user.data.attributes.isBanned = this.user.data.relationships.banned_ips.data.length !== 0;\n }\n\n if (bannedIP && Array.isArray(bannedIP.data)) {\n this.bannedIPs = bannedIP.data.map((b) => b.attributes.address);\n this.loading = false;\n\n m.redraw();\n }\n }\n\n hide() {\n super.hide();\n\n if (!this.attrs.redraw) {\n location.reload();\n }\n }\n}\n","import Modal from 'flarum/common/components/Modal';\nimport Button from 'flarum/common/components/Button';\nimport Stream from 'flarum/common/utils/Stream';\n\nexport default class ChangeReasonModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.item = this.attrs.item;\n\n this.reason = Stream(this.item.reason());\n }\n\n className() {\n return 'Modal--medium';\n }\n\n title() {\n return app.translator.trans('fof-ban-ips.admin.modal.update_title');\n }\n\n content() {\n return (\n \n
\n \n \n
\n\n
\n \n
\n
\n );\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n if (!this.reason()) return;\n\n this.loading = true;\n\n this.item\n .save({\n reason: this.reason(),\n })\n .then(this.hide.bind(this))\n .catch(this.onerror.bind(this))\n .then(this.loaded.bind(this));\n }\n}\n","import Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport username from 'flarum/common/helpers/username';\n\nimport UnbanIPModal from '../../common/components/UnbanIPModal';\nimport ChangeReasonModal from './ChangeReasonModal';\n\nexport default class SettingsPageItem extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.item = this.attrs.bannedIP;\n }\n\n view() {\n return (\n \n {this.item.id()} | \n {username(this.item.creator())} | \n {this.item.user() && username(this.item.user())} | \n {this.item.address()} | \n {this.item.reason()} | \n {this.item.createdAt().toLocaleDateString()} | \n \n \n {Button.component({\n className: 'Button Button--warning',\n icon: 'fas fa-pencil-alt',\n disabled: this.item.creator() !== app.session.user,\n onclick: () => app.modal.show(ChangeReasonModal, { item: this.item }),\n })}\n {Button.component({\n className: 'Button Button--danger',\n icon: 'fas fa-times',\n onclick: () => app.modal.show(UnbanIPModal, { address: this.item.address(), redraw: true }),\n })}\n \n | \n
\n );\n }\n}\n","import Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Placeholder from 'flarum/common/components/Placeholder';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\n\nimport BanIPModal from './BanIPModal';\nimport SettingsPageItem from './SettingsPageItem';\n\nexport default class SettingsPage extends ExtensionPage {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.loading = true;\n\n this.page = 0;\n this.pageSize = 20;\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n this.refresh();\n }\n\n content() {\n let next, prev;\n\n if (this.nextResults === true) {\n next = Button.component({\n className: 'Button Button--PageList-next',\n icon: 'fas fa-angle-right',\n onclick: this.loadNext.bind(this),\n });\n }\n\n if (this.prevResults === true) {\n prev = Button.component({\n className: 'Button Button--PageList-prev',\n icon: 'fas fa-angle-left',\n onclick: this.loadPrev.bind(this),\n });\n }\n\n return (\n \n
\n
\n {Button.component(\n {\n className: 'Button Button--primary',\n icon: 'fas fa-plus',\n onclick: () => app.modal.show(BanIPModal),\n },\n app.translator.trans('fof-ban-ips.admin.page.create_button')\n )}\n
\n
\n
\n
\n
\n {this.loading ? (\n LoadingIndicator.component()\n ) : app.store.all('banned_ips').length ? (\n
\n \n \n # | \n {app.translator.trans('fof-ban-ips.admin.page.creator_label')} | \n {app.translator.trans('fof-ban-ips.admin.page.user_label')} | \n {app.translator.trans('fof-ban-ips.admin.page.address_label')} | \n {app.translator.trans('fof-ban-ips.admin.page.reason_label')} | \n {app.translator.trans('fof-ban-ips.admin.page.date_label')} | \n | \n
\n \n \n {app.store\n .all('banned_ips')\n .slice(this.page, this.page + this.pageSize)\n .map((bannedIP) => SettingsPageItem.component({ bannedIP }))}\n \n
\n ) : (\n
{Placeholder.component({ text: app.translator.trans('fof-ban-ips.admin.empty_text') })}
\n )}\n
\n
\n
\n {next}\n {prev}\n
\n
\n );\n }\n\n refresh() {\n return this.loadResults().then(this.parseResults.bind(this));\n }\n\n /**\n * Load a new page of Pages results.\n *\n * @param {Integer} page number.\n * @return {Promise}\n */\n loadResults() {\n const offset = this.page * this.pageSize;\n\n return app.store.find('fof/ban-ips', { page: { offset, limit: this.pageSize } });\n }\n\n /**\n * Load the next page of results.\n *\n * @public\n */\n loadNext() {\n if (this.nextResults === true) {\n this.page++;\n this.refresh();\n }\n }\n\n /**\n * Load the previous page of results.\n *\n * @public\n */\n loadPrev() {\n if (this.prevResults === true) {\n this.page--;\n this.refresh();\n }\n }\n\n /**\n * Parse results and append them to the page list.\n *\n * @param {Page[]} results\n * @return {Page[]}\n */\n parseResults(results) {\n this.loading = false;\n\n this.nextResults = !!results.payload.links.next;\n this.prevResults = !!results.payload.links.prev;\n\n m.redraw();\n }\n}\n","import BanIPModal from './components/BanIPModal';\nimport UnbanIPModal from './components/UnbanIPModal';\nimport BannedIP from './models/BannedIP';\n\nexport default {\n 'fof/ban-ips/components/BanIPModal': BanIPModal,\n 'fof/ban-ips/components/UnbanIPModal': UnbanIPModal,\n 'fof/ban-ips/models/BannedIP': BannedIP,\n};\n","import compat from '../common/compat';\n\nimport BanIPModal from './components/BanIPModal';\nimport ChangeReasonModal from './components/ChangeReasonModal';\nimport SettingsPage from './components/SettingsPage';\nimport SettingsPageItem from './components/SettingsPageItem';\n\nexport default Object.assign(compat, {\n 'fof/ban-ips/components/BanIPModal': BanIPModal,\n 'fof/ban-ips/components/ChangeReasonModal': ChangeReasonModal,\n 'fof/ban-ips/components/SettingsPage': SettingsPage,\n 'fof/ban-ips/components/SettingsPageItem': SettingsPageItem,\n});\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core;","import app from 'flarum/admin/app';\nimport Model from 'flarum/common/Model';\n\nimport BannedIP from '../common/models/BannedIP';\nimport SettingsPage from './components/SettingsPage';\n\napp.initializers.add('fof/ban-ips', () => {\n app.store.models.banned_ips = BannedIP;\n\n app.store.models.users.prototype.bannedIPs = Model.hasMany('banned_ips');\n\n app.extensionData\n .for('fof-ban-ips')\n .registerPermission(\n {\n icon: 'fas fa-gavel',\n label: app.translator.trans('fof-ban-ips.admin.permissions.view_banned_ip_list_label'),\n permission: 'fof.ban-ips.viewBannedIPList',\n },\n 'moderate'\n )\n .registerPermission(\n {\n icon: 'fas fa-gavel',\n label: app.translator.trans('fof-ban-ips.admin.permissions.ban_ip_label'),\n permission: 'fof.ban-ips.banIP',\n },\n 'moderate'\n )\n .registerPage(SettingsPage);\n});\n\n// Expose compat API\nimport extCompat from './compat';\nimport { compat } from '@flarum/core/admin';\n\nObject.assign(compat, extCompat);\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_setPrototypeOf","p","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","create","constructor","BannedIP","apiEndpoint","this","exists","id","mixin","Model","creator","user","address","reason","createdAt","deletedAt","BanIPModal","oninit","vnode","Stream","usersBanned","loading","className","title","app","translator","trans","content","usernames","map","username","type","bidi","required","pattern","length","Alert","dismissible","users","punctuateSeries","count","disabled","store","getBy","onsubmit","e","preventDefault","getOtherUsers","attrs","createRecord","save","then","hide","bind","onerror","loaded","data","ip","request","params","url","forum","attribute","method","res","pushObject","m","redraw","Modal","post","bannedIP","banOptions","ipAddress","push","banOption","otherUsers","otherUsersBanned","u","displayName","name","checked","onclick","htmlFor","userId","body","attributes","errorHandler","pushPayload","forEach","done","filter","bannedIPs","relationships","banned_ip","banned_ips","isBanned","UnbanIPModal","ips","skipValidation","models","Array","isArray","b","location","reload","ChangeReasonModal","item","SettingsPageItem","view","toLocaleDateString","Button","icon","session","modal","show","Component","SettingsPage","page","pageSize","oncreate","refresh","next","prev","nextResults","loadNext","prevResults","loadPrev","LoadingIndicator","all","style","width","textAlign","slice","component","Placeholder","text","loadResults","parseResults","offset","find","limit","results","payload","links","ExtensionPage","assign","registerPermission","label","permission","registerPage","extCompat"],"sourceRoot":""}
\ No newline at end of file
diff --git a/js/dist/forum.js b/js/dist/forum.js
index cc2884b..b2d5192 100644
--- a/js/dist/forum.js
+++ b/js/dist/forum.js
@@ -1,2 +1,2 @@
-(()=>{var t={n:s=>{var n=s&&s.__esModule?()=>s.default:()=>s;return t.d(n,{a:n}),n},d:(s,n)=>{for(var a in n)t.o(n,a)&&!t.o(s,a)&&Object.defineProperty(s,a,{enumerable:!0,get:n[a]})},o:(t,s)=>Object.prototype.hasOwnProperty.call(t,s),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},s={};(()=>{"use strict";t.r(s);const n=flarum.core.compat["common/app"];var a=t.n(n);const e=flarum.core.compat["common/Model"];var o=t.n(e);const r=flarum.core.compat["common/extend"],i=flarum.core.compat["forum/utils/PostControls"];var p=t.n(i);const d=flarum.core.compat["forum/utils/UserControls"];var l=t.n(d);const u=flarum.core.compat["common/components/Button"];var h=t.n(u);function c(t,s){return c=Object.setPrototypeOf||function(t,s){return t.__proto__=s,t},c(t,s)}function b(t,s){t.prototype=Object.create(s.prototype),t.prototype.constructor=t,c(t,s)}const f=flarum.core.compat["common/components/Modal"];var y=t.n(f);const _=flarum.core.compat["common/components/Alert"];var v=t.n(_);const O=flarum.core.compat["common/utils/Stream"];var g=t.n(O);const P=flarum.core.compat["common/helpers/punctuateSeries"];var B=t.n(P),I=function(t){function s(){return t.apply(this,arguments)||this}b(s,t);var n=s.prototype;return n.oninit=function(s){if(t.prototype.oninit.call(this,s),this.address=this.attrs.address,this.post=this.attrs.post,this.user=this.attrs.user||this.post&&this.post.user(),!this.user&&this.address){var n=app.store.getBy("banned_ips","address",this.address);n&&(this.user=n.user())}this.banOptions=[],(this.post&&this.post.ipAddress()||this.address)&&this.banOptions.push("only"),this.user&&this.banOptions.push("all"),this.banOption=g()(this.banOptions[0]),this.reason=g()(""),this.otherUsers={},this.loading=!1},n.className=function(){return"Modal--medium"},n.title=function(){return app.translator.trans("fof-ban-ips.lib.modal.title")},n.content=function(){var t=this,s=this.otherUsers[this.banOption()],n=s&&s.map((function(t){return t&&t.displayName()||app.translator.trans("core.lib.username.deleted_text")}));return m("div",{className:"Modal-body"},m("p",null,app.translator.trans("fof-ban-ips.lib.modal.ban_ip_confirmation")),m("div",{className:"Form-group"},this.banOptions.map((function(s){return m("div",null,m("input",{type:"radio",name:"ban-option",id:"ban-option-"+s,checked:t.banOption()===s,onclick:t.banOption.bind(t,s)})," ",m("label",{htmlFor:"ban-option-"+s},app.translator.trans("fof-ban-ips.forum.modal.ban_options_"+s+"_ip",{user:t.user,ip:t.address||t.post&&t.post.ipAddress()})))}))),m("div",{className:"Form-group"},m("label",{className:"label"},app.translator.trans("fof-ban-ips.lib.modal.reason_label")),m("input",{type:"text",className:"FormControl",bidi:this.reason})),s?s.length?v().component({dismissible:!1},app.translator.transChoice("fof-ban-ips.lib.modal.ban_ip_users",n.length,{users:B()(n)})):v().component({dismissible:!1,type:"success"},app.translator.trans("fof-ban-ips.forum.modal.ban_ip_no_users")):"",s&&m("br",null),m("div",{className:"Form-group"},m(h(),{className:"Button Button--primary",type:"submit",loading:this.loading},n?app.translator.trans("fof-ban-ips.lib.modal.ban_button"):app.translator.trans("fof-ban-ips.lib.modal.check_button"))))},n.onsubmit=function(t){var s=this;if(t.preventDefault(),this.loading=!0,void 0===this.otherUsers[this.banOption()])return this.getOtherUsers();var n={reason:this.reason(),userId:this.user.id()};"only"===this.banOption()?(n.address=this.post.ipAddress(),app.store.createRecord("banned_ips").save(n).then(this.hide.bind(this)).catch(this.onerror.bind(this)).then(this.loaded.bind(this))):"all"===this.banOption()&&app.request({body:{data:{attributes:n}},url:""+app.forum.attribute("apiUrl")+this.user.apiEndpoint()+"/ban",method:"POST",errorHandler:this.onerror.bind(this)}).then((function(t){return app.store.pushPayload(t).forEach(s.done.bind(s))})).then(this.hide.bind(this)).catch((function(){})).then(this.loaded.bind(this))},n.getOtherUsers=function(){var t=this,s={};"only"===this.banOption()&&(s.ip=this.address||this.post.ipAddress()),app.request({params:s,url:app.forum.attribute("apiUrl")+"/fof/ban-ips/check-users/"+this.user.id(),method:"GET",errorHandler:this.onerror.bind(this)}).then((function(s){t.otherUsers[t.banOption()]=s.data.map((function(t){return app.store.pushObject(t)})).filter((function(t){return 0===t.bannedIPs().length})),t.loading=!1})).catch((function(){})).then(this.loaded.bind(this))},n.done=function(t){var s={type:"banned_ips",id:t.id()};this.post&&(this.post.data.relationships.banned_ip={data:s}),this.user.data.relationships.banned_ips||(this.user.data.relationships.banned_ips={data:[]}),this.user.data.relationships.banned_ips.data.push(s),this.user.data.attributes.isBanned=!0,app.store.pushObject(this.user.data)},s}(y());flarum.core.compat["common/helpers/username"];var U=function(t){function s(){return t.apply(this,arguments)||this}b(s,t);var n=s.prototype;return n.title=function(){return app.translator.trans("fof-ban-ips.lib.modal.unban_title")},n.content=function(){var t=this,s=this.otherUsers[this.banOption()],n=s&&s.map((function(t){return t&&t.displayName()||app.translator.trans("core.lib.username.deleted_text")}));return this.bannedIPs?m("div",{className:"Modal-body"},v().component({dismissible:!1,type:"success"},app.translator.trans("fof-ban-ips.lib.modal.unbanned_ips",{ips:B()(this.bannedIPs)}))):m("div",{className:"Modal-body"},m("p",null,app.translator.trans("fof-ban-ips.lib.modal.unban_ip_confirmation")),m("div",{className:"Form-group"},this.banOptions.map((function(s){return m("div",null,m("input",{type:"radio",name:"ban-option",id:"ban-option-"+s,checked:t.banOption()===s,onclick:t.banOption.bind(t,s)})," ",m("label",{htmlFor:"ban-option-"+s},app.translator.trans("fof-ban-ips.lib.modal.unban_options_"+s+"_ip",{user:t.user,ip:t.address||t.post&&t.post.ipAddress()})))}))),s?s.length?v().component({dismissible:!1},app.translator.transChoice("fof-ban-ips.lib.modal.unban_ip_users",n.length,{users:B()(n)})):v().component({dismissible:!1,type:"success"},app.translator.trans("fof-ban-ips.lib.modal.unban_ip_no_users")):"",s&&m("br",null),m("div",{className:"Form-group"},m(h(),{className:"Button Button--primary",type:"submit",loading:this.loading},n?app.translator.trans("fof-ban-ips.lib.modal.unban_button"):app.translator.trans("fof-ban-ips.lib.modal.check_button"))))},n.onsubmit=function(t){if(t.preventDefault(),this.loading=!0,void 0===this.otherUsers[this.banOption()])return this.getOtherUsers();var s={};if("only"===this.banOption()){s.address=this.address||this.post.ipAddress();var n=this.post?this.post.bannedIP():app.store.getBy("banned_ips","address",this.address);n.delete().then(this.done.bind(this,n)).catch(this.onerror.bind(this)).then(this.hide.bind(this))}else"all"===this.banOption()&&app.request({body:{data:{attributes:s}},url:""+app.forum.attribute("apiUrl")+this.user.apiEndpoint()+"/unban",method:"POST",errorHandler:this.onerror.bind(this)}).then(this.done.bind(this)).catch(this.onerror.bind(this)).then(this.hide.bind(this))},n.getOtherUsers=function(){var t=this,s={};"only"===this.banOption()&&(s.ip=this.address||this.post.ipAddress(),s.skipValidation=!0);var n=app.forum.attribute("apiUrl")+"/fof/ban-ips/check-users";this.user&&(n+="/"+this.user.id()),app.request({params:s,url:n,method:"GET",errorHandler:this.onerror.bind(this)}).then((function(s){var n=app.store.pushPayload(s);t.otherUsers[t.banOption()]=n.filter((function(t){return 1===t.bannedIPs().length})),t.loading=!1,m.redraw()})).catch((function(){})).then(this.loaded.bind(this))},n.done=function(t){this.loading=!1,this.post&&delete this.post.data.relationships.banned_ip,!this.user||this.user.data.relationships||t?this.user&&t instanceof app.store.models.banned_ips&&(this.user.data.relationships.banned_ips={data:this.user.data.relationships.banned_ips.data.filter((function(s){return s.id!==t.id()}))},this.user.data.attributes.isBanned=0!==this.user.data.relationships.banned_ips.data.length):(this.user.data.relationships.banned_ips.data=[],this.user.data.attributes.isBanned=!1),t&&Array.isArray(t.data)&&(this.bannedIPs=t.data.map((function(t){return t.attributes.address})),this.loading=!1,m.redraw())},n.hide=function(){t.prototype.hide.call(this),this.attrs.redraw||location.reload()},s}(I);const A=flarum.core.compat["common/utils/mixin"];var N=function(t){function s(){return t.apply(this,arguments)||this}return b(s,t),s.prototype.apiEndpoint=function(){return"/fof/ban-ips"+(this.exists?"/"+this.id():"")},s}(t.n(A)()(o(),{creator:o().hasOne("creator"),user:o().hasOne("user"),address:o().attribute("address"),reason:o().attribute("reason"),createdAt:o().attribute("createdAt",o().transformDate),deletedAt:o().attribute("deletedAt",o().transformDate)}));const M=flarum.core.compat["common/models/User"];var k=t.n(M);const x=flarum.core.compat["common/components/Badge"];var j=t.n(x);const S={"fof/ban-ips/components/BanIPModal":I,"fof/ban-ips/components/UnbanIPModal":U,"fof/ban-ips/models/BannedIP":N},F=flarum.core;a().initializers.add("fof/ban-ips",(function(){a().store.models.posts.prototype.canBanIP=o().attribute("canBanIP"),a().store.models.posts.prototype.ipAddress=o().attribute("ipAddress"),a().store.models.posts.prototype.bannedIP=o().hasOne("banned_ip"),a().store.models.users.prototype.canBanIP=o().attribute("canBanIP"),a().store.models.users.prototype.isBanned=o().attribute("isBanned"),a().store.models.users.prototype.bannedIPs=o().hasMany("banned_ips"),a().store.models.banned_ips=N,(0,r.extend)(p(),"userControls",(function(t,s){if(s&&s.user()){var n=s.user().isBanned(),a=n?"un":"";s.canBanIP()&&!s.isHidden()&&s.user()!==app.session.user&&"comment"===s.contentType()&&t.add(a+"ban",h().component({icon:"fas fa-gavel",onclick:function(){return app.modal.show(n?U:I,{post:s})}},app.translator.trans("fof-ban-ips.forum."+a+"ban_ip_button")))}})),(0,r.extend)(l(),"moderationControls",(function(t,s){if(s.canBanIP()&&s!==app.session.user){var n=s.isBanned(),a=n?"un":"";t.add(a+"ban",h().component({icon:"fas fa-gavel",onclick:function(){return app.modal.show(n?U:I,{user:s})}},app.translator.trans("fof-ban-ips.forum.user_controls."+a+"ban_button")))}})),(0,r.extend)(k().prototype,"badges",(function(t){this.isBanned()&&t.add("banned",j().component({icon:"fas fa-gavel",type:"banned",label:app.translator.trans("fof-ban-ips.forum.user_badge.banned_tooltip")}))}))})),Object.assign(F.compat,S)})(),module.exports=s})();
+(()=>{var t={n:n=>{var s=n&&n.__esModule?()=>n.default:()=>n;return t.d(s,{a:s}),s},d:(n,s)=>{for(var a in s)t.o(s,a)&&!t.o(n,a)&&Object.defineProperty(n,a,{enumerable:!0,get:s[a]})},o:(t,n)=>Object.prototype.hasOwnProperty.call(t,n),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};(()=>{"use strict";t.r(n);const s=flarum.core.compat["common/app"];var a=t.n(s);const e=flarum.core.compat["common/Model"];var o=t.n(e);const r=flarum.core.compat["common/extend"],i=flarum.core.compat["forum/utils/PostControls"];var p=t.n(i);const d=flarum.core.compat["forum/utils/UserControls"];var u=t.n(d);const l=flarum.core.compat["common/components/Button"];var h=t.n(l);function c(t,n){return c=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t},c(t,n)}function b(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,c(t,n)}const f=flarum.core.compat["common/components/Modal"];var y=t.n(f);const _=flarum.core.compat["common/components/Alert"];var v=t.n(_);const O=flarum.core.compat["common/utils/Stream"];var g=t.n(O);const P=flarum.core.compat["common/helpers/punctuateSeries"];var B=t.n(P),I=function(t){function n(){return t.apply(this,arguments)||this}b(n,t);var s=n.prototype;return s.oninit=function(n){if(t.prototype.oninit.call(this,n),this.address=this.attrs.address,this.post=this.attrs.post,this.user=this.attrs.user||this.post&&this.post.user(),!this.user&&this.address){var s=app.store.getBy("banned_ips","address",this.address);s&&(this.user=s.user())}this.banOptions=[],(this.post&&this.post.ipAddress()||this.address)&&this.banOptions.push("only"),this.user&&this.banOptions.push("all"),this.banOption=g()(this.banOptions[0]),this.reason=g()(""),this.otherUsers={},this.loading=!1},s.className=function(){return"Modal--medium"},s.title=function(){return app.translator.trans("fof-ban-ips.lib.modal.title")},s.content=function(){var t=this,n=this.otherUsers[this.banOption()],s=n&&n.map((function(t){return t&&t.displayName()||app.translator.trans("core.lib.username.deleted_text")}));return m("div",{className:"Modal-body"},m("p",null,app.translator.trans("fof-ban-ips.lib.modal.ban_ip_confirmation")),m("div",{className:"Form-group"},this.banOptions.map((function(n){return m("div",null,m("input",{type:"radio",name:"ban-option",id:"ban-option-"+n,checked:t.banOption()===n,onclick:t.banOption.bind(t,n)})," ",m("label",{htmlFor:"ban-option-"+n},app.translator.trans("fof-ban-ips.forum.modal.ban_options_"+n+"_ip",{user:t.user,ip:t.address||t.post&&t.post.ipAddress()})))}))),m("div",{className:"Form-group"},m("label",{className:"label"},app.translator.trans("fof-ban-ips.lib.modal.reason_label")),m("input",{type:"text",className:"FormControl",bidi:this.reason})),n?n.length?v().component({dismissible:!1},app.translator.trans("fof-ban-ips.lib.modal.ban_ip_users",{users:B()(s),count:s.length})):v().component({dismissible:!1,type:"success"},app.translator.trans("fof-ban-ips.forum.modal.ban_ip_no_users")):"",n&&m("br",null),m("div",{className:"Form-group"},m(h(),{className:"Button Button--primary",type:"submit",loading:this.loading},s?app.translator.trans("fof-ban-ips.lib.modal.ban_button"):app.translator.trans("fof-ban-ips.lib.modal.check_button"))))},s.onsubmit=function(t){var n=this;if(t.preventDefault(),this.loading=!0,void 0===this.otherUsers[this.banOption()])return this.getOtherUsers();var s={reason:this.reason(),userId:this.user.id()};"only"===this.banOption()?(s.address=this.post.ipAddress(),app.store.createRecord("banned_ips").save(s).then(this.hide.bind(this)).catch(this.onerror.bind(this)).then(this.loaded.bind(this))):"all"===this.banOption()&&app.request({body:{data:{attributes:s}},url:""+app.forum.attribute("apiUrl")+this.user.apiEndpoint()+"/ban",method:"POST",errorHandler:this.onerror.bind(this)}).then((function(t){return app.store.pushPayload(t).forEach(n.done.bind(n))})).then(this.hide.bind(this)).catch((function(){})).then(this.loaded.bind(this))},s.getOtherUsers=function(){var t=this,n={};"only"===this.banOption()&&(n.ip=this.address||this.post.ipAddress()),app.request({params:n,url:app.forum.attribute("apiUrl")+"/fof/ban-ips/check-users/"+this.user.id(),method:"GET",errorHandler:this.onerror.bind(this)}).then((function(n){t.otherUsers[t.banOption()]=n.data.map((function(t){return app.store.pushObject(t)})).filter((function(t){return 0===t.bannedIPs().length})),t.loading=!1})).catch((function(){})).then(this.loaded.bind(this))},s.done=function(t){var n={type:"banned_ips",id:t.id()};this.post&&(this.post.data.relationships.banned_ip={data:n}),this.user.data.relationships.banned_ips||(this.user.data.relationships.banned_ips={data:[]}),this.user.data.relationships.banned_ips.data.push(n),this.user.data.attributes.isBanned=!0,app.store.pushObject(this.user.data)},n}(y());flarum.core.compat["common/helpers/username"];var U=function(t){function n(){return t.apply(this,arguments)||this}b(n,t);var s=n.prototype;return s.title=function(){return app.translator.trans("fof-ban-ips.lib.modal.unban_title")},s.content=function(){var t=this,n=this.otherUsers[this.banOption()],s=n&&n.map((function(t){return t&&t.displayName()||app.translator.trans("core.lib.username.deleted_text")}));return this.bannedIPs?m("div",{className:"Modal-body"},v().component({dismissible:!1,type:"success"},app.translator.trans("fof-ban-ips.lib.modal.unbanned_ips",{ips:B()(this.bannedIPs)}))):m("div",{className:"Modal-body"},m("p",null,app.translator.trans("fof-ban-ips.lib.modal.unban_ip_confirmation")),m("div",{className:"Form-group"},this.banOptions.map((function(n){return m("div",null,m("input",{type:"radio",name:"ban-option",id:"ban-option-"+n,checked:t.banOption()===n,onclick:t.banOption.bind(t,n)})," ",m("label",{htmlFor:"ban-option-"+n},app.translator.trans("fof-ban-ips.lib.modal.unban_options_"+n+"_ip",{user:t.user,ip:t.address||t.post&&t.post.ipAddress()})))}))),n?n.length?v().component({dismissible:!1},app.translator.trans("fof-ban-ips.lib.modal.unban_ip_users",{users:B()(s),count:s.length})):v().component({dismissible:!1,type:"success"},app.translator.trans("fof-ban-ips.lib.modal.unban_ip_no_users")):"",n&&m("br",null),m("div",{className:"Form-group"},m(h(),{className:"Button Button--primary",type:"submit",loading:this.loading},s?app.translator.trans("fof-ban-ips.lib.modal.unban_button"):app.translator.trans("fof-ban-ips.lib.modal.check_button"))))},s.onsubmit=function(t){if(t.preventDefault(),this.loading=!0,void 0===this.otherUsers[this.banOption()])return this.getOtherUsers();var n={};if("only"===this.banOption()){n.address=this.address||this.post.ipAddress();var s=this.post?this.post.bannedIP():app.store.getBy("banned_ips","address",this.address);s.delete().then(this.done.bind(this,s)).catch(this.onerror.bind(this)).then(this.hide.bind(this))}else"all"===this.banOption()&&app.request({body:{data:{attributes:n}},url:""+app.forum.attribute("apiUrl")+this.user.apiEndpoint()+"/unban",method:"POST",errorHandler:this.onerror.bind(this)}).then(this.done.bind(this)).catch(this.onerror.bind(this)).then(this.hide.bind(this))},s.getOtherUsers=function(){var t=this,n={};"only"===this.banOption()&&(n.ip=this.address||this.post.ipAddress(),n.skipValidation=!0);var s=app.forum.attribute("apiUrl")+"/fof/ban-ips/check-users";this.user&&(s+="/"+this.user.id()),app.request({params:n,url:s,method:"GET",errorHandler:this.onerror.bind(this)}).then((function(n){var s=app.store.pushPayload(n);t.otherUsers[t.banOption()]=s.filter((function(t){return 1===t.bannedIPs().length})),t.loading=!1,m.redraw()})).catch((function(){})).then(this.loaded.bind(this))},s.done=function(t){this.loading=!1,this.post&&delete this.post.data.relationships.banned_ip,!this.user||this.user.data.relationships||t?this.user&&t instanceof app.store.models.banned_ips&&(this.user.data.relationships.banned_ips={data:this.user.data.relationships.banned_ips.data.filter((function(n){return n.id!==t.id()}))},this.user.data.attributes.isBanned=0!==this.user.data.relationships.banned_ips.data.length):(this.user.data.relationships.banned_ips.data=[],this.user.data.attributes.isBanned=!1),t&&Array.isArray(t.data)&&(this.bannedIPs=t.data.map((function(t){return t.attributes.address})),this.loading=!1,m.redraw())},s.hide=function(){t.prototype.hide.call(this),this.attrs.redraw||location.reload()},n}(I);const A=flarum.core.compat["common/utils/mixin"];var N=function(t){function n(){return t.apply(this,arguments)||this}return b(n,t),n.prototype.apiEndpoint=function(){return"/fof/ban-ips"+(this.exists?"/"+this.id():"")},n}(t.n(A)()(o(),{creator:o().hasOne("creator"),user:o().hasOne("user"),address:o().attribute("address"),reason:o().attribute("reason"),createdAt:o().attribute("createdAt",o().transformDate),deletedAt:o().attribute("deletedAt",o().transformDate)}));const M=flarum.core.compat["common/models/User"];var k=t.n(M);const x=flarum.core.compat["common/components/Badge"];var j=t.n(x);const S={"fof/ban-ips/components/BanIPModal":I,"fof/ban-ips/components/UnbanIPModal":U,"fof/ban-ips/models/BannedIP":N},F=flarum.core;a().initializers.add("fof/ban-ips",(function(){a().store.models.posts.prototype.canBanIP=o().attribute("canBanIP"),a().store.models.posts.prototype.ipAddress=o().attribute("ipAddress"),a().store.models.posts.prototype.bannedIP=o().hasOne("banned_ip"),a().store.models.users.prototype.canBanIP=o().attribute("canBanIP"),a().store.models.users.prototype.isBanned=o().attribute("isBanned"),a().store.models.users.prototype.bannedIPs=o().hasMany("banned_ips"),a().store.models.banned_ips=N,(0,r.extend)(p(),"userControls",(function(t,n){if(n&&n.user()){var s=n.user().isBanned(),a=s?"un":"";n.canBanIP()&&!n.isHidden()&&n.user()!==app.session.user&&"comment"===n.contentType()&&t.add(a+"ban",h().component({icon:"fas fa-gavel",onclick:function(){return app.modal.show(s?U:I,{post:n})}},app.translator.trans("fof-ban-ips.forum."+a+"ban_ip_button")))}})),(0,r.extend)(u(),"moderationControls",(function(t,n){if(n.canBanIP()&&n!==app.session.user){var s=n.isBanned(),a=s?"un":"";t.add(a+"ban",h().component({icon:"fas fa-gavel",onclick:function(){return app.modal.show(s?U:I,{user:n})}},app.translator.trans("fof-ban-ips.forum.user_controls."+a+"ban_button")))}})),(0,r.extend)(k().prototype,"badges",(function(t){this.isBanned()&&t.add("banned",j().component({icon:"fas fa-gavel",type:"banned",label:app.translator.trans("fof-ban-ips.forum.user_badge.banned_tooltip")}))}))})),Object.assign(F.compat,S)})(),module.exports=n})();
//# sourceMappingURL=forum.js.map
\ No newline at end of file
diff --git a/js/dist/forum.js.map b/js/dist/forum.js.map
index b9beb51..ddf909d 100644
--- a/js/dist/forum.js.map
+++ b/js/dist/forum.js.map
@@ -1 +1 @@
-{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLRF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3ER,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,M,+BCLvD,MAAM,EAA+BC,OAAOC,KAAKC,O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,MAAM,wDGatC/C,OAAO0I,OAAO5H,EAAAA,OAAQ6H,I","sources":["webpack://@fof/ban-ips/webpack/bootstrap","webpack://@fof/ban-ips/webpack/runtime/compat get default export","webpack://@fof/ban-ips/webpack/runtime/define property getters","webpack://@fof/ban-ips/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/ban-ips/webpack/runtime/make namespace object","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/app']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/extend']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['forum/utils/PostControls']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['forum/utils/UserControls']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/ban-ips/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/ban-ips/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/components/Alert']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/helpers/punctuateSeries']\"","webpack://@fof/ban-ips/./src/common/components/BanIPModal.js","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/helpers/username']\"","webpack://@fof/ban-ips/./src/common/components/UnbanIPModal.js","webpack://@fof/ban-ips/./src/forum/addBanIPControl.js","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/utils/mixin']\"","webpack://@fof/ban-ips/./src/common/models/BannedIP.js","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/models/User']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/components/Badge']\"","webpack://@fof/ban-ips/./src/forum/addBannedBadge.js","webpack://@fof/ban-ips/./src/common/compat.js","webpack://@fof/ban-ips/external assign \"flarum.core\"","webpack://@fof/ban-ips/./src/forum/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/PostControls'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/UserControls'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Alert'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/punctuateSeries'];","import Modal from 'flarum/common/components/Modal';\nimport Button from 'flarum/common/components/Button';\nimport Alert from 'flarum/common/components/Alert';\nimport Stream from 'flarum/common/utils/Stream';\nimport punctuateSeries from 'flarum/common/helpers/punctuateSeries';\n\nexport default class BanIPModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.address = this.attrs.address;\n this.post = this.attrs.post;\n this.user = this.attrs.user || (this.post && this.post.user());\n\n if (!this.user && this.address) {\n const bannedIP = app.store.getBy('banned_ips', 'address', this.address);\n\n if (bannedIP) this.user = bannedIP.user();\n }\n\n this.banOptions = [];\n\n if ((this.post && this.post.ipAddress()) || this.address) this.banOptions.push('only');\n if (this.user) this.banOptions.push('all');\n\n this.banOption = Stream(this.banOptions[0]);\n this.reason = Stream('');\n\n this.otherUsers = {};\n\n this.loading = false;\n }\n\n className() {\n return 'Modal--medium';\n }\n\n title() {\n return app.translator.trans('fof-ban-ips.lib.modal.title');\n }\n\n content() {\n const otherUsersBanned = this.otherUsers[this.banOption()];\n const usernames =\n otherUsersBanned && otherUsersBanned.map((u) => (u && u.displayName()) || app.translator.trans('core.lib.username.deleted_text'));\n\n return (\n \n
{app.translator.trans('fof-ban-ips.lib.modal.ban_ip_confirmation')}
\n\n
\n {this.banOptions.map((key) => (\n
\n \n \n \n
\n ))}\n
\n\n
\n \n \n
\n\n {otherUsersBanned\n ? otherUsersBanned.length\n ? Alert.component(\n {\n dismissible: false,\n },\n app.translator.transChoice('fof-ban-ips.lib.modal.ban_ip_users', usernames.length, {\n users: punctuateSeries(usernames),\n })\n )\n : Alert.component(\n {\n dismissible: false,\n type: 'success',\n },\n app.translator.trans('fof-ban-ips.forum.modal.ban_ip_no_users')\n )\n : ''}\n\n {otherUsersBanned &&
}\n\n
\n \n
\n
\n );\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n this.loading = true;\n\n if (typeof this.otherUsers[this.banOption()] === 'undefined') return this.getOtherUsers();\n\n const attrs = {\n reason: this.reason(),\n userId: this.user.id(),\n };\n\n if (this.banOption() === 'only') {\n attrs.address = this.post.ipAddress();\n\n app.store.createRecord('banned_ips').save(attrs).then(this.hide.bind(this)).catch(this.onerror.bind(this)).then(this.loaded.bind(this));\n } else if (this.banOption() === 'all') {\n app\n .request({\n body: {\n data: {\n attributes: attrs,\n },\n },\n url: `${app.forum.attribute('apiUrl')}${this.user.apiEndpoint()}/ban`,\n method: 'POST',\n errorHandler: this.onerror.bind(this),\n })\n .then((res) => app.store.pushPayload(res).forEach(this.done.bind(this)))\n .then(this.hide.bind(this))\n .catch(() => {})\n .then(this.loaded.bind(this));\n }\n }\n\n getOtherUsers() {\n const data = {};\n\n if (this.banOption() === 'only') data.ip = this.address || this.post.ipAddress();\n\n app\n .request({\n params: data,\n url: `${app.forum.attribute('apiUrl')}/fof/ban-ips/check-users/${this.user.id()}`,\n method: 'GET',\n errorHandler: this.onerror.bind(this),\n })\n .then((res) => {\n this.otherUsers[this.banOption()] = res.data.map((e) => app.store.pushObject(e)).filter((e) => e.bannedIPs().length === 0);\n this.loading = false;\n })\n .catch(() => {})\n .then(this.loaded.bind(this));\n }\n\n done(bannedIP) {\n const obj = {\n type: 'banned_ips',\n id: bannedIP.id(),\n };\n\n if (this.post) {\n this.post.data.relationships.banned_ip = {\n data: obj,\n };\n }\n\n if (!this.user.data.relationships.banned_ips)\n this.user.data.relationships.banned_ips = {\n data: [],\n };\n\n this.user.data.relationships.banned_ips.data.push(obj);\n this.user.data.attributes.isBanned = true;\n\n app.store.pushObject(this.user.data);\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/username'];","import Button from 'flarum/common/components/Button';\nimport Alert from 'flarum/common/components/Alert';\nimport punctuateSeries from 'flarum/common/helpers/punctuateSeries';\nimport username from 'flarum/common/helpers/username';\n\nimport BanIPModal from './BanIPModal';\n\nexport default class UnbanIPModal extends BanIPModal {\n title() {\n return app.translator.trans('fof-ban-ips.lib.modal.unban_title');\n }\n\n content() {\n const otherUsers = this.otherUsers[this.banOption()];\n const usernames = otherUsers && otherUsers.map((u) => (u && u.displayName()) || app.translator.trans('core.lib.username.deleted_text'));\n\n if (this.bannedIPs) {\n return (\n \n {Alert.component(\n {\n dismissible: false,\n type: 'success',\n },\n app.translator.trans('fof-ban-ips.lib.modal.unbanned_ips', { ips: punctuateSeries(this.bannedIPs) })\n )}\n
\n );\n }\n\n return (\n \n
{app.translator.trans('fof-ban-ips.lib.modal.unban_ip_confirmation')}
\n\n
\n {this.banOptions.map((key) => (\n
\n \n \n \n
\n ))}\n
\n\n {otherUsers\n ? otherUsers.length\n ? Alert.component(\n {\n dismissible: false,\n },\n app.translator.transChoice('fof-ban-ips.lib.modal.unban_ip_users', usernames.length, {\n users: punctuateSeries(usernames),\n })\n )\n : Alert.component(\n {\n dismissible: false,\n type: 'success',\n },\n app.translator.trans('fof-ban-ips.lib.modal.unban_ip_no_users')\n )\n : ''}\n\n {otherUsers &&
}\n\n
\n \n
\n
\n );\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n this.loading = true;\n\n if (typeof this.otherUsers[this.banOption()] === 'undefined') return this.getOtherUsers();\n\n const attrs = {};\n\n if (this.banOption() === 'only') {\n attrs.address = this.address || this.post.ipAddress();\n\n const bannedIP = this.post ? this.post.bannedIP() : app.store.getBy('banned_ips', 'address', this.address);\n\n bannedIP.delete().then(this.done.bind(this, bannedIP)).catch(this.onerror.bind(this)).then(this.hide.bind(this));\n } else if (this.banOption() === 'all') {\n app\n .request({\n body: {\n data: {\n attributes: attrs,\n },\n },\n url: `${app.forum.attribute('apiUrl')}${this.user.apiEndpoint()}/unban`,\n method: 'POST',\n errorHandler: this.onerror.bind(this),\n })\n .then(this.done.bind(this))\n .catch(this.onerror.bind(this))\n .then(this.hide.bind(this));\n }\n }\n\n getOtherUsers() {\n const data = {};\n\n if (this.banOption() === 'only') {\n data.ip = this.address || this.post.ipAddress();\n data.skipValidation = true;\n }\n\n let url = `${app.forum.attribute('apiUrl')}/fof/ban-ips/check-users`;\n\n if (this.user) url += `/${this.user.id()}`;\n\n app\n .request({\n params: data,\n url: url,\n method: 'GET',\n errorHandler: this.onerror.bind(this),\n })\n .then((res) => {\n const data = app.store.pushPayload(res);\n\n this.otherUsers[this.banOption()] = data.filter((e) => e.bannedIPs().length === 1);\n this.loading = false;\n\n m.redraw();\n })\n .catch(() => {})\n .then(this.loaded.bind(this));\n }\n\n done(bannedIP) {\n this.loading = false;\n\n if (this.post) delete this.post.data.relationships.banned_ip;\n\n if (this.user && !this.user.data.relationships && !bannedIP) {\n this.user.data.relationships.banned_ips.data = [];\n this.user.data.attributes.isBanned = false;\n } else if (this.user && bannedIP instanceof app.store.models.banned_ips) {\n this.user.data.relationships.banned_ips = {\n data: this.user.data.relationships.banned_ips.data.filter((e) => e.id !== bannedIP.id()),\n };\n this.user.data.attributes.isBanned = this.user.data.relationships.banned_ips.data.length !== 0;\n }\n\n if (bannedIP && Array.isArray(bannedIP.data)) {\n this.bannedIPs = bannedIP.data.map((b) => b.attributes.address);\n this.loading = false;\n\n m.redraw();\n }\n }\n\n hide() {\n super.hide();\n\n if (!this.attrs.redraw) {\n location.reload();\n }\n }\n}\n","import { extend } from 'flarum/common/extend';\nimport PostControls from 'flarum/forum/utils/PostControls';\nimport UserControls from 'flarum/forum/utils/UserControls';\nimport Button from 'flarum/common/components/Button';\n\nimport BanIPModal from '../common/components/BanIPModal';\nimport UnbanIPModal from '../common/components/UnbanIPModal';\n\nexport default () => {\n extend(PostControls, 'userControls', function (items, post) {\n if (!post || !post.user()) return;\n\n const isBanned = post.user().isBanned();\n const prefix = isBanned ? 'un' : '';\n\n // Removes ability to ban thyself and also does permission check.\n if (!post.canBanIP() || post.isHidden() || post.user() === app.session.user || post.contentType() !== 'comment') return;\n\n items.add(\n `${prefix}ban`,\n Button.component(\n {\n icon: 'fas fa-gavel',\n onclick: () => app.modal.show(isBanned ? UnbanIPModal : BanIPModal, { post }),\n },\n app.translator.trans(`fof-ban-ips.forum.${prefix}ban_ip_button`)\n )\n );\n });\n\n extend(UserControls, 'moderationControls', function (items, user) {\n if (!user.canBanIP() || user === app.session.user) return;\n\n const isBanned = user.isBanned();\n const prefix = isBanned ? 'un' : '';\n\n items.add(\n `${prefix}ban`,\n Button.component(\n {\n icon: 'fas fa-gavel',\n onclick: () => app.modal.show(isBanned ? UnbanIPModal : BanIPModal, { user }),\n },\n app.translator.trans(`fof-ban-ips.forum.user_controls.${prefix}ban_button`)\n )\n );\n });\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/mixin'];","import Model from 'flarum/common/Model';\nimport mixin from 'flarum/common/utils/mixin';\n\nexport default class BannedIP extends mixin(Model, {\n creator: Model.hasOne('creator'),\n user: Model.hasOne('user'),\n address: Model.attribute('address'),\n reason: Model.attribute('reason'),\n createdAt: Model.attribute('createdAt', Model.transformDate),\n deletedAt: Model.attribute('deletedAt', Model.transformDate),\n}) {\n apiEndpoint() {\n return `/fof/ban-ips${this.exists ? `/${this.id()}` : ''}`;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Badge'];","import { extend } from 'flarum/common/extend';\nimport User from 'flarum/common/models/User';\nimport Badge from 'flarum/common/components/Badge';\n\nexport default () => {\n extend(User.prototype, 'badges', function (items) {\n if (this.isBanned()) {\n items.add(\n 'banned',\n Badge.component({\n icon: 'fas fa-gavel',\n type: 'banned',\n label: app.translator.trans('fof-ban-ips.forum.user_badge.banned_tooltip'),\n })\n );\n }\n });\n};\n","import BanIPModal from './components/BanIPModal';\nimport UnbanIPModal from './components/UnbanIPModal';\nimport BannedIP from './models/BannedIP';\n\nexport default {\n 'fof/ban-ips/components/BanIPModal': BanIPModal,\n 'fof/ban-ips/components/UnbanIPModal': UnbanIPModal,\n 'fof/ban-ips/models/BannedIP': BannedIP,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core;","import app from 'flarum/common/app';\nimport Model from 'flarum/common/Model';\nimport addBanIPControl from './addBanIPControl';\nimport BannedIP from '../common/models/BannedIP';\nimport addBannedBadge from './addBannedBadge';\n\napp.initializers.add('fof/ban-ips', () => {\n app.store.models.posts.prototype.canBanIP = Model.attribute('canBanIP');\n app.store.models.posts.prototype.ipAddress = Model.attribute('ipAddress');\n app.store.models.posts.prototype.bannedIP = Model.hasOne('banned_ip');\n\n app.store.models.users.prototype.canBanIP = Model.attribute('canBanIP');\n app.store.models.users.prototype.isBanned = Model.attribute('isBanned');\n app.store.models.users.prototype.bannedIPs = Model.hasMany('banned_ips');\n\n app.store.models.banned_ips = BannedIP;\n\n addBanIPControl();\n addBannedBadge();\n});\n\n// Expose compat API\nimport extCompat from '../common/compat';\nimport { compat } from '@flarum/core/forum';\n\nObject.assign(compat, extCompat);\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_setPrototypeOf","p","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","create","constructor","BanIPModal","oninit","vnode","this","address","attrs","post","user","bannedIP","app","store","getBy","banOptions","ipAddress","push","banOption","Stream","reason","otherUsers","loading","className","title","translator","trans","content","otherUsersBanned","usernames","map","u","displayName","type","name","id","checked","onclick","bind","htmlFor","ip","bidi","length","Alert","dismissible","transChoice","users","punctuateSeries","onsubmit","e","preventDefault","getOtherUsers","userId","createRecord","save","then","hide","onerror","loaded","request","body","data","attributes","url","forum","attribute","apiEndpoint","method","errorHandler","res","pushPayload","forEach","done","params","pushObject","filter","bannedIPs","relationships","banned_ip","banned_ips","isBanned","Modal","UnbanIPModal","ips","skipValidation","m","redraw","models","Array","isArray","b","location","reload","BannedIP","exists","mixin","Model","creator","createdAt","deletedAt","extend","PostControls","items","prefix","canBanIP","isHidden","session","contentType","add","Button","icon","modal","show","UserControls","User","Badge","label","assign","extCompat"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLRF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3ER,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,M,+BCLvD,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,c,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,gB,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,iBCAlD,EAA+BF,OAAOC,KAAKC,OAAO,4B,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,4B,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,4B,aCAzC,SAASC,EAAgBhB,EAAGiB,GAMzC,OALAD,EAAkBf,OAAOiB,gBAAkB,SAAyBlB,EAAGiB,GAErE,OADAjB,EAAEmB,UAAYF,EACPjB,GAGFgB,EAAgBhB,EAAGiB,GCLb,SAASG,EAAeC,EAAUC,GAC/CD,EAASd,UAAYN,OAAOsB,OAAOD,EAAWf,WAC9Cc,EAAS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AAchG,EAAKC,SAAWE,IAAI8F,QAAQhG,MAA+B,YAAvBD,EAAKkG,eAEpFL,EAAMM,IACDL,EADL,MAEEM,IAAAA,UACE,CACEC,KAAM,eACNzE,QAAS,kBAAMzB,IAAImG,MAAMC,KAAKhC,EAAWE,EAAe/E,EAAY,CAAEM,KAAAA,MAExEG,IAAIa,WAAWC,MAAf,qBAA0C6E,EAA1C,wBAKNH,EAAAA,EAAAA,QAAOa,IAAc,sBAAsB,SAAUX,EAAO5F,GAC1D,GAAKA,EAAK8F,YAAc9F,IAASE,IAAI8F,QAAQhG,KAA7C,CAEA,IAAMsE,EAAWtE,EAAKsE,WAChBuB,EAASvB,EAAW,KAAO,GAEjCsB,EAAMM,IACDL,EADL,MAEEM,IAAAA,UACE,CACEC,KAAM,eACNzE,QAAS,kBAAMzB,IAAImG,MAAMC,KAAKhC,EAAWE,EAAe/E,EAAY,CAAEO,KAAAA,MAExEE,IAAIa,WAAWC,MAAf,mCAAwD6E,EAAxD,qBKtCNH,EAAAA,EAAAA,QAAOc,IAAAA,UAAgB,UAAU,SAAUZ,GACrChG,KAAK0E,YACPsB,EAAMM,IACJ,SACAO,IAAAA,UAAgB,CACdL,KAAM,eACN7E,KAAM,SACNmF,MAAOxG,IAAIa,WAAWC,MAAM,wDGatC/C,OAAO0I,OAAO5H,EAAAA,OAAQ6H,I","sources":["webpack://@fof/ban-ips/webpack/bootstrap","webpack://@fof/ban-ips/webpack/runtime/compat get default export","webpack://@fof/ban-ips/webpack/runtime/define property getters","webpack://@fof/ban-ips/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/ban-ips/webpack/runtime/make namespace object","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/app']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/extend']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['forum/utils/PostControls']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['forum/utils/UserControls']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/ban-ips/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/ban-ips/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/components/Alert']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/helpers/punctuateSeries']\"","webpack://@fof/ban-ips/./src/common/components/BanIPModal.js","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/helpers/username']\"","webpack://@fof/ban-ips/./src/common/components/UnbanIPModal.js","webpack://@fof/ban-ips/./src/forum/addBanIPControl.js","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/utils/mixin']\"","webpack://@fof/ban-ips/./src/common/models/BannedIP.js","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/models/User']\"","webpack://@fof/ban-ips/external root \"flarum.core.compat['common/components/Badge']\"","webpack://@fof/ban-ips/./src/forum/addBannedBadge.js","webpack://@fof/ban-ips/./src/common/compat.js","webpack://@fof/ban-ips/external assign \"flarum.core\"","webpack://@fof/ban-ips/./src/forum/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/PostControls'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/UserControls'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Alert'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/punctuateSeries'];","import Modal from 'flarum/common/components/Modal';\nimport Button from 'flarum/common/components/Button';\nimport Alert from 'flarum/common/components/Alert';\nimport Stream from 'flarum/common/utils/Stream';\nimport punctuateSeries from 'flarum/common/helpers/punctuateSeries';\n\nexport default class BanIPModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.address = this.attrs.address;\n this.post = this.attrs.post;\n this.user = this.attrs.user || (this.post && this.post.user());\n\n if (!this.user && this.address) {\n const bannedIP = app.store.getBy('banned_ips', 'address', this.address);\n\n if (bannedIP) this.user = bannedIP.user();\n }\n\n this.banOptions = [];\n\n if ((this.post && this.post.ipAddress()) || this.address) this.banOptions.push('only');\n if (this.user) this.banOptions.push('all');\n\n this.banOption = Stream(this.banOptions[0]);\n this.reason = Stream('');\n\n this.otherUsers = {};\n\n this.loading = false;\n }\n\n className() {\n return 'Modal--medium';\n }\n\n title() {\n return app.translator.trans('fof-ban-ips.lib.modal.title');\n }\n\n content() {\n const otherUsersBanned = this.otherUsers[this.banOption()];\n const usernames =\n otherUsersBanned && otherUsersBanned.map((u) => (u && u.displayName()) || app.translator.trans('core.lib.username.deleted_text'));\n\n return (\n \n
{app.translator.trans('fof-ban-ips.lib.modal.ban_ip_confirmation')}
\n\n
\n {this.banOptions.map((key) => (\n
\n \n \n \n
\n ))}\n
\n\n
\n \n \n
\n\n {otherUsersBanned\n ? otherUsersBanned.length\n ? Alert.component(\n {\n dismissible: false,\n },\n app.translator.trans('fof-ban-ips.lib.modal.ban_ip_users', {\n users: punctuateSeries(usernames),\n count: usernames.length,\n })\n )\n : Alert.component(\n {\n dismissible: false,\n type: 'success',\n },\n app.translator.trans('fof-ban-ips.forum.modal.ban_ip_no_users')\n )\n : ''}\n\n {otherUsersBanned &&
}\n\n
\n \n
\n
\n );\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n this.loading = true;\n\n if (typeof this.otherUsers[this.banOption()] === 'undefined') return this.getOtherUsers();\n\n const attrs = {\n reason: this.reason(),\n userId: this.user.id(),\n };\n\n if (this.banOption() === 'only') {\n attrs.address = this.post.ipAddress();\n\n app.store.createRecord('banned_ips').save(attrs).then(this.hide.bind(this)).catch(this.onerror.bind(this)).then(this.loaded.bind(this));\n } else if (this.banOption() === 'all') {\n app\n .request({\n body: {\n data: {\n attributes: attrs,\n },\n },\n url: `${app.forum.attribute('apiUrl')}${this.user.apiEndpoint()}/ban`,\n method: 'POST',\n errorHandler: this.onerror.bind(this),\n })\n .then((res) => app.store.pushPayload(res).forEach(this.done.bind(this)))\n .then(this.hide.bind(this))\n .catch(() => {})\n .then(this.loaded.bind(this));\n }\n }\n\n getOtherUsers() {\n const data = {};\n\n if (this.banOption() === 'only') data.ip = this.address || this.post.ipAddress();\n\n app\n .request({\n params: data,\n url: `${app.forum.attribute('apiUrl')}/fof/ban-ips/check-users/${this.user.id()}`,\n method: 'GET',\n errorHandler: this.onerror.bind(this),\n })\n .then((res) => {\n this.otherUsers[this.banOption()] = res.data.map((e) => app.store.pushObject(e)).filter((e) => e.bannedIPs().length === 0);\n this.loading = false;\n })\n .catch(() => {})\n .then(this.loaded.bind(this));\n }\n\n done(bannedIP) {\n const obj = {\n type: 'banned_ips',\n id: bannedIP.id(),\n };\n\n if (this.post) {\n this.post.data.relationships.banned_ip = {\n data: obj,\n };\n }\n\n if (!this.user.data.relationships.banned_ips)\n this.user.data.relationships.banned_ips = {\n data: [],\n };\n\n this.user.data.relationships.banned_ips.data.push(obj);\n this.user.data.attributes.isBanned = true;\n\n app.store.pushObject(this.user.data);\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/username'];","import Button from 'flarum/common/components/Button';\nimport Alert from 'flarum/common/components/Alert';\nimport punctuateSeries from 'flarum/common/helpers/punctuateSeries';\nimport username from 'flarum/common/helpers/username';\n\nimport BanIPModal from './BanIPModal';\n\nexport default class UnbanIPModal extends BanIPModal {\n title() {\n return app.translator.trans('fof-ban-ips.lib.modal.unban_title');\n }\n\n content() {\n const otherUsers = this.otherUsers[this.banOption()];\n const usernames = otherUsers && otherUsers.map((u) => (u && u.displayName()) || app.translator.trans('core.lib.username.deleted_text'));\n\n if (this.bannedIPs) {\n return (\n \n {Alert.component(\n {\n dismissible: false,\n type: 'success',\n },\n app.translator.trans('fof-ban-ips.lib.modal.unbanned_ips', { ips: punctuateSeries(this.bannedIPs) })\n )}\n
\n );\n }\n\n return (\n \n
{app.translator.trans('fof-ban-ips.lib.modal.unban_ip_confirmation')}
\n\n
\n {this.banOptions.map((key) => (\n
\n \n \n \n
\n ))}\n
\n\n {otherUsers\n ? otherUsers.length\n ? Alert.component(\n {\n dismissible: false,\n },\n app.translator.trans('fof-ban-ips.lib.modal.unban_ip_users', {\n users: punctuateSeries(usernames),\n count: usernames.length,\n })\n )\n : Alert.component(\n {\n dismissible: false,\n type: 'success',\n },\n app.translator.trans('fof-ban-ips.lib.modal.unban_ip_no_users')\n )\n : ''}\n\n {otherUsers &&
}\n\n
\n \n
\n
\n );\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n this.loading = true;\n\n if (typeof this.otherUsers[this.banOption()] === 'undefined') return this.getOtherUsers();\n\n const attrs = {};\n\n if (this.banOption() === 'only') {\n attrs.address = this.address || this.post.ipAddress();\n\n const bannedIP = this.post ? this.post.bannedIP() : app.store.getBy('banned_ips', 'address', this.address);\n\n bannedIP.delete().then(this.done.bind(this, bannedIP)).catch(this.onerror.bind(this)).then(this.hide.bind(this));\n } else if (this.banOption() === 'all') {\n app\n .request({\n body: {\n data: {\n attributes: attrs,\n },\n },\n url: `${app.forum.attribute('apiUrl')}${this.user.apiEndpoint()}/unban`,\n method: 'POST',\n errorHandler: this.onerror.bind(this),\n })\n .then(this.done.bind(this))\n .catch(this.onerror.bind(this))\n .then(this.hide.bind(this));\n }\n }\n\n getOtherUsers() {\n const data = {};\n\n if (this.banOption() === 'only') {\n data.ip = this.address || this.post.ipAddress();\n data.skipValidation = true;\n }\n\n let url = `${app.forum.attribute('apiUrl')}/fof/ban-ips/check-users`;\n\n if (this.user) url += `/${this.user.id()}`;\n\n app\n .request({\n params: data,\n url: url,\n method: 'GET',\n errorHandler: this.onerror.bind(this),\n })\n .then((res) => {\n const data = app.store.pushPayload(res);\n\n this.otherUsers[this.banOption()] = data.filter((e) => e.bannedIPs().length === 1);\n this.loading = false;\n\n m.redraw();\n })\n .catch(() => {})\n .then(this.loaded.bind(this));\n }\n\n done(bannedIP) {\n this.loading = false;\n\n if (this.post) delete this.post.data.relationships.banned_ip;\n\n if (this.user && !this.user.data.relationships && !bannedIP) {\n this.user.data.relationships.banned_ips.data = [];\n this.user.data.attributes.isBanned = false;\n } else if (this.user && bannedIP instanceof app.store.models.banned_ips) {\n this.user.data.relationships.banned_ips = {\n data: this.user.data.relationships.banned_ips.data.filter((e) => e.id !== bannedIP.id()),\n };\n this.user.data.attributes.isBanned = this.user.data.relationships.banned_ips.data.length !== 0;\n }\n\n if (bannedIP && Array.isArray(bannedIP.data)) {\n this.bannedIPs = bannedIP.data.map((b) => b.attributes.address);\n this.loading = false;\n\n m.redraw();\n }\n }\n\n hide() {\n super.hide();\n\n if (!this.attrs.redraw) {\n location.reload();\n }\n }\n}\n","import { extend } from 'flarum/common/extend';\nimport PostControls from 'flarum/forum/utils/PostControls';\nimport UserControls from 'flarum/forum/utils/UserControls';\nimport Button from 'flarum/common/components/Button';\n\nimport BanIPModal from '../common/components/BanIPModal';\nimport UnbanIPModal from '../common/components/UnbanIPModal';\n\nexport default () => {\n extend(PostControls, 'userControls', function (items, post) {\n if (!post || !post.user()) return;\n\n const isBanned = post.user().isBanned();\n const prefix = isBanned ? 'un' : '';\n\n // Removes ability to ban thyself and also does permission check.\n if (!post.canBanIP() || post.isHidden() || post.user() === app.session.user || post.contentType() !== 'comment') return;\n\n items.add(\n `${prefix}ban`,\n Button.component(\n {\n icon: 'fas fa-gavel',\n onclick: () => app.modal.show(isBanned ? UnbanIPModal : BanIPModal, { post }),\n },\n app.translator.trans(`fof-ban-ips.forum.${prefix}ban_ip_button`)\n )\n );\n });\n\n extend(UserControls, 'moderationControls', function (items, user) {\n if (!user.canBanIP() || user === app.session.user) return;\n\n const isBanned = user.isBanned();\n const prefix = isBanned ? 'un' : '';\n\n items.add(\n `${prefix}ban`,\n Button.component(\n {\n icon: 'fas fa-gavel',\n onclick: () => app.modal.show(isBanned ? UnbanIPModal : BanIPModal, { user }),\n },\n app.translator.trans(`fof-ban-ips.forum.user_controls.${prefix}ban_button`)\n )\n );\n });\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/mixin'];","import Model from 'flarum/common/Model';\nimport mixin from 'flarum/common/utils/mixin';\n\nexport default class BannedIP extends mixin(Model, {\n creator: Model.hasOne('creator'),\n user: Model.hasOne('user'),\n address: Model.attribute('address'),\n reason: Model.attribute('reason'),\n createdAt: Model.attribute('createdAt', Model.transformDate),\n deletedAt: Model.attribute('deletedAt', Model.transformDate),\n}) {\n apiEndpoint() {\n return `/fof/ban-ips${this.exists ? `/${this.id()}` : ''}`;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Badge'];","import { extend } from 'flarum/common/extend';\nimport User from 'flarum/common/models/User';\nimport Badge from 'flarum/common/components/Badge';\n\nexport default () => {\n extend(User.prototype, 'badges', function (items) {\n if (this.isBanned()) {\n items.add(\n 'banned',\n Badge.component({\n icon: 'fas fa-gavel',\n type: 'banned',\n label: app.translator.trans('fof-ban-ips.forum.user_badge.banned_tooltip'),\n })\n );\n }\n });\n};\n","import BanIPModal from './components/BanIPModal';\nimport UnbanIPModal from './components/UnbanIPModal';\nimport BannedIP from './models/BannedIP';\n\nexport default {\n 'fof/ban-ips/components/BanIPModal': BanIPModal,\n 'fof/ban-ips/components/UnbanIPModal': UnbanIPModal,\n 'fof/ban-ips/models/BannedIP': BannedIP,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core;","import app from 'flarum/common/app';\nimport Model from 'flarum/common/Model';\nimport addBanIPControl from './addBanIPControl';\nimport BannedIP from '../common/models/BannedIP';\nimport addBannedBadge from './addBannedBadge';\n\napp.initializers.add('fof/ban-ips', () => {\n app.store.models.posts.prototype.canBanIP = Model.attribute('canBanIP');\n app.store.models.posts.prototype.ipAddress = Model.attribute('ipAddress');\n app.store.models.posts.prototype.bannedIP = Model.hasOne('banned_ip');\n\n app.store.models.users.prototype.canBanIP = Model.attribute('canBanIP');\n app.store.models.users.prototype.isBanned = Model.attribute('isBanned');\n app.store.models.users.prototype.bannedIPs = Model.hasMany('banned_ips');\n\n app.store.models.banned_ips = BannedIP;\n\n addBanIPControl();\n addBannedBadge();\n});\n\n// Expose compat API\nimport extCompat from '../common/compat';\nimport { compat } from '@flarum/core/forum';\n\nObject.assign(compat, extCompat);\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_setPrototypeOf","p","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","create","constructor","BanIPModal","oninit","vnode","this","address","attrs","post","user","bannedIP","app","store","getBy","banOptions","ipAddress","push","banOption","Stream","reason","otherUsers","loading","className","title","translator","trans","content","otherUsersBanned","usernames","map","u","displayName","type","name","id","checked","onclick","bind","htmlFor","ip","bidi","length","Alert","dismissible","users","punctuateSeries","count","onsubmit","e","preventDefault","getOtherUsers","userId","createRecord","save","then","hide","onerror","loaded","request","body","data","attributes","url","forum","attribute","apiEndpoint","method","errorHandler","res","pushPayload","forEach","done","params","pushObject","filter","bannedIPs","relationships","banned_ip","banned_ips","isBanned","Modal","UnbanIPModal","ips","skipValidation","m","redraw","models","Array","isArray","b","location","reload","BannedIP","exists","mixin","Model","creator","createdAt","deletedAt","extend","PostControls","items","prefix","canBanIP","isHidden","session","contentType","add","Button","icon","modal","show","UserControls","User","Badge","label","assign","extCompat"],"sourceRoot":""}
\ No newline at end of file