From f751ae37e2b8cab65a4e4b4de518c280146cf523 Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Thu, 10 Oct 2024 07:05:18 +0000 Subject: [PATCH] Bundled output for commit e7b43d837357347cc1d296b3fc3ce0c3ee1f463a Includes transpiled JS/TS, and Typescript declaration files (typings). [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 3628226..12e65fc 100644 --- a/js/dist/admin.js +++ b/js/dist/admin.js @@ -1,2 +1,2 @@ -(()=>{var t={n:e=>{var s=e&&e.__esModule?()=>e.default:()=>e;return t.d(s,{a:s}),s},d:(e,s)=>{for(var o in s)t.o(s,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:s[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};(()=>{"use strict";const e=flarum.core.compat["admin/app"];var s=t.n(e);const o=flarum.core.compat["common/models/User"];var i=t.n(o);function a(t,e){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},a(t,e)}const n=flarum.core.compat["admin/components/ExtensionPage"];var r=t.n(n);const l=flarum.core.compat["common/components/Badge"];var c=t.n(l);const p=flarum.core.compat["common/helpers/icon"];var f=t.n(p),u=function(t){var e,o;function i(){for(var e,s=arguments.length,o=new Array(s),i=0;i{var t={n:e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return t.d(o,{a:o}),o},d:(e,o)=>{for(var s in o)t.o(o,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:o[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};(()=>{"use strict";t.r(e),t.d(e,{extend:()=>d});const o=flarum.core.compat["admin/app"];var s=t.n(o);const i=flarum.core.compat["common/models/User"];var a=t.n(i);function n(t,e){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},n(t,e)}const r=flarum.core.compat["admin/components/ExtensionPage"];var l=t.n(r);const c=flarum.core.compat["common/components/Badge"];var p=t.n(c);const f=flarum.core.compat["common/helpers/icon"];var u=t.n(f),b=function(t){function e(){for(var e,o=arguments.length,s=new Array(o),i=0;i {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/ExtensionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Badge'];","const __WEBPACK_NAMESPACE_OBJECT__ = 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 badgeDefault: string = 'fas fa-map';\n postActionDefault: string = 'far fa-map';\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 {this.buildSettingComponent({\n type: 'boolean',\n setting: 'fof-byobu.delete_on_last_recipient_left',\n label: app.translator.trans('fof-byobu.admin.settings.delete_on_last_recipient_left'),\n help: app.translator.trans('fof-byobu.admin.settings.delete_on_last_recipient_left_help'),\n })}\n {this.buildSettingComponent({\n type: 'boolean',\n setting: 'fof-byobu.hide_from_all_discussions_page',\n label: app.translator.trans('fof-byobu.admin.settings.hide_from_all_discussions_page'),\n help: app.translator.trans('fof-byobu.admin.settings.hide_from_all_discussions_page_help'),\n })}\n
\n
{this.submitButton()}
\n
\n
\n
\n );\n }\n}\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}","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.add_more_than_two_user_recipients'),\n permission: 'discussion.addMoreThanTwoUserRecipients',\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: 'discussion.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"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","flarum","core","compat","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","ByobuSetingsPage","_ExtensionPage","subClass","superClass","_this","_len","arguments","length","args","Array","_key","apply","concat","badgeDefault","postActionDefault","create","constructor","content","helpText","extensions","app","trans","m","href","fontawesome","tabindex","className","this","buildSettingComponent","type","setting","label","help","Badge","icon","toJSON","placeholder","submitButton","ExtensionPage","add","byobuData","models","recipients","User","registerPage","ByobuSettings","registerPermission","permission","tagScoped","settings"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,qDCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,sB,aCAxD,SAASC,EAAgBC,EAAGC,GAC1B,OAAOF,EAAkBf,OAAO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b,QACA,IAEDF,mBACC,CACEZ,KAAM,aACNH,MAAOX,IAAAA,WAAeC,MAAM,mDAC5B0B,WAAY,gCACZC,WAAW,GAEb,WACA,IAEDF,mBACC,CACEZ,KAAM,aACNH,MAAOX,IAAAA,WAAeC,MAAM,oDAC5B0B,WAAY,iCACZC,WAAW,GAEb,WACA,IAEDF,mBACC,CACEZ,KAAM,cACNH,MAAOX,IAAAA,WAAeC,MAAM,oEAC5B0B,WAAY,yCACZC,WAAW,GAEb,WACA,IAGA5B,IAAAA,KAAS6B,SAAS,yBACpBT,EAAUM,mBACR,CACEZ,KAAM,aACNH,MAAOX,IAAAA,WAAeC,MAAM,uDAC5B0B,WAAY,wBACZC,WAAW,GAEb,QACA,GDxEN,G","sources":["webpack://@fof/byobu/webpack/bootstrap","webpack://@fof/byobu/webpack/runtime/compat get default export","webpack://@fof/byobu/webpack/runtime/define property getters","webpack://@fof/byobu/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/byobu/webpack/runtime/make namespace object","webpack://@fof/byobu/external root \"flarum.core.compat['admin/app']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/models/User']\"","webpack://@fof/byobu/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/byobu/external root \"flarum.core.compat['admin/components/ExtensionPage']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/components/Badge']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/byobu/./src/admin/components/ByobuSettingsPage.tsx","webpack://@fof/byobu/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/byobu/./src/common/extend.ts","webpack://@fof/byobu/./src/admin/extend.ts","webpack://@fof/byobu/./src/admin/index.ts","webpack://@fof/byobu/./src/admin/addPrivateDiscussionPermission.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","function _setPrototypeOf(t, e) {\n return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {\n return t.__proto__ = e, t;\n }, _setPrototypeOf(t, e);\n}\nexport { _setPrototypeOf as default };","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/ExtensionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Badge'];","const __WEBPACK_NAMESPACE_OBJECT__ = 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 badgeDefault: string = 'fas fa-map';\n postActionDefault: string = 'far fa-map';\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 {this.buildSettingComponent({\n type: 'boolean',\n setting: 'fof-byobu.delete_on_last_recipient_left',\n label: app.translator.trans('fof-byobu.admin.settings.delete_on_last_recipient_left'),\n help: app.translator.trans('fof-byobu.admin.settings.delete_on_last_recipient_left_help'),\n })}\n {this.buildSettingComponent({\n type: 'boolean',\n setting: 'fof-byobu.hide_from_all_discussions_page',\n label: app.translator.trans('fof-byobu.admin.settings.hide_from_all_discussions_page'),\n help: app.translator.trans('fof-byobu.admin.settings.hide_from_all_discussions_page_help'),\n })}\n
\n
{this.submitButton()}
\n
\n
\n
\n );\n }\n}\n","import setPrototypeOf from \"./setPrototypeOf.js\";\nfunction _inheritsLoose(t, o) {\n t.prototype = Object.create(o.prototype), t.prototype.constructor = t, setPrototypeOf(t, o);\n}\nexport { _inheritsLoose as default };","import Extend from 'flarum/common/extenders';\n\nexport default [];\n","import Extend from 'flarum/common/extenders';\nimport commonExtend from '../common/extend';\n\nexport default [...commonExtend];\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\nexport { default as extend } from './extend';\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.add_more_than_two_user_recipients'),\n permission: 'discussion.addMoreThanTwoUserRecipients',\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: 'discussion.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"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_setPrototypeOf","t","e","setPrototypeOf","bind","__proto__","ByobuSetingsPage","_ExtensionPage","_this","_len","arguments","length","args","Array","_key","apply","concat","badgeDefault","postActionDefault","create","constructor","content","helpText","extensions","app","trans","m","href","fontawesome","tabindex","className","this","buildSettingComponent","type","setting","label","help","Badge","icon","toJSON","placeholder","submitButton","ExtensionPage","add","byobuData","models","recipients","User","registerPage","ByobuSettings","registerPermission","permission","tagScoped","settings"],"sourceRoot":""} \ No newline at end of file diff --git a/js/dist/forum.js b/js/dist/forum.js index 6499aa8..da7a090 100644 --- a/js/dist/forum.js +++ b/js/dist/forum.js @@ -1,2 +1,2 @@ -(()=>{var t={n:e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};(()=>{"use strict";t.r(e),t.d(e,{discussions:()=>Ht,events:()=>te,extend:()=>le,helpers:()=>ee,modals:()=>Ft});const n=flarum.core.compat["forum/app"];var o=t.n(n);const s=flarum.core.compat["common/extend"],r=flarum.core.compat["forum/components/SettingsPage"];var i=t.n(r);const a=flarum.core.compat["common/components/Switch"];var c=t.n(a);const u=flarum.core.compat["common/components/Badge"];var l=t.n(u);const p=flarum.core.compat["common/models/Discussion"];var f=t.n(p);const d=flarum.core.compat["common/models/User"];var h=t.n(d);const b=flarum.core.compat["common/models/Group"];var v=t.n(b);const y=flarum.core.compat["common/components/Button"];var g=t.n(y);const _=flarum.core.compat["forum/components/DiscussionListItem"];var P=t.n(_);const w=flarum.core.compat["forum/components/DiscussionHero"];var R=t.n(w);const S=flarum.core.compat["forum/states/DiscussionListState"];var D=t.n(S);function x(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}const k=flarum.core.compat["common/utils/classList"];var N=t.n(k);function U(t,e){return U=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},U(t,e)}function A(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,U(t,e)}const I=flarum.core.compat["common/helpers/username"];var C=t.n(I);const M=flarum.core.compat["common/components/LinkButton"];var L=t.n(M);const j=flarum.core.compat["common/Component"];var O=["recipient","link"],G=function(t){function e(){return t.apply(this,arguments)||this}return A(e,t),e.prototype.view=function(t){var e,n=this.attrs,s=n.recipient,r=n.link,i=x(n,O);if(i.style=i.style||{},i.className=N()("RecipientLabel",null==i?void 0:i.className),r&&s instanceof h()&&(i.href=o().route.user(s)),s instanceof h()){var a,c;e=C()(s),i.href||s.id()===(null==o()||null==(a=o().session)||null==(c=a.user)?void 0:c.id())||(i.href=o().route.user(s))}else{if(s instanceof v())return m("span",{class:i.className},s.namePlural());i.className+=" none",e=o().translator.trans("core.lib.username.deleted_text")}return m(L(),i,e)},e}(t.n(j)()),T=["link","className"];function B(t,e){void 0===e&&(e={});var n=e,o=n.link,s=n.className,r=x(n,T);return r.className=N()("RecipientsLabel",s),m("span",r,null==t?void 0:t.map((function(t,e){var n=t instanceof h()?"u":"g";return m(G,{key:n+"-"+e,recipient:t,link:o})})),!t&&m(G,null))}const q=flarum.core.compat["forum/utils/DiscussionControls"];var E=t.n(q);const V=flarum.core.compat["common/utils/ItemList"];var K=t.n(V);const F=flarum.core.compat["common/components/Modal"];var W=t.n(F);const z=flarum.core.compat["forum/components/DiscussionPage"];var H=t.n(z);const J=flarum.core.compat["common/utils/Stream"];var Q=t.n(J);const X=flarum.core.compat["forum/states/SearchState"];var Y=t.n(X);const Z=flarum.core.compat["forum/components/Search"];var tt=t.n(Z);function et(){return et=Object.assign?Object.assign.bind():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,o().translator.trans("fof-byobu.forum.modal.labels.selected_users")),m("p",null,o().translator.trans("fof-byobu.forum.modal.help.selected_users")),this.attrs.selected().toArray().map((function(e){return m(mt(),{text:o().translator.trans("fof-byobu.forum.modal.help.click_user_to_remove_tooltip")},m(G,{"data-container":"[data-modal-number]",recipient:e,onclick:function(n){return t.removeRecipient(e,n)}}))}))),m("div",{className:"Form-group"},m("label",{for:"byobu-addrecipient-search-input-"+this.inputUuid},o().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:N()("RecipientsInput","FormControl",{open:!!this.searchState.getValue(),focused:!!this.searchState.getValue(),active:!!this.searchState.getValue(),loading:!!this.loadingSources}),oncreate:function(t){return t.dom.focus()},type:"search",placeholder:ut()(o().translator.trans("fof-byobu.forum.input.search_recipients")),value:this.searchState.getValue(),oninput:function(e){return t.searchState.setValue(e.target.value)},onfocus:function(){return t.hasFocus=!0},onblur:function(){return t.hasFocus=!1}}),m("ul",{className:N()("Dropdown-menu","Search-results","fade",{in:!!e})},this.doSearch?this.sources.map((function(e){return e.view(t.searchState.getValue())})):pt().component({size:"tiny",className:"Button Button--icon Button--link"})))))},n.sourceItems=function(){var t=new(K());return(!this.attrs.discussion&&o().forum.attribute("canStartPrivateDiscussionWithUsers")||this.attrs.discussion&&this.attrs.discussion.canEditUserRecipients())&&t.add("users",new it),(!this.attrs.discussion&&o().forum.attribute("canStartPrivateDiscussionWithGroups")||this.attrs.discussion&&this.attrs.discussion.canEditGroupRecipients())&&t.add("groups",new at),t},n.addRecipient=function(t){var e=this,n=t.split(":"),s=n[0],r=n[1],i=this.findRecipient(s,r);"users"!==s||o().forum.attribute("canAddMoreThanTwoUserRecipients")||this.attrs.selected().toArray().forEach((function(t){var n;t instanceof h()&&t.id()!==(null==(n=o().session.user)?void 0:n.id())&&e.attrs.selected().remove("users:"+t.id())})),this.attrs.selected().add(t,i),this.searchState.clear()},n.removeRecipient=function(t,e){var n;e.preventDefault(),t instanceof h()&&(n="users"),t instanceof v()&&(n="groups"),this.attrs.selected().remove(n+":"+t.id())},n.findRecipient=function(t,e){return o().store.getById(t,e)},e}(tt()),ht=function(t){function e(){return t.apply(this,arguments)||this}A(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.selected=Q()(new(K())),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:"+o().session.user.id(),o().session.user),this.recipientSearch=new(Y())},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?o().translator.trans("fof-byobu.forum.modal.titles.update_recipients",{title:m("em",null,this.attrs.discussion.title())}):o().translator.trans("fof-byobu.forum.modal.titles.add_recipients")},n.helpText=function(){return this.attrs.discussion?o().translator.trans("fof-byobu.forum.modal.help.update_recipients"):o().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"},dt.component({state:this.recipientSearch,selected:this.selected,discussion:this.attrs.discussion}),m("div",{className:"AddRecipientModal-form-submit App-primaryControl"},g().component({type:"submit",className:"Button Button--primary",icon:"fas fa-check"},o().translator.trans("fof-byobu.forum.buttons.submit")),g().component({onclick:this.hide.bind(this),className:"Button Button--cancel"},o().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(),s=[],r=[];n.toArray().forEach((function(t){t instanceof h()&&r.push(t),t instanceof v()&&s.push(t)})),e&&e.save({relationships:{recipientUsers:r,recipientGroups:s}}).then((function(){o().current instanceof H()&&o().current.stream.update(),m.redraw()})),this.attrs.onsubmit&&this.attrs.onsubmit(n),o().modal.close(),this.attrs.discussion||o().composer.show(),t.redraw=!1},e}(W());const bt=flarum.core.compat["tags/components/TagDiscussionModal"];var vt=function(t){function e(){return t.apply(this,arguments)||this}return A(e,t),e.prototype.onsubmit=function(t){t.preventDefault();var e=this.selected;this.attrs.resolve&&this.attrs.resolve(e),this.hide()},e}(t.n(bt)());vt.isDismissible=!1;const yt=flarum.core.compat["components/DiscussionPage"];var gt=t.n(yt);var _t=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",B(o),10):e.add("recipients",B(o,{link:!0}),4))};const Pt=flarum.core.compat["forum/utils/UserControls"];var wt=t.n(Pt);const Rt=flarum.core.compat["forum/components/DiscussionComposer"];var St=function(t){function e(){for(var e,n=arguments.length,o=new Array(n),s=0;s{var t={n:e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};(()=>{"use strict";t.r(e),t.d(e,{discussions:()=>Jt,events:()=>ee,extend:()=>me,helpers:()=>ne,modals:()=>Wt});const n=flarum.core.compat["forum/app"];var o=t.n(n);const r=flarum.core.compat["common/extend"],s=flarum.core.compat["forum/components/SettingsPage"];var i=t.n(s);const a=flarum.core.compat["common/components/Switch"];var c=t.n(a);const u=flarum.core.compat["common/components/Badge"];var l=t.n(u);const p=flarum.core.compat["common/models/Discussion"];var f=t.n(p);const d=flarum.core.compat["common/models/User"];var h=t.n(d);const b=flarum.core.compat["common/models/Group"];var v=t.n(b);const y=flarum.core.compat["common/components/Button"];var g=t.n(y);const _=flarum.core.compat["forum/components/DiscussionListItem"];var P=t.n(_);const w=flarum.core.compat["forum/components/DiscussionHero"];var R=t.n(w);const S=flarum.core.compat["forum/states/DiscussionListState"];var D=t.n(S);function x(t,e){if(null==t)return{};var n={};for(var o in t)if({}.hasOwnProperty.call(t,o)){if(e.includes(o))continue;n[o]=t[o]}return n}const k=flarum.core.compat["common/utils/classList"];var N=t.n(k);function U(t,e){return U=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},U(t,e)}function A(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,U(t,e)}const C=flarum.core.compat["common/helpers/username"];var I=t.n(C);const M=flarum.core.compat["common/components/LinkButton"];var L=t.n(M);const j=flarum.core.compat["common/Component"];var G=["recipient","link"],T=function(t){function e(){return t.apply(this,arguments)||this}return A(e,t),e.prototype.view=function(t){var e,n=this.attrs,r=n.recipient,s=n.link,i=x(n,G);if(i.style=i.style||{},i.className=N()("RecipientLabel",null==i?void 0:i.className),s&&r instanceof h()&&(i.href=o().route.user(r)),r instanceof h()){var a;e=I()(r),i.href||r.id()===(null==o()||null==(a=o().session)||null==(a=a.user)?void 0:a.id())||(i.href=o().route.user(r))}else{if(r instanceof v())return m("span",{class:i.className},r.namePlural());i.className+=" none",e=o().translator.trans("core.lib.username.deleted_text")}return m(L(),i,e)},e}(t.n(j)()),B=["link","className"];function O(t,e){void 0===e&&(e={});var n=e,o=n.link,r=n.className,s=x(n,B);return s.className=N()("RecipientsLabel",r),m("span",s,null==t?void 0:t.map((function(t,e){var n=t instanceof h()?"u":"g";return m(T,{key:n+"-"+e,recipient:t,link:o})})),!t&&m(T,null))}const E=flarum.core.compat["forum/utils/DiscussionControls"];var q=t.n(E);const V=flarum.core.compat["common/utils/ItemList"];var K=t.n(V);const F=flarum.core.compat["common/components/Modal"];var W=t.n(F);const z=flarum.core.compat["forum/components/DiscussionPage"];var H=t.n(z);const J=flarum.core.compat["common/utils/Stream"];var Q=t.n(J);const X=flarum.core.compat["forum/states/SearchState"];var Y=t.n(X);const Z=flarum.core.compat["forum/components/Search"];var tt=t.n(Z);function et(){return et=Object.assign?Object.assign.bind():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,o().translator.trans("fof-byobu.forum.modal.labels.selected_users")),m("p",null,o().translator.trans("fof-byobu.forum.modal.help.selected_users")),this.attrs.selected().toArray().map((function(e){return m(mt(),{text:o().translator.trans("fof-byobu.forum.modal.help.click_user_to_remove_tooltip")},m(T,{"data-container":"[data-modal-number]",recipient:e,onclick:function(n){return t.removeRecipient(e,n)}}))}))),m("div",{className:"Form-group"},m("label",{for:"byobu-addrecipient-search-input-"+this.inputUuid},o().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:N()("RecipientsInput","FormControl",{open:!!this.searchState.getValue(),focused:!!this.searchState.getValue(),active:!!this.searchState.getValue(),loading:!!this.loadingSources}),oncreate:function(t){return t.dom.focus()},type:"search",placeholder:ut()(o().translator.trans("fof-byobu.forum.input.search_recipients")),value:this.searchState.getValue(),oninput:function(e){return t.searchState.setValue(e.target.value)},onfocus:function(){return t.hasFocus=!0},onblur:function(){return t.hasFocus=!1}}),m("ul",{className:N()("Dropdown-menu","Search-results","fade",{in:!!e})},this.doSearch?this.sources.map((function(e){return e.view(t.searchState.getValue())})):pt().component({size:"tiny",className:"Button Button--icon Button--link"})))))},n.sourceItems=function(){var t=new(K());return(!this.attrs.discussion&&o().forum.attribute("canStartPrivateDiscussionWithUsers")||this.attrs.discussion&&this.attrs.discussion.canEditUserRecipients())&&t.add("users",new it),(!this.attrs.discussion&&o().forum.attribute("canStartPrivateDiscussionWithGroups")||this.attrs.discussion&&this.attrs.discussion.canEditGroupRecipients())&&t.add("groups",new at),t},n.addRecipient=function(t){var e=this,n=t.split(":"),r=n[0],s=n[1],i=this.findRecipient(r,s);"users"!==r||o().forum.attribute("canAddMoreThanTwoUserRecipients")||this.attrs.selected().toArray().forEach((function(t){var n;t instanceof h()&&t.id()!==(null==(n=o().session.user)?void 0:n.id())&&e.attrs.selected().remove("users:"+t.id())})),this.attrs.selected().add(t,i),this.searchState.clear()},n.removeRecipient=function(t,e){var n;e.preventDefault(),t instanceof h()&&(n="users"),t instanceof v()&&(n="groups"),this.attrs.selected().remove(n+":"+t.id())},n.findRecipient=function(t,e){return o().store.getById(t,e)},e}(tt()),ht=function(t){function e(){return t.apply(this,arguments)||this}A(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.selected=Q()(new(K())),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:"+o().session.user.id(),o().session.user),this.recipientSearch=new(Y())},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?o().translator.trans("fof-byobu.forum.modal.titles.update_recipients",{title:m("em",null,this.attrs.discussion.title())}):o().translator.trans("fof-byobu.forum.modal.titles.add_recipients")},n.helpText=function(){return this.attrs.discussion?o().translator.trans("fof-byobu.forum.modal.help.update_recipients"):o().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"},dt.component({state:this.recipientSearch,selected:this.selected,discussion:this.attrs.discussion}),m("div",{className:"AddRecipientModal-form-submit App-primaryControl"},g().component({type:"submit",className:"Button Button--primary",icon:"fas fa-check"},o().translator.trans("fof-byobu.forum.buttons.submit")),g().component({onclick:this.hide.bind(this),className:"Button Button--cancel"},o().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(),r=[],s=[];n.toArray().forEach((function(t){t instanceof h()&&s.push(t),t instanceof v()&&r.push(t)})),e&&e.save({relationships:{recipientUsers:s,recipientGroups:r}}).then((function(){o().current instanceof H()&&o().current.stream.update(),m.redraw()})),this.attrs.onsubmit&&this.attrs.onsubmit(n),o().modal.close(),this.attrs.discussion||o().composer.show(),t.redraw=!1},e}(W());const bt=flarum.core.compat["tags/components/TagDiscussionModal"];var vt=function(t){function e(){return t.apply(this,arguments)||this}return A(e,t),e.prototype.onsubmit=function(t){t.preventDefault();var e=this.selected;this.attrs.resolve&&this.attrs.resolve(e),this.hide()},e}(t.n(bt)());vt.isDismissible=!1;const yt=flarum.core.compat["components/DiscussionPage"];var gt=t.n(yt);var _t=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",O(o),10):e.add("recipients",O(o,{link:!0}),4))};const Pt=flarum.core.compat["forum/utils/UserControls"];var wt=t.n(Pt);const Rt=flarum.core.compat["forum/components/DiscussionComposer"];var St=function(t){function e(){for(var e,n=arguments.length,o=new Array(n),r=0;r {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/SettingsPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","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","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Badge'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Discussion'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Group'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionListItem'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionHero'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/states/DiscussionListState'];","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 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 return target;\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/classList'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/username'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","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';\nimport { NestedStringArray } from '@askvortsov/rich-icu-message-formatter';\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 | NestedStringArray;\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","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/DiscussionControls'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/states/SearchState'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/Search'];","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/highlight'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/avatar'];","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","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extractText'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","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.searchState.getValue() === 'undefined') {\n this.searchState.setValue('');\n }\n\n const loading = this.searchState.getValue() && this.searchState.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.searchState.getValue()}\n oninput={(e) => this.searchState.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.searchState.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 // If the user is only allowed to add another recipient apart themselves\n // We will remove all other users from the selection when a new value is picked\n if (type === 'users' && !app.forum.attribute('canAddMoreThanTwoUserRecipients')) {\n this.attrs\n .selected()\n .toArray()\n .forEach((recipient) => {\n if (recipient instanceof User && recipient.id() !== app.session.user?.id()) {\n this.attrs.selected().remove('users:' + recipient.id());\n }\n });\n }\n\n this.attrs.selected().add(value, recipient);\n\n this.searchState.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","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['tags/components/TagDiscussionModal'];","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","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/DiscussionPage'];","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\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 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: () =>\n app.modal.show(AddRecipientModal, {\n discussion,\n /**\n * @param {ItemList} recipients\n */\n onsubmit(recipients) {\n if (recipients.isEmpty()) {\n // The discussion might have been perma-deleted! Let's check...\n app.store\n .find(\n 'discussions',\n discussion.id(),\n {},\n {\n errorHandler(err) {\n if (err.status === 404) {\n // Almost certainly permadeleted, so let's just redirect to the PD list.\n m.route.set(app.route('byobuPrivate'));\n }\n },\n }\n )\n .catch((err) => {\n // some other error... assume not deleted\n console.error(err);\n });\n }\n },\n }),\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","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/UserControls'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionComposer'];","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', 'slug', 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","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/UserPage'];","import app from 'flarum/forum/app';\nimport type User from 'flarum/common/models/User';\n\nexport default function canStartPrivateDiscussion(recipient: User) {\n return (\n app.session.user &&\n app.session.user.id() !== recipient.id() &&\n app.forum.attribute('canStartPrivateDiscussion') &&\n (!recipient.blocksPd() || app.forum.attribute('canStartPrivateDiscussionWithBlockers'))\n );\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\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';\nimport canStartPrivateDiscussion from '../helpers/canStartPrivateDiscussion';\n\nexport default () => {\n message();\n sharedMessageHistory();\n};\n\nfunction message() {\n extend(UserControls, 'userControls', function (items, user) {\n if (canStartPrivateDiscussion(user)) {\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.displayName() })\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","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/IndexPage'];","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _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, toPropertyKey(descriptor.key), descriptor);\n }\n}\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/LogInModal'];","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 { 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.setContent('newDiscussion', compose.component());\n }\n });\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/NotificationGrid'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/Notification'];","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 excerpt() {\n return null;\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 excerpt() {\n return null;\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 excerpt() {\n return null;\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 excerpt() {\n return null;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/Notification'];","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 excerpt() {\n return null;\n }\n}\n","import AddRecipientModal from './AddRecipientModal';\n\nexport const modals = {\n AddRecipientModal: AddRecipientModal,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionList'];","import DiscussionList from 'flarum/forum/components/DiscussionList';\n\nexport default class PrivateDiscussionList extends DiscussionList {}\n","import PrivateDiscussionComposer from './PrivateDiscussionComposer';\nimport PrivateDiscussionList from './PrivateDiscussionList';\n\nexport const discussions = {\n PrivateDiscussionComposer: PrivateDiscussionComposer,\n PrivateDiscussionList: PrivateDiscussionList,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/EventPost'];","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: 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.removed_self';\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 MadePublic from './MadePublic';\nimport RecipientLeft from './RecipientLeft';\nimport RecipientsModified from './RecipientsModified';\n\nexport const events = [MadePublic, RecipientLeft, RecipientsModified];\n","import canStartPrivateDiscussion from './canStartPrivateDiscussion';\n\nexport const helpers = [canStartPrivateDiscussion];\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extenders'];","import DiscussionListState from 'flarum/forum/states/DiscussionListState';\n\nexport default class PrivateDiscussionListState extends DiscussionListState {}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Dropdown'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/listItems'];","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';\nimport canStartPrivateDiscussion from '../helpers/canStartPrivateDiscussion';\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 (canStartPrivateDiscussion(this.user)) {\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 Extend from 'flarum/common/extenders';\nimport Discussion from 'flarum/common/models/Discussion';\nimport Group from 'flarum/common/models/Group';\nimport User from 'flarum/common/models/User';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport MadePublic from './events/MadePublic';\nimport RecipientLeft from './events/RecipientLeft';\nimport RecipientsModified from './events/RecipientsModified';\nimport PrivateDiscussionsUserPage from './pages/PrivateDiscussionsUserPage';\n\nexport default [\n new Extend.PostTypes() //\n .add('recipientsModified', RecipientsModified)\n .add('recipientLeft', RecipientLeft)\n .add('madePublic', MadePublic),\n\n new Extend.Routes() //\n .add('byobuUserPrivate', '/u/:username/private', PrivateDiscussionsUserPage)\n .add('byobuPrivate', '/private', IndexPage),\n\n new Extend.Model(Discussion)\n .hasMany('recipientUsers')\n .hasMany('oldRecipientUsers')\n .hasMany('recipientGroups')\n .hasMany('oldRecipientGroups')\n .attribute('canEditRecipients')\n .attribute('canEditUserRecipients')\n .attribute('canEditGroupRecipients')\n .attribute('canMakePublic')\n .attribute('isPrivateDiscussion'),\n\n new Extend.Model(User) //\n .attribute('blocksPd')\n .attribute('unreadPrivateMessagesCount'),\n];\n","import app from 'flarum/forum/app';\nimport extenders from './extenders';\nimport pages from './pages';\nimport notifications from './notifications';\n\nexport * from './modals';\nexport * from './pages/discussions';\nexport * from './events';\nexport * from './helpers';\n\nexport { default as extend } from './extend';\n\napp.initializers.add('fof-byobu', function () {\n extenders();\n\n pages();\n notifications();\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"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_objectWithoutPropertiesLoose","source","excluded","i","target","sourceKeys","keys","length","indexOf","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","_inheritsLoose","subClass","superClass","create","constructor","RecipientLabel","_Component","apply","arguments","view","vnode","label","_this$attrs","this","attrs","recipient","link","newAttrs","_excluded","style","className","classList","User","href","app","user","_app$session","_app$session$user","username","id","Group","m","class","namePlural","trans","LinkButton","Component","recipientsLabel","recipients","_attrs","otherAttrs","map","index","type","_extends","assign","UserSearchSource","_proto","query","_this","loading","byobuResults","name","children","highlight","text","avatar","undefined","find","filter","q","page","limit","then","pushResults","results","_this2","payload","data","result","getById","push","redraw","GroupSearchSource","search","toLowerCase","all","group","substr","groupName","RecipientSearch","_Search","_len","args","Array","_key","concat","inputUuid","oninit","Math","random","toString","substring","oncreate","$search","$","on","e","addRecipient","focus","parentNode","clearTimeout","typingTimer","doSearch","setTimeout","_this3","searchState","getValue","setValue","sources","sourceItems","toArray","role","selected","Tooltip","onclick","removeRecipient","for","open","focused","active","loadingSources","dom","placeholder","extractText","oninput","onfocus","hasFocus","onblur","in","LoadingIndicator","size","items","ItemList","discussion","attribute","canEditUserRecipients","add","canEditGroupRecipients","_this4","values","split","findRecipient","forEach","remove","clear","preventDefault","store","Search","AddRecipientModal","_Modal","Stream","assignInitialRecipients","selectedRecipients","merge","recipientSearch","SearchState","isDismissible","recipientUsers","recipientGroups","title","helpText","content","component","state","Button","icon","hide","select","metaKey","ctrlKey","submit","onsubmit","save","relationships","DiscussionPage","stream","update","close","show","Modal","ByobuTagDiscussionModal","_TagDiscussionModal","tags","resolve","TagDiscussionModal","long","PrivateDiscussionComposer","_DiscussionComposer","_isByobuComposer","initAttrs","titlePlaceholder","submitLabel","composer","fields","route","param","addDefaultRecipients","users","groups","chooseRecipients","headerItems","count","recipientCountLabel","getBy","createRecord","discussionList","refresh","set","loaded","DiscussionComposer","canStartPrivateDiscussion","blocksPd","_typeof","iterator","_defineProperties","props","descriptor","configurable","writable","arg","input","prim","toPrimitive","res","hint","TypeError","String","PrivateComposing","Constructor","protoProps","action","Promise","reject","load","LogInModal","itemClassName","disabled","canStartDiscussion","PrivateDiscussionNotification","_Notification","notification","subject","fromUser","excerpt","Notification","PrivateDiscussionReplyNotification","postNumber","PrivateDiscussionUserLeftNotification","PrivateDiscussionAddedNotification","PrivateDiscussionMadePublicNotification","modals","PrivateDiscussionList","_DiscussionList","DiscussionList","discussions","MadePublic","_EventPost","descriptionKey","EventPost","RecipientLeft","RecipientsModified","diff","diff1","diff2","item","post","usersAdded","usersRemoved","groupsAdded","groupsRemoved","added","removed","oldRecipients","newRecipients","localeBase","descriptionData","events","helpers","PrivateDiscussionListState","_DiscussionListState","DiscussionListState","PrivateDiscussionsUserPage","_UserPage","changeSort","list","slug","sort","handleChangeSort","loadUser","listItems","actionItems","viewItems","composing","sortMap","sortOptions","Dropdown","buttonClassName","UserPage","Extend","IndexPage","Discussion","hasMany","extend","badges","Badge","attributes","DiscussionListItem","DiscussionHero","params","include","DiscussionControls","canEditRecipients","isEmpty","errorHandler","err","status","console","error","back","isPrivateDiscussion","canMakePublic","confirm","extensions","public","matches","SettingsPage","Switch","onchange","blocksPdLoading","UserControls","displayName","compose","setContent","byobuPrivateDiscussionCreated","byobuPrivateDiscussionReplied","PrivateDiscussionRepliedNotification","byobuRecipientRemoved","byobuPrivateDiscussionAdded","byobuPrivateDiscussionMadePubic","NotificationGrid"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,oHCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,iBCAlD,EAA+BF,OAAOC,KAAKC,OAAO,iC,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,4B,aCKxD,MCLM,EAA+BF,OAAOC,KAAKC,OAAO,2B,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,4B,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,sB,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,uB,aCAxD,MAAM,E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of/byobu/webpack/bootstrap","webpack://@fof/byobu/webpack/runtime/compat get default export","webpack://@fof/byobu/webpack/runtime/define property getters","webpack://@fof/byobu/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/byobu/webpack/runtime/make namespace object","webpack://@fof/byobu/external root \"flarum.core.compat['forum/app']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/extend']\"","webpack://@fof/byobu/external root \"flarum.core.compat['forum/components/SettingsPage']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/components/Switch']\"","webpack://@fof/byobu/./src/forum/extenders/SettingsPage.js","webpack://@fof/byobu/external root \"flarum.core.compat['common/components/Badge']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/models/Discussion']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/models/User']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/models/Group']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/byobu/external root \"flarum.core.compat['forum/components/DiscussionListItem']\"","webpack://@fof/byobu/external root \"flarum.core.compat['forum/components/DiscussionHero']\"","webpack://@fof/byobu/external root \"flarum.core.compat['forum/states/DiscussionListState']\"","webpack://@fof/byobu/./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","webpack://@fof/byobu/external root \"flarum.core.compat['common/utils/classList']\"","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 root \"flarum.core.compat['common/helpers/username']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/components/LinkButton']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/byobu/./src/forum/pages/labels/RecipientLabel.tsx","webpack://@fof/byobu/./src/forum/pages/labels/recipientsLabels.tsx","webpack://@fof/byobu/external root \"flarum.core.compat['forum/utils/DiscussionControls']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@fof/byobu/external root \"flarum.core.compat['forum/components/DiscussionPage']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@fof/byobu/external root \"flarum.core.compat['forum/states/SearchState']\"","webpack://@fof/byobu/external root \"flarum.core.compat['forum/components/Search']\"","webpack://@fof/byobu/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@fof/byobu/external root \"flarum.core.compat['common/helpers/highlight']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/helpers/avatar']\"","webpack://@fof/byobu/./src/forum/search/sources/UserSearchSource.js","webpack://@fof/byobu/./src/forum/search/sources/GroupSearchSource.js","webpack://@fof/byobu/external root \"flarum.core.compat['common/utils/extractText']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/components/Tooltip']\"","webpack://@fof/byobu/./src/forum/search/RecipientSearch.js","webpack://@fof/byobu/./src/forum/modals/AddRecipientModal.js","webpack://@fof/byobu/external root \"flarum.core.compat['tags/components/TagDiscussionModal']\"","webpack://@fof/byobu/./src/forum/modals/ByobuTagDiscussionModal.js","webpack://@fof/byobu/external root \"flarum.core.compat['components/DiscussionPage']\"","webpack://@fof/byobu/./src/forum/extenders/Discussion.js","webpack://@fof/byobu/external root \"flarum.core.compat['forum/utils/UserControls']\"","webpack://@fof/byobu/external root \"flarum.core.compat['forum/components/DiscussionComposer']\"","webpack://@fof/byobu/./src/forum/pages/discussions/PrivateDiscussionComposer.js","webpack://@fof/byobu/./src/forum/pages/labels/recipientCountLabel.js","webpack://@fof/byobu/external root \"flarum.core.compat['forum/components/UserPage']\"","webpack://@fof/byobu/./src/forum/helpers/canStartPrivateDiscussion.ts","webpack://@fof/byobu/./src/forum/extenders/User.js","webpack://@fof/byobu/external root \"flarum.core.compat['forum/components/IndexPage']\"","webpack://@fof/byobu/./node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@fof/byobu/./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@fof/byobu/./node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@fof/byobu/./node_modules/@babel/runtime/helpers/esm/createClass.js","webpack://@fof/byobu/external root \"flarum.core.compat['forum/components/LogInModal']\"","webpack://@fof/byobu/./src/forum/pages/PrivateComposing.js","webpack://@fof/byobu/./src/forum/pages/PrivateDiscussionsPage.js","webpack://@fof/byobu/external root \"flarum.core.compat['forum/components/NotificationGrid']\"","webpack://@fof/byobu/external root \"flarum.core.compat['forum/components/Notification']\"","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/external root \"flarum.core.compat['components/Notification']\"","webpack://@fof/byobu/./src/forum/notifications/PrivateDiscussionMadePublicNotification.js","webpack://@fof/byobu/./src/forum/modals/index.js","webpack://@fof/byobu/external root \"flarum.core.compat['forum/components/DiscussionList']\"","webpack://@fof/byobu/./src/forum/pages/discussions/PrivateDiscussionList.js","webpack://@fof/byobu/./src/forum/pages/discussions/index.js","webpack://@fof/byobu/external root \"flarum.core.compat['forum/components/EventPost']\"","webpack://@fof/byobu/./src/forum/events/MadePublic.ts","webpack://@fof/byobu/./src/forum/events/RecipientLeft.ts","webpack://@fof/byobu/./src/forum/events/RecipientsModified.js","webpack://@fof/byobu/./src/forum/events/index.ts","webpack://@fof/byobu/./src/forum/helpers/index.ts","webpack://@fof/byobu/external root \"flarum.core.compat['common/extenders']\"","webpack://@fof/byobu/./src/forum/states/PrivateDiscussionListState.js","webpack://@fof/byobu/external root \"flarum.core.compat['common/components/Dropdown']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/helpers/listItems']\"","webpack://@fof/byobu/./src/forum/pages/PrivateDiscussionsUserPage.js","webpack://@fof/byobu/./src/common/extend.ts","webpack://@fof/byobu/external root \"flarum.core.compat['common/components/Page']\"","webpack://@fof/byobu/./src/forum/components/PrivateComposerPage.tsx","webpack://@fof/byobu/./src/forum/extend.ts","webpack://@fof/byobu/./src/forum/index.ts","webpack://@fof/byobu/./src/forum/notifications/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/SettingsPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","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","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Badge'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Discussion'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Group'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionListItem'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionHero'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/states/DiscussionListState'];","function _objectWithoutPropertiesLoose(r, e) {\n if (null == r) return {};\n var t = {};\n for (var n in r) if ({}.hasOwnProperty.call(r, n)) {\n if (e.includes(n)) continue;\n t[n] = r[n];\n }\n return t;\n}\nexport { _objectWithoutPropertiesLoose as default };","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/classList'];","function _setPrototypeOf(t, e) {\n return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {\n return t.__proto__ = e, t;\n }, _setPrototypeOf(t, e);\n}\nexport { _setPrototypeOf as default };","import setPrototypeOf from \"./setPrototypeOf.js\";\nfunction _inheritsLoose(t, o) {\n t.prototype = Object.create(o.prototype), t.prototype.constructor = t, setPrototypeOf(t, o);\n}\nexport { _inheritsLoose as default };","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/username'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","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';\nimport { NestedStringArray } from '@askvortsov/rich-icu-message-formatter';\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 | NestedStringArray;\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","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/DiscussionControls'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/states/SearchState'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/Search'];","function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/highlight'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/avatar'];","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","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extractText'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","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.searchState.getValue() === 'undefined') {\n this.searchState.setValue('');\n }\n\n const loading = this.searchState.getValue() && this.searchState.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.searchState.getValue()}\n oninput={(e) => this.searchState.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.searchState.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 // If the user is only allowed to add another recipient apart themselves\n // We will remove all other users from the selection when a new value is picked\n if (type === 'users' && !app.forum.attribute('canAddMoreThanTwoUserRecipients')) {\n this.attrs\n .selected()\n .toArray()\n .forEach((recipient) => {\n if (recipient instanceof User && recipient.id() !== app.session.user?.id()) {\n this.attrs.selected().remove('users:' + recipient.id());\n }\n });\n }\n\n this.attrs.selected().add(value, recipient);\n\n this.searchState.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","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['tags/components/TagDiscussionModal'];","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","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/DiscussionPage'];","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\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 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: () =>\n app.modal.show(AddRecipientModal, {\n discussion,\n /**\n * @param {ItemList} recipients\n */\n onsubmit(recipients) {\n if (recipients.isEmpty()) {\n // The discussion might have been perma-deleted! Let's check...\n app.store\n .find(\n 'discussions',\n discussion.id(),\n {},\n {\n errorHandler(err) {\n if (err.status === 404) {\n // Almost certainly permadeleted, so let's just redirect to the PD list.\n m.route.set(app.route('byobuPrivate'));\n }\n },\n }\n )\n .catch((err) => {\n // some other error... assume not deleted\n console.error(err);\n });\n }\n },\n }),\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","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/UserControls'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionComposer'];","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 const items = super.headerItems();\n\n items.remove('tags');\n items.remove('polls');\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', 'slug', 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","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/UserPage'];","import app from 'flarum/forum/app';\nimport type User from 'flarum/common/models/User';\n\nexport default function canStartPrivateDiscussion(recipient: User) {\n return (\n app.session.user &&\n app.session.user.id() !== recipient.id() &&\n app.forum.attribute('canStartPrivateDiscussion') &&\n (!recipient.blocksPd() || app.forum.attribute('canStartPrivateDiscussionWithBlockers'))\n );\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\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';\nimport canStartPrivateDiscussion from '../helpers/canStartPrivateDiscussion';\n\nexport default () => {\n message();\n sharedMessageHistory();\n};\n\nfunction message() {\n extend(UserControls, 'userControls', function (items, user) {\n if (canStartPrivateDiscussion(user)) {\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.displayName() })\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","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/IndexPage'];","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperties(e, r) {\n for (var t = 0; t < r.length; t++) {\n var o = r[t];\n o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);\n }\n}\nfunction _createClass(e, r, t) {\n return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", {\n writable: !1\n }), e;\n}\nexport { _createClass as default };","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/LogInModal'];","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 { 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.setContent('newDiscussion', compose.component());\n }\n });\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/NotificationGrid'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/Notification'];","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 excerpt() {\n return null;\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 excerpt() {\n return null;\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 excerpt() {\n return null;\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 excerpt() {\n return null;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/Notification'];","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 excerpt() {\n return null;\n }\n}\n","import AddRecipientModal from './AddRecipientModal';\n\nexport const modals = {\n AddRecipientModal: AddRecipientModal,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionList'];","import DiscussionList from 'flarum/forum/components/DiscussionList';\n\nexport default class PrivateDiscussionList extends DiscussionList {}\n","import PrivateDiscussionComposer from './PrivateDiscussionComposer';\nimport PrivateDiscussionList from './PrivateDiscussionList';\n\nexport const discussions = {\n PrivateDiscussionComposer: PrivateDiscussionComposer,\n PrivateDiscussionList: PrivateDiscussionList,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/EventPost'];","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: 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.removed_self';\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 MadePublic from './MadePublic';\nimport RecipientLeft from './RecipientLeft';\nimport RecipientsModified from './RecipientsModified';\n\nexport const events = [MadePublic, RecipientLeft, RecipientsModified];\n","import canStartPrivateDiscussion from './canStartPrivateDiscussion';\n\nexport const helpers = [canStartPrivateDiscussion];\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extenders'];","import DiscussionListState from 'flarum/forum/states/DiscussionListState';\n\nexport default class PrivateDiscussionListState extends DiscussionListState {}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Dropdown'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/listItems'];","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';\nimport canStartPrivateDiscussion from '../helpers/canStartPrivateDiscussion';\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 (canStartPrivateDiscussion(this.user)) {\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 Extend from 'flarum/common/extenders';\n\nexport default [];\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Page'];","import app from 'flarum/forum/app';\nimport Page from 'flarum/common/components/Page';\nimport type Mithril from 'mithril';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport PrivateDiscussionComposer from '../pages/discussions/PrivateDiscussionComposer';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Group from 'flarum/common/models/Group';\nimport User from 'flarum/common/models/User';\n\nexport default class PrivateComposerPage extends Page {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.configComposer();\n }\n\n configComposer() {\n if (!app.session.user) {\n setTimeout(() => app.modal.show(LogInModal), 500);\n return m.route.set('/');\n }\n\n const params = m.route.param();\n const recipients = new ItemList();\n\n recipients.add(`users:${app.session.user.id()}`, app.session.user);\n\n m.route.set(app.route('byobuPrivate'));\n\n setTimeout(() => {\n const composerProps = {\n user: app.session.user,\n recipients: recipients,\n originalContent: null,\n };\n\n if (params.content) {\n composerProps.originalContent = params.content;\n }\n\n if (params.recipientUsers) {\n params.recipientUsers.split(',').forEach((u: string) => {\n const su = app.store.getById('users', u);\n if (!su) return;\n recipients.add(`users:${u}`, su);\n });\n }\n\n if (params.recipientGroups) {\n params.recipientGroups.split(',').forEach((g: string) => {\n const sg = app.store.getById('groups', g);\n if (!sg) return;\n recipients.add(`groups:${g}`, sg);\n });\n }\n\n app.composer.load(PrivateDiscussionComposer, composerProps);\n\n app.composer.show();\n\n if (params.title) {\n // @ts-expect-error\n app.composer.fields?.title(params.title);\n }\n }, 0);\n }\n\n view() {\n return
    ;\n }\n}\n","import Extend from 'flarum/common/extenders';\nimport Discussion from 'flarum/common/models/Discussion';\nimport Group from 'flarum/common/models/Group';\nimport User from 'flarum/common/models/User';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport MadePublic from './events/MadePublic';\nimport RecipientLeft from './events/RecipientLeft';\nimport RecipientsModified from './events/RecipientsModified';\nimport PrivateDiscussionsUserPage from './pages/PrivateDiscussionsUserPage';\nimport commonExtend from '../common/extend';\nimport PrivateComposerPage from './components/PrivateComposerPage';\n\nexport default [\n ...commonExtend,\n new Extend.PostTypes() //\n .add('recipientsModified', RecipientsModified)\n .add('recipientLeft', RecipientLeft)\n .add('madePublic', MadePublic),\n\n new Extend.Routes() //\n .add('byobuUserPrivate', '/u/:username/private', PrivateDiscussionsUserPage)\n .add('byobuPrivate', '/private', IndexPage)\n .add('byobuComposer', '/private/composer', PrivateComposerPage),\n\n new Extend.Model(Discussion)\n .hasMany('recipientUsers')\n .hasMany('oldRecipientUsers')\n .hasMany('recipientGroups')\n .hasMany('oldRecipientGroups')\n .attribute('canEditRecipients')\n .attribute('canEditUserRecipients')\n .attribute('canEditGroupRecipients')\n .attribute('canMakePublic')\n .attribute('isPrivateDiscussion'),\n\n new Extend.Model(User) //\n .attribute('blocksPd')\n .attribute('unreadPrivateMessagesCount'),\n];\n","import app from 'flarum/forum/app';\nimport extenders from './extenders';\nimport pages from './pages';\nimport notifications from './notifications';\n\nexport * from './modals';\nexport * from './pages/discussions';\nexport * from './events';\nexport * from './helpers';\n\nexport { default as extend } from './extend';\n\napp.initializers.add('fof-byobu', function () {\n extenders();\n\n pages();\n notifications();\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"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_objectWithoutPropertiesLoose","r","e","t","n","includes","_setPrototypeOf","setPrototypeOf","bind","__proto__","_inheritsLoose","create","constructor","RecipientLabel","_Component","apply","arguments","view","vnode","label","_this$attrs","this","attrs","recipient","link","newAttrs","_excluded","style","className","classList","User","href","app","user","_app$session","username","id","Group","m","class","namePlural","trans","LinkButton","Component","recipientsLabel","recipients","_attrs","otherAttrs","map","index","type","_extends","assign","length","UserSearchSource","_proto","query","_this","loading","byobuResults","name","children","highlight","text","avatar","undefined","find","filter","q","page","limit","then","pushResults","results","_this2","payload","data","result","getById","push","redraw","GroupSearchSource","search","toLowerCase","all","group","substr","groupName","RecipientSearch","_Search","_len","args","Array","_key","concat","inputUuid","oninit","Math","random","toString","substring","oncreate","$search","$","on","target","addRecipient","focus","parentNode","clearTimeout","typingTimer","doSearch","setTimeout","_this3","searchState","getValue","setValue","sources","sourceItems","toArray","role","selected","Tooltip","onclick","removeRecipient","for","open","focused","active","loadingSources","dom","placeholder","extractText","oninput","onfocus","hasFocus","onblur","in","source","LoadingIndicator","size","items","ItemList","discussion","attribute","canEditUserRecipients","add","canEditGroupRecipients","_this4","values","split","findRecipient","forEach","_app$session$user","remove","clear","preventDefault","store","Search","AddRecipientModal","_Modal","Stream","assignInitialRecipients","selectedRecipients","merge","recipientSearch","SearchState","isDismissible","recipientUsers","recipientGroups","title","helpText","content","component","state","Button","icon","hide","select","metaKey","ctrlKey","indexOf","submit","onsubmit","save","relationships","DiscussionPage","stream","update","close","show","Modal","ByobuTagDiscussionModal","_TagDiscussionModal","tags","resolve","TagDiscussionModal","long","PrivateDiscussionComposer","_DiscussionComposer","_isByobuComposer","initAttrs","titlePlaceholder","submitLabel","composer","fields","route","param","addDefaultRecipients","users","groups","chooseRecipients","headerItems","count","recipientCountLabel","getBy","createRecord","discussionList","refresh","set","loaded","DiscussionComposer","canStartPrivateDiscussion","blocksPd","_typeof","iterator","toPropertyKey","i","toPrimitive","TypeError","String","_defineProperties","configurable","writable","PrivateComposing","action","Promise","reject","load","LogInModal","itemClassName","disabled","canStartDiscussion","PrivateDiscussionNotification","_Notification","notification","subject","fromUser","excerpt","Notification","PrivateDiscussionReplyNotification","postNumber","PrivateDiscussionUserLeftNotification","PrivateDiscussionAddedNotification","PrivateDiscussionMadePublicNotification","props","modals","PrivateDiscussionList","_DiscussionList","DiscussionList","discussions","MadePublic","_EventPost","descriptionKey","EventPost","RecipientLeft","RecipientsModified","diff","diff1","diff2","item","post","usersAdded","usersRemoved","groupsAdded","groupsRemoved","added","removed","oldRecipients","newRecipients","localeBase","descriptionData","events","helpers","PrivateDiscussionListState","_DiscussionListState","DiscussionListState","PrivateDiscussionsUserPage","_UserPage","changeSort","list","slug","sort","handleChangeSort","loadUser","listItems","actionItems","viewItems","composing","sortMap","sortOptions","Dropdown","buttonClassName","keys","UserPage","PrivateComposerPage","_Page","configComposer","params","_app$composer$fields","composerProps","originalContent","u","su","g","sg","Page","Extend","IndexPage","Discussion","hasMany","extend","badges","Badge","attributes","DiscussionListItem","DiscussionHero","include","DiscussionControls","canEditRecipients","isEmpty","errorHandler","err","status","console","error","back","isPrivateDiscussion","canMakePublic","confirm","extensions","public","matches","SettingsPage","Switch","onchange","blocksPdLoading","UserControls","displayName","compose","setContent","byobuPrivateDiscussionCreated","byobuPrivateDiscussionReplied","PrivateDiscussionRepliedNotification","byobuRecipientRemoved","byobuPrivateDiscussionAdded","byobuPrivateDiscussionMadePubic","NotificationGrid"],"sourceRoot":""} \ No newline at end of file