From ea873d46cd3ecb9f0fc2d932df4411badf1253fe Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Thu, 23 Dec 2021 09:27:42 +0000 Subject: [PATCH] Bundled output for commit a1e194e3129a1e876d615f2ac693991a96afda8a Includes transpiled JS/TS. [skip ci] --- js/dist/admin.js | 2 +- js/dist/admin.js.map | 2 +- js/dist/forum.js | 2 +- js/dist/forum.js.map | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/js/dist/admin.js b/js/dist/admin.js index cb94c40..579c0a8 100644 --- a/js/dist/admin.js +++ b/js/dist/admin.js @@ -1,2 +1,2 @@ -module.exports=function(t){var e={};function o(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,o),i.l=!0,i.exports}return o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)o.d(n,i,function(e){return t[e]}.bind(null,i));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=45)}({1:function(t,e,o){"use strict";function n(t,e){return(n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function i(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,n(t,e)}o.d(e,"a",(function(){return i}))},15:function(t,e){t.exports=flarum.core.compat["common/components/Badge"]},2:function(t,e){t.exports=flarum.core.compat["common/models/User"]},4:function(t,e){t.exports=flarum.core.compat["admin/app"]},42:function(t,e){t.exports=flarum.core.compat["admin/components/ExtensionPage"]},43:function(t,e){t.exports=flarum.core.compat["common/helpers/icon"]},45:function(t,e,o){"use strict";o.r(e);var n=o(4),i=o.n(n),r=o(2),s=o.n(r),a=o(1),c=o(42),u=o.n(c),f=o(15),p=o.n(f),l=o(43),d=o.n(l),b=function(t){function e(){return t.apply(this,arguments)||this}Object(a.a)(e,t);var o=e.prototype;return o.oninit=function(e){t.prototype.oninit.call(this,e),this.badgeDefault="fas fa-map",this.postActionDefault="far fa-map"},o.content=function(){return[m("div",{className:"container"},m("div",{className:"ByobuSettingsPage"},m("div",{className:"Form"},m("div",{className:"Form-group"},this.buildSettingComponent({type:"string",setting:"fof-byobu.icon-badge",label:i.a.translator.trans("fof-byobu.admin.settings.badge-icon"),help:m(p.a,{icon:this.setting("fof-byobu.icon-badge").toJSON()||this.badgeDefault}),placeholder:this.badgeDefault}),this.buildSettingComponent({type:"string",setting:"fof-byobu.icon-postAction",label:i.a.translator.trans("fof-byobu.admin.settings.post-event-icon"),help:m("h2",null,d()(this.setting("fof-byobu.icon-postAction").toJSON()||this.postActionDefault)),placeholder:this.postActionDefault})),flarum.extensions["flarum-tags"]&&m("div",{className:"Form-group"},m("p",null,i.a.translator.trans("flarum-tags.admin.edit_tag.icon_text",{a:m("a",{href:"https://fontawesome.com/icons?m=free",tabindex:"-1"})}))),m("div",{className:"Form-group"},this.submitButton()))))]},e}(u.a);i.a.initializers.add("fof-byobu",(function(){i.a.store.models.recipients=s.a,i.a.extensionData.for("fof-byobu").registerPage(b),i.a.extensionData.for("fof-byobu").registerPermission({icon:"far fa-map",label:i.a.translator.trans("fof-byobu.admin.permission.create_private_discussions_with_users"),permission:"discussion.startPrivateDiscussionWithUsers",tagScoped:!1},"start",95).registerPermission({icon:"far fa-map",label:i.a.translator.trans("fof-byobu.admin.permission.create_private_discussions_with_groups"),permission:"discussion.startPrivateDiscussionWithGroups",tagScoped:!1},"start",95).registerPermission({icon:"far fa-map",label:i.a.translator.trans("fof-byobu.admin.permission.create_private_discussions_with_blocking_users"),permission:"startPrivateDiscussionWithBlockers",tagScoped:!1},"start",95).registerPermission({icon:"far fa-map",label:i.a.translator.trans("fof-byobu.admin.permission.edit_user_recipients"),permission:"discussion.editUserRecipients",tagScoped:!1},"moderate",95).registerPermission({icon:"far fa-map",label:i.a.translator.trans("fof-byobu.admin.permission.edit_group_recipients"),permission:"discussion.editGroupRecipients",tagScoped:!1},"moderate",95).registerPermission({icon:"fas fa-flag",label:i.a.translator.trans("fof-byobu.admin.permission.view_private_discussions-when-flagged"),permission:"user.viewPrivateDiscussionsWhenFlagged",tagScoped:!1},"moderate",95)}))}}); +module.exports=function(t){var e={};function o(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=t,o.c=e,o.d=function(t,e,i){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(o.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)o.d(i,n,function(e){return t[e]}.bind(null,n));return i},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=48)}({1:function(t,e,o){"use strict";function i(t,e){return(i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function n(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,i(t,e)}o.d(e,"a",(function(){return n}))},16:function(t,e){t.exports=flarum.core.compat["common/components/Badge"]},2:function(t,e){t.exports=flarum.core.compat["common/models/User"]},3:function(t,e){t.exports=flarum.core.compat["admin/app"]},45:function(t,e){t.exports=flarum.core.compat["admin/components/ExtensionPage"]},46:function(t,e){t.exports=flarum.core.compat["common/helpers/icon"]},48:function(t,e,o){"use strict";o.r(e);var i=o(3),n=o.n(i),r=o(2),s=o.n(r),a=o(1),u=o(45),c=o.n(u),f=o(16),p=o.n(f),l=o(46),b=o.n(l),d=function(t){function e(){return t.apply(this,arguments)||this}Object(a.a)(e,t);var o=e.prototype;return o.oninit=function(e){t.prototype.oninit.call(this,e),this.badgeDefault="fas fa-map",this.postActionDefault="far fa-map"},o.content=function(){var t=flarum.extensions["flarum-tags"]?n.a.translator.trans("flarum-tags.admin.edit_tag.icon_text",{a:m("a",{href:"https://fontawesome.com/icons?m=free",tabindex:"-1"})}):"";return[m("div",{className:"ByobuSettingsPage"},m("div",{className:"container"},m("div",{className:"Form"},m("div",{className:"Form-group"},this.buildSettingComponent({type:"string",setting:"fof-byobu.icon-badge",label:n.a.translator.trans("fof-byobu.admin.settings.badge-icon"),help:m("div",null,m(p.a,{icon:this.setting("fof-byobu.icon-badge").toJSON()||this.badgeDefault})," ",t),placeholder:this.badgeDefault}),this.buildSettingComponent({type:"string",setting:"fof-byobu.icon-postAction",label:n.a.translator.trans("fof-byobu.admin.settings.post-event-icon"),help:m("div",null,b()(this.setting("fof-byobu.icon-postAction").toJSON()||this.postActionDefault)," ",t),placeholder:this.postActionDefault}),this.buildSettingComponent({type:"boolean",setting:"fof-byobu.makePublic",label:n.a.translator.trans("fof-byobu.admin.settings.enable-make-public-option"),help:n.a.translator.trans("fof-byobu.admin.settings.enable-make-public-option-help")})),m("div",{className:"Form-group"},this.submitButton()))))]},e}(c.a);n.a.initializers.add("fof-byobu",(function(){var t;n.a.store.models.recipients=s.a,n.a.extensionData.for("fof-byobu").registerPage(d),(t=n.a.extensionData.for("fof-byobu")).registerPermission({icon:"far fa-map",label:n.a.translator.trans("fof-byobu.admin.permission.create_private_discussions_with_users"),permission:"discussion.startPrivateDiscussionWithUsers",tagScoped:!1},"start",95).registerPermission({icon:"far fa-map",label:n.a.translator.trans("fof-byobu.admin.permission.create_private_discussions_with_groups"),permission:"discussion.startPrivateDiscussionWithGroups",tagScoped:!1},"start",95).registerPermission({icon:"far fa-map",label:n.a.translator.trans("fof-byobu.admin.permission.create_private_discussions_with_blocking_users"),permission:"startPrivateDiscussionWithBlockers",tagScoped:!1},"start",95).registerPermission({icon:"far fa-map",label:n.a.translator.trans("fof-byobu.admin.permission.edit_user_recipients"),permission:"discussion.editUserRecipients",tagScoped:!1},"moderate",95).registerPermission({icon:"far fa-map",label:n.a.translator.trans("fof-byobu.admin.permission.edit_group_recipients"),permission:"discussion.editGroupRecipients",tagScoped:!1},"moderate",95).registerPermission({icon:"fas fa-flag",label:n.a.translator.trans("fof-byobu.admin.permission.view_private_discussions-when-flagged"),permission:"user.viewPrivateDiscussionsWhenFlagged",tagScoped:!1},"moderate",95),n.a.data.settings["fof-byobu.makePublic"]&&t.registerPermission({icon:"far fa-map",label:n.a.translator.trans("fof-byobu.admin.permission.make_private_into_public"),permission:"discussion.makePublic",tagScoped:!1},"reply",95)}))}}); //# 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 8c9ab74..6b646d4 100644 --- a/js/dist/admin.js.map +++ b/js/dist/admin.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://@fof/byobu/webpack/bootstrap","webpack://@fof/byobu/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/byobu/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/byobu/external \"flarum.core.compat['common/components/Badge']\"","webpack://@fof/byobu/external \"flarum.core.compat['common/models/User']\"","webpack://@fof/byobu/external \"flarum.core.compat['admin/app']\"","webpack://@fof/byobu/external \"flarum.core.compat['admin/components/ExtensionPage']\"","webpack://@fof/byobu/external \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/byobu/./src/admin/components/ByobuSettingsPage.tsx","webpack://@fof/byobu/./src/admin/index.ts","webpack://@fof/byobu/./src/admin/addPrivateDiscussionPermission.ts"],"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","_setPrototypeOf","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","constructor","flarum","core","compat","ByobuSetingsPage","oninit","vnode","this","badgeDefault","postActionDefault","content","className","buildSettingComponent","type","setting","label","app","translator","trans","help","icon","toJSON","placeholder","extensions","a","href","tabindex","submitButton","ExtensionPage","initializers","add","store","models","recipients","User","extensionData","registerPage","ByobuSettings","registerPermission","permission","tagScoped"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,E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CACZC,WAAW,GAEb,WACA,IAEDF,mBACC,CACElB,KAAM,aACNL,MAAOC,IAAIC,WAAWC,MAAM,oDAC5BqB,WAAY,iCACZC,WAAW,GAEb,WACA,IAEDF,mBACC,CACElB,KAAM,cACNL,MAAOC,IAAIC,WAAWC,MAAM,oEAC5BqB,WAAY,yCACZC,WAAW,GAEb,WACA","file":"admin.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\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 = 45);\n","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}","module.exports = flarum.core.compat['common/components/Badge'];","module.exports = flarum.core.compat['common/models/User'];","module.exports = flarum.core.compat['admin/app'];","module.exports = flarum.core.compat['admin/components/ExtensionPage'];","module.exports = flarum.core.compat['common/helpers/icon'];","import app from 'flarum/admin/app';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport Badge from 'flarum/common/components/Badge';\nimport icon from 'flarum/common/helpers/icon';\n\nimport type Mithril from 'mithril';\n\nexport default class ByobuSetingsPage extends ExtensionPage {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.badgeDefault = 'fas fa-map';\n this.postActionDefault = 'far fa-map';\n }\n\n content() {\n return [\n
\n
\n
\n
\n {this.buildSettingComponent({\n type: 'string',\n setting: 'fof-byobu.icon-badge',\n label: app.translator.trans('fof-byobu.admin.settings.badge-icon'),\n help: ,\n placeholder: this.badgeDefault,\n })}\n {this.buildSettingComponent({\n type: 'string',\n setting: 'fof-byobu.icon-postAction',\n label: app.translator.trans('fof-byobu.admin.settings.post-event-icon'),\n help:

{icon(this.setting('fof-byobu.icon-postAction').toJSON() || this.postActionDefault)}

,\n placeholder: this.postActionDefault,\n })}\n
\n {flarum.extensions['flarum-tags'] && (\n
\n

\n {app.translator.trans('flarum-tags.admin.edit_tag.icon_text', {\n a: ,\n })}\n

\n
\n )}\n
{this.submitButton()}
\n
\n
\n
,\n ];\n }\n}\n","import app from 'flarum/admin/app';\nimport User from 'flarum/common/models/User';\n\nimport addPrivateDiscussionPermission from './addPrivateDiscussionPermission';\nimport ByobuSettings from './components/ByobuSettingsPage';\n\napp.initializers.add('fof-byobu', () => {\n app.store.models.recipients = User;\n\n app.extensionData.for('fof-byobu').registerPage(ByobuSettings);\n\n addPrivateDiscussionPermission();\n});\n","import app from 'flarum/admin/app';\n\nexport default function () {\n app.extensionData\n .for('fof-byobu')\n .registerPermission(\n {\n icon: 'far fa-map',\n label: app.translator.trans('fof-byobu.admin.permission.create_private_discussions_with_users'),\n permission: 'discussion.startPrivateDiscussionWithUsers',\n tagScoped: false,\n },\n 'start',\n 95\n )\n .registerPermission(\n {\n icon: 'far fa-map',\n label: app.translator.trans('fof-byobu.admin.permission.create_private_discussions_with_groups'),\n permission: 'discussion.startPrivateDiscussionWithGroups',\n tagScoped: false,\n },\n 'start',\n 95\n )\n .registerPermission(\n {\n icon: 'far fa-map',\n label: app.translator.trans('fof-byobu.admin.permission.create_private_discussions_with_blocking_users'),\n permission: 'startPrivateDiscussionWithBlockers',\n tagScoped: false,\n },\n 'start',\n 95\n )\n .registerPermission(\n {\n icon: 'far fa-map',\n label: app.translator.trans('fof-byobu.admin.permission.edit_user_recipients'),\n permission: 'discussion.editUserRecipients',\n tagScoped: false,\n },\n 'moderate',\n 95\n )\n .registerPermission(\n {\n icon: 'far fa-map',\n label: app.translator.trans('fof-byobu.admin.permission.edit_group_recipients'),\n permission: 'discussion.editGroupRecipients',\n tagScoped: false,\n },\n 'moderate',\n 95\n )\n .registerPermission(\n {\n icon: 'fas fa-flag',\n label: app.translator.trans('fof-byobu.admin.permission.view_private_discussions-when-flagged'),\n permission: 'user.viewPrivateDiscussionsWhenFlagged',\n tagScoped: false,\n },\n 'moderate',\n 95\n );\n}\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://@fof/byobu/webpack/bootstrap","webpack://@fof/byobu/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/byobu/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/byobu/external \"flarum.core.compat['common/components/Badge']\"","webpack://@fof/byobu/external \"flarum.core.compat['common/models/User']\"","webpack://@fof/byobu/external \"flarum.core.compat['admin/app']\"","webpack://@fof/byobu/external \"flarum.core.compat['admin/components/ExtensionPage']\"","webpack://@fof/byobu/external \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/byobu/./src/admin/components/ByobuSettingsPage.tsx","webpack://@fof/byobu/./src/admin/index.ts","webpack://@fof/byobu/./src/admin/addPrivateDiscussionPermission.ts"],"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","_setPrototypeOf","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","constructor","flarum","core","compat","ByobuSetingsPage","oninit","vnode","this","badgeDefault","postActionDefault","content","helpText","extensions","app","translator","trans","a","href","tabindex","className","buildSettingComponent","type","setting","label","help","icon","toJSON","placeholder","submitButton","ExtensionPage","initializers","add","byobuData","store","models","recipients","User","extensionData","registerPage","ByobuSettings","registerPermission","permission","tagScoped","data","settings"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAAS1B,GAChC,IAAIS,EAAST,GAAUA,EAAOqB,WAC7B,WAAwB,OAAOr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,EAAUQ,mBACR,CACEf,KAAM,aACNF,MAAOV,IAAIC,WAAWC,MAAM,uDAC5B0B,WAAY,wBACZC,WAAW,GAEb,QACA","file":"admin.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\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 = 48);\n","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}","module.exports = flarum.core.compat['common/components/Badge'];","module.exports = flarum.core.compat['common/models/User'];","module.exports = flarum.core.compat['admin/app'];","module.exports = flarum.core.compat['admin/components/ExtensionPage'];","module.exports = flarum.core.compat['common/helpers/icon'];","import app from 'flarum/admin/app';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport Badge from 'flarum/common/components/Badge';\nimport icon from 'flarum/common/helpers/icon';\n\nimport type Mithril from 'mithril';\n\nexport default class ByobuSetingsPage extends ExtensionPage {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.badgeDefault = 'fas fa-map';\n this.postActionDefault = 'far fa-map';\n }\n\n content() {\n const helpText = flarum.extensions['flarum-tags']\n ? app.translator.trans('flarum-tags.admin.edit_tag.icon_text', {\n a: ,\n })\n : '';\n\n return [\n
\n
\n
\n
\n {this.buildSettingComponent({\n type: 'string',\n setting: 'fof-byobu.icon-badge',\n label: app.translator.trans('fof-byobu.admin.settings.badge-icon'),\n help: (\n
\n {helpText}\n
\n ),\n placeholder: this.badgeDefault,\n })}\n {this.buildSettingComponent({\n type: 'string',\n setting: 'fof-byobu.icon-postAction',\n label: app.translator.trans('fof-byobu.admin.settings.post-event-icon'),\n help: (\n
\n {icon(this.setting('fof-byobu.icon-postAction').toJSON() || this.postActionDefault)} {helpText}\n
\n ),\n placeholder: this.postActionDefault,\n })}\n {this.buildSettingComponent({\n type: 'boolean',\n setting: 'fof-byobu.makePublic',\n label: app.translator.trans('fof-byobu.admin.settings.enable-make-public-option'),\n help: app.translator.trans('fof-byobu.admin.settings.enable-make-public-option-help'),\n })}\n
\n
{this.submitButton()}
\n
\n
\n
,\n ];\n }\n}\n","import app from 'flarum/admin/app';\nimport User from 'flarum/common/models/User';\n\nimport addPrivateDiscussionPermission from './addPrivateDiscussionPermission';\nimport ByobuSettings from './components/ByobuSettingsPage';\n\napp.initializers.add('fof-byobu', () => {\n app.store.models.recipients = User;\n\n app.extensionData.for('fof-byobu').registerPage(ByobuSettings);\n\n addPrivateDiscussionPermission();\n});\n","import app from 'flarum/admin/app';\n\nexport default function () {\n const byobuData = app.extensionData.for('fof-byobu');\n\n byobuData\n .registerPermission(\n {\n icon: 'far fa-map',\n label: app.translator.trans('fof-byobu.admin.permission.create_private_discussions_with_users'),\n permission: 'discussion.startPrivateDiscussionWithUsers',\n tagScoped: false,\n },\n 'start',\n 95\n )\n .registerPermission(\n {\n icon: 'far fa-map',\n label: app.translator.trans('fof-byobu.admin.permission.create_private_discussions_with_groups'),\n permission: 'discussion.startPrivateDiscussionWithGroups',\n tagScoped: false,\n },\n 'start',\n 95\n )\n .registerPermission(\n {\n icon: 'far fa-map',\n label: app.translator.trans('fof-byobu.admin.permission.create_private_discussions_with_blocking_users'),\n permission: 'startPrivateDiscussionWithBlockers',\n tagScoped: false,\n },\n 'start',\n 95\n )\n .registerPermission(\n {\n icon: 'far fa-map',\n label: app.translator.trans('fof-byobu.admin.permission.edit_user_recipients'),\n permission: 'discussion.editUserRecipients',\n tagScoped: false,\n },\n 'moderate',\n 95\n )\n .registerPermission(\n {\n icon: 'far fa-map',\n label: app.translator.trans('fof-byobu.admin.permission.edit_group_recipients'),\n permission: 'discussion.editGroupRecipients',\n tagScoped: false,\n },\n 'moderate',\n 95\n )\n .registerPermission(\n {\n icon: 'fas fa-flag',\n label: app.translator.trans('fof-byobu.admin.permission.view_private_discussions-when-flagged'),\n permission: 'user.viewPrivateDiscussionsWhenFlagged',\n tagScoped: false,\n },\n 'moderate',\n 95\n );\n\n if (app.data.settings['fof-byobu.makePublic']) {\n byobuData.registerPermission(\n {\n icon: 'far fa-map',\n label: app.translator.trans('fof-byobu.admin.permission.make_private_into_public'),\n permission: 'discussion.makePublic',\n tagScoped: false,\n },\n 'reply',\n 95\n );\n }\n}\n"],"sourceRoot":""} \ No newline at end of file diff --git a/js/dist/forum.js b/js/dist/forum.js index eac9b2d..5a4507c 100644 --- a/js/dist/forum.js +++ b/js/dist/forum.js @@ -1,2 +1,2 @@ -module.exports=function(t){var e={};function n(o){if(e[o])return e[o].exports;var s=e[o]={i:o,l:!1,exports:{}};return t[o].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},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 o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)n.d(o,s,function(e){return t[e]}.bind(null,s));return o},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=44)}([function(t,e){t.exports=flarum.core.compat["forum/app"]},function(t,e,n){"use strict";function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,o(t,e)}n.d(e,"a",(function(){return s}))},function(t,e){t.exports=flarum.core.compat["common/models/User"]},function(t,e){t.exports=flarum.core.compat["common/extend"]},,function(t,e){t.exports=flarum.core.compat["common/utils/ItemList"]},function(t,e){t.exports=flarum.core.compat["common/Model"]},function(t,e){t.exports=flarum.core.compat["common/components/Button"]},function(t,e){t.exports=flarum.core.compat["common/models/Discussion"]},function(t,e){t.exports=flarum.core.compat["common/models/Group"]},function(t,e){t.exports=flarum.core.compat["forum/components/Notification"]},function(t,e){t.exports=flarum.core.compat["common/utils/classList"]},function(t,e){t.exports=flarum.core.compat["common/components/LinkButton"]},function(t,e){t.exports=flarum.core.compat["forum/states/DiscussionListState"]},function(t,e){t.exports=flarum.core.compat["forum/components/IndexPage"]},function(t,e){t.exports=flarum.core.compat["common/components/Badge"]},function(t,e){t.exports=flarum.core.compat["forum/components/EventPost"]},function(t,e){t.exports=flarum.core.compat["common/helpers/username"]},function(t,e){t.exports=flarum.core.compat["common/helpers/highlight"]},function(t,e){t.exports=flarum.core.compat["forum/components/UserPage"]},function(t,e){t.exports=flarum.core.compat["common/helpers/listItems"]},function(t,e){t.exports=flarum.core.compat["common/Component"]},function(t,e){t.exports=flarum.core.compat["forum/components/SettingsPage"]},function(t,e){t.exports=flarum.core.compat["common/components/Switch"]},function(t,e){t.exports=flarum.core.compat["forum/components/DiscussionListItem"]},function(t,e){t.exports=flarum.core.compat["forum/components/DiscussionHero"]},function(t,e){t.exports=flarum.core.compat["forum/utils/DiscussionControls"]},function(t,e){t.exports=flarum.core.compat["common/components/Modal"]},function(t,e){t.exports=flarum.core.compat["forum/components/DiscussionPage"]},function(t,e){t.exports=flarum.core.compat["common/utils/Stream"]},function(t,e){t.exports=flarum.core.compat["forum/states/SearchState"]},function(t,e){t.exports=flarum.core.compat["forum/components/Search"]},function(t,e){t.exports=flarum.core.compat["common/helpers/avatar"]},function(t,e){t.exports=flarum.core.compat["common/utils/extractText"]},function(t,e){t.exports=flarum.core.compat["common/components/LoadingIndicator"]},function(t,e){t.exports=flarum.core.compat["common/components/Tooltip"]},function(t,e){t.exports=flarum.core.compat["forum/utils/UserControls"]},function(t,e){t.exports=flarum.core.compat["forum/components/DiscussionComposer"]},function(t,e){t.exports=flarum.core.compat["common/components/Dropdown"]},function(t,e){t.exports=flarum.core.compat["forum/components/DiscussionList"]},function(t,e){t.exports=flarum.core.compat["forum/components/LogInModal"]},function(t,e){t.exports=flarum.core.compat["forum/components/NotificationGrid"]},,,function(t,e,n){"use strict";n.r(e),n.d(e,"modals",(function(){return ne})),n.d(e,"discussions",(function(){return oe}));var o=n(0),s=n.n(o),r=n(1),i=n(16),a=n.n(i),c=function(t){function e(){return t.apply(this,arguments)||this}Object(r.a)(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e)};var n=e.prototype;return n.icon=function(){return s.a.forum.attribute("byobu.icon-postAction")},n.descriptionKey=function(){return"fof-byobu.forum.post.recipients_modified.removed_self"},e}(a.a);function u(t,e){if(null==t)return{};var n,o,s={},r=Object.keys(t);for(o=0;o=0||(s[n]=t[n]);return s}var p=n(2),f=n.n(p),l=n(11),d=n.n(l),b=n(17),h=n.n(b),y=n(9),v=n.n(y),g=n(12),x=n.n(g),_=n(21),R=["recipient","link"],P=function(t){function e(){return t.apply(this,arguments)||this}return Object(r.a)(e,t),e.prototype.view=function(t){var e,n=this.attrs,o=n.recipient,r=n.link,i=u(n,R);if(i.style=i.style||{},i.className=d()("RecipientLabel",null==i?void 0:i.className),r&&o instanceof f.a&&(i.href=s.a.route.user(o)),o instanceof f.a){var a,c;e=h()(o),i.href||o.id()===(null==s.a||null==(a=s.a.session)||null==(c=a.user)?void 0:c.id())||(i.href=s.a.route.user(o))}else{if(o instanceof v.a)return m("span",{class:i.className},o.namePlural());i.className+=" none",e=s.a.translator.trans("core.lib.username.deleted_text")}return m(x.a,i,e)},e}(n.n(_).a),w=["link","className"];function D(t,e){void 0===e&&(e={});var n=e,o=n.link,s=n.className,r=u(n,w);return r.className=d()("RecipientsLabel",s),m("span",r,null==t?void 0:t.map((function(t,e){var n=t instanceof f.a?"u":"g";return m(P,{key:n+"-"+e,recipient:t,link:o})})),!t&&m(P,null))}var O=function(t){function e(){return t.apply(this,arguments)||this}Object(r.a)(e,t),e.initAttrs=function(e){function n(t,e,n){return t.filter((function(t){return-1===e.indexOf(t)})).map((function(t){return s.a.store.getById(n,t)}))}t.initAttrs.call(this,e);var o=e.post.content();if(o.new||2!=o.length){var r=n(o.new.users,o.old.users,"users"),i=n(o.old.users,o.new.users,"users"),a=n(o.new.groups,o.old.groups,"groups"),c=n(o.old.groups,o.new.groups,"groups");e.added=r.concat(a),e.removed=i.concat(c)}else{var u=e.post.content()[0],p=e.post.content()[1];e.added=n(p,u,"users"),e.removed=n(u,p,"users")}};var n=e.prototype;return n.icon=function(){return s.a.forum.attribute("byobu.icon-postAction")},n.descriptionKey=function(){var t="fof-byobu.forum.post.recipients_modified.";return this.attrs.added.length?this.attrs.removed.length?t+"added_and_removed":t+"added":t+"removed"},n.descriptionData=function(){var t={};return this.attrs.added.length&&(t.added=D(this.attrs.added,{link:!0})),this.attrs.removed.length&&(t.removed=D(this.attrs.removed,{link:!0})),t},e}(a.a),j=n(3),N=n(22),k=n.n(N),S=n(23),U=n.n(S),A=function(){Object(j.extend)(k.a.prototype,"privacyItems",(function(t){var e=this;t.add("byobu-block-dm",U.a.component({state:this.user.blocksPd(),onchange:function(t){e.blocksPdLoading=!0,e.user.save({blocksPd:t}).then((function(){e.blocksPdLoading=!1,m.redraw()}))},loading:this.blocksPdLoading},s.a.translator.trans("fof-byobu.forum.user.settings.block_pd")))}))};var I=n(6),C=n.n(I),M=n(15),L=n.n(M),G=n(8),B=n.n(G),E=n(7),T=n.n(E),q=n(24),V=n.n(q),F=n(25),K=n.n(F),W=n(13),z=n.n(W),H=n(26),J=n.n(H),Q=n(5),X=n.n(Q),Y=n(27),Z=n.n(Y),tt=n(28),et=n.n(tt),nt=n(29),ot=n.n(nt),st=n(30),rt=n.n(st),it=n(31),at=n.n(it);function ct(){return(ct=Object.assign||function(t){for(var e=1;e=3;return this.sources||(this.sources=this.sourceItems().toArray()),m("div",{role:"search",className:"Search"},m("div",{className:"RecipientsInput-selected RecipientsLabel","aria-live":"polite"},m("h4",null,s.a.translator.trans("fof-byobu.forum.modal.labels.selected_users")),m("p",null,s.a.translator.trans("fof-byobu.forum.modal.help.selected_users")),this.attrs.selected().toArray().map((function(e){return m(xt.a,{text:s.a.translator.trans("fof-byobu.forum.modal.help.click_user_to_remove_tooltip")},m(P,{"data-container":"body",recipient:e,onclick:function(n){return t.removeRecipient(e,n)}}))}))),m("div",{className:"Form-group"},m("label",{for:"byobu-addrecipient-search-input-"+this.inputUuid},s.a.translator.trans("fof-byobu.forum.modal.labels.search_field")),m("div",{className:"AddRecipientModal-form-input Search-input"},m("input",{id:"byobu-addrecipient-search-input-"+this.inputUuid,className:d()("RecipientsInput","FormControl",{open:!!this.state.getValue(),focused:!!this.state.getValue(),active:!!this.state.getValue(),loading:!!this.loadingSources}),oncreate:function(t){return t.dom.focus()},type:"search",placeholder:ht()(s.a.translator.trans("fof-byobu.forum.input.search_recipients")),value:this.state.getValue(),oninput:function(e){return t.state.setValue(e.target.value)},onfocus:function(){return t.hasFocus=!0},onblur:function(){return t.hasFocus=!1}}),m("ul",{className:d()("Dropdown-menu","Search-results","fade",{in:!!e})},this.doSearch?this.sources.map((function(e){return e.view(t.state.getValue())})):vt.a.component({size:"tiny",className:"Button Button--icon Button--link"})))))},n.sourceItems=function(){var t=new X.a;return(!this.attrs.discussion&&s.a.forum.attribute("canStartPrivateDiscussionWithUsers")||this.attrs.discussion&&this.attrs.discussion.canEditUserRecipients())&&t.add("users",new dt),(!this.attrs.discussion&&s.a.forum.attribute("canStartPrivateDiscussionWithGroups")||this.attrs.discussion&&this.attrs.discussion.canEditGroupRecipients())&&t.add("groups",new mt),t},n.addRecipient=function(t){var e=t.split(":"),n=e[0],o=e[1],s=this.findRecipient(n,o);this.attrs.selected().add(t,s),this.state.clear()},n.removeRecipient=function(t,e){var n;e.preventDefault(),t instanceof f.a&&(n="users"),t instanceof v.a&&(n="groups"),this.attrs.selected().remove(n+":"+t.id())},n.findRecipient=function(t,e){return s.a.store.getById(t,e)},e}(at.a),Rt=function(t){function e(){return t.apply(this,arguments)||this}Object(r.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.selected=ot()(new X.a),this.attrs.discussion?this.assignInitialRecipients(this.attrs.discussion):this.attrs.selectedRecipients&&this.attrs.selectedRecipients.toArray().length>0?this.selected().merge(this.attrs.selectedRecipients):this.selected().add("users:"+s.a.session.user.id(),s.a.session.user),this.recipientSearch=new rt.a},n.isDismissible=function(){return!1},n.assignInitialRecipients=function(t){var e=this;t.recipientUsers().map((function(t){e.selected().add("users:"+t.id(),t)})),t.recipientGroups().map((function(t){e.selected().add("groups:"+t.id(),t)}))},n.className=function(){return"AddRecipientModal"},n.title=function(){return this.attrs.discussion?s.a.translator.trans("fof-byobu.forum.modal.titles.update_recipients",{title:m("em",null,this.attrs.discussion.title())}):s.a.translator.trans("fof-byobu.forum.modal.titles.add_recipients")},n.helpText=function(){return this.attrs.discussion?s.a.translator.trans("fof-byobu.forum.modal.help.update_recipients"):s.a.translator.trans("fof-byobu.forum.modal.help.add_recipients")},n.content=function(){return[m("div",{className:"Modal-body"},m("div",{class:"AddRecipientModal-help"},this.helpText()),m("div",{className:"AddRecipientModal-form"},_t.component({state:this.recipientSearch,selected:this.selected,discussion:this.attrs.discussion}),m("div",{className:"AddRecipientModal-form-submit App-primaryControl"},T.a.component({type:"submit",className:"Button Button--primary",icon:"fas fa-check"},s.a.translator.trans("fof-byobu.forum.buttons.submit")),T.a.component({onclick:this.hide.bind(this),className:"Button Button--cancel"},s.a.translator.trans("fof-byobu.forum.buttons.cancel")))))]},n.select=function(t){(t.metaKey||t.ctrlKey||-1!==this.selected.indexOf(this.index))&&this.selected().length&&this.$("form").submit()},n.onsubmit=function(t){t.preventDefault();var e=this.attrs.discussion,n=this.selected(),o=[],r=[];n.toArray().forEach((function(t){t instanceof f.a&&r.push(t),t instanceof v.a&&o.push(t)})),e&&e.save({relationships:{recipientUsers:r,recipientGroups:o}}).then((function(){s.a.current instanceof et.a&&s.a.current.stream.update(),m.redraw()})),this.attrs.onsubmit&&this.attrs.onsubmit(n),s.a.modal.close(),this.attrs.discussion||s.a.composer.show(),t.redraw=!1},e}(Z.a),Pt=function(){B.a.prototype.recipientUsers=C.a.hasMany("recipientUsers"),B.a.prototype.oldRecipientUsers=C.a.hasMany("oldRecipientUsers"),B.a.prototype.recipientGroups=C.a.hasMany("recipientGroups"),B.a.prototype.oldRecipientGroups=C.a.hasMany("oldRecipientGroups"),B.a.prototype.canEditRecipients=C.a.attribute("canEditRecipients"),B.a.prototype.canEditUserRecipients=C.a.attribute("canEditUserRecipients"),B.a.prototype.canEditGroupRecipients=C.a.attribute("canEditGroupRecipients"),B.a.prototype.canEditGroupRecipients=C.a.attribute("canEditGroupRecipients"),B.a.prototype.isPrivateDiscussion=C.a.attribute("isPrivateDiscussion"),Object(j.extend)(B.a.prototype,"badges",(function(t){(this.recipientUsers().length||this.recipientGroups().length)&&t.add("private",L.a.component({type:"private",label:s.a.translator.trans("fof-byobu.forum.badges.is_private.tooltip"),icon:s.a.forum.data.attributes["byobu.icon-badge"]}),10)})),Object(j.extend)(V.a.prototype,"infoItems",(function(t){var e=this.attrs.discussion;wt(e,t,!0)})),Object(j.extend)(K.a.prototype,"items",(function(t){var e=this.attrs.discussion;wt(e,t,!1)})),Object(j.extend)(z.a.prototype,"requestParams",(function(t){t.include.push("recipientUsers"),t.include.push("recipientGroups")})),Object(j.extend)(J.a,"moderationControls",(function(t,e){e.canEditRecipients()&&t.add("recipients",T.a.component({icon:s.a.forum.data.attributes["byobu.icon-badge"],onclick:function(){return s.a.modal.show(Rt,{discussion:e})}},s.a.translator.trans("fof-byobu.forum.buttons.edit_recipients"))),e&&e.recipientUsers().find((function(t){return t.id()===s.a.session.user.id()}))&&t.add("remove",T.a.component({icon:"fas fa-user-slash",onclick:function(){if(e){var t=new X.a;e.recipientUsers().map((function(e){s.a.session.user.id()!==e.id()&&t.add("users:"+e.id(),e)}));var n=[],o=[];t.toArray().forEach((function(t){t instanceof f.a&&o.push(t),t instanceof v.a&&n.push(t)})),e.save({relationships:{recipientUsers:o,recipientGroups:n}}).then((function(){return s.a.history.back()}))}}},s.a.translator.trans("fof-byobu.forum.buttons.remove_from_discussion")))}))},wt=function(t,e,n){var o=[];t.recipientUsers().length&&(o=o.concat(t.recipientUsers())),t.recipientGroups().length&&(o=o.concat(t.recipientGroups())),o&&o.length&&(n?e.add("recipients",D(o),10):e.add("recipients",D(o,{link:!0}),4))};var Dt=n(36),Ot=n.n(Dt),jt=n(37);var Nt=function(t){function e(){for(var e,n=arguments.length,o=new Array(n),s=0;s=0||(s[n]=t[n]);return s}var f=n(2),l=n.n(f),d=n(11),b=n.n(d),h=n(17),y=n.n(h),v=n(9),g=n.n(v),x=n(13),_=n.n(x),P=n(21),R=["recipient","link"],w=function(t){function e(){return t.apply(this,arguments)||this}return Object(r.a)(e,t),e.prototype.view=function(t){var e,n=this.attrs,o=n.recipient,r=n.link,i=p(n,R);if(i.style=i.style||{},i.className=b()("RecipientLabel",null==i?void 0:i.className),r&&o instanceof l.a&&(i.href=s.a.route.user(o)),o instanceof l.a){var a,c;e=y()(o),i.href||o.id()===(null==s.a||null==(a=s.a.session)||null==(c=a.user)?void 0:c.id())||(i.href=s.a.route.user(o))}else{if(o instanceof g.a)return m("span",{class:i.className},o.namePlural());i.className+=" none",e=s.a.translator.trans("core.lib.username.deleted_text")}return m(_.a,i,e)},e}(n.n(P).a),D=["link","className"];function j(t,e){void 0===e&&(e={});var n=e,o=n.link,s=n.className,r=p(n,D);return r.className=b()("RecipientsLabel",s),m("span",r,null==t?void 0:t.map((function(t,e){var n=t instanceof l.a?"u":"g";return m(w,{key:n+"-"+e,recipient:t,link:o})})),!t&&m(w,null))}var k=function(t){function e(){return t.apply(this,arguments)||this}Object(r.a)(e,t),e.initAttrs=function(e){function n(t,e,n){return t.filter((function(t){return-1===e.indexOf(t)})).map((function(t){return s.a.store.getById(n,t)}))}t.initAttrs.call(this,e);var o=e.post.content();if(o.new||2!=o.length){var r=n(o.new.users,o.old.users,"users"),i=n(o.old.users,o.new.users,"users"),a=n(o.new.groups,o.old.groups,"groups"),c=n(o.old.groups,o.new.groups,"groups");e.added=r.concat(a),e.removed=i.concat(c)}else{var u=e.post.content()[0],p=e.post.content()[1];e.added=n(p,u,"users"),e.removed=n(u,p,"users")}};var n=e.prototype;return n.icon=function(){return s.a.forum.attribute("byobu.icon-postAction")},n.descriptionKey=function(){var t="fof-byobu.forum.post.recipients_modified.";return this.attrs.added.length?this.attrs.removed.length?t+"added_and_removed":t+"added":t+"removed"},n.descriptionData=function(){var t={};return this.attrs.added.length&&(t.added=j(this.attrs.added,{link:!0})),this.attrs.removed.length&&(t.removed=j(this.attrs.removed,{link:!0})),t},e}(a.a),O=n(4),N=n(22),U=n.n(N),S=n(23),A=n.n(S),C=function(){Object(O.extend)(U.a.prototype,"privacyItems",(function(t){var e=this;t.add("byobu-block-dm",A.a.component({state:this.user.blocksPd(),onchange:function(t){e.blocksPdLoading=!0,e.user.save({blocksPd:t}).then((function(){e.blocksPdLoading=!1,m.redraw()}))},loading:this.blocksPdLoading},s.a.translator.trans("fof-byobu.forum.user.settings.block_pd")))}))};var M=n(6),I=n.n(M),G=n(16),L=n.n(G),B=n(8),T=n.n(B),E=n(7),q=n.n(E),V=n(24),K=n.n(V),F=n(25),W=n.n(F),z=n(14),H=n.n(z),J=n(26),Q=n.n(J),X=n(5),Y=n.n(X),Z=n(27),tt=n.n(Z),et=n(28),nt=n.n(et),ot=n(29),st=n.n(ot),rt=n(30),it=n.n(rt),at=n(31),ct=n.n(at);function ut(){return(ut=Object.assign||function(t){for(var e=1;e=3;return this.sources||(this.sources=this.sourceItems().toArray()),m("div",{role:"search",className:"Search"},m("div",{className:"RecipientsInput-selected RecipientsLabel","aria-live":"polite"},m("h4",null,s.a.translator.trans("fof-byobu.forum.modal.labels.selected_users")),m("p",null,s.a.translator.trans("fof-byobu.forum.modal.help.selected_users")),this.attrs.selected().toArray().map((function(e){return m(_t.a,{text:s.a.translator.trans("fof-byobu.forum.modal.help.click_user_to_remove_tooltip")},m(w,{"data-container":"body",recipient:e,onclick:function(n){return t.removeRecipient(e,n)}}))}))),m("div",{className:"Form-group"},m("label",{for:"byobu-addrecipient-search-input-"+this.inputUuid},s.a.translator.trans("fof-byobu.forum.modal.labels.search_field")),m("div",{className:"AddRecipientModal-form-input Search-input"},m("input",{id:"byobu-addrecipient-search-input-"+this.inputUuid,className:b()("RecipientsInput","FormControl",{open:!!this.state.getValue(),focused:!!this.state.getValue(),active:!!this.state.getValue(),loading:!!this.loadingSources}),oncreate:function(t){return t.dom.focus()},type:"search",placeholder:yt()(s.a.translator.trans("fof-byobu.forum.input.search_recipients")),value:this.state.getValue(),oninput:function(e){return t.state.setValue(e.target.value)},onfocus:function(){return t.hasFocus=!0},onblur:function(){return t.hasFocus=!1}}),m("ul",{className:b()("Dropdown-menu","Search-results","fade",{in:!!e})},this.doSearch?this.sources.map((function(e){return e.view(t.state.getValue())})):gt.a.component({size:"tiny",className:"Button Button--icon Button--link"})))))},n.sourceItems=function(){var t=new Y.a;return(!this.attrs.discussion&&s.a.forum.attribute("canStartPrivateDiscussionWithUsers")||this.attrs.discussion&&this.attrs.discussion.canEditUserRecipients())&&t.add("users",new dt),(!this.attrs.discussion&&s.a.forum.attribute("canStartPrivateDiscussionWithGroups")||this.attrs.discussion&&this.attrs.discussion.canEditGroupRecipients())&&t.add("groups",new bt),t},n.addRecipient=function(t){var e=t.split(":"),n=e[0],o=e[1],s=this.findRecipient(n,o);this.attrs.selected().add(t,s),this.state.clear()},n.removeRecipient=function(t,e){var n;e.preventDefault(),t instanceof l.a&&(n="users"),t instanceof g.a&&(n="groups"),this.attrs.selected().remove(n+":"+t.id())},n.findRecipient=function(t,e){return s.a.store.getById(t,e)},e}(ct.a),Rt=function(t){function e(){return t.apply(this,arguments)||this}Object(r.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.selected=st()(new Y.a),this.attrs.discussion?this.assignInitialRecipients(this.attrs.discussion):this.attrs.selectedRecipients&&this.attrs.selectedRecipients.toArray().length>0?this.selected().merge(this.attrs.selectedRecipients):this.selected().add("users:"+s.a.session.user.id(),s.a.session.user),this.recipientSearch=new it.a},n.isDismissible=function(){return!1},n.assignInitialRecipients=function(t){var e=this;t.recipientUsers().map((function(t){e.selected().add("users:"+t.id(),t)})),t.recipientGroups().map((function(t){e.selected().add("groups:"+t.id(),t)}))},n.className=function(){return"AddRecipientModal"},n.title=function(){return this.attrs.discussion?s.a.translator.trans("fof-byobu.forum.modal.titles.update_recipients",{title:m("em",null,this.attrs.discussion.title())}):s.a.translator.trans("fof-byobu.forum.modal.titles.add_recipients")},n.helpText=function(){return this.attrs.discussion?s.a.translator.trans("fof-byobu.forum.modal.help.update_recipients"):s.a.translator.trans("fof-byobu.forum.modal.help.add_recipients")},n.content=function(){return[m("div",{className:"Modal-body"},m("div",{class:"AddRecipientModal-help"},this.helpText()),m("div",{className:"AddRecipientModal-form"},Pt.component({state:this.recipientSearch,selected:this.selected,discussion:this.attrs.discussion}),m("div",{className:"AddRecipientModal-form-submit App-primaryControl"},q.a.component({type:"submit",className:"Button Button--primary",icon:"fas fa-check"},s.a.translator.trans("fof-byobu.forum.buttons.submit")),q.a.component({onclick:this.hide.bind(this),className:"Button Button--cancel"},s.a.translator.trans("fof-byobu.forum.buttons.cancel")))))]},n.select=function(t){(t.metaKey||t.ctrlKey||-1!==this.selected.indexOf(this.index))&&this.selected().length&&this.$("form").submit()},n.onsubmit=function(t){t.preventDefault();var e=this.attrs.discussion,n=this.selected(),o=[],r=[];n.toArray().forEach((function(t){t instanceof l.a&&r.push(t),t instanceof g.a&&o.push(t)})),e&&e.save({relationships:{recipientUsers:r,recipientGroups:o}}).then((function(){s.a.current instanceof nt.a&&s.a.current.stream.update(),m.redraw()})),this.attrs.onsubmit&&this.attrs.onsubmit(n),s.a.modal.close(),this.attrs.discussion||s.a.composer.show(),t.redraw=!1},e}(tt.a),wt=n(36),Dt=function(t){function e(){return t.apply(this,arguments)||this}return Object(r.a)(e,t),e.prototype.onsubmit=function(t){t.preventDefault();var e=this.selected;this.attrs.resolve&&this.attrs.resolve(e),this.hide()},e}(n.n(wt).a);Dt.isDismissible=!1;var jt=n(37),kt=n.n(jt),Ot=function(){T.a.prototype.recipientUsers=I.a.hasMany("recipientUsers"),T.a.prototype.oldRecipientUsers=I.a.hasMany("oldRecipientUsers"),T.a.prototype.recipientGroups=I.a.hasMany("recipientGroups"),T.a.prototype.oldRecipientGroups=I.a.hasMany("oldRecipientGroups"),T.a.prototype.canEditRecipients=I.a.attribute("canEditRecipients"),T.a.prototype.canEditUserRecipients=I.a.attribute("canEditUserRecipients"),T.a.prototype.canEditGroupRecipients=I.a.attribute("canEditGroupRecipients"),T.a.prototype.canEditGroupRecipients=I.a.attribute("canEditGroupRecipients"),T.a.prototype.canMakePublic=I.a.attribute("canMakePublic"),T.a.prototype.isPrivateDiscussion=I.a.attribute("isPrivateDiscussion"),Object(O.extend)(T.a.prototype,"badges",(function(t){(this.recipientUsers().length||this.recipientGroups().length)&&t.add("private",L.a.component({type:"private",label:s.a.translator.trans("fof-byobu.forum.badges.is_private.tooltip"),icon:s.a.forum.data.attributes["byobu.icon-badge"]}),10)})),Object(O.extend)(K.a.prototype,"infoItems",(function(t){var e=this.attrs.discussion;Nt(e,t,!0)})),Object(O.extend)(W.a.prototype,"items",(function(t){var e=this.attrs.discussion;Nt(e,t,!1)})),Object(O.extend)(H.a.prototype,"requestParams",(function(t){t.include.push("recipientUsers"),t.include.push("recipientGroups")})),Object(O.extend)(Q.a,"moderationControls",(function(t,e){e.canEditRecipients()&&t.add("recipients",q.a.component({icon:s.a.forum.data.attributes["byobu.icon-badge"],onclick:function(){return s.a.modal.show(Rt,{discussion:e})}},s.a.translator.trans("fof-byobu.forum.buttons.edit_recipients"))),e&&e.recipientUsers().find((function(t){return t.id()===s.a.session.user.id()}))&&(t.add("remove",q.a.component({icon:"fas fa-user-slash",onclick:function(){if(e){var t=new Y.a;e.recipientUsers().map((function(e){s.a.session.user.id()!==e.id()&&t.add("users:"+e.id(),e)}));var n=[],o=[];t.toArray().forEach((function(t){t instanceof l.a&&o.push(t),t instanceof g.a&&n.push(t)})),e.save({relationships:{recipientUsers:o,recipientGroups:n}}).then((function(){return s.a.history.back()}))}}},s.a.translator.trans("fof-byobu.forum.buttons.remove_from_discussion"))),null!=e&&null!=e.isPrivateDiscussion&&e.isPrivateDiscussion()&&null!=e&&null!=e.canMakePublic&&e.canMakePublic()&&t.add("transform-public",m(q.a,{icon:"far fa-eye",onclick:function(){if(e&&confirm(s.a.translator.trans("fof-byobu.forum.confirm.make_public"))){var t=[],n=[];flarum.extensions["flarum-tags"]?new Promise((function(t,n){s.a.modal.show(Dt,{discussion:e,resolve:t,reject:n})})).then((function(o){e.save({relationships:{recipientUsers:n,recipientGroups:t},public:e.id()}).then((function(){e.save({relationships:{tags:o}}).then((function(){s.a.current.matches(kt.a)&&s.a.current.get("stream").update(),m.redraw()}))}))})):e.save({relationships:{recipientUsers:n,recipientGroups:t},public:e.id()}).then((function(){return m.redraw()}))}}},s.a.translator.trans("fof-byobu.forum.buttons.make_public"))))}))},Nt=function(t,e,n){var o=[];t.recipientUsers().length&&(o=o.concat(t.recipientUsers())),t.recipientGroups().length&&(o=o.concat(t.recipientGroups())),o&&o.length&&(n?e.add("recipients",j(o),10):e.add("recipients",j(o,{link:!0}),4))};var Ut=n(38),St=n.n(Ut),At=n(39);var Ct=function(t){function e(){for(var e,n=arguments.length,o=new Array(n),s=0;s= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}","import type * as Mithril from 'mithril';\nimport username from 'flarum/common/helpers/username';\nimport User from 'flarum/common/models/User';\nimport Group from 'flarum/common/models/Group';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport classList from 'flarum/common/utils/classList';\nimport app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\n\nexport interface IRecipientLabelAttrs extends ComponentAttrs, Mithril.Attributes {\n recipient: User | Group;\n link: string;\n}\n\nexport default class RecipientLabel extends Component {\n view(vnode: Mithril.Vnode) {\n const { recipient, link, ...newAttrs } = this.attrs;\n\n newAttrs.style = newAttrs.style || {};\n newAttrs.className = classList('RecipientLabel', newAttrs?.className);\n\n if (link && recipient instanceof User) {\n newAttrs.href = app.route.user(recipient);\n }\n\n let label: string;\n\n if (recipient instanceof User) {\n label = username(recipient);\n\n if (!newAttrs.href && recipient.id() !== app?.session?.user?.id()) {\n newAttrs.href = app.route.user(recipient);\n }\n } else if (recipient instanceof Group) {\n return {recipient.namePlural()};\n } else {\n newAttrs.className += ' none';\n label = app.translator.trans('core.lib.username.deleted_text');\n }\n\n return {label};\n }\n}\n","import Group from 'flarum/common/models/Group';\nimport User from 'flarum/common/models/User';\nimport classList from 'flarum/common/utils/classList';\nimport RecipientLabel from './RecipientLabel';\n\nexport default function recipientsLabel(recipients?: (User | Group)[], attrs: Record = {}): JSX.Element {\n const { link, className, ...otherAttrs } = attrs;\n\n otherAttrs.className = classList('RecipientsLabel', className);\n\n return (\n \n {recipients?.map((recipient, index) => {\n const type = recipient instanceof User ? 'u' : 'g';\n\n return ;\n })}\n {!recipients && }\n \n );\n}\n","import app from 'flarum/forum/app';\nimport EventPost from 'flarum/forum/components/EventPost';\nimport recipientsLabel from '../pages/labels/recipientsLabels';\n\nexport default class RecipientsModified extends EventPost {\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n\n function diff(diff1, diff2, store) {\n return diff1.filter((item) => diff2.indexOf(item) === -1).map((id) => app.store.getById(store, id));\n }\n\n const content = attrs.post.content();\n\n // For event posts existing before groups functionality.\n if (!content['new'] && content.length == 2) {\n const oldRecipients = attrs.post.content()[0];\n const newRecipients = attrs.post.content()[1];\n attrs.added = diff(newRecipients, oldRecipients, 'users');\n attrs.removed = diff(oldRecipients, newRecipients, 'users');\n } else {\n let usersAdded = diff(content['new']['users'], content['old']['users'], 'users');\n let usersRemoved = diff(content['old']['users'], content['new']['users'], 'users');\n let groupsAdded = diff(content['new']['groups'], content['old']['groups'], 'groups');\n let groupsRemoved = diff(content['old']['groups'], content['new']['groups'], 'groups');\n\n attrs.added = usersAdded.concat(groupsAdded);\n attrs.removed = usersRemoved.concat(groupsRemoved);\n }\n }\n\n icon() {\n return app.forum.attribute('byobu.icon-postAction');\n }\n\n descriptionKey() {\n var localeBase = 'fof-byobu.forum.post.recipients_modified.';\n\n if (this.attrs.added.length) {\n if (this.attrs.removed.length) {\n return localeBase + 'added_and_removed';\n }\n\n return localeBase + 'added';\n }\n\n return localeBase + 'removed';\n }\n\n descriptionData() {\n const data = {};\n\n if (this.attrs.added.length) {\n data.added = recipientsLabel(this.attrs.added, { link: true });\n }\n\n if (this.attrs.removed.length) {\n data.removed = recipientsLabel(this.attrs.removed, { link: true });\n }\n\n return data;\n }\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport SettingsPage from 'flarum/forum/components/SettingsPage';\nimport Switch from 'flarum/common/components/Switch';\n\nexport default () => {\n privacyToggle();\n};\n\nfunction privacyToggle() {\n extend(SettingsPage.prototype, 'privacyItems', function (items) {\n items.add(\n 'byobu-block-dm',\n Switch.component(\n {\n state: this.user.blocksPd(),\n onchange: (value) => {\n this.blocksPdLoading = true;\n\n this.user.save({ blocksPd: value }).then(() => {\n this.blocksPdLoading = false;\n m.redraw();\n });\n },\n loading: this.blocksPdLoading,\n },\n app.translator.trans('fof-byobu.forum.user.settings.block_pd')\n )\n );\n });\n}\n","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","import app from 'flarum/forum/app';\nimport highlight from 'flarum/common/helpers/highlight';\nimport avatar from 'flarum/common/helpers/avatar';\nimport username from 'flarum/common/helpers/username';\n\nexport default class UserSearchSource {\n view(query) {\n if (query.length < 3 || this.loading) return;\n\n if (!app.cache.byobuResults) {\n app.cache.byobuResults = [];\n }\n\n this.query = query;\n\n if (!app.cache.byobuResults[this.query]) {\n this.loading = true;\n\n app.cache.byobuResults[this.query] = [];\n app.store\n .find('users', {\n filter: { q: this.query + ' allows-pd' },\n page: { limit: 5 },\n })\n .then(this.pushResults.bind(this));\n } else\n return [\n
  • {app.translator.trans('core.forum.search.users_heading')}
  • ,\n app.cache.byobuResults[this.query].map((user) => {\n const name = username(user);\n const children = [highlight(name.text, this.query)];\n\n return (\n
  • \n \n {avatar(user)}\n {{ ...name, text: undefined, children }}\n \n
  • \n );\n }),\n ];\n }\n\n pushResults(results) {\n results.payload.data.map((result) => {\n var user = app.store.getById('users', result.id);\n app.cache.byobuResults[this.query].push(user);\n });\n this.loading = false;\n m.redraw();\n }\n}\n","import app from 'flarum/forum/app';\nimport highlight from 'flarum/common/helpers/highlight';\n\nexport default class GroupSearchSource {\n search(query) {\n return app.store.find('groups', {\n filter: { q: query },\n page: { limit: 5 },\n });\n }\n\n view(query) {\n query = query.toLowerCase();\n\n const results = app.store.all('groups').filter((group) => group.namePlural().toLowerCase().substr(0, query.length) === query);\n\n if (!results.length) return '';\n\n return [\n
  • {app.translator.trans('fof-byobu.forum.search.headings.groups')}
  • ,\n results.map((group) => {\n const groupName = group.namePlural();\n var name = highlight(groupName, query);\n\n return (\n
  • \n \n {name}\n \n
  • \n );\n }),\n ];\n }\n}\n","import app from 'flarum/forum/app';\nimport Search from 'flarum/forum/components/Search';\nimport UserSearchSource from './sources/UserSearchSource';\nimport GroupSearchSource from './sources/GroupSearchSource';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport classList from 'flarum/common/utils/classList';\nimport extractText from 'flarum/common/utils/extractText';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport RecipientLabel from '../pages/labels/RecipientLabel';\nimport User from 'flarum/common/models/User';\nimport Group from 'flarum/common/models/Group';\nimport Tooltip from 'flarum/common/components/Tooltip';\n\nexport default class RecipientSearch extends Search {\n /**\n * Used to prevent duplicate IDs. Doesn't remove the possibility, but is extremely low.\n */\n inputUuid;\n\n oninit(vnode) {\n super.oninit(vnode);\n\n this.inputUuid = Math.random().toString(36).substring(2);\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n const $search = this;\n\n this.$('.Search-results').on('click', (e) => {\n const target = this.$('.SearchResult.active');\n\n $search.addRecipient(target.data('index'));\n $search.$('.RecipientsInput').focus();\n });\n\n this.$('.Search-results').on('touchstart', (e) => {\n const target = this.$(e.target.parentNode);\n\n $search.addRecipient(target.data('index'));\n $search.$('.RecipientsInput').focus();\n });\n\n $('.RecipientsInput')\n .on('input', () => {\n clearTimeout(this.typingTimer);\n this.doSearch = false;\n this.typingTimer = setTimeout(() => {\n this.doSearch = true;\n m.redraw();\n }, 900);\n })\n .on('keydown', () => {\n clearTimeout(this.typingTimer);\n });\n\n super.oncreate(vnode);\n }\n\n view() {\n if (typeof this.state.getValue() === 'undefined') {\n this.state.setValue('');\n }\n\n const loading = this.state.getValue() && this.state.getValue().length >= 3;\n\n if (!this.sources) {\n this.sources = this.sourceItems().toArray();\n }\n\n return (\n
    \n
    \n

    {app.translator.trans('fof-byobu.forum.modal.labels.selected_users')}

    \n

    {app.translator.trans('fof-byobu.forum.modal.help.selected_users')}

    \n\n {this.attrs\n .selected()\n .toArray()\n .map((recipient) => {\n return (\n \n this.removeRecipient(recipient, e)} />\n \n );\n })}\n
    \n\n
    \n \n\n
    \n vnode.dom.focus()}\n type=\"search\"\n placeholder={extractText(app.translator.trans('fof-byobu.forum.input.search_recipients'))}\n value={this.state.getValue()}\n oninput={(e) => this.state.setValue(e.target.value)}\n onfocus={() => (this.hasFocus = true)}\n onblur={() => (this.hasFocus = false)}\n />\n \n {!this.doSearch\n ? LoadingIndicator.component({ size: 'tiny', className: 'Button Button--icon Button--link' })\n : this.sources.map((source) => source.view(this.state.getValue()))}\n \n
    \n
    \n
    \n );\n }\n\n /**\n * Build an item list of SearchSources.\n *\n * @return {ItemList}\n */\n sourceItems() {\n const items = new ItemList();\n\n // Add user source based on permissions.\n if (\n (!this.attrs.discussion && app.forum.attribute('canStartPrivateDiscussionWithUsers')) ||\n (this.attrs.discussion && this.attrs.discussion.canEditUserRecipients())\n ) {\n items.add('users', new UserSearchSource());\n }\n\n // Add group source based on permissions.\n if (\n (!this.attrs.discussion && app.forum.attribute('canStartPrivateDiscussionWithGroups')) ||\n (this.attrs.discussion && this.attrs.discussion.canEditGroupRecipients())\n ) {\n items.add('groups', new GroupSearchSource());\n }\n\n return items;\n }\n\n /**\n * Adds a recipient.\n *\n * @param value\n */\n addRecipient(value) {\n let values = value.split(':'),\n type = values[0],\n id = values[1];\n\n let recipient = this.findRecipient(type, id);\n\n this.attrs.selected().add(value, recipient);\n\n this.state.clear();\n }\n\n /**\n * Removes a recipient.\n *\n * @param recipient\n */\n removeRecipient(recipient, e) {\n e.preventDefault();\n\n let type;\n\n if (recipient instanceof User) {\n type = 'users';\n }\n if (recipient instanceof Group) {\n type = 'groups';\n }\n\n this.attrs.selected().remove(type + ':' + recipient.id());\n }\n\n /**\n * Loads a recipient from the global store.\n *\n * @param store\n * @param id\n * @returns {Model}\n */\n findRecipient(store, id) {\n return app.store.getById(store, id);\n }\n}\n","import app from 'flarum/forum/app';\nimport Modal from 'flarum/common/components/Modal';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport Button from 'flarum/common/components/Button';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Stream from 'flarum/common/utils/Stream';\nimport SearchState from 'flarum/forum/states/SearchState';\nimport RecipientSearch from '../search/RecipientSearch';\nimport User from 'flarum/common/models/User';\nimport Group from 'flarum/common/models/Group';\n\nexport default class AddRecipientModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.selected = Stream(new ItemList());\n\n if (this.attrs.discussion) {\n // Adds recipients of the currently viewed discussion.\n this.assignInitialRecipients(this.attrs.discussion);\n } else if (this.attrs.selectedRecipients && this.attrs.selectedRecipients.toArray().length > 0) {\n // Adds previously selected recipients.\n this.selected().merge(this.attrs.selectedRecipients);\n } else {\n // Adds the current user in case there are no selected recipients yet and this is a new discussion.\n this.selected().add('users:' + app.session.user.id(), app.session.user);\n }\n\n this.recipientSearch = new SearchState();\n }\n\n isDismissible() {\n return false;\n }\n\n assignInitialRecipients(discussion) {\n discussion.recipientUsers().map((user) => {\n this.selected().add('users:' + user.id(), user);\n });\n discussion.recipientGroups().map((group) => {\n this.selected().add('groups:' + group.id(), group);\n });\n }\n\n className() {\n return 'AddRecipientModal';\n }\n\n title() {\n return this.attrs.discussion\n ? app.translator.trans('fof-byobu.forum.modal.titles.update_recipients', { title: {this.attrs.discussion.title()} })\n : app.translator.trans('fof-byobu.forum.modal.titles.add_recipients');\n }\n\n helpText() {\n return this.attrs.discussion\n ? app.translator.trans('fof-byobu.forum.modal.help.update_recipients')\n : app.translator.trans('fof-byobu.forum.modal.help.add_recipients');\n }\n\n content() {\n return [\n
    \n
    {this.helpText()}
    \n
    \n {RecipientSearch.component({\n state: this.recipientSearch,\n selected: this.selected,\n discussion: this.attrs.discussion,\n })}\n
    \n {Button.component(\n {\n type: 'submit',\n className: 'Button Button--primary',\n icon: 'fas fa-check',\n },\n app.translator.trans('fof-byobu.forum.buttons.submit')\n )}\n {Button.component(\n {\n onclick: this.hide.bind(this),\n className: 'Button Button--cancel',\n },\n app.translator.trans('fof-byobu.forum.buttons.cancel')\n )}\n
    \n
    \n
    ,\n ];\n }\n\n select(e) {\n // Ctrl + Enter submits the selection, just Enter completes the current entry\n if (e.metaKey || e.ctrlKey || this.selected.indexOf(this.index) !== -1) {\n if (this.selected().length) {\n this.$('form').submit();\n }\n }\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n const discussion = this.attrs.discussion;\n const recipients = this.selected();\n\n let recipientGroups = [];\n let recipientUsers = [];\n\n recipients.toArray().forEach((recipient) => {\n if (recipient instanceof User) {\n recipientUsers.push(recipient);\n }\n if (recipient instanceof Group) {\n recipientGroups.push(recipient);\n }\n });\n\n // Recipients are updated here for existing discussions here.\n if (discussion) {\n discussion.save({ relationships: { recipientUsers, recipientGroups } }).then(() => {\n if (app.current instanceof DiscussionPage) {\n app.current.stream.update();\n }\n m.redraw();\n });\n }\n\n // Use the onsubmit callback to trigger an update in the DiscussionComposer\n if (this.attrs.onsubmit) this.attrs.onsubmit(recipients);\n\n app.modal.close();\n\n if (!this.attrs.discussion) {\n app.composer.show();\n }\n\n e.redraw = false;\n }\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Model from 'flarum/common/Model';\nimport Badge from 'flarum/common/components/Badge';\nimport Discussion from 'flarum/common/models/Discussion';\nimport User from 'flarum/common/models/User';\nimport Group from 'flarum/common/models/Group';\nimport Button from 'flarum/common/components/Button';\nimport DiscussionListItem from 'flarum/forum/components/DiscussionListItem';\nimport DiscussionHero from 'flarum/forum/components/DiscussionHero';\nimport DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport recipientsLabel from '../pages/labels/recipientsLabels';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport AddRecipientModal from './../modals/AddRecipientModal';\n\nexport default () => {\n attributes();\n badges();\n index();\n hero();\n apiInclude();\n controls();\n};\n\nconst add = function (discussion, items, long) {\n let recipients = [];\n\n if (discussion.recipientUsers().length) {\n recipients = recipients.concat(discussion.recipientUsers());\n }\n\n if (discussion.recipientGroups().length) {\n recipients = recipients.concat(discussion.recipientGroups());\n }\n\n if (recipients && recipients.length) {\n if (long) {\n items.add('recipients', recipientsLabel(recipients), 10);\n } else {\n items.add('recipients', recipientsLabel(recipients, { link: true }), 4);\n }\n }\n};\n\nfunction badges() {\n extend(Discussion.prototype, 'badges', function (badges) {\n if (this.recipientUsers().length || this.recipientGroups().length) {\n badges.add(\n 'private',\n Badge.component({\n type: 'private',\n label: app.translator.trans('fof-byobu.forum.badges.is_private.tooltip'),\n icon: app.forum.data.attributes['byobu.icon-badge'],\n }),\n 10\n );\n }\n });\n}\n\nfunction index() {\n extend(DiscussionListItem.prototype, 'infoItems', function (items) {\n const discussion = this.attrs.discussion;\n\n add(discussion, items, true);\n });\n}\n\nfunction hero() {\n extend(DiscussionHero.prototype, 'items', function (items) {\n const discussion = this.attrs.discussion;\n\n add(discussion, items, false);\n });\n}\n\nfunction apiInclude() {\n extend(DiscussionListState.prototype, 'requestParams', function (params) {\n params.include.push('recipientUsers');\n params.include.push('recipientGroups');\n });\n}\n\nfunction controls() {\n extend(DiscussionControls, 'moderationControls', function (items, discussion) {\n if (discussion.canEditRecipients()) {\n items.add(\n 'recipients',\n Button.component(\n {\n icon: app.forum.data.attributes['byobu.icon-badge'],\n onclick: () => app.modal.show(AddRecipientModal, { discussion }),\n },\n app.translator.trans('fof-byobu.forum.buttons.edit_recipients')\n )\n );\n }\n if (discussion && discussion.recipientUsers().find((user) => user.id() === app.session.user.id())) {\n items.add(\n 'remove',\n Button.component(\n {\n icon: 'fas fa-user-slash',\n onclick: () => {\n if (discussion) {\n let recipients = new ItemList();\n discussion.recipientUsers().map((user) => {\n if (app.session.user.id() !== user.id()) {\n recipients.add('users:' + user.id(), user);\n }\n });\n\n let recipientGroups = [];\n let recipientUsers = [];\n\n recipients.toArray().forEach((recipient) => {\n if (recipient instanceof User) {\n recipientUsers.push(recipient);\n }\n if (recipient instanceof Group) {\n recipientGroups.push(recipient);\n }\n });\n\n discussion\n .save({\n relationships: {\n recipientUsers,\n recipientGroups,\n },\n })\n .then(() => app.history.back());\n }\n },\n },\n app.translator.trans('fof-byobu.forum.buttons.remove_from_discussion')\n )\n );\n }\n });\n}\n\nfunction attributes() {\n Discussion.prototype.recipientUsers = Model.hasMany('recipientUsers');\n Discussion.prototype.oldRecipientUsers = Model.hasMany('oldRecipientUsers');\n Discussion.prototype.recipientGroups = Model.hasMany('recipientGroups');\n Discussion.prototype.oldRecipientGroups = Model.hasMany('oldRecipientGroups');\n\n Discussion.prototype.canEditRecipients = Model.attribute('canEditRecipients');\n Discussion.prototype.canEditUserRecipients = Model.attribute('canEditUserRecipients');\n Discussion.prototype.canEditGroupRecipients = Model.attribute('canEditGroupRecipients');\n Discussion.prototype.canEditGroupRecipients = Model.attribute('canEditGroupRecipients');\n\n Discussion.prototype.isPrivateDiscussion = Model.attribute('isPrivateDiscussion');\n}\n","import app from 'flarum/forum/app';\nimport DiscussionComposer from 'flarum/forum/components/DiscussionComposer';\nimport AddRecipientModal from '../../modals/AddRecipientModal';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport recipientCountLabel from '../labels/recipientCountLabel';\nimport User from 'flarum/common/models/User';\nimport Group from 'flarum/common/models/Group';\n\nexport default class PrivateDiscussionComposer extends DiscussionComposer {\n /**\n * Tells other extensions that this composer is a Byobu composer.\n */\n _isByobuComposer = true;\n\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n\n attrs.titlePlaceholder = app.translator.trans('fof-byobu.forum.composer_private_discussion.title_placeholder');\n attrs.submitLabel = app.translator.trans('fof-byobu.forum.composer_private_discussion.submit_button');\n }\n\n oninit(vnode) {\n super.oninit(vnode);\n\n this.composer.fields.recipients = this.attrs.recipients || new ItemList();\n\n this.composer.fields.recipientUsers = this.attrs.recipientUsers || [];\n this.composer.fields.recipientGroups = this.attrs.recipientGroups || [];\n\n const username = m.route.param('username');\n\n if (typeof username !== 'undefined') {\n this.addDefaultRecipients(username);\n }\n }\n\n data() {\n let data = super.data();\n\n const users = [];\n const groups = [];\n\n if (this.composer.fields.recipients !== undefined) {\n this.composer.fields.recipients.toArray().forEach((recipient) => {\n if (recipient instanceof User) {\n users.push(recipient);\n }\n\n if (recipient instanceof Group) {\n groups.push(recipient);\n }\n });\n }\n\n data.relationships = data.relationships || {};\n\n if (users.length) {\n data.relationships.recipientUsers = users;\n }\n\n if (groups.length) {\n data.relationships.recipientGroups = groups;\n }\n\n delete data.relationships.tags;\n\n return data;\n }\n\n chooseRecipients() {\n app.modal.show(AddRecipientModal, {\n selectedRecipients: this.composer.fields.recipients,\n onsubmit: (recipients) => {\n this.composer.fields.recipients = recipients;\n\n // Focus on recipient autocomplete field.\n this.$('.RecipientsInput').focus();\n },\n });\n }\n\n headerItems() {\n let items = super.headerItems();\n\n items.remove('tags');\n\n if (app.session.user && app.forum.attribute('canStartPrivateDiscussion')) {\n const recipients = this.composer.fields.recipients.toArray();\n\n items.add(\n 'recipients',\n \n {recipients.length ? (\n recipientCountLabel(recipients.length)\n ) : (\n {app.translator.trans('fof-byobu.forum.buttons.add_recipients')}\n )}\n ,\n 5\n );\n }\n\n return items;\n }\n\n addDefaultRecipients(username) {\n const user = app.store.getBy('users', 'username', username);\n\n this.composer.fields.recipients.add('users:' + app.session.user.id(), app.session.user);\n\n if (user.id() !== app.session.user.id()) {\n this.composer.fields.recipients.add('users:' + user.id(), user);\n }\n }\n\n onsubmit() {\n this.loading = true;\n\n const recipients = this.composer.fields.recipients.toArray();\n\n if (recipients.length < 2) {\n this.chooseRecipients();\n\n this.loading = false;\n } else {\n const data = this.data();\n\n app.store\n .createRecord('discussions')\n .save(data)\n .then((discussion) => {\n if (app.cache.discussionList) {\n app.cache.discussionList.refresh();\n }\n m.route.set(app.route.discussion(discussion));\n\n app.composer.hide();\n }, this.loaded.bind(this));\n }\n }\n}\n","import app from 'flarum/forum/app';\n\nexport default function recipientCountLabel(count, attrs = {}) {\n attrs.style = attrs.style || {};\n attrs.className = 'RecipientLabel ' + (attrs.className || '');\n\n var label = app.translator.trans('fof-byobu.forum.labels.recipients', { count });\n\n return m('span', attrs, {label});\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Model from 'flarum/common/Model';\nimport User from 'flarum/common/models/User';\nimport UserControls from 'flarum/forum/utils/UserControls';\nimport PrivateDiscussionComposer from './../pages/discussions/PrivateDiscussionComposer';\nimport Button from 'flarum/common/components/Button';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport UserPage from 'flarum/forum/components/UserPage';\nimport LinkButton from 'flarum/common/components/LinkButton';\n\nexport default () => {\n attributes();\n message();\n sharedMessageHistory();\n};\n\nfunction message() {\n extend(UserControls, 'userControls', function (items, user) {\n if (\n app.session.user &&\n app.session.user.id() !== user.id() &&\n app.forum.attribute('canStartPrivateDiscussion') &&\n (user.blocksPd() === false || (app.forum.attribute('canStartPrivateDiscussionWithBlockers') && user.cannotBeDirectMessaged()))\n ) {\n items.add(\n 'private-discussion',\n Button.component(\n {\n icon: app.forum.attribute('byobu.icon-badge'),\n onclick: (e) => {\n e.preventDefault();\n\n return new Promise((resolve) => {\n let recipients = new ItemList();\n recipients.add('users:' + app.session.user.id(), app.session.user);\n recipients.add('users:' + user.id(), user);\n\n PrivateDiscussionComposer.prototype.recipients = recipients;\n\n app.composer.load(PrivateDiscussionComposer, {\n user: app.session.user,\n recipients: recipients,\n recipientUsers: recipients,\n titlePlaceholder: app.translator.trans('fof-byobu.forum.composer_private_discussion.title_placeholder'),\n submitLabel: app.translator.trans('fof-byobu.forum.composer_private_discussion.submit_button'),\n });\n app.composer.show();\n\n return resolve(app.composer);\n });\n },\n },\n app.translator.trans('fof-byobu.forum.buttons.send_pd', { username: user.username() })\n )\n );\n }\n\n return items;\n });\n}\n\nfunction sharedMessageHistory() {\n extend(UserPage.prototype, 'navItems', function (items) {\n const href = app.route('byobuUserPrivate', { username: this.user.slug() });\n\n // Hide links from guests if they are not already on the page\n if (!app.session.user && m.route.get() !== href) return;\n // Hide link for your own page.\n if (app.session.user === this.user) return;\n\n items.add(\n 'byobu',\n LinkButton.component(\n {\n href,\n icon: app.forum.attribute('byobu.icon-badge'),\n },\n app.translator.trans('fof-byobu.forum.user.byobu_link')\n ),\n 85\n );\n });\n}\n\nfunction attributes() {\n User.prototype.blocksPd = Model.attribute('blocksPd');\n User.prototype.cannotBeDirectMessaged = Model.attribute('cannotBeDirectMessaged');\n User.prototype.unreadPrivateMessagesCount = Model.attribute('unreadPrivateMessagesCount');\n}\n","import SettingsPage from './SettingsPage';\nimport Discussion from './Discussion';\nimport User from './User';\n\nexport default () => {\n Discussion();\n SettingsPage();\n User();\n};\n","import DiscussionListState from 'flarum/forum/states/DiscussionListState';\n\nexport default class PrivateDiscussionListState extends DiscussionListState {}\n","import DiscussionList from 'flarum/forum/components/DiscussionList';\n\nexport default class PrivateDiscussionList extends DiscussionList {}\n","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}","import app from 'flarum/forum/app';\nimport Button from 'flarum/common/components/Button';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport PrivateDiscussionComposer from './discussions/PrivateDiscussionComposer';\n\nexport default class PrivateComposing {\n constructor(recipient) {\n this.recipient = recipient;\n }\n\n action(e) {\n e.preventDefault();\n\n return new Promise((resolve, reject) => {\n if (app.session.user) {\n let recipients = new ItemList();\n\n recipients.add('users:' + app.session.user.id(), app.session.user);\n\n if (this.recipient && app.session.user.id() !== this.recipient.id()) {\n recipients.add('users:' + this.recipient.id(), this.recipient);\n }\n\n app.composer.load(PrivateDiscussionComposer, {\n user: app.session.user,\n recipients: recipients,\n recipientUsers: recipients,\n });\n\n app.composer.show();\n\n return resolve();\n } else {\n app.modal.show(LogInModal);\n\n return reject();\n }\n });\n }\n\n component() {\n return Button.component(\n {\n icon: 'fas fa-pen',\n className: 'Button Button--primary IndexPage-newDiscussion',\n itemClassName: 'App-primaryControl fof-byobu_primaryControl',\n onclick: this.action.bind(this),\n disabled: !this.canStartDiscussion,\n },\n app.translator.trans(this.canStartDiscussion ? 'fof-byobu.forum.nav.start_button' : 'core.forum.index.cannot_start_discussion_button')\n );\n }\n\n get canStartDiscussion() {\n return app.session.user && app.forum.attribute('canStartPrivateDiscussion');\n }\n}\n","import app from 'flarum/forum/app';\nimport UserPage from 'flarum/forum/components/UserPage';\nimport PrivateDiscussionListState from '../states/PrivateDiscussionListState';\nimport Button from 'flarum/common/components/Button';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport listItems from 'flarum/common/helpers/listItems';\nimport PrivateDiscussionList from './discussions/PrivateDiscussionList';\nimport PrivateComposing from './PrivateComposing';\n\nexport default class PrivateDiscussionsUserPage extends UserPage {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.changeSort('latest');\n }\n\n show(user) {\n // We can not create the list in init because the user will not be available if it has to be loaded asynchronously\n this.list = new PrivateDiscussionListState({\n q: `byobu:${user.slug()} is:private`,\n sort: this.sort,\n });\n\n this.list.refresh();\n\n // We call the parent method after creating the list, this way the this.list property\n // is set before content() is called for the first time\n super.show(user);\n }\n\n handleChangeSort(sort, e) {\n e.preventDefault();\n\n this.changeSort(sort);\n }\n\n changeSort(sort) {\n this.sort = sort;\n this.loadUser(m.route.param('username'));\n }\n\n content() {\n return (\n
    \n
    \n
      {listItems(this.actionItems().toArray())}
    \n
      {listItems(this.viewItems().toArray())}
    \n
    \n \n
    \n );\n }\n\n actionItems() {\n let composing = new PrivateComposing(this.user);\n\n const items = new ItemList();\n\n if (app.session.user && app.forum.attribute('canStartPrivateDiscussion')) {\n items.add('start_private', composing.component());\n }\n\n return items;\n }\n\n viewItems() {\n const items = new ItemList();\n const sortMap = this.list.sortMap();\n\n const sortOptions = {};\n for (const i in sortMap) {\n sortOptions[i] = app.translator.trans('core.forum.index_sort.' + i + '_button');\n }\n\n items.add(\n 'sort',\n Dropdown.component(\n {\n buttonClassName: 'Button',\n label: sortOptions[this.sort] || Object.keys(sortMap).map((key) => sortOptions[key])[0],\n },\n Object.keys(sortOptions).map((value) => {\n const label = sortOptions[value];\n const active = (this.sort || Object.keys(sortMap)[0]) === value;\n\n return Button.component(\n {\n icon: active ? 'fas fa-check' : true,\n onclick: this.handleChangeSort.bind(this, value),\n active: active,\n },\n label\n );\n })\n )\n );\n\n return items;\n }\n}\n","import routes from './routes';\nimport PrivateDiscussionsPage from './PrivateDiscussionsPage';\n\nexport default () => {\n routes();\n PrivateDiscussionsPage();\n};\n","import app from 'flarum/forum/app';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport PrivateDiscussionsUserPage from './PrivateDiscussionsUserPage';\n\nexport default () => {\n app.routes.byobuUserPrivate = { path: '/u/:username/private', component: PrivateDiscussionsUserPage };\n app.routes.byobuPrivate = { path: '/private', component: IndexPage };\n};\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport PrivateComposing from './PrivateComposing';\n\nexport default () => {\n extend(IndexPage.prototype, 'navItems', (items) => {\n const user = app.session.user;\n\n if (user) {\n items.add(\n 'privateDiscussions',\n LinkButton.component(\n {\n icon: app.forum.data.attributes['byobu.icon-badge'],\n href: app.route('byobuPrivate'),\n },\n app.translator.trans('fof-byobu.forum.nav.nav_item')\n ),\n 75\n );\n }\n });\n\n extend(IndexPage.prototype, 'setTitle', function () {\n if (app.current.get('routeName') === 'byobuPrivate') {\n app.setTitle(app.translator.trans('fof-byobu.forum.user.dropdown_label'));\n }\n });\n\n extend(DiscussionListState.prototype, 'requestParams', function (params) {\n if (app.current.get('routeName') === 'byobuPrivate') {\n params.filter.q = (params.filter.q || '') + ' is:private';\n\n params.include.push('recipientUsers');\n params.include.push('recipientGroups');\n }\n });\n\n extend(IndexPage.prototype, 'sidebarItems', function (items) {\n if (app.current.get('routeName') === 'byobuPrivate') {\n let compose = new PrivateComposing();\n\n items.replace('newDiscussion', compose.component());\n }\n });\n};\n","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\n\nexport default class PrivateDiscussionNotification extends Notification {\n icon() {\n return app.forum.attribute('byobu.icon-badge');\n }\n\n href() {\n const notification = this.attrs.notification;\n const discussion = notification.subject();\n\n return app.route.discussion(discussion);\n }\n\n content() {\n const user = this.attrs.notification.fromUser();\n return app.translator.trans('fof-byobu.forum.notifications.pd_text', {\n user: user,\n });\n }\n}\n","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\n\nexport default class PrivateDiscussionReplyNotification extends Notification {\n icon() {\n return 'fas fa-reply';\n }\n\n href() {\n const notification = this.attrs.notification;\n const discussion = notification.subject();\n const content = notification.content() || {};\n\n return app.route.discussion(discussion, content.postNumber);\n }\n\n content() {\n const user = this.attrs.notification.fromUser();\n return app.translator.trans('fof-byobu.forum.notifications.pd_reply_text', {\n user: user,\n });\n }\n}\n","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\n\nexport default class PrivateDiscussionUserLeftNotification extends Notification {\n icon() {\n return app.forum.attribute('byobu.icon-badge');\n }\n\n href() {\n const notification = this.attrs.notification;\n const discussion = notification.subject();\n\n return app.route.discussion(discussion);\n }\n\n content() {\n const user = this.attrs.notification.fromUser();\n return app.translator.trans('fof-byobu.forum.notifications.pd_user_left_text', {\n user: user,\n });\n }\n}\n","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\n\nexport default class PrivateDiscussionAddedNotification extends Notification {\n icon() {\n return app.forum.attribute('byobu.icon-badge');\n }\n\n href() {\n const notification = this.attrs.notification;\n const discussion = notification.subject();\n\n return app.route.discussion(discussion);\n }\n\n content() {\n const user = this.attrs.notification.fromUser();\n return app.translator.trans('fof-byobu.forum.notifications.pd_added_text', {\n user: user,\n });\n }\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport NotificationGrid from 'flarum/forum/components/NotificationGrid';\nimport PrivateDiscussionNotification from './PrivateDiscussionNotification';\nimport PrivateDiscussionRepliedNotification from './PrivateDiscussionReplyNotification';\nimport PrivateDiscussionUserLeftNotification from './PrivateDiscussionUserLeftNotification';\nimport PrivateDiscussionAddedNotification from './PrivateDiscussionAddedNotification';\n\nexport default function () {\n app.notificationComponents.byobuPrivateDiscussionCreated = PrivateDiscussionNotification;\n app.notificationComponents.byobuPrivateDiscussionReplied = PrivateDiscussionRepliedNotification;\n app.notificationComponents.byobuRecipientRemoved = PrivateDiscussionUserLeftNotification;\n app.notificationComponents.byobuPrivateDiscussionAdded = PrivateDiscussionAddedNotification;\n\n grid();\n}\n\nfunction grid() {\n // Add notification preferences.\n extend(NotificationGrid.prototype, 'notificationTypes', function (items) {\n items.add('byobuPrivateDiscussionCreated', {\n name: 'byobuPrivateDiscussionCreated',\n icon: app.forum.data.attributes['byobu.icon-badge'],\n label: app.translator.trans('fof-byobu.forum.notifications.pd_label'),\n });\n items.add('byobuPrivateDiscussionReplied', {\n name: 'byobuPrivateDiscussionReplied',\n icon: app.forum.data.attributes['byobu.icon-badge'],\n label: app.translator.trans('fof-byobu.forum.notifications.pd_reply_label'),\n });\n items.add('byobuPrivateDiscussionAdded', {\n name: 'byobuPrivateDiscussionAdded',\n icon: app.forum.data.attributes['byobu.icon-badge'],\n label: app.translator.trans('fof-byobu.forum.notifications.pd_added_label'),\n });\n items.add('byobuRecipientRemoved', {\n name: 'byobuRecipientRemoved',\n icon: app.forum.data.attributes['byobu.icon-badge'],\n label: app.translator.trans('fof-byobu.forum.notifications.pd_user_left_label'),\n });\n });\n}\n","import AddRecipientModal from './AddRecipientModal';\n\nexport const modals = {\n AddRecipientModal: AddRecipientModal,\n};\n","import PrivateDiscussionComposer from './PrivateDiscussionComposer';\nimport PrivateDiscussionList from './PrivateDiscussionList';\n\nexport const discussions = {\n PrivateDiscussionComposer: PrivateDiscussionComposer,\n PrivateDiscussionList: PrivateDiscussionList,\n};\n","import app from 'flarum/forum/app';\nimport events from './events';\nimport extend from './extend';\nimport pages from './pages';\nimport notifications from './notifications';\n\nexport * from './modals';\nexport * from './pages/discussions';\n\napp.initializers.add('fof-byobu', function () {\n events();\n extend();\n\n pages();\n notifications();\n});\n","import app from 'flarum/forum/app';\nimport RecipientLeft from './RecipientLeft';\nimport RecipientsModified from './RecipientsModified';\n\nexport default () => {\n app.postComponents.recipientsModified = RecipientsModified;\n app.postComponents.recipientLeft = RecipientLeft;\n};\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://@fof/byobu/webpack/bootstrap","webpack://@fof/byobu/external \"flarum.core.compat['forum/app']\"","webpack://@fof/byobu/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/byobu/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/byobu/external \"flarum.core.compat['common/models/User']\"","webpack://@fof/byobu/external \"flarum.core.compat['common/extend']\"","webpack://@fof/byobu/external \"flarum.core.compat['common/utils/ItemList']\"","webpack://@fof/byobu/external \"flarum.core.compat['common/Model']\"","webpack://@fof/byobu/external \"flarum.core.compat['common/components/Button']\"","webpack://@fof/byobu/external \"flarum.core.compat['common/models/Discussion']\"","webpack://@fof/byobu/external \"flarum.core.compat['common/models/Group']\"","webpack://@fof/byobu/external \"flarum.core.compat['forum/components/Notification']\"","webpack://@fof/byobu/external \"flarum.core.compat['common/utils/classList']\"","webpack://@fof/byobu/external \"flarum.core.compat['forum/components/EventPost']\"","webpack://@fof/byobu/external \"flarum.core.compat['common/components/LinkButton']\"","webpack://@fof/byobu/external \"flarum.core.compat['forum/states/DiscussionListState']\"","webpack://@fof/byobu/external \"flarum.core.compat['forum/components/IndexPage']\"","webpack://@fof/byobu/external \"flarum.core.compat['common/components/Badge']\"","webpack://@fof/byobu/external \"flarum.core.compat['common/helpers/username']\"","webpack://@fof/byobu/external \"flarum.core.compat['common/helpers/highlight']\"","webpack://@fof/byobu/external \"flarum.core.compat['forum/components/UserPage']\"","webpack://@fof/byobu/external \"flarum.core.compat['common/helpers/listItems']\"","webpack://@fof/byobu/external \"flarum.core.compat['common/Component']\"","webpack://@fof/byobu/external \"flarum.core.compat['forum/components/SettingsPage']\"","webpack://@fof/byobu/external \"flarum.core.compat['common/components/Switch']\"","webpack://@fof/byobu/external \"flarum.core.compat['forum/components/DiscussionListItem']\"","webpack://@fof/byobu/external \"flarum.core.compat['forum/components/DiscussionHero']\"","webpack://@fof/byobu/external \"flarum.core.compat['forum/utils/DiscussionControls']\"","webpack://@fof/byobu/external \"flarum.core.compat['common/components/Modal']\"","webpack://@fof/byobu/external \"flarum.core.compat['forum/components/DiscussionPage']\"","webpack://@fof/byobu/external \"flarum.core.compat['common/utils/Stream']\"","webpack://@fof/byobu/external \"flarum.core.compat['forum/states/SearchState']\"","webpack://@fof/byobu/external \"flarum.core.compat['forum/components/Search']\"","webpack://@fof/byobu/external \"flarum.core.compat['common/helpers/avatar']\"","webpack://@fof/byobu/external \"flarum.core.compat['common/utils/extractText']\"","webpack://@fof/byobu/external \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@fof/byobu/external \"flarum.core.compat['common/components/Tooltip']\"","webpack://@fof/byobu/external \"flarum.core.compat['tags/components/TagDiscussionModal']\"","webpack://@fof/byobu/external \"flarum.core.compat['components/DiscussionPage']\"","webpack://@fof/byobu/external \"flarum.core.compat['forum/utils/UserControls']\"","webpack://@fof/byobu/external \"flarum.core.compat['forum/components/DiscussionComposer']\"","webpack://@fof/byobu/external \"flarum.core.compat['common/components/Dropdown']\"","webpack://@fof/byobu/external \"flarum.core.compat['forum/components/DiscussionList']\"","webpack://@fof/byobu/external \"flarum.core.compat['forum/components/LogInModal']\"","webpack://@fof/byobu/external \"flarum.core.compat['forum/components/NotificationGrid']\"","webpack://@fof/byobu/external \"flarum.core.compat['components/Notification']\"","webpack://@fof/byobu/./src/forum/events/MadePublic.ts","webpack://@fof/byobu/./src/forum/events/RecipientLeft.js","webpack://@fof/byobu/./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","webpack://@fof/byobu/./src/forum/pages/labels/RecipientLabel.tsx","webpack://@fof/byobu/./src/forum/pages/labels/recipientsLabels.tsx","webpack://@fof/byobu/./src/forum/events/RecipientsModified.js","webpack://@fof/byobu/./src/forum/extend/SettingsPage.js","webpack://@fof/byobu/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@fof/byobu/./src/forum/search/sources/UserSearchSource.js","webpack://@fof/byobu/./src/forum/search/sources/GroupSearchSource.js","webpack://@fof/byobu/./src/forum/search/RecipientSearch.js","webpack://@fof/byobu/./src/forum/modals/AddRecipientModal.js","webpack://@fof/byobu/./src/forum/modals/ByobuTagDiscussionModal.js","webpack://@fof/byobu/./src/forum/extend/Discussion.js","webpack://@fof/byobu/./src/forum/pages/discussions/PrivateDiscussionComposer.js","webpack://@fof/byobu/./src/forum/pages/labels/recipientCountLabel.js","webpack://@fof/byobu/./src/forum/extend/User.js","webpack://@fof/byobu/./src/forum/extend/index.ts","webpack://@fof/byobu/./src/forum/states/PrivateDiscussionListState.js","webpack://@fof/byobu/./src/forum/pages/discussions/PrivateDiscussionList.js","webpack://@fof/byobu/./node_modules/@babel/runtime/helpers/esm/createClass.js","webpack://@fof/byobu/./src/forum/pages/PrivateComposing.js","webpack://@fof/byobu/./src/forum/pages/PrivateDiscussionsUserPage.js","webpack://@fof/byobu/./src/forum/pages/index.js","webpack://@fof/byobu/./src/forum/pages/routes.js","webpack://@fof/byobu/./src/forum/pages/PrivateDiscussionsPage.js","webpack://@fof/byobu/./src/forum/notifications/PrivateDiscussionNotification.js","webpack://@fof/byobu/./src/forum/notifications/PrivateDiscussionReplyNotification.js","webpack://@fof/byobu/./src/forum/notifications/PrivateDiscussionUserLeftNotification.js","webpack://@fof/byobu/./src/forum/notifications/PrivateDiscussionAddedNotification.js","webpack://@fof/byobu/./src/forum/notifications/PrivateDiscussionMadePublicNotification.js","webpack://@fof/byobu/./src/forum/notifications/index.js","webpack://@fof/byobu/./src/forum/modals/index.js","webpack://@fof/byobu/./src/forum/pages/discussions/index.js","webpack://@fof/byobu/./src/forum/index.ts","webpack://@fof/byobu/./src/forum/events/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","_setPrototypeOf","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","constructor","MadePublic","initAttrs","attrs","icon","app","forum","attribute","descriptionKey","EventPost","RecipientLeft","_objectWithoutPropertiesLoose","source","excluded","target","sourceKeys","keys","length","indexOf","RecipientLabel","view","vnode","label","this","recipient","link","newAttrs","style","className","classList","User","href","route","user","username","id","session","Group","class","namePlural","translator","trans","Component","recipientsLabel","recipients","otherAttrs","map","index","type","RecipientsModified","diff","diff1","diff2","store","filter","item","getById","content","post","usersAdded","usersRemoved","groupsAdded","groupsRemoved","added","concat","removed","oldRecipients","newRecipients","localeBase","descriptionData","data","extend","SettingsPage","items","add","Switch","component","state","blocksPd","onchange","blocksPdLoading","save","then","redraw","loading","_extends","assign","arguments","apply","UserSearchSource","query","cache","byobuResults","children","highlight","text","data-index","avatar","undefined","find","q","page","limit","pushResults","results","payload","result","push","GroupSearchSource","search","toLowerCase","all","group","substr","groupName","RecipientSearch","inputUuid","oninit","Math","random","toString","substring","oncreate","$search","$","on","e","addRecipient","focus","parentNode","clearTimeout","typingTimer","doSearch","setTimeout","getValue","setValue","sources","sourceItems","toArray","role","aria-live","selected","data-container","onclick","removeRecipient","for","open","focused","active","loadingSources","dom","placeholder","extractText","oninput","onfocus","hasFocus","onblur","in","LoadingIndicator","size","ItemList","discussion","canEditUserRecipients","canEditGroupRecipients","values","split","findRecipient","clear","preventDefault","remove","Search","AddRecipientModal","Stream","assignInitialRecipients","selectedRecipients","merge","recipientSearch","SearchState","isDismissible","recipientUsers","recipientGroups","title","helpText","Button","hide","select","metaKey","ctrlKey","submit","onsubmit","forEach","relationships","current","DiscussionPage","stream","update","modal","close","composer","show","Modal","ByobuTagDiscussionModal","tags","resolve","TagDiscussionModal","Discussion","Model","hasMany","oldRecipientUsers","oldRecipientGroups","canEditRecipients","canMakePublic","isPrivateDiscussion","badges","Badge","attributes","DiscussionListItem","DiscussionHero","DiscussionListState","params","include","DiscussionControls","history","back","confirm","extensions","Promise","reject","public","matches","long","PrivateDiscussionComposer","_isByobuComposer","titlePlaceholder","submitLabel","fields","param","addDefaultRecipients","users","groups","chooseRecipients","headerItems","count","recipientCountLabel","getBy","createRecord","discussionList","refresh","set","loaded","DiscussionComposer","cannotBeDirectMessaged","unreadPrivateMessagesCount","UserControls","load","UserPage","slug","LinkButton","PrivateDiscussionListState","PrivateDiscussionList","DiscussionList","_defineProperties","props","descriptor","configurable","writable","PrivateComposing","Constructor","protoProps","staticProps","action","LogInModal","itemClassName","disabled","canStartDiscussion","PrivateDiscussionsUserPage","changeSort","list","sort","handleChangeSort","loadUser","listItems","actionItems","viewItems","composing","sortMap","sortOptions","Dropdown","buttonClassName","routes","byobuUserPrivate","path","byobuPrivate","IndexPage","setTitle","compose","replace","PrivateDiscussionNotification","notification","subject","fromUser","Notification","PrivateDiscussionReplyNotification","postNumber","PrivateDiscussionUserLeftNotification","PrivateDiscussionAddedNotification","PrivateDiscussionMadePublicNotification","notificationComponents","byobuPrivateDiscussionCreated","byobuPrivateDiscussionReplied","PrivateDiscussionRepliedNotification","byobuRecipientRemoved","byobuPrivateDiscussionAdded","byobuPrivateDiscussionMadePubic","NotificationGrid","modals","discussions","initializers","postComponents","recipientsModified","recipientLeft","madePublic","pages","notifications"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAAS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I8S,uBAAuBK,4BAA8BP,GACzD5S,IAAI8S,uBAAuBM,gCAAkCP,GAO7D3O,iBAAOmP,KAAiBvU,UAAW,qBAAqB,SAAUsF,GAChEA,EAAMC,IAAI,gCAAiC,CACzC5G,KAAM,gCACNsC,KAAMC,IAAIC,MAAMgE,KAAKiJ,WAAW,oBAChCjM,MAAOjB,IAAImC,WAAWC,MAAM,4CAE9BgC,EAAMC,IAAI,gCAAiC,CACzC5G,KAAM,gCACNsC,KAAMC,IAAIC,MAAMgE,KAAKiJ,WAAW,oBAChCjM,MAAOjB,IAAImC,WAAWC,MAAM,kDAE9BgC,EAAMC,IAAI,8BAA+B,CACvC5G,KAAM,8BACNsC,KAAMC,IAAIC,MAAMgE,KAAKiJ,WAAW,oBAChCjM,MAAOjB,IAAImC,WAAWC,MAAM,kDAE9BgC,EAAMC,IAAI,wBAAyB,CACjC5G,KAAM,wBACNsC,KAAMC,IAAIC,MAAMgE,KAAKiJ,WAAW,oBAChCjM,MAAOjB,IAAImC,WAAWC,MAAM,0DCtC3B,IAAMkR,GAAS,CACpBhJ,kBAAmBA,ICARiJ,GAAc,CACzBrF,0BAA2BA,GAC3B4B,sBAAuBA,ICIzB9P,IAAIwT,aAAanP,IAAI,aAAa,WCHhCrE,IAAIyT,eAAeC,mBAAqB9Q,EACxC5C,IAAIyT,eAAeE,cAAgBtT,EACnCL,IAAIyT,eAAeG,WAAahU,ElBHhC4M,KACArI,IACA1C,KiBMAoS,KACAC","file":"forum.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\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 = 47);\n","module.exports = flarum.core.compat['forum/app'];","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}","module.exports = flarum.core.compat['common/models/User'];","module.exports = flarum.core.compat['common/extend'];","module.exports = flarum.core.compat['common/utils/ItemList'];","module.exports = flarum.core.compat['common/Model'];","module.exports = flarum.core.compat['common/components/Button'];","module.exports = flarum.core.compat['common/models/Discussion'];","module.exports = flarum.core.compat['common/models/Group'];","module.exports = flarum.core.compat['forum/components/Notification'];","module.exports = flarum.core.compat['common/utils/classList'];","module.exports = flarum.core.compat['forum/components/EventPost'];","module.exports = flarum.core.compat['common/components/LinkButton'];","module.exports = flarum.core.compat['forum/states/DiscussionListState'];","module.exports = flarum.core.compat['forum/components/IndexPage'];","module.exports = flarum.core.compat['common/components/Badge'];","module.exports = flarum.core.compat['common/helpers/username'];","module.exports = flarum.core.compat['common/helpers/highlight'];","module.exports = flarum.core.compat['forum/components/UserPage'];","module.exports = flarum.core.compat['common/helpers/listItems'];","module.exports = flarum.core.compat['common/Component'];","module.exports = flarum.core.compat['forum/components/SettingsPage'];","module.exports = flarum.core.compat['common/components/Switch'];","module.exports = flarum.core.compat['forum/components/DiscussionListItem'];","module.exports = flarum.core.compat['forum/components/DiscussionHero'];","module.exports = flarum.core.compat['forum/utils/DiscussionControls'];","module.exports = flarum.core.compat['common/components/Modal'];","module.exports = flarum.core.compat['forum/components/DiscussionPage'];","module.exports = flarum.core.compat['common/utils/Stream'];","module.exports = flarum.core.compat['forum/states/SearchState'];","module.exports = flarum.core.compat['forum/components/Search'];","module.exports = flarum.core.compat['common/helpers/avatar'];","module.exports = flarum.core.compat['common/utils/extractText'];","module.exports = flarum.core.compat['common/components/LoadingIndicator'];","module.exports = flarum.core.compat['common/components/Tooltip'];","module.exports = flarum.core.compat['tags/components/TagDiscussionModal'];","module.exports = flarum.core.compat['components/DiscussionPage'];","module.exports = flarum.core.compat['forum/utils/UserControls'];","module.exports = flarum.core.compat['forum/components/DiscussionComposer'];","module.exports = flarum.core.compat['common/components/Dropdown'];","module.exports = flarum.core.compat['forum/components/DiscussionList'];","module.exports = flarum.core.compat['forum/components/LogInModal'];","module.exports = flarum.core.compat['forum/components/NotificationGrid'];","module.exports = flarum.core.compat['components/Notification'];","import app from 'flarum/forum/app';\nimport EventPost from 'flarum/forum/components/EventPost';\n\nexport default class MadePublic extends EventPost {\n static initAttrs(attrs: any) {\n super.initAttrs(attrs);\n }\n\n icon() {\n return app.forum.attribute('byobu.icon-postAction');\n }\n\n descriptionKey() {\n return 'fof-byobu.forum.post.recipients_modified.made_public';\n }\n}\n","import app from 'flarum/forum/app';\nimport EventPost from 'flarum/forum/components/EventPost';\n\nexport default class RecipientLeft extends EventPost {\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n }\n\n icon() {\n return app.forum.attribute('byobu.icon-postAction');\n }\n\n descriptionKey() {\n return 'fof-byobu.forum.post.recipients_modified.removed_self';\n }\n}\n","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}","import type * as Mithril from 'mithril';\nimport username from 'flarum/common/helpers/username';\nimport User from 'flarum/common/models/User';\nimport Group from 'flarum/common/models/Group';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport classList from 'flarum/common/utils/classList';\nimport app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\n\nexport interface IRecipientLabelAttrs extends ComponentAttrs, Mithril.Attributes {\n recipient: User | Group;\n link: string;\n}\n\nexport default class RecipientLabel extends Component {\n view(vnode: Mithril.Vnode) {\n const { recipient, link, ...newAttrs } = this.attrs;\n\n newAttrs.style = newAttrs.style || {};\n newAttrs.className = classList('RecipientLabel', newAttrs?.className);\n\n if (link && recipient instanceof User) {\n newAttrs.href = app.route.user(recipient);\n }\n\n let label: string;\n\n if (recipient instanceof User) {\n label = username(recipient);\n\n if (!newAttrs.href && recipient.id() !== app?.session?.user?.id()) {\n newAttrs.href = app.route.user(recipient);\n }\n } else if (recipient instanceof Group) {\n return {recipient.namePlural()};\n } else {\n newAttrs.className += ' none';\n label = app.translator.trans('core.lib.username.deleted_text');\n }\n\n return {label};\n }\n}\n","import Group from 'flarum/common/models/Group';\nimport User from 'flarum/common/models/User';\nimport classList from 'flarum/common/utils/classList';\nimport RecipientLabel from './RecipientLabel';\n\nexport default function recipientsLabel(recipients?: (User | Group)[], attrs: Record = {}): JSX.Element {\n const { link, className, ...otherAttrs } = attrs;\n\n otherAttrs.className = classList('RecipientsLabel', className);\n\n return (\n \n {recipients?.map((recipient, index) => {\n const type = recipient instanceof User ? 'u' : 'g';\n\n return ;\n })}\n {!recipients && }\n \n );\n}\n","import app from 'flarum/forum/app';\nimport EventPost from 'flarum/forum/components/EventPost';\nimport recipientsLabel from '../pages/labels/recipientsLabels';\n\nexport default class RecipientsModified extends EventPost {\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n\n function diff(diff1, diff2, store) {\n return diff1.filter((item) => diff2.indexOf(item) === -1).map((id) => app.store.getById(store, id));\n }\n\n const content = attrs.post.content();\n\n // For event posts existing before groups functionality.\n if (!content['new'] && content.length == 2) {\n const oldRecipients = attrs.post.content()[0];\n const newRecipients = attrs.post.content()[1];\n attrs.added = diff(newRecipients, oldRecipients, 'users');\n attrs.removed = diff(oldRecipients, newRecipients, 'users');\n } else {\n let usersAdded = diff(content['new']['users'], content['old']['users'], 'users');\n let usersRemoved = diff(content['old']['users'], content['new']['users'], 'users');\n let groupsAdded = diff(content['new']['groups'], content['old']['groups'], 'groups');\n let groupsRemoved = diff(content['old']['groups'], content['new']['groups'], 'groups');\n\n attrs.added = usersAdded.concat(groupsAdded);\n attrs.removed = usersRemoved.concat(groupsRemoved);\n }\n }\n\n icon() {\n return app.forum.attribute('byobu.icon-postAction');\n }\n\n descriptionKey() {\n var localeBase = 'fof-byobu.forum.post.recipients_modified.';\n\n if (this.attrs.added.length) {\n if (this.attrs.removed.length) {\n return localeBase + 'added_and_removed';\n }\n\n return localeBase + 'added';\n }\n\n return localeBase + 'removed';\n }\n\n descriptionData() {\n const data = {};\n\n if (this.attrs.added.length) {\n data.added = recipientsLabel(this.attrs.added, { link: true });\n }\n\n if (this.attrs.removed.length) {\n data.removed = recipientsLabel(this.attrs.removed, { link: true });\n }\n\n return data;\n }\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport SettingsPage from 'flarum/forum/components/SettingsPage';\nimport Switch from 'flarum/common/components/Switch';\n\nexport default () => {\n privacyToggle();\n};\n\nfunction privacyToggle() {\n extend(SettingsPage.prototype, 'privacyItems', function (items) {\n items.add(\n 'byobu-block-dm',\n Switch.component(\n {\n state: this.user.blocksPd(),\n onchange: (value) => {\n this.blocksPdLoading = true;\n\n this.user.save({ blocksPd: value }).then(() => {\n this.blocksPdLoading = false;\n m.redraw();\n });\n },\n loading: this.blocksPdLoading,\n },\n app.translator.trans('fof-byobu.forum.user.settings.block_pd')\n )\n );\n });\n}\n","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","import app from 'flarum/forum/app';\nimport highlight from 'flarum/common/helpers/highlight';\nimport avatar from 'flarum/common/helpers/avatar';\nimport username from 'flarum/common/helpers/username';\n\nexport default class UserSearchSource {\n view(query) {\n if (query.length < 3 || this.loading) return;\n\n if (!app.cache.byobuResults) {\n app.cache.byobuResults = [];\n }\n\n this.query = query;\n\n if (!app.cache.byobuResults[this.query]) {\n this.loading = true;\n\n app.cache.byobuResults[this.query] = [];\n app.store\n .find('users', {\n filter: { q: this.query + ' allows-pd' },\n page: { limit: 5 },\n })\n .then(this.pushResults.bind(this));\n } else\n return [\n
  • {app.translator.trans('core.forum.search.users_heading')}
  • ,\n app.cache.byobuResults[this.query].map((user) => {\n const name = username(user);\n const children = [highlight(name.text, this.query)];\n\n return (\n
  • \n \n {avatar(user)}\n {{ ...name, text: undefined, children }}\n \n
  • \n );\n }),\n ];\n }\n\n pushResults(results) {\n results.payload.data.map((result) => {\n var user = app.store.getById('users', result.id);\n app.cache.byobuResults[this.query].push(user);\n });\n this.loading = false;\n m.redraw();\n }\n}\n","import app from 'flarum/forum/app';\nimport highlight from 'flarum/common/helpers/highlight';\n\nexport default class GroupSearchSource {\n search(query) {\n return app.store.find('groups', {\n filter: { q: query },\n page: { limit: 5 },\n });\n }\n\n view(query) {\n query = query.toLowerCase();\n\n const results = app.store.all('groups').filter((group) => group.namePlural().toLowerCase().substr(0, query.length) === query);\n\n if (!results.length) return '';\n\n return [\n
  • {app.translator.trans('fof-byobu.forum.search.headings.groups')}
  • ,\n results.map((group) => {\n const groupName = group.namePlural();\n var name = highlight(groupName, query);\n\n return (\n
  • \n \n {name}\n \n
  • \n );\n }),\n ];\n }\n}\n","import app from 'flarum/forum/app';\nimport Search from 'flarum/forum/components/Search';\nimport UserSearchSource from './sources/UserSearchSource';\nimport GroupSearchSource from './sources/GroupSearchSource';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport classList from 'flarum/common/utils/classList';\nimport extractText from 'flarum/common/utils/extractText';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport RecipientLabel from '../pages/labels/RecipientLabel';\nimport User from 'flarum/common/models/User';\nimport Group from 'flarum/common/models/Group';\nimport Tooltip from 'flarum/common/components/Tooltip';\n\nexport default class RecipientSearch extends Search {\n /**\n * Used to prevent duplicate IDs. Doesn't remove the possibility, but is extremely low.\n */\n inputUuid;\n\n oninit(vnode) {\n super.oninit(vnode);\n\n this.inputUuid = Math.random().toString(36).substring(2);\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n const $search = this;\n\n this.$('.Search-results').on('click', (e) => {\n const target = this.$('.SearchResult.active');\n\n $search.addRecipient(target.data('index'));\n $search.$('.RecipientsInput').focus();\n });\n\n this.$('.Search-results').on('touchstart', (e) => {\n const target = this.$(e.target.parentNode);\n\n $search.addRecipient(target.data('index'));\n $search.$('.RecipientsInput').focus();\n });\n\n $('.RecipientsInput')\n .on('input', () => {\n clearTimeout(this.typingTimer);\n this.doSearch = false;\n this.typingTimer = setTimeout(() => {\n this.doSearch = true;\n m.redraw();\n }, 900);\n })\n .on('keydown', () => {\n clearTimeout(this.typingTimer);\n });\n\n super.oncreate(vnode);\n }\n\n view() {\n if (typeof this.state.getValue() === 'undefined') {\n this.state.setValue('');\n }\n\n const loading = this.state.getValue() && this.state.getValue().length >= 3;\n\n if (!this.sources) {\n this.sources = this.sourceItems().toArray();\n }\n\n return (\n
    \n
    \n

    {app.translator.trans('fof-byobu.forum.modal.labels.selected_users')}

    \n

    {app.translator.trans('fof-byobu.forum.modal.help.selected_users')}

    \n\n {this.attrs\n .selected()\n .toArray()\n .map((recipient) => {\n return (\n \n this.removeRecipient(recipient, e)} />\n \n );\n })}\n
    \n\n
    \n \n\n
    \n vnode.dom.focus()}\n type=\"search\"\n placeholder={extractText(app.translator.trans('fof-byobu.forum.input.search_recipients'))}\n value={this.state.getValue()}\n oninput={(e) => this.state.setValue(e.target.value)}\n onfocus={() => (this.hasFocus = true)}\n onblur={() => (this.hasFocus = false)}\n />\n \n {!this.doSearch\n ? LoadingIndicator.component({ size: 'tiny', className: 'Button Button--icon Button--link' })\n : this.sources.map((source) => source.view(this.state.getValue()))}\n \n
    \n
    \n
    \n );\n }\n\n /**\n * Build an item list of SearchSources.\n *\n * @return {ItemList}\n */\n sourceItems() {\n const items = new ItemList();\n\n // Add user source based on permissions.\n if (\n (!this.attrs.discussion && app.forum.attribute('canStartPrivateDiscussionWithUsers')) ||\n (this.attrs.discussion && this.attrs.discussion.canEditUserRecipients())\n ) {\n items.add('users', new UserSearchSource());\n }\n\n // Add group source based on permissions.\n if (\n (!this.attrs.discussion && app.forum.attribute('canStartPrivateDiscussionWithGroups')) ||\n (this.attrs.discussion && this.attrs.discussion.canEditGroupRecipients())\n ) {\n items.add('groups', new GroupSearchSource());\n }\n\n return items;\n }\n\n /**\n * Adds a recipient.\n *\n * @param value\n */\n addRecipient(value) {\n let values = value.split(':'),\n type = values[0],\n id = values[1];\n\n let recipient = this.findRecipient(type, id);\n\n this.attrs.selected().add(value, recipient);\n\n this.state.clear();\n }\n\n /**\n * Removes a recipient.\n *\n * @param recipient\n */\n removeRecipient(recipient, e) {\n e.preventDefault();\n\n let type;\n\n if (recipient instanceof User) {\n type = 'users';\n }\n if (recipient instanceof Group) {\n type = 'groups';\n }\n\n this.attrs.selected().remove(type + ':' + recipient.id());\n }\n\n /**\n * Loads a recipient from the global store.\n *\n * @param store\n * @param id\n * @returns {Model}\n */\n findRecipient(store, id) {\n return app.store.getById(store, id);\n }\n}\n","import app from 'flarum/forum/app';\nimport Modal from 'flarum/common/components/Modal';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport Button from 'flarum/common/components/Button';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Stream from 'flarum/common/utils/Stream';\nimport SearchState from 'flarum/forum/states/SearchState';\nimport RecipientSearch from '../search/RecipientSearch';\nimport User from 'flarum/common/models/User';\nimport Group from 'flarum/common/models/Group';\n\nexport default class AddRecipientModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.selected = Stream(new ItemList());\n\n if (this.attrs.discussion) {\n // Adds recipients of the currently viewed discussion.\n this.assignInitialRecipients(this.attrs.discussion);\n } else if (this.attrs.selectedRecipients && this.attrs.selectedRecipients.toArray().length > 0) {\n // Adds previously selected recipients.\n this.selected().merge(this.attrs.selectedRecipients);\n } else {\n // Adds the current user in case there are no selected recipients yet and this is a new discussion.\n this.selected().add('users:' + app.session.user.id(), app.session.user);\n }\n\n this.recipientSearch = new SearchState();\n }\n\n isDismissible() {\n return false;\n }\n\n assignInitialRecipients(discussion) {\n discussion.recipientUsers().map((user) => {\n this.selected().add('users:' + user.id(), user);\n });\n discussion.recipientGroups().map((group) => {\n this.selected().add('groups:' + group.id(), group);\n });\n }\n\n className() {\n return 'AddRecipientModal';\n }\n\n title() {\n return this.attrs.discussion\n ? app.translator.trans('fof-byobu.forum.modal.titles.update_recipients', { title: {this.attrs.discussion.title()} })\n : app.translator.trans('fof-byobu.forum.modal.titles.add_recipients');\n }\n\n helpText() {\n return this.attrs.discussion\n ? app.translator.trans('fof-byobu.forum.modal.help.update_recipients')\n : app.translator.trans('fof-byobu.forum.modal.help.add_recipients');\n }\n\n content() {\n return [\n
    \n
    {this.helpText()}
    \n
    \n {RecipientSearch.component({\n state: this.recipientSearch,\n selected: this.selected,\n discussion: this.attrs.discussion,\n })}\n
    \n {Button.component(\n {\n type: 'submit',\n className: 'Button Button--primary',\n icon: 'fas fa-check',\n },\n app.translator.trans('fof-byobu.forum.buttons.submit')\n )}\n {Button.component(\n {\n onclick: this.hide.bind(this),\n className: 'Button Button--cancel',\n },\n app.translator.trans('fof-byobu.forum.buttons.cancel')\n )}\n
    \n
    \n
    ,\n ];\n }\n\n select(e) {\n // Ctrl + Enter submits the selection, just Enter completes the current entry\n if (e.metaKey || e.ctrlKey || this.selected.indexOf(this.index) !== -1) {\n if (this.selected().length) {\n this.$('form').submit();\n }\n }\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n const discussion = this.attrs.discussion;\n const recipients = this.selected();\n\n let recipientGroups = [];\n let recipientUsers = [];\n\n recipients.toArray().forEach((recipient) => {\n if (recipient instanceof User) {\n recipientUsers.push(recipient);\n }\n if (recipient instanceof Group) {\n recipientGroups.push(recipient);\n }\n });\n\n // Recipients are updated here for existing discussions here.\n if (discussion) {\n discussion.save({ relationships: { recipientUsers, recipientGroups } }).then(() => {\n if (app.current instanceof DiscussionPage) {\n app.current.stream.update();\n }\n m.redraw();\n });\n }\n\n // Use the onsubmit callback to trigger an update in the DiscussionComposer\n if (this.attrs.onsubmit) this.attrs.onsubmit(recipients);\n\n app.modal.close();\n\n if (!this.attrs.discussion) {\n app.composer.show();\n }\n\n e.redraw = false;\n }\n}\n","import app from 'flarum/forum/app';\nimport TagDiscussionModal from 'flarum/tags/components/TagDiscussionModal';\n\nexport default class ByobuTagDiscussionModal extends TagDiscussionModal {\n static isDismissible = false;\n\n onsubmit(e) {\n e.preventDefault();\n\n const tags = this.selected;\n\n if (this.attrs.resolve) this.attrs.resolve(tags);\n\n this.hide();\n }\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Model from 'flarum/common/Model';\nimport Badge from 'flarum/common/components/Badge';\nimport Discussion from 'flarum/common/models/Discussion';\nimport User from 'flarum/common/models/User';\nimport Group from 'flarum/common/models/Group';\nimport Button from 'flarum/common/components/Button';\nimport DiscussionListItem from 'flarum/forum/components/DiscussionListItem';\nimport DiscussionHero from 'flarum/forum/components/DiscussionHero';\nimport DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport recipientsLabel from '../pages/labels/recipientsLabels';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport AddRecipientModal from './../modals/AddRecipientModal';\nimport ByobuTagDiscussionModal from '../modals/ByobuTagDiscussionModal';\nimport DiscussionPage from 'flarum/components/DiscussionPage';\n\nexport default () => {\n attributes();\n badges();\n index();\n hero();\n apiInclude();\n controls();\n};\n\nconst add = function (discussion, items, long) {\n let recipients = [];\n\n if (discussion.recipientUsers().length) {\n recipients = recipients.concat(discussion.recipientUsers());\n }\n\n if (discussion.recipientGroups().length) {\n recipients = recipients.concat(discussion.recipientGroups());\n }\n\n if (recipients && recipients.length) {\n if (long) {\n items.add('recipients', recipientsLabel(recipients), 10);\n } else {\n items.add('recipients', recipientsLabel(recipients, { link: true }), 4);\n }\n }\n};\n\nfunction badges() {\n extend(Discussion.prototype, 'badges', function (badges) {\n if (this.recipientUsers().length || this.recipientGroups().length) {\n badges.add(\n 'private',\n Badge.component({\n type: 'private',\n label: app.translator.trans('fof-byobu.forum.badges.is_private.tooltip'),\n icon: app.forum.data.attributes['byobu.icon-badge'],\n }),\n 10\n );\n }\n });\n}\n\nfunction index() {\n extend(DiscussionListItem.prototype, 'infoItems', function (items) {\n const discussion = this.attrs.discussion;\n\n add(discussion, items, true);\n });\n}\n\nfunction hero() {\n extend(DiscussionHero.prototype, 'items', function (items) {\n const discussion = this.attrs.discussion;\n\n add(discussion, items, false);\n });\n}\n\nfunction apiInclude() {\n extend(DiscussionListState.prototype, 'requestParams', function (params) {\n params.include.push('recipientUsers');\n params.include.push('recipientGroups');\n });\n}\n\nfunction controls() {\n extend(DiscussionControls, 'moderationControls', function (items, discussion) {\n if (discussion.canEditRecipients()) {\n items.add(\n 'recipients',\n Button.component(\n {\n icon: app.forum.data.attributes['byobu.icon-badge'],\n onclick: () => app.modal.show(AddRecipientModal, { discussion }),\n },\n app.translator.trans('fof-byobu.forum.buttons.edit_recipients')\n )\n );\n }\n if (discussion && discussion.recipientUsers().find((user) => user.id() === app.session.user.id())) {\n items.add(\n 'remove',\n Button.component(\n {\n icon: 'fas fa-user-slash',\n onclick: () => {\n if (discussion) {\n let recipients = new ItemList();\n discussion.recipientUsers().map((user) => {\n if (app.session.user.id() !== user.id()) {\n recipients.add('users:' + user.id(), user);\n }\n });\n\n let recipientGroups = [];\n let recipientUsers = [];\n\n recipients.toArray().forEach((recipient) => {\n if (recipient instanceof User) {\n recipientUsers.push(recipient);\n }\n if (recipient instanceof Group) {\n recipientGroups.push(recipient);\n }\n });\n\n discussion\n .save({\n relationships: {\n recipientUsers,\n recipientGroups,\n },\n })\n .then(() => app.history.back());\n }\n },\n },\n app.translator.trans('fof-byobu.forum.buttons.remove_from_discussion')\n )\n );\n\n if (discussion?.isPrivateDiscussion?.() && discussion?.canMakePublic?.()) {\n items.add(\n 'transform-public',\n {\n if (discussion && confirm(app.translator.trans('fof-byobu.forum.confirm.make_public'))) {\n const recipientGroups = [];\n const recipientUsers = [];\n\n if (flarum.extensions['flarum-tags']) {\n new Promise((resolve, reject) => {\n app.modal.show(ByobuTagDiscussionModal, { discussion, resolve, reject });\n }).then((tags) => {\n discussion.save({ relationships: { recipientUsers, recipientGroups }, public: discussion.id() }).then(() => {\n discussion.save({ relationships: { tags } }).then(() => {\n if (app.current.matches(DiscussionPage)) {\n app.current.get('stream').update();\n }\n m.redraw();\n });\n });\n });\n } else {\n discussion.save({ relationships: { recipientUsers, recipientGroups }, public: discussion.id() }).then(() => m.redraw());\n }\n }\n }}\n >\n {app.translator.trans('fof-byobu.forum.buttons.make_public')}\n \n );\n }\n }\n });\n}\n\nfunction attributes() {\n Discussion.prototype.recipientUsers = Model.hasMany('recipientUsers');\n Discussion.prototype.oldRecipientUsers = Model.hasMany('oldRecipientUsers');\n Discussion.prototype.recipientGroups = Model.hasMany('recipientGroups');\n Discussion.prototype.oldRecipientGroups = Model.hasMany('oldRecipientGroups');\n\n Discussion.prototype.canEditRecipients = Model.attribute('canEditRecipients');\n Discussion.prototype.canEditUserRecipients = Model.attribute('canEditUserRecipients');\n Discussion.prototype.canEditGroupRecipients = Model.attribute('canEditGroupRecipients');\n Discussion.prototype.canEditGroupRecipients = Model.attribute('canEditGroupRecipients');\n Discussion.prototype.canMakePublic = Model.attribute('canMakePublic');\n\n Discussion.prototype.isPrivateDiscussion = Model.attribute('isPrivateDiscussion');\n}\n","import app from 'flarum/forum/app';\nimport DiscussionComposer from 'flarum/forum/components/DiscussionComposer';\nimport AddRecipientModal from '../../modals/AddRecipientModal';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport recipientCountLabel from '../labels/recipientCountLabel';\nimport User from 'flarum/common/models/User';\nimport Group from 'flarum/common/models/Group';\n\nexport default class PrivateDiscussionComposer extends DiscussionComposer {\n /**\n * Tells other extensions that this composer is a Byobu composer.\n */\n _isByobuComposer = true;\n\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n\n attrs.titlePlaceholder = app.translator.trans('fof-byobu.forum.composer_private_discussion.title_placeholder');\n attrs.submitLabel = app.translator.trans('fof-byobu.forum.composer_private_discussion.submit_button');\n }\n\n oninit(vnode) {\n super.oninit(vnode);\n\n this.composer.fields.recipients = this.attrs.recipients || new ItemList();\n\n this.composer.fields.recipientUsers = this.attrs.recipientUsers || [];\n this.composer.fields.recipientGroups = this.attrs.recipientGroups || [];\n\n const username = m.route.param('username');\n\n if (typeof username !== 'undefined') {\n this.addDefaultRecipients(username);\n }\n }\n\n data() {\n let data = super.data();\n\n const users = [];\n const groups = [];\n\n if (this.composer.fields.recipients !== undefined) {\n this.composer.fields.recipients.toArray().forEach((recipient) => {\n if (recipient instanceof User) {\n users.push(recipient);\n }\n\n if (recipient instanceof Group) {\n groups.push(recipient);\n }\n });\n }\n\n data.relationships = data.relationships || {};\n\n if (users.length) {\n data.relationships.recipientUsers = users;\n }\n\n if (groups.length) {\n data.relationships.recipientGroups = groups;\n }\n\n delete data.relationships.tags;\n\n return data;\n }\n\n chooseRecipients() {\n app.modal.show(AddRecipientModal, {\n selectedRecipients: this.composer.fields.recipients,\n onsubmit: (recipients) => {\n this.composer.fields.recipients = recipients;\n\n // Focus on recipient autocomplete field.\n this.$('.RecipientsInput').focus();\n },\n });\n }\n\n headerItems() {\n let items = super.headerItems();\n\n items.remove('tags');\n\n if (app.session.user && app.forum.attribute('canStartPrivateDiscussion')) {\n const recipients = this.composer.fields.recipients.toArray();\n\n items.add(\n 'recipients',\n \n {recipients.length ? (\n recipientCountLabel(recipients.length)\n ) : (\n {app.translator.trans('fof-byobu.forum.buttons.add_recipients')}\n )}\n ,\n 5\n );\n }\n\n return items;\n }\n\n addDefaultRecipients(username) {\n const user = app.store.getBy('users', 'username', username);\n\n this.composer.fields.recipients.add('users:' + app.session.user.id(), app.session.user);\n\n if (user.id() !== app.session.user.id()) {\n this.composer.fields.recipients.add('users:' + user.id(), user);\n }\n }\n\n onsubmit() {\n this.loading = true;\n\n const recipients = this.composer.fields.recipients.toArray();\n\n if (recipients.length < 2) {\n this.chooseRecipients();\n\n this.loading = false;\n } else {\n const data = this.data();\n\n app.store\n .createRecord('discussions')\n .save(data)\n .then((discussion) => {\n if (app.cache.discussionList) {\n app.cache.discussionList.refresh();\n }\n m.route.set(app.route.discussion(discussion));\n\n app.composer.hide();\n }, this.loaded.bind(this));\n }\n }\n}\n","import app from 'flarum/forum/app';\n\nexport default function recipientCountLabel(count, attrs = {}) {\n attrs.style = attrs.style || {};\n attrs.className = 'RecipientLabel ' + (attrs.className || '');\n\n var label = app.translator.trans('fof-byobu.forum.labels.recipients', { count });\n\n return m('span', attrs, {label});\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Model from 'flarum/common/Model';\nimport User from 'flarum/common/models/User';\nimport UserControls from 'flarum/forum/utils/UserControls';\nimport PrivateDiscussionComposer from './../pages/discussions/PrivateDiscussionComposer';\nimport Button from 'flarum/common/components/Button';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport UserPage from 'flarum/forum/components/UserPage';\nimport LinkButton from 'flarum/common/components/LinkButton';\n\nexport default () => {\n attributes();\n message();\n sharedMessageHistory();\n};\n\nfunction message() {\n extend(UserControls, 'userControls', function (items, user) {\n if (\n app.session.user &&\n app.session.user.id() !== user.id() &&\n app.forum.attribute('canStartPrivateDiscussion') &&\n (user.blocksPd() === false || (app.forum.attribute('canStartPrivateDiscussionWithBlockers') && user.cannotBeDirectMessaged()))\n ) {\n items.add(\n 'private-discussion',\n Button.component(\n {\n icon: app.forum.attribute('byobu.icon-badge'),\n onclick: (e) => {\n e.preventDefault();\n\n return new Promise((resolve) => {\n let recipients = new ItemList();\n recipients.add('users:' + app.session.user.id(), app.session.user);\n recipients.add('users:' + user.id(), user);\n\n PrivateDiscussionComposer.prototype.recipients = recipients;\n\n app.composer.load(PrivateDiscussionComposer, {\n user: app.session.user,\n recipients: recipients,\n recipientUsers: recipients,\n titlePlaceholder: app.translator.trans('fof-byobu.forum.composer_private_discussion.title_placeholder'),\n submitLabel: app.translator.trans('fof-byobu.forum.composer_private_discussion.submit_button'),\n });\n app.composer.show();\n\n return resolve(app.composer);\n });\n },\n },\n app.translator.trans('fof-byobu.forum.buttons.send_pd', { username: user.username() })\n )\n );\n }\n\n return items;\n });\n}\n\nfunction sharedMessageHistory() {\n extend(UserPage.prototype, 'navItems', function (items) {\n const href = app.route('byobuUserPrivate', { username: this.user.slug() });\n\n // Hide links from guests if they are not already on the page\n if (!app.session.user && m.route.get() !== href) return;\n // Hide link for your own page.\n if (app.session.user === this.user) return;\n\n items.add(\n 'byobu',\n LinkButton.component(\n {\n href,\n icon: app.forum.attribute('byobu.icon-badge'),\n },\n app.translator.trans('fof-byobu.forum.user.byobu_link')\n ),\n 85\n );\n });\n}\n\nfunction attributes() {\n User.prototype.blocksPd = Model.attribute('blocksPd');\n User.prototype.cannotBeDirectMessaged = Model.attribute('cannotBeDirectMessaged');\n User.prototype.unreadPrivateMessagesCount = Model.attribute('unreadPrivateMessagesCount');\n}\n","import SettingsPage from './SettingsPage';\nimport Discussion from './Discussion';\nimport User from './User';\n\nexport default () => {\n Discussion();\n SettingsPage();\n User();\n};\n","import DiscussionListState from 'flarum/forum/states/DiscussionListState';\n\nexport default class PrivateDiscussionListState extends DiscussionListState {}\n","import DiscussionList from 'flarum/forum/components/DiscussionList';\n\nexport default class PrivateDiscussionList extends DiscussionList {}\n","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}","import app from 'flarum/forum/app';\nimport Button from 'flarum/common/components/Button';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport PrivateDiscussionComposer from './discussions/PrivateDiscussionComposer';\n\nexport default class PrivateComposing {\n constructor(recipient) {\n this.recipient = recipient;\n }\n\n action(e) {\n e.preventDefault();\n\n return new Promise((resolve, reject) => {\n if (app.session.user) {\n let recipients = new ItemList();\n\n recipients.add('users:' + app.session.user.id(), app.session.user);\n\n if (this.recipient && app.session.user.id() !== this.recipient.id()) {\n recipients.add('users:' + this.recipient.id(), this.recipient);\n }\n\n app.composer.load(PrivateDiscussionComposer, {\n user: app.session.user,\n recipients: recipients,\n recipientUsers: recipients,\n });\n\n app.composer.show();\n\n return resolve();\n } else {\n app.modal.show(LogInModal);\n\n return reject();\n }\n });\n }\n\n component() {\n return Button.component(\n {\n icon: 'fas fa-pen',\n className: 'Button Button--primary IndexPage-newDiscussion',\n itemClassName: 'App-primaryControl fof-byobu_primaryControl',\n onclick: this.action.bind(this),\n disabled: !this.canStartDiscussion,\n },\n app.translator.trans(this.canStartDiscussion ? 'fof-byobu.forum.nav.start_button' : 'core.forum.index.cannot_start_discussion_button')\n );\n }\n\n get canStartDiscussion() {\n return app.session.user && app.forum.attribute('canStartPrivateDiscussion');\n }\n}\n","import app from 'flarum/forum/app';\nimport UserPage from 'flarum/forum/components/UserPage';\nimport PrivateDiscussionListState from '../states/PrivateDiscussionListState';\nimport Button from 'flarum/common/components/Button';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport listItems from 'flarum/common/helpers/listItems';\nimport PrivateDiscussionList from './discussions/PrivateDiscussionList';\nimport PrivateComposing from './PrivateComposing';\n\nexport default class PrivateDiscussionsUserPage extends UserPage {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.changeSort('latest');\n }\n\n show(user) {\n // We can not create the list in init because the user will not be available if it has to be loaded asynchronously\n this.list = new PrivateDiscussionListState({\n q: `byobu:${user.slug()} is:private`,\n sort: this.sort,\n });\n\n this.list.refresh();\n\n // We call the parent method after creating the list, this way the this.list property\n // is set before content() is called for the first time\n super.show(user);\n }\n\n handleChangeSort(sort, e) {\n e.preventDefault();\n\n this.changeSort(sort);\n }\n\n changeSort(sort) {\n this.sort = sort;\n this.loadUser(m.route.param('username'));\n }\n\n content() {\n return (\n
    \n
    \n
      {listItems(this.actionItems().toArray())}
    \n
      {listItems(this.viewItems().toArray())}
    \n
    \n \n
    \n );\n }\n\n actionItems() {\n let composing = new PrivateComposing(this.user);\n\n const items = new ItemList();\n\n if (app.session.user && app.forum.attribute('canStartPrivateDiscussion')) {\n items.add('start_private', composing.component());\n }\n\n return items;\n }\n\n viewItems() {\n const items = new ItemList();\n const sortMap = this.list.sortMap();\n\n const sortOptions = {};\n for (const i in sortMap) {\n sortOptions[i] = app.translator.trans('core.forum.index_sort.' + i + '_button');\n }\n\n items.add(\n 'sort',\n Dropdown.component(\n {\n buttonClassName: 'Button',\n label: sortOptions[this.sort] || Object.keys(sortMap).map((key) => sortOptions[key])[0],\n },\n Object.keys(sortOptions).map((value) => {\n const label = sortOptions[value];\n const active = (this.sort || Object.keys(sortMap)[0]) === value;\n\n return Button.component(\n {\n icon: active ? 'fas fa-check' : true,\n onclick: this.handleChangeSort.bind(this, value),\n active: active,\n },\n label\n );\n })\n )\n );\n\n return items;\n }\n}\n","import routes from './routes';\nimport PrivateDiscussionsPage from './PrivateDiscussionsPage';\n\nexport default () => {\n routes();\n PrivateDiscussionsPage();\n};\n","import app from 'flarum/forum/app';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport PrivateDiscussionsUserPage from './PrivateDiscussionsUserPage';\n\nexport default () => {\n app.routes.byobuUserPrivate = { path: '/u/:username/private', component: PrivateDiscussionsUserPage };\n app.routes.byobuPrivate = { path: '/private', component: IndexPage };\n};\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport PrivateComposing from './PrivateComposing';\n\nexport default () => {\n extend(IndexPage.prototype, 'navItems', (items) => {\n const user = app.session.user;\n\n if (user) {\n items.add(\n 'privateDiscussions',\n LinkButton.component(\n {\n icon: app.forum.data.attributes['byobu.icon-badge'],\n href: app.route('byobuPrivate'),\n },\n app.translator.trans('fof-byobu.forum.nav.nav_item')\n ),\n 75\n );\n }\n });\n\n extend(IndexPage.prototype, 'setTitle', function () {\n if (app.current.get('routeName') === 'byobuPrivate') {\n app.setTitle(app.translator.trans('fof-byobu.forum.user.dropdown_label'));\n }\n });\n\n extend(DiscussionListState.prototype, 'requestParams', function (params) {\n if (app.current.get('routeName') === 'byobuPrivate') {\n params.filter.q = (params.filter.q || '') + ' is:private';\n\n params.include.push('recipientUsers');\n params.include.push('recipientGroups');\n }\n });\n\n extend(IndexPage.prototype, 'sidebarItems', function (items) {\n if (app.current.get('routeName') === 'byobuPrivate') {\n let compose = new PrivateComposing();\n\n items.replace('newDiscussion', compose.component());\n }\n });\n};\n","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\n\nexport default class PrivateDiscussionNotification extends Notification {\n icon() {\n return app.forum.attribute('byobu.icon-badge');\n }\n\n href() {\n const notification = this.attrs.notification;\n const discussion = notification.subject();\n\n return app.route.discussion(discussion);\n }\n\n content() {\n const user = this.attrs.notification.fromUser();\n return app.translator.trans('fof-byobu.forum.notifications.pd_text', {\n user: user,\n });\n }\n}\n","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\n\nexport default class PrivateDiscussionReplyNotification extends Notification {\n icon() {\n return 'fas fa-reply';\n }\n\n href() {\n const notification = this.attrs.notification;\n const discussion = notification.subject();\n const content = notification.content() || {};\n\n return app.route.discussion(discussion, content.postNumber);\n }\n\n content() {\n const user = this.attrs.notification.fromUser();\n return app.translator.trans('fof-byobu.forum.notifications.pd_reply_text', {\n user: user,\n });\n }\n}\n","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\n\nexport default class PrivateDiscussionUserLeftNotification extends Notification {\n icon() {\n return app.forum.attribute('byobu.icon-badge');\n }\n\n href() {\n const notification = this.attrs.notification;\n const discussion = notification.subject();\n\n return app.route.discussion(discussion);\n }\n\n content() {\n const user = this.attrs.notification.fromUser();\n return app.translator.trans('fof-byobu.forum.notifications.pd_user_left_text', {\n user: user,\n });\n }\n}\n","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\n\nexport default class PrivateDiscussionAddedNotification extends Notification {\n icon() {\n return app.forum.attribute('byobu.icon-badge');\n }\n\n href() {\n const notification = this.attrs.notification;\n const discussion = notification.subject();\n\n return app.route.discussion(discussion);\n }\n\n content() {\n const user = this.attrs.notification.fromUser();\n return app.translator.trans('fof-byobu.forum.notifications.pd_added_text', {\n user: user,\n });\n }\n}\n","import app from 'flarum/forum/app';\nimport Notification from 'flarum/components/Notification';\n\nexport default class PrivateDiscussionMadePublicNotification extends Notification {\n icon() {\n return app.forum.attribute('byobu.icon-badge');\n }\n\n href() {\n const notification = this.props.notification;\n const discussion = notification.subject();\n\n return app.route.discussion(discussion);\n }\n\n content() {\n const user = this.props.notification.fromUser();\n return app.translator.trans('fof-byobu.forum.notifications.pd_made_public_text', {\n user: user,\n });\n }\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport NotificationGrid from 'flarum/forum/components/NotificationGrid';\nimport PrivateDiscussionNotification from './PrivateDiscussionNotification';\nimport PrivateDiscussionRepliedNotification from './PrivateDiscussionReplyNotification';\nimport PrivateDiscussionUserLeftNotification from './PrivateDiscussionUserLeftNotification';\nimport PrivateDiscussionAddedNotification from './PrivateDiscussionAddedNotification';\nimport PrivateDiscussionMadePublicNotification from './PrivateDiscussionMadePublicNotification';\n\nexport default function () {\n app.notificationComponents.byobuPrivateDiscussionCreated = PrivateDiscussionNotification;\n app.notificationComponents.byobuPrivateDiscussionReplied = PrivateDiscussionRepliedNotification;\n app.notificationComponents.byobuRecipientRemoved = PrivateDiscussionUserLeftNotification;\n app.notificationComponents.byobuPrivateDiscussionAdded = PrivateDiscussionAddedNotification;\n app.notificationComponents.byobuPrivateDiscussionMadePubic = PrivateDiscussionMadePublicNotification;\n\n grid();\n}\n\nfunction grid() {\n // Add notification preferences.\n extend(NotificationGrid.prototype, 'notificationTypes', function (items) {\n items.add('byobuPrivateDiscussionCreated', {\n name: 'byobuPrivateDiscussionCreated',\n icon: app.forum.data.attributes['byobu.icon-badge'],\n label: app.translator.trans('fof-byobu.forum.notifications.pd_label'),\n });\n items.add('byobuPrivateDiscussionReplied', {\n name: 'byobuPrivateDiscussionReplied',\n icon: app.forum.data.attributes['byobu.icon-badge'],\n label: app.translator.trans('fof-byobu.forum.notifications.pd_reply_label'),\n });\n items.add('byobuPrivateDiscussionAdded', {\n name: 'byobuPrivateDiscussionAdded',\n icon: app.forum.data.attributes['byobu.icon-badge'],\n label: app.translator.trans('fof-byobu.forum.notifications.pd_added_label'),\n });\n items.add('byobuRecipientRemoved', {\n name: 'byobuRecipientRemoved',\n icon: app.forum.data.attributes['byobu.icon-badge'],\n label: app.translator.trans('fof-byobu.forum.notifications.pd_user_left_label'),\n });\n });\n}\n","import AddRecipientModal from './AddRecipientModal';\n\nexport const modals = {\n AddRecipientModal: AddRecipientModal,\n};\n","import PrivateDiscussionComposer from './PrivateDiscussionComposer';\nimport PrivateDiscussionList from './PrivateDiscussionList';\n\nexport const discussions = {\n PrivateDiscussionComposer: PrivateDiscussionComposer,\n PrivateDiscussionList: PrivateDiscussionList,\n};\n","import app from 'flarum/forum/app';\nimport events from './events';\nimport extend from './extend';\nimport pages from './pages';\nimport notifications from './notifications';\n\nexport * from './modals';\nexport * from './pages/discussions';\n\napp.initializers.add('fof-byobu', function () {\n events();\n extend();\n\n pages();\n notifications();\n});\n","import app from 'flarum/forum/app';\nimport MadePublic from './MadePublic';\nimport RecipientLeft from './RecipientLeft';\nimport RecipientsModified from './RecipientsModified';\n\nexport default () => {\n app.postComponents.recipientsModified = RecipientsModified;\n app.postComponents.recipientLeft = RecipientLeft;\n app.postComponents.madePublic = MadePublic;\n};\n"],"sourceRoot":""} \ No newline at end of file