From f31e27ff3ac0a197c2864671521ae0b8b384396f Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Thu, 2 Jul 2020 00:06:05 +0000 Subject: [PATCH] Bundled output for commit 78f8a4d310d7b2b347363f31fcb47d084751243b [skip ci] --- extensions/suspend/js/dist/forum.js | 2 +- extensions/suspend/js/dist/forum.js.map | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/suspend/js/dist/forum.js b/extensions/suspend/js/dist/forum.js index d1bf8ffb0..2acb0b723 100644 --- a/extensions/suspend/js/dist/forum.js +++ b/extensions/suspend/js/dist/forum.js @@ -1,2 +1,2 @@ -module.exports=function(t){var e={};function n(s){if(e[s])return e[s].exports;var r=e[s]={i:s,l:!1,exports:{}};return t[s].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,s){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:s})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(n.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(s,r,function(e){return t[e]}.bind(null,r));return s},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=10)}([function(t,e){t.exports=flarum.core.compat.app},function(t,e){t.exports=flarum.core.compat.extend},function(t,e){t.exports=flarum.core.compat["components/Button"]},function(t,e){t.exports=flarum.core.compat["components/Notification"]},function(t,e){t.exports=flarum.core.compat.Model},function(t,e){t.exports=flarum.core.compat["models/User"]},function(t,e){t.exports=flarum.core.compat["utils/UserControls"]},function(t,e){t.exports=flarum.core.compat["components/Badge"]},function(t,e){t.exports=flarum.core.compat["components/Modal"]},,function(t,e,n){"use strict";n.r(e);var s=n(1),r=n(0),a=n.n(r),o=n(6),u=n.n(o),i=n(2),p=n.n(i),l=n(7),c=n.n(l),d=n(4),f=n.n(d),h=n(5),y=n.n(h);function b(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var v=n(8),_=function(t){function e(){return t.apply(this,arguments)||this}b(e,t);var n=e.prototype;return n.init=function(){t.prototype.init.call(this);var e=this.props.user.suspendedUntil(),n=null;new Date>e&&(e=null),e&&(n=9999===e.getFullYear()?"indefinitely":"limited"),this.status=m.prop(n),this.daysRemaining=m.prop("limited"===n&&1-moment().diff(e,"days"))},n.className=function(){return"SuspendUserModal Modal--small"},n.title=function(){return app.translator.trans("flarum-suspend.forum.suspend_user.title",{user:this.props.user})},n.content=function(){var t=this;return m("div",{className:"Modal-body"},m("div",{className:"Form"},m("div",{className:"Form-group"},m("label",null,app.translator.trans("flarum-suspend.forum.suspend_user.status_heading")),m("div",null,m("label",{className:"checkbox"},m("input",{type:"radio",name:"status",checked:!this.status(),value:"",onclick:m.withAttr("value",this.status)}),app.translator.trans("flarum-suspend.forum.suspend_user.not_suspended_label")),m("label",{className:"checkbox"},m("input",{type:"radio",name:"status",checked:"indefinitely"===this.status(),value:"indefinitely",onclick:m.withAttr("value",this.status)}),app.translator.trans("flarum-suspend.forum.suspend_user.indefinitely_label")),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(!0),t.$(".SuspendUserModal-days-input input").select(),m.redraw.strategy("none")}}),app.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:m.withAttr("value",this.daysRemaining),className:"FormControl"}),app.translator.trans("flarum-suspend.forum.suspend_user.limited_time_days_text")):""))),m("div",{className:"Form-group"},m(p.a,{className:"Button Button--primary",loading:this.loading,type:"submit"},app.translator.trans("flarum-suspend.forum.suspend_user.submit_button")))))},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=moment().add(this.daysRemaining(),"days").toDate()}this.props.user.save({suspendedUntil:n}).then((function(){return e.hide()}),this.loaded.bind(this))},e}(n.n(v).a),x=n(3),g=n.n(x),U=function(t){function e(){return t.apply(this,arguments)||this}b(e,t);var n=e.prototype;return n.icon=function(){return"fas fa-ban"},n.href=function(){return app.route.user(this.props.notification.subject())},n.content=function(){var t=this.props.notification,e=t.content(),n=moment(e.date).from(t.createdAt(),!0);return app.translator.trans("flarum-suspend.forum.notifications.user_suspended_text",{user:t.fromUser(),timeReadable:n})},e}(g.a),S=function(t){function e(){return t.apply(this,arguments)||this}b(e,t);var n=e.prototype;return n.icon=function(){return"fas fa-ban"},n.href=function(){return app.route.user(this.props.notification.subject())},n.content=function(){var t=this.props.notification;return app.translator.trans("flarum-suspend.forum.notifications.user_unsuspended_text",{user:t.fromUser()})},e}(g.a);a.a.initializers.add("flarum-suspend",(function(){a.a.notificationComponents.userSuspended=U,a.a.notificationComponents.userUnsuspended=S,y.a.prototype.canSuspend=f.a.attribute("canSuspend"),y.a.prototype.suspendedUntil=f.a.attribute("suspendedUntil",f.a.transformDate),Object(s.extend)(u.a,"moderationControls",(function(t,e){e.canSuspend()&&t.add("suspend",p.a.component({children:a.a.translator.trans("flarum-suspend.forum.user_controls.suspend_button"),icon:"fas fa-ban",onclick:function(){return a.a.modal.show(new _({user:e}))}}))})),Object(s.extend)(y.a.prototype,"badges",(function(t){var e=this.suspendedUntil();new Datee&&(e=null),e&&(n=9999===e.getFullYear()?"indefinitely":"limited"),this.status=m.prop(n),this.daysRemaining=m.prop("limited"===n&&1-moment().diff(e,"days"))},n.className=function(){return"SuspendUserModal Modal--small"},n.title=function(){return app.translator.trans("flarum-suspend.forum.suspend_user.title",{user:this.props.user})},n.content=function(){var t=this;return m("div",{className:"Modal-body"},m("div",{className:"Form"},m("div",{className:"Form-group"},m("label",null,app.translator.trans("flarum-suspend.forum.suspend_user.status_heading")),m("div",null,m("label",{className:"checkbox"},m("input",{type:"radio",name:"status",checked:!this.status(),value:"",onclick:m.withAttr("value",this.status)}),app.translator.trans("flarum-suspend.forum.suspend_user.not_suspended_label")),m("label",{className:"checkbox"},m("input",{type:"radio",name:"status",checked:"indefinitely"===this.status(),value:"indefinitely",onclick:m.withAttr("value",this.status)}),app.translator.trans("flarum-suspend.forum.suspend_user.indefinitely_label")),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(!0),t.$(".SuspendUserModal-days-input input").select(),m.redraw.strategy("none")}}),app.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:m.withAttr("value",this.daysRemaining),className:"FormControl"}),app.translator.trans("flarum-suspend.forum.suspend_user.limited_time_days_text")):""))),m("div",{className:"Form-group"},m(p.a,{className:"Button Button--primary",loading:this.loading,type:"submit"},app.translator.trans("flarum-suspend.forum.suspend_user.submit_button")))))},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=moment().add(this.daysRemaining(),"days").toDate()}this.props.user.save({suspendedUntil:n}).then((function(){return e.hide()}),this.loaded.bind(this))},e}(n.n(v).a),x=n(3),g=n.n(x),U=function(t){function e(){return t.apply(this,arguments)||this}b(e,t);var n=e.prototype;return n.icon=function(){return"fas fa-ban"},n.href=function(){return app.route.user(this.props.notification.subject())},n.content=function(){var t=this.props.notification,e=t.content(),n=moment(e.date).from(t.createdAt(),!0);return app.translator.trans("flarum-suspend.forum.notifications.user_suspended_text",{user:t.fromUser(),timeReadable:n})},e}(g.a),S=function(t){function e(){return t.apply(this,arguments)||this}b(e,t);var n=e.prototype;return n.icon=function(){return"fas fa-ban"},n.href=function(){return app.route.user(this.props.notification.subject())},n.content=function(){var t=this.props.notification;return app.translator.trans("flarum-suspend.forum.notifications.user_unsuspended_text",{user:t.fromUser()})},e}(g.a);a.a.initializers.add("flarum-suspend",(function(){a.a.notificationComponents.userSuspended=U,a.a.notificationComponents.userUnsuspended=S,y.a.prototype.canSuspend=f.a.attribute("canSuspend"),y.a.prototype.suspendedUntil=f.a.attribute("suspendedUntil",f.a.transformDate),Object(s.extend)(u.a,"moderationControls",(function(t,e){e.canSuspend()&&t.add("suspend",p.a.component({children:a.a.translator.trans("flarum-suspend.forum.user_controls.suspend_button"),icon:"fas fa-ban",onclick:function(){return a.a.modal.show(_,{user:e})}}))})),Object(s.extend)(y.a.prototype,"badges",(function(t){var e=this.suspendedUntil();new Date until) until = null;\n\n if (until) {\n if (until.getFullYear() === 9999) status = 'indefinitely';\n else status = 'limited';\n }\n\n this.status = m.prop(status);\n this.daysRemaining = m.prop(status === 'limited' && -moment().diff(until, 'days') + 1);\n }\n\n className() {\n return 'SuspendUserModal Modal--small';\n }\n\n title() {\n return app.translator.trans('flarum-suspend.forum.suspend_user.title', {user: this.props.user});\n }\n\n content() {\n return (\n
\n
\n
\n \n
\n \n\n \n\n \n
\n
\n\n
\n \n
\n
\n
\n );\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n this.loading = true;\n\n let suspendedUntil = null;\n switch (this.status()) {\n case 'indefinitely':\n suspendedUntil = new Date('2038-01-01');\n break;\n\n case 'limited':\n suspendedUntil = moment().add(this.daysRemaining(), 'days').toDate();\n break;\n\n default:\n // no default\n }\n\n this.props.user.save({suspendedUntil}).then(\n () => this.hide(),\n this.loaded.bind(this)\n );\n }\n}\n","import Notification from 'flarum/components/Notification';\n\nexport default class UserSuspendedNotification extends Notification {\n icon() {\n return 'fas fa-ban';\n }\n\n href() {\n return app.route.user(this.props.notification.subject());\n }\n\n content() {\n const notification = this.props.notification;\n const suspendedUntil = notification.content();\n const timeReadable = moment(suspendedUntil.date).from(notification.createdAt(), true);\n\n return app.translator.trans('flarum-suspend.forum.notifications.user_suspended_text', {\n user: notification.fromUser(),\n timeReadable,\n });\n }\n}\n","import Notification from 'flarum/components/Notification';\n\nexport default class UserUnsuspendedNotification extends Notification {\n icon() {\n return 'fas fa-ban';\n }\n\n href() {\n return app.route.user(this.props.notification.subject());\n }\n\n content() {\n const notification = this.props.notification;\n\n return app.translator.trans('flarum-suspend.forum.notifications.user_unsuspended_text', {\n user: notification.fromUser(),\n });\n }\n}\n","import { extend } from 'flarum/extend';\nimport app from 'flarum/app';\nimport UserControls from 'flarum/utils/UserControls';\nimport Button from 'flarum/components/Button';\nimport Badge from 'flarum/components/Badge';\nimport Model from 'flarum/Model';\nimport User from 'flarum/models/User';\n\nimport SuspendUserModal from './components/SuspendUserModal';\nimport UserSuspendedNotification from './components/UserSuspendedNotification';\nimport UserUnsuspendedNotification from './components/UserUnsuspendedNotification';\n\napp.initializers.add('flarum-suspend', () => {\n app.notificationComponents.userSuspended = UserSuspendedNotification;\n app.notificationComponents.userUnsuspended = UserUnsuspendedNotification;\n\n User.prototype.canSuspend = Model.attribute('canSuspend');\n User.prototype.suspendedUntil = Model.attribute('suspendedUntil', Model.transformDate);\n\n extend(UserControls, 'moderationControls', (items, user) => {\n if (user.canSuspend()) {\n items.add('suspend', Button.component({\n children: app.translator.trans('flarum-suspend.forum.user_controls.suspend_button'),\n icon: 'fas fa-ban',\n onclick: () => app.modal.show(new SuspendUserModal({user}))\n }));\n }\n });\n\n extend(User.prototype, 'badges', function(items) {\n const until = this.suspendedUntil();\n\n if (new Date() < until) {\n items.add('suspended', Badge.component({\n icon: 'fas fa-ban',\n type: 'suspended',\n label: app.translator.trans('flarum-suspend.forum.user_badge.suspended_tooltip')\n }));\n }\n });\n});\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://@flarum/suspend/webpack/bootstrap","webpack://@flarum/suspend/external \"flarum.core.compat['app']\"","webpack://@flarum/suspend/external \"flarum.core.compat['extend']\"","webpack://@flarum/suspend/external \"flarum.core.compat['components/Button']\"","webpack://@flarum/suspend/external \"flarum.core.compat['components/Notification']\"","webpack://@flarum/suspend/external \"flarum.core.compat['Model']\"","webpack://@flarum/suspend/external \"flarum.core.compat['models/User']\"","webpack://@flarum/suspend/external \"flarum.core.compat['utils/UserControls']\"","webpack://@flarum/suspend/external \"flarum.core.compat['components/Badge']\"","webpack://@flarum/suspend/external \"flarum.core.compat['components/Modal']\"","webpack://@flarum/suspend/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/suspend/./src/forum/components/SuspendUserModal.js","webpack://@flarum/suspend/./src/forum/components/UserSuspendedNotification.js","webpack://@flarum/suspend/./src/forum/components/UserUnsuspendedNotification.js","webpack://@flarum/suspend/./src/forum/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","_inheritsLoose","subClass","superClass","constructor","__proto__","SuspendUserModal","init","until","this","props","user","suspendedUntil","status","Date","getFullYear","prop","daysRemaining","moment","diff","className","title","app","translator","trans","content","type","checked","onclick","withAttr","e","target","redraw","$","select","strategy","min","oninput","loading","onsubmit","preventDefault","add","toDate","save","then","hide","loaded","Modal","UserSuspendedNotification","icon","href","route","notification","subject","timeReadable","date","from","createdAt","fromUser","Notification","UserUnsuspendedNotification","initializers","notificationComponents","userSuspended","userUnsuspended","User","canSuspend","Model","attribute","transformDate","extend","UserControls","items","Button","component","children","modal","show","Badge","label"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ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n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 10);\n","module.exports = flarum.core.compat['app'];","module.exports = flarum.core.compat['extend'];","module.exports = flarum.core.compat['components/Button'];","module.exports = flarum.core.compat['components/Notification'];","module.exports = flarum.core.compat['Model'];","module.exports = flarum.core.compat['models/User'];","module.exports = flarum.core.compat['utils/UserControls'];","module.exports = flarum.core.compat['components/Badge'];","module.exports = flarum.core.compat['components/Modal'];","export default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}","import Modal from 'flarum/components/Modal';\nimport Button from 'flarum/components/Button';\n\nexport default class SuspendUserModal extends Modal {\n init() {\n super.init();\n\n let until = this.props.user.suspendedUntil();\n let status = null;\n\n if (new Date() > until) until = null;\n\n if (until) {\n if (until.getFullYear() === 9999) status = 'indefinitely';\n else status = 'limited';\n }\n\n this.status = m.prop(status);\n this.daysRemaining = m.prop(status === 'limited' && -moment().diff(until, 'days') + 1);\n }\n\n className() {\n return 'SuspendUserModal Modal--small';\n }\n\n title() {\n return app.translator.trans('flarum-suspend.forum.suspend_user.title', {user: this.props.user});\n }\n\n content() {\n return (\n
\n
\n
\n \n
\n \n\n \n\n \n
\n
\n\n
\n \n
\n
\n
\n );\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n this.loading = true;\n\n let suspendedUntil = null;\n switch (this.status()) {\n case 'indefinitely':\n suspendedUntil = new Date('2038-01-01');\n break;\n\n case 'limited':\n suspendedUntil = moment().add(this.daysRemaining(), 'days').toDate();\n break;\n\n default:\n // no default\n }\n\n this.props.user.save({suspendedUntil}).then(\n () => this.hide(),\n this.loaded.bind(this)\n );\n }\n}\n","import Notification from 'flarum/components/Notification';\n\nexport default class UserSuspendedNotification extends Notification {\n icon() {\n return 'fas fa-ban';\n }\n\n href() {\n return app.route.user(this.props.notification.subject());\n }\n\n content() {\n const notification = this.props.notification;\n const suspendedUntil = notification.content();\n const timeReadable = moment(suspendedUntil.date).from(notification.createdAt(), true);\n\n return app.translator.trans('flarum-suspend.forum.notifications.user_suspended_text', {\n user: notification.fromUser(),\n timeReadable,\n });\n }\n}\n","import Notification from 'flarum/components/Notification';\n\nexport default class UserUnsuspendedNotification extends Notification {\n icon() {\n return 'fas fa-ban';\n }\n\n href() {\n return app.route.user(this.props.notification.subject());\n }\n\n content() {\n const notification = this.props.notification;\n\n return app.translator.trans('flarum-suspend.forum.notifications.user_unsuspended_text', {\n user: notification.fromUser(),\n });\n }\n}\n","import { extend } from 'flarum/extend';\nimport app from 'flarum/app';\nimport UserControls from 'flarum/utils/UserControls';\nimport Button from 'flarum/components/Button';\nimport Badge from 'flarum/components/Badge';\nimport Model from 'flarum/Model';\nimport User from 'flarum/models/User';\n\nimport SuspendUserModal from './components/SuspendUserModal';\nimport UserSuspendedNotification from './components/UserSuspendedNotification';\nimport UserUnsuspendedNotification from './components/UserUnsuspendedNotification';\n\napp.initializers.add('flarum-suspend', () => {\n app.notificationComponents.userSuspended = UserSuspendedNotification;\n app.notificationComponents.userUnsuspended = UserUnsuspendedNotification;\n\n User.prototype.canSuspend = Model.attribute('canSuspend');\n User.prototype.suspendedUntil = Model.attribute('suspendedUntil', Model.transformDate);\n\n extend(UserControls, 'moderationControls', (items, user) => {\n if (user.canSuspend()) {\n items.add('suspend', Button.component({\n children: app.translator.trans('flarum-suspend.forum.user_controls.suspend_button'),\n icon: 'fas fa-ban',\n onclick: () => app.modal.show(SuspendUserModal, {user})\n }));\n }\n });\n\n extend(User.prototype, 'badges', function(items) {\n const until = this.suspendedUntil();\n\n if (new Date() < until) {\n items.add('suspended', Badge.component({\n icon: 'fas fa-ban',\n type: 'suspended',\n label: app.translator.trans('flarum-suspend.forum.user_badge.suspended_tooltip')\n }));\n }\n });\n});\n"],"sourceRoot":""} \ No newline at end of file