(()=>{var t={757:function(t){t.exports=function(){"use strict";var t=6e4,e=36e5,n="millisecond",s="second",r="minute",i="hour",a="day",o="week",u="month",c="quarter",l="year",d="date",f="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},v=function(t,e,n){var s=String(t);return!s||s.length>=e?t:""+Array(e+1-s.length).join(n)+t},$={s:v,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),s=Math.floor(n/60),r=n%60;return(e<=0?"+":"-")+v(s,2,"0")+":"+v(r,2,"0")},m:function t(e,n){if(e.date(){var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var s in e)n.o(e,s)&&!n.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var s={};(()=>{"use strict";n.r(s);const t=flarum.core.compat.extend,e=flarum.core.compat.app;var r=n.n(e);const i=flarum.core.compat["utils/UserControls"];var a=n.n(i);const o=flarum.core.compat["components/Button"];var u=n.n(o);const c=flarum.core.compat["components/Badge"];var l=n.n(c);const d=flarum.core.compat.Model;var f=n.n(d);const h=flarum.core.compat["models/User"];var p=n.n(h);function v(t,e){return v=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},v(t,e)}function $(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,v(t,e)}const g=flarum.core.compat["forum/app"];var y=n.n(g);const M=flarum.core.compat["components/Modal"];var _=n.n(M);const S=flarum.core.compat["utils/Stream"];var b=n.n(S);const D=flarum.core.compat["utils/withAttr"];var w=n.n(D);const O=flarum.core.compat["common/utils/ItemList"];var T=n.n(O),x=n(757),U=n.n(x),N=n(221),k=n.n(N);function C(t){return U().utc(t).isSame(U().utc("2038-01-01"))}U().extend(k());var Y=function(t){function e(){return t.apply(this,arguments)||this}$(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e);var n=this.attrs.user.suspendedUntil(),s=this.attrs.user.suspendReason(),r=this.attrs.user.suspendMessage(),i=null;new Date>n&&(n=null),n&&(i=9999===n.getFullYear()?"indefinitely":"limited"),this.status=b()(i),this.reason=b()(s),this.message=b()(r),this.daysRemaining=b()("limited"===i&&1-dayjs().diff(n,"days"))},n.className=function(){return"SuspendUserModal Modal--medium"},n.title=function(){return y().translator.trans("flarum-suspend.forum.suspend_user.title",{user:this.attrs.user})},n.content=function(){return m("div",{className:"Modal-body"},m("div",{className:"Form"},m("div",{className:"Form-group"},m("label",null,y().translator.trans("flarum-suspend.forum.suspend_user.status_heading")),m("div",null,this.formItems().toArray())),m("div",{className:"Form-group"},m(u(),{className:"Button Button--primary",loading:this.loading,type:"submit"},y().translator.trans("flarum-suspend.forum.suspend_user.submit_button")))))},n.radioItems=function(){var t=this,e=new(T());return e.add("not-suspended",m("label",{className:"checkbox"},m("input",{type:"radio",name:"status",checked:!this.status(),value:"",onclick:w()("value",this.status)}),y().translator.trans("flarum-suspend.forum.suspend_user.not_suspended_label")),100),e.add("indefinitely",m("label",{className:"checkbox"},m("input",{type:"radio",name:"status",checked:"indefinitely"===this.status(),value:"indefinitely",onclick:w()("value",this.status)}),y().translator.trans("flarum-suspend.forum.suspend_user.indefinitely_label")),90),e.add("time-suspension",m("label",{className:"checkbox SuspendUserModal-days"},m("input",{type:"radio",name:"status",checked:"limited"===this.status(),value:"limited",onclick:function(e){t.status(e.target.value),m.redraw.sync(),t.$(".SuspendUserModal-days-input input").select(),e.redraw=!1}}),y().translator.trans("flarum-suspend.forum.suspend_user.limited_time_label"),"limited"===this.status()&&m("div",{className:"SuspendUserModal-days-input"},m("input",{type:"number",min:"0",value:this.daysRemaining(),oninput:w()("value",this.daysRemaining),className:"FormControl"}),y().translator.trans("flarum-suspend.forum.suspend_user.limited_time_days_text"))),80),e},n.formItems=function(){var t=new(T());return t.add("radioItems",m("div",{className:"Form-group"},this.radioItems().toArray()),100),t.add("reason",m("div",{className:"Form-group"},m("label",null,y().translator.trans("flarum-suspend.forum.suspend_user.reason"),m("textarea",{className:"FormControl",bidi:this.reason,placeholder:y().translator.trans("flarum-suspend.forum.suspend_user.placeholder_optional"),rows:"2"}))),90),t.add("message",m("div",{className:"Form-group"},m("label",null,y().translator.trans("flarum-suspend.forum.suspend_user.display_message"),m("textarea",{className:"FormControl",bidi:this.message,placeholder:y().translator.trans("flarum-suspend.forum.suspend_user.placeholder_optional"),rows:"2"}))),80),t},n.onsubmit=function(t){var e=this;t.preventDefault(),this.loading=!0;var n=null;switch(this.status()){case"indefinitely":n=new Date("2038-01-01");break;case"limited":n=dayjs().add(this.daysRemaining(),"days").toDate()}this.attrs.user.save({suspendedUntil:n,suspendReason:this.reason(),suspendMessage:this.message()}).then((function(){return e.hide()}),this.loaded.bind(this))},e}(_());const I=flarum.core.compat["components/Notification"];var F=n.n(I),H=function(t){function e(){return t.apply(this,arguments)||this}$(e,t);var n=e.prototype;return n.icon=function(){return"fas fa-ban"},n.href=function(){return y().route.user(this.attrs.notification.subject())},n.content=function(){var t=this.attrs.notification,e=t.content(),n=dayjs(e).from(t.createdAt(),!0);return C(e)?y().translator.trans("flarum-suspend.forum.notifications.user_suspended_indefinite_text"):y().translator.trans("flarum-suspend.forum.notifications.user_suspended_text",{timeReadable:n})},e}(F()),j=function(t){function e(){return t.apply(this,arguments)||this}$(e,t);var n=e.prototype;return n.icon=function(){return"fas fa-ban"},n.href=function(){return y().route.user(this.attrs.notification.subject())},n.content=function(){return this.attrs.notification,y().translator.trans("flarum-suspend.forum.notifications.user_unsuspended_text")},e}(F());const A=flarum.core.compat["common/components/Modal"];var L=n.n(A);const W=flarum.core.compat["common/components/Button"];var B=n.n(W);const R=flarum.core.compat["common/helpers/fullTime"];var z=n.n(R),P=function(t){function e(){return t.apply(this,arguments)||this}$(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.message=this.attrs.message,this.until=this.attrs.until},n.className=function(){return"SuspensionInfoModal Modal"},n.title=function(){return y().translator.trans("flarum-suspend.forum.suspension_info.title")},n.content=function(){var t=C(new Date(this.until))?y().translator.trans("flarum-suspend.forum.suspension_info.indefinite"):y().translator.trans("flarum-suspend.forum.suspension_info.limited",{date:z()(this.until)});return m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("p",{className:"helpText"},this.message),m("p",{className:"helpText"},t),m("div",{className:"Form-group"},m(B(),{className:"Button Button--primary Button--block",onclick:this.hide.bind(this)},y().translator.trans("flarum-suspend.forum.suspension_info.dismiss_button")))))},n.hide=function(){localStorage.setItem("flarum-suspend.acknowledge-suspension",this.attrs.until.getTime()),this.attrs.state.close()},e}(L());function Z(){return setTimeout((function(){if(y().session.user){var t=y().session.user.suspendMessage(),e=y().session.user.suspendedUntil(),n=t&&e&&new Date