diff --git a/js/dist/admin.js b/js/dist/admin.js index 311c3d1..94b1fa5 100644 --- a/js/dist/admin.js +++ b/js/dist/admin.js @@ -1,2 +1,146 @@ -module.exports=function(e){var r={};function t(n){if(r[n])return r[n].exports;var s=r[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,t),s.l=!0,s.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var s in e)t.d(n,s,function(r){return e[r]}.bind(null,s));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=24)}({1:function(e,r){e.exports=flarum.core.compat["admin/app"]},24:function(e,r,t){"use strict";t.r(r);var n=t(1),s=t.n(n);s.a.initializers.add("fof/merge-discussions",(function(){s.a.extensionData.for("fof-merge-discussions").registerPermission({icon:"fas fa-code-branch fa-flip-vertical",label:s.a.translator.trans("fof-merge-discussions.admin.permissions.merge_discussions_label"),permission:"discussion.merge"},"moderate").registerSetting({label:s.a.translator.trans("fof-merge-discussions.admin.settings.search_result_label"),type:"number",setting:"fof-merge-discussions.search_limit",placeholder:"4",help:s.a.translator.trans("fof-merge-discussions.admin.settings.search_result_help"),min:1,max:99})}))}}); +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./admin.js"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./admin.js": +/*!******************!*\ + !*** ./admin.js ***! + \******************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _src_admin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./src/admin */ "./src/admin/index.js"); +/* empty/unused harmony star reexport */ + +/***/ }), + +/***/ "./src/admin/index.js": +/*!****************************!*\ + !*** ./src/admin/index.js ***! + \****************************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var flarum_admin_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! flarum/admin/app */ "flarum/admin/app"); +/* harmony import */ var flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(flarum_admin_app__WEBPACK_IMPORTED_MODULE_0__); + +flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default.a.initializers.add('fof/merge-discussions', function () { + flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default.a.extensionData["for"]('fof-merge-discussions').registerPermission({ + icon: 'fas fa-code-branch fa-flip-vertical', + label: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default.a.translator.trans('fof-merge-discussions.admin.permissions.merge_discussions_label'), + permission: 'discussion.merge' + }, 'moderate').registerSetting({ + label: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default.a.translator.trans('fof-merge-discussions.admin.settings.search_result_label'), + type: 'number', + setting: 'fof-merge-discussions.search_limit', + placeholder: '4', + help: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default.a.translator.trans('fof-merge-discussions.admin.settings.search_result_help'), + min: 1, + max: 99 + }); +}); + +/***/ }), + +/***/ "flarum/admin/app": +/*!**************************************************!*\ + !*** external "flarum.core.compat['admin/app']" ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['admin/app']; + +/***/ }) + +/******/ }); //# sourceMappingURL=admin.js.map \ No newline at end of file diff --git a/js/dist/admin.js.map b/js/dist/admin.js.map index c950884..b544f10 100644 --- a/js/dist/admin.js.map +++ b/js/dist/admin.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://@fof/merge-discussions/webpack/bootstrap","webpack://@fof/merge-discussions/external \"flarum.core.compat['admin/app']\"","webpack://@fof/merge-discussions/./src/admin/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","app","initializers","add","extensionData","registerPermission","icon","label","translator","trans","permission","registerSetting","type","setting","placeholder","help","min","max"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG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AAIO,WAAWC,MAAM,4DAC5BG,KAAM,SACNC,QAAS,qCACTC,YAAa,IACbC,KAAMd,IAAIO,WAAWC,MAAM,2DAC3BO,IAAK,EACLC,IAAK","file":"admin.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 24);\n","module.exports = flarum.core.compat['admin/app'];","import app from 'flarum/admin/app';\n\napp.initializers.add('fof/merge-discussions', () => {\n app.extensionData\n .for('fof-merge-discussions')\n .registerPermission(\n {\n icon: 'fas fa-code-branch fa-flip-vertical',\n label: app.translator.trans('fof-merge-discussions.admin.permissions.merge_discussions_label'),\n permission: 'discussion.merge',\n },\n 'moderate'\n )\n .registerSetting({\n label: app.translator.trans('fof-merge-discussions.admin.settings.search_result_label'),\n type: 'number',\n setting: 'fof-merge-discussions.search_limit',\n placeholder: '4',\n help: app.translator.trans('fof-merge-discussions.admin.settings.search_result_help'),\n min: 1,\n max: 99,\n });\n});\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://@fof/merge-discussions/webpack/bootstrap","webpack://@fof/merge-discussions/./admin.js","webpack://@fof/merge-discussions/./src/admin/index.js","webpack://@fof/merge-discussions/external \"flarum.core.compat['admin/app']\""],"names":["app","initializers","add","extensionData","registerPermission","icon","label","translator","trans","permission","registerSetting","type","setting","placeholder","help","min","max"],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;AClFA;AAAA;AAAA,wC;;;;;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAEAA,uDAAG,CAACC,YAAJ,CAAiBC,GAAjB,CAAqB,uBAArB,EAA8C,YAAM;AAClDF,yDAAG,CAACG,aAAJ,QACO,uBADP,EAEGC,kBAFH,CAGI;AACEC,QAAI,EAAE,qCADR;AAEEC,SAAK,EAAEN,uDAAG,CAACO,UAAJ,CAAeC,KAAf,CAAqB,iEAArB,CAFT;AAGEC,cAAU,EAAE;AAHd,GAHJ,EAQI,UARJ,EAUGC,eAVH,CAUmB;AACfJ,SAAK,EAAEN,uDAAG,CAACO,UAAJ,CAAeC,KAAf,CAAqB,0DAArB,CADQ;AAEfG,QAAI,EAAE,QAFS;AAGfC,WAAO,EAAE,oCAHM;AAIfC,eAAW,EAAE,GAJE;AAKfC,QAAI,EAAEd,uDAAG,CAACO,UAAJ,CAAeC,KAAf,CAAqB,yDAArB,CALS;AAMfO,OAAG,EAAE,CANU;AAOfC,OAAG,EAAE;AAPU,GAVnB;AAmBD,CApBD,E;;;;;;;;;;;ACFA,iD","file":"admin.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./admin.js\");\n","export * from './src/admin';\n","import app from 'flarum/admin/app';\n\napp.initializers.add('fof/merge-discussions', () => {\n app.extensionData\n .for('fof-merge-discussions')\n .registerPermission(\n {\n icon: 'fas fa-code-branch fa-flip-vertical',\n label: app.translator.trans('fof-merge-discussions.admin.permissions.merge_discussions_label'),\n permission: 'discussion.merge',\n },\n 'moderate'\n )\n .registerSetting({\n label: app.translator.trans('fof-merge-discussions.admin.settings.search_result_label'),\n type: 'number',\n setting: 'fof-merge-discussions.search_limit',\n placeholder: '4',\n help: app.translator.trans('fof-merge-discussions.admin.settings.search_result_help'),\n min: 1,\n max: 99,\n });\n});\n","module.exports = flarum.core.compat['admin/app'];"],"sourceRoot":""} \ No newline at end of file diff --git a/js/dist/forum.js b/js/dist/forum.js index 9b98c3c..4ce1a10 100644 --- a/js/dist/forum.js +++ b/js/dist/forum.js @@ -1,2 +1,1869 @@ -module.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=23)}([function(t,e){t.exports=flarum.core.compat["forum/app"]},,function(t,e){t.exports=flarum.core.compat["common/components/Button"]},function(t,e){t.exports=flarum.core.compat["common/extend"]},function(t,e,r){t.exports=r(22)},function(t,e){t.exports=flarum.core.compat["common/helpers/highlight"]},function(t,e){t.exports=flarum.core.compat["common/Model"]},function(t,e){t.exports=flarum.core.compat["forum/utils/DiscussionControls"]},function(t,e){t.exports=flarum.core.compat["forum/components/DiscussionPage"]},function(t,e){t.exports=flarum.core.compat["forum/components/IndexPage"]},function(t,e){t.exports=flarum.core.compat["common/components/Modal"]},function(t,e){t.exports=flarum.core.compat["forum/components/PostStream"]},function(t,e){t.exports=flarum.core.compat["forum/states/PostStreamState"]},function(t,e){t.exports=flarum.core.compat["forum/states/GlobalSearchState"]},function(t,e){t.exports=flarum.core.compat["common/utils/Stream"]},function(t,e){t.exports=flarum.core.compat["common/utils/classList"]},function(t,e){t.exports=flarum.core.compat["forum/components/Search"]},function(t,e){t.exports=flarum.core.compat["common/utils/ItemList"]},function(t,e){t.exports=flarum.core.compat["forum/components/EventPost"]},function(t,e){t.exports=flarum.core.compat["common/helpers/punctuateSeries"]},function(t,e){t.exports=flarum.core.compat["forum/components/Notification"]},function(t,e){t.exports=flarum.core.compat["forum/components/NotificationGrid"]},function(t,e,r){var n=function(t){"use strict";var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",s=n.toStringTag||"@@toStringTag";function a(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof l?e:l,i=Object.create(o.prototype),s=new N(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var s=r.delegate;if(s){var a=w(s,r);if(a){if(a===f)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(t,r,s),i}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function l(){}function m(){}function h(){}var p={};a(p,o,(function(){return this}));var d=Object.getPrototypeOf,g=d&&d(d(L([])));g&&g!==e&&r.call(g,o)&&(p=g);var v=h.prototype=l.prototype=Object.create(p);function y(t){["next","throw","return"].forEach((function(e){a(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){var n;this._invoke=function(o,i){function s(){return new e((function(n,s){!function n(o,i,s,a){var c=u(t[o],t,i);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,s,a)}),(function(t){n("throw",t,s,a)})):e.resolve(l).then((function(t){f.value=t,s(f)}),(function(t){return n("throw",t,s,a)}))}a(c.arg)}(o,i,n,s)}))}return n=n?n.then(s,s):s()}}function w(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function L(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var a=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(a&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),_(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;_(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:L(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}(t.exports);try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},function(t,e,r){"use strict";r.r(e),r.d(e,"components",(function(){return tt}));var n=r(0),o=r.n(n),i=r(3),s=r(6),a=r.n(s),c=r(2),u=r.n(c),f=r(7),l=r.n(f);function h(t,e,r,n,o,i,s){try{var a=t[i](s),c=a.value}catch(t){return void r(t)}a.done?e(c):Promise.resolve(c).then(n,o)}function p(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function s(t){h(i,n,o,s,a,"next",t)}function a(t){h(i,n,o,s,a,"throw",t)}s(void 0)}))}}function d(t,e){return(d=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function g(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,d(t,e)}var v=r(4),y=r.n(v),b=r(8),w=r.n(b),x=r(9),_=r.n(x),N=r(10),L=r.n(N),S=r(11),P=r.n(S),E=r(12),O=r.n(E),j=r(13),M=r.n(j),k=r(14),D=r.n(k),F=r(15),T=r.n(F),G=r(16),R=r.n(G),B=r(17),C=r.n(B),I=r(5),q=r.n(I),A=function(){function t(t,e){this.results=new Map,this.onSelect=t,this.ignore=e}var e=t.prototype;return e.search=function(t){var e=this;t=t.toLowerCase();var r=o.a.forum.attribute("fof-merge-discussions.search_limit")||4;this.results.set(t,[]);var n={filter:{q:t},page:{limit:r}},i=Number(t);return Number.isNaN(i)||i===this.ignore?o.a.store.find("discussions",n).then((function(r){e.results.set(t,r.filter((function(t){return t.id()!==e.ignore})))})):o.a.store.find("discussions",i).then((function(r){e.results.set(t,[r])})).catch((function(){return[]}))},e.view=function(t){var e=this;return t=t.toLowerCase(),[(this.results.get(t)||[]).map((function(r){return m("li",{className:"DiscussionSearchResult","data-index":"discussions"+r.id()},m("a",{onclick:function(){return e.onSelect(r)}},m("div",{className:"DiscussionSearchResult-title"},m("i",null,q()(r.id(),t))," ~ ",q()(r.title(),t))))}))]},t}(),U=function(t){function e(){return t.apply(this,arguments)||this}g(e,t);var r=e.prototype;return r.view=function(){this.hasFocus=!0;var e=t.prototype.view.call(this);return e.attrs.className="MergeDiscussions-Search "+(this.state.getValue()&&"open")+" "+e.attrs.className.replace(/(focused|open)/g,""),e},r.sourceItems=function(){var t=new C.a;return t.add("discussions",new A(this.attrs.onSelect,this.attrs.ignore)),t},e}(R.a),H=function(t){function e(){return t.apply(this,arguments)||this}g(e,t);var r=e.prototype;return r.oninit=function(e){t.prototype.oninit.call(this,e),this.discussion=this.attrs.discussion,this.type=D()("target"),this.merging=[],this.attrs.preselect&&this.merging.push(this.attrs.preselect),this.results=[],this.preview=null,this.loadingPreview=!1,this.search=new M.a},r.title=function(){return o.a.translator.trans("fof-merge-discussions.forum.modal.title")},r.className=function(){return"FoFMergeDiscussionsModal Modal--large"},r.content=function(){var t=this;return m("div",{className:"Modal-body"},m("div",{className:"Form"},m("div",{className:"Form-group"},["target","from"].map((function(e){return m("div",null,m("input",{type:"radio",id:"type_"+e,checked:t.type()===e,onclick:t.changeType.bind(t,e)})," ",m("label",{htmlFor:"type_"+e},o.a.translator.trans("fof-merge-discussions.forum.modal.type_"+e+"_label")))}))),m("p",{className:"help"},o.a.translator.trans("fof-merge-discussions.forum.modal.type_"+this.type()+"_help_text",{title:this.discussion.title()})),m("div",{className:T()("FormGroup",this.disabled()&&"hidden")},m(U,{state:this.search,onSelect:this.select.bind(this),ignore:this.discussion.id()})),m("div",{className:"Form-group MergeDiscussions-Discussions"},m("ul",null,this.merging.map((function(e){return m("li",null,m("i",{className:"fas fa-trash DeleteEntry-Button",onclick:function(){return t.remove(e)}})," ",m("a",{href:o.a.forum.attribute("baseUrl")+"/d/"+e.id(),target:"_blank"},m("i",null,e.id())," ~ ",e.title()))})))),m("div",{className:"Form-group MergeDiscussions-Preview"},m(u.a,{className:"Button Button--danger",onclick:this.loadPreview.bind(this),loading:this.loadingPreview,disabled:!this.discussion||!this.merging.length},o.a.translator.trans("fof-merge-discussions.forum.modal.load_preview_button")),this.preview&&m("div",{className:"MergeDiscussions-PostStream"},m("div",{className:"Hero"},m("h2",null,"target"===this.type()?this.discussion.title():this.merging[0].title())),m(P.a,{stream:this.preview,discussion:this.preview.discussion,onPositionChange:function(){}}))),m("div",{className:"Form-group"},m(u.a,{className:"Button Button--primary Button--block",type:"submit",onclick:this.submit.bind(this),loading:this.loading,disabled:!this.discussion||!this.merging.length},o.a.translator.trans("fof-merge-discussions.forum.modal.submit_button")))))},r.disabled=function(){return"from"===this.type()&&0!==this.merging.length},r.select=function(t){t&&t.id()===this.discussion.id()||this.merging.includes(t)||this.disabled()||(this.merging.push(t),delete this.preview)},r.remove=function(t){delete this.preview,this.merging.splice(this.merging.indexOf(this.merging.filter((function(e){return e.id()===t.id()}))[0]),1)},r.changeType=function(t){this.type(t),this.merging.length>1&&(this.merging=[])},r.loadPreview=function(){var t=this;return this.loadingPreview=!0,o.a.request(this.getRequestData("GET")).then((function(e){var r=1;e.included&&e.included.map(o.a.store.pushObject.bind(o.a.store)),e.data.relationships.posts.data.map((function(t){return o.a.store.getById("posts",t.id)})).sort((function(t,e){return t.createdAt()-e.createdAt()})).forEach((function(t,n){t.number(r++),e.data.relationships.posts.data[n]={type:"posts",id:t.id()}}));var n=o.a.store.createRecord(e.data.type,e.data);n.payload=e,t.loadingPreview=!1;var i=n.posts();t.preview=new O.a(n,i),m.redraw()})).catch((function(){return t.loadingPreview=!1}))},r.submit=function(t){var e=this;return t.preventDefault(),this.loading=!0,o.a.request(this.getRequestData()).then(p(y.a.mark((function t(){var r;return y.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r="target"===e.type()?e.discussion:e.merging[0],!o.a.current.matches(w.a)){t.next=12;break}if("target"!==e.type()){t.next=9;break}return t.next=5,o.a.store.find("discussions",r.id());case 5:return t.next=7,o.a.current.get("stream").update();case 7:t.next=10;break;case 9:m.route.set(o.a.route.discussion(r));case 10:t.next=15;break;case 12:if(!o.a.current.matches(_.a)){t.next=15;break}return t.next=15,o.a.store.find("discussions",r.id());case 15:"target"===e.type()?e.merging.forEach((function(t){return o.a.discussions.removeDiscussion(t)})):o.a.discussions.removeDiscussion(e.discussion),o.a.modal.close();case 17:case"end":return t.stop()}}),t)})))).catch(console.error).then(this.loaded.bind(this))},r.getRequestData=function(t){void 0===t&&(t="POST");var e="target"===this.type(),r=e?this.discussion.apiEndpoint():this.merging[0].apiEndpoint(),n=e?this.merging.map((function(t){return t.id()})):this.discussion.id();return{method:t,url:""+o.a.forum.attribute("apiUrl")+r+"/merge",params:{ids:n},body:{ids:n},errorHandler:this.onerror.bind(this)}},e}(L.a),Y=r(18),z=r.n(Y),K=r(19),V=r.n(K),J=function(t){function e(){return t.apply(this,arguments)||this}g(e,t);var r=e.prototype;return r.icon=function(){return"fas fa-code-branch fa-flip-vertical"},r.descriptionKey=function(){return"fof-merge-discussions.forum.post.merged"},r.descriptionData=function(){var t=this.attrs.post.content();return Array.isArray(t.titles)&&(t.titles=V()(t.titles).join("")),t},e}(z.a),Q=r(20),W=function(t){function e(){return t.apply(this,arguments)||this}g(e,t);var r=e.prototype;return r.icon=function(){return"fas fa-code-branch fa-flip-vertical"},r.href=function(){var t=this.attrs.notification.subject();return o.a.route.discussion(t)},r.content=function(){var t=this.attrs.notification,e=t.fromUser(),r=t.content().merged_title;return o.a.translator.trans("fof-merge-discussions.forum.notification.discussion_merged",{user:e,oldTitle:r})},e}(r.n(Q).a),X=r(21),Z=r.n(X),$=function(){o.a.notificationComponents.discussionMerged=W,Object(i.extend)(Z.a.prototype,"notificationTypes",(function(t){t.add("discussionMerged",{name:"discussionMerged",icon:"fas fa-code-branch fa-flip-vertical",label:o.a.translator.trans("fof-merge-discussions.forum.notification.preferences.discussion_merged")})}))},tt={DiscussionMergedNotification:W,DiscussionMergeModal:H,DiscussionMergePost:J,DiscussionSearch:U,DiscussionSearchSource:A};o.a.initializers.add("fof/merge-discussions",(function(){o.a.store.models.discussions.prototype.canMerge=a.a.attribute("canMerge"),o.a.postComponents.discussionMerged=J,Object(i.extend)(l.a,"moderationControls",(function(t,e){e.canMerge()&&t.add("fof-merge",u.a.component({icon:"fas fa-code-branch fa-flip-vertical",onclick:function(){return o.a.modal.show(H,{discussion:e})}},o.a.translator.trans("fof-merge-discussions.forum.discussion.merge")))})),$()}))}]); +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./forum.js"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./forum.js": +/*!******************!*\ + !*** ./forum.js ***! + \******************/ +/*! exports provided: components */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _src_forum__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./src/forum */ "./src/forum/index.js"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "components", function() { return _src_forum__WEBPACK_IMPORTED_MODULE_0__["components"]; }); + + + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js ***! + \*********************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _asyncToGenerator; }); +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { + try { + var info = gen[key](arg); + var value = info.value; + } catch (error) { + reject(error); + return; + } + + if (info.done) { + resolve(value); + } else { + Promise.resolve(value).then(_next, _throw); + } +} + +function _asyncToGenerator(fn) { + return function () { + var self = this, + args = arguments; + return new Promise(function (resolve, reject) { + var gen = fn.apply(self, args); + + function _next(value) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); + } + + function _throw(err) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); + } + + _next(undefined); + }); + }; +} + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js": +/*!******************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js ***! + \******************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _inheritsLoose; }); +/* harmony import */ var _setPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./setPrototypeOf.js */ "./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js"); + +function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + Object(_setPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(subClass, superClass); +} + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js ***! + \*******************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _setPrototypeOf; }); +function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + + return _setPrototypeOf(o, p); +} + +/***/ }), + +/***/ "./node_modules/@babel/runtime/regenerator/index.js": +/*!**********************************************************!*\ + !*** ./node_modules/@babel/runtime/regenerator/index.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(/*! regenerator-runtime */ "./node_modules/regenerator-runtime/runtime.js"); + +/***/ }), + +/***/ "./node_modules/regenerator-runtime/runtime.js": +/*!*****************************************************!*\ + !*** ./node_modules/regenerator-runtime/runtime.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * Copyright (c) 2014-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +var runtime = function (exports) { + "use strict"; + + var Op = Object.prototype; + var hasOwn = Op.hasOwnProperty; + var undefined; // More compressible than void 0. + + var $Symbol = typeof Symbol === "function" ? Symbol : {}; + var iteratorSymbol = $Symbol.iterator || "@@iterator"; + var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; + var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; + + function define(obj, key, value) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + return obj[key]; + } + + try { + // IE 8 has a broken Object.defineProperty that only works on DOM objects. + define({}, ""); + } catch (err) { + define = function define(obj, key, value) { + return obj[key] = value; + }; + } + + function wrap(innerFn, outerFn, self, tryLocsList) { + // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. + var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; + var generator = Object.create(protoGenerator.prototype); + var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next, + // .throw, and .return methods. + + generator._invoke = makeInvokeMethod(innerFn, self, context); + return generator; + } + + exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion + // record like context.tryEntries[i].completion. This interface could + // have been (and was previously) designed to take a closure to be + // invoked without arguments, but in all the cases we care about we + // already have an existing method we want to call, so there's no need + // to create a new function object. We can even get away with assuming + // the method takes exactly one argument, since that happens to be true + // in every case, so we don't have to touch the arguments object. The + // only additional allocation required is the completion record, which + // has a stable shape and so hopefully should be cheap to allocate. + + function tryCatch(fn, obj, arg) { + try { + return { + type: "normal", + arg: fn.call(obj, arg) + }; + } catch (err) { + return { + type: "throw", + arg: err + }; + } + } + + var GenStateSuspendedStart = "suspendedStart"; + var GenStateSuspendedYield = "suspendedYield"; + var GenStateExecuting = "executing"; + var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as + // breaking out of the dispatch switch statement. + + var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and + // .constructor.prototype properties for functions that return Generator + // objects. For full spec compliance, you may wish to configure your + // minifier not to mangle the names of these two functions. + + function Generator() {} + + function GeneratorFunction() {} + + function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that + // don't natively support it. + + + var IteratorPrototype = {}; + define(IteratorPrototype, iteratorSymbol, function () { + return this; + }); + var getProto = Object.getPrototypeOf; + var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); + + if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { + // This environment has a native %IteratorPrototype%; use it instead + // of the polyfill. + IteratorPrototype = NativeIteratorPrototype; + } + + var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); + GeneratorFunction.prototype = GeneratorFunctionPrototype; + define(Gp, "constructor", GeneratorFunctionPrototype); + define(GeneratorFunctionPrototype, "constructor", GeneratorFunction); + GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); // Helper for defining the .next, .throw, and .return methods of the + // Iterator interface in terms of a single ._invoke method. + + function defineIteratorMethods(prototype) { + ["next", "throw", "return"].forEach(function (method) { + define(prototype, method, function (arg) { + return this._invoke(method, arg); + }); + }); + } + + exports.isGeneratorFunction = function (genFun) { + var ctor = typeof genFun === "function" && genFun.constructor; + return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can + // do is to check its .name property. + (ctor.displayName || ctor.name) === "GeneratorFunction" : false; + }; + + exports.mark = function (genFun) { + if (Object.setPrototypeOf) { + Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); + } else { + genFun.__proto__ = GeneratorFunctionPrototype; + define(genFun, toStringTagSymbol, "GeneratorFunction"); + } + + genFun.prototype = Object.create(Gp); + return genFun; + }; // Within the body of any async function, `await x` is transformed to + // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test + // `hasOwn.call(value, "__await")` to determine if the yielded value is + // meant to be awaited. + + + exports.awrap = function (arg) { + return { + __await: arg + }; + }; + + function AsyncIterator(generator, PromiseImpl) { + function invoke(method, arg, resolve, reject) { + var record = tryCatch(generator[method], generator, arg); + + if (record.type === "throw") { + reject(record.arg); + } else { + var result = record.arg; + var value = result.value; + + if (value && typeof value === "object" && hasOwn.call(value, "__await")) { + return PromiseImpl.resolve(value.__await).then(function (value) { + invoke("next", value, resolve, reject); + }, function (err) { + invoke("throw", err, resolve, reject); + }); + } + + return PromiseImpl.resolve(value).then(function (unwrapped) { + // When a yielded Promise is resolved, its final value becomes + // the .value of the Promise<{value,done}> result for the + // current iteration. + result.value = unwrapped; + resolve(result); + }, function (error) { + // If a rejected Promise was yielded, throw the rejection back + // into the async generator function so it can be handled there. + return invoke("throw", error, resolve, reject); + }); + } + } + + var previousPromise; + + function enqueue(method, arg) { + function callInvokeWithMethodAndArg() { + return new PromiseImpl(function (resolve, reject) { + invoke(method, arg, resolve, reject); + }); + } + + return previousPromise = // If enqueue has been called before, then we want to wait until + // all previous Promises have been resolved before calling invoke, + // so that results are always delivered in the correct order. If + // enqueue has not been called before, then it is important to + // call invoke immediately, without waiting on a callback to fire, + // so that the async generator function has the opportunity to do + // any necessary setup in a predictable way. This predictability + // is why the Promise constructor synchronously invokes its + // executor callback, and why async functions synchronously + // execute code before the first await. Since we implement simple + // async functions in terms of async generators, it is especially + // important to get this right, even though it requires care. + previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later + // invocations of the iterator. + callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); + } // Define the unified helper method that is used to implement .next, + // .throw, and .return (see defineIteratorMethods). + + + this._invoke = enqueue; + } + + defineIteratorMethods(AsyncIterator.prototype); + define(AsyncIterator.prototype, asyncIteratorSymbol, function () { + return this; + }); + exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of + // AsyncIterator objects; they just return a Promise for the value of + // the final result produced by the iterator. + + exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { + if (PromiseImpl === void 0) PromiseImpl = Promise; + var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); + return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator. + : iter.next().then(function (result) { + return result.done ? result.value : iter.next(); + }); + }; + + function makeInvokeMethod(innerFn, self, context) { + var state = GenStateSuspendedStart; + return function invoke(method, arg) { + if (state === GenStateExecuting) { + throw new Error("Generator is already running"); + } + + if (state === GenStateCompleted) { + if (method === "throw") { + throw arg; + } // Be forgiving, per 25.3.3.3.3 of the spec: + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume + + + return doneResult(); + } + + context.method = method; + context.arg = arg; + + while (true) { + var delegate = context.delegate; + + if (delegate) { + var delegateResult = maybeInvokeDelegate(delegate, context); + + if (delegateResult) { + if (delegateResult === ContinueSentinel) continue; + return delegateResult; + } + } + + if (context.method === "next") { + // Setting context._sent for legacy support of Babel's + // function.sent implementation. + context.sent = context._sent = context.arg; + } else if (context.method === "throw") { + if (state === GenStateSuspendedStart) { + state = GenStateCompleted; + throw context.arg; + } + + context.dispatchException(context.arg); + } else if (context.method === "return") { + context.abrupt("return", context.arg); + } + + state = GenStateExecuting; + var record = tryCatch(innerFn, self, context); + + if (record.type === "normal") { + // If an exception is thrown from innerFn, we leave state === + // GenStateExecuting and loop back for another invocation. + state = context.done ? GenStateCompleted : GenStateSuspendedYield; + + if (record.arg === ContinueSentinel) { + continue; + } + + return { + value: record.arg, + done: context.done + }; + } else if (record.type === "throw") { + state = GenStateCompleted; // Dispatch the exception by looping back around to the + // context.dispatchException(context.arg) call above. + + context.method = "throw"; + context.arg = record.arg; + } + } + }; + } // Call delegate.iterator[context.method](context.arg) and handle the + // result, either by returning a { value, done } result from the + // delegate iterator, or by modifying context.method and context.arg, + // setting context.delegate to null, and returning the ContinueSentinel. + + + function maybeInvokeDelegate(delegate, context) { + var method = delegate.iterator[context.method]; + + if (method === undefined) { + // A .throw or .return when the delegate iterator has no .throw + // method always terminates the yield* loop. + context.delegate = null; + + if (context.method === "throw") { + // Note: ["return"] must be used for ES3 parsing compatibility. + if (delegate.iterator["return"]) { + // If the delegate iterator has a return method, give it a + // chance to clean up. + context.method = "return"; + context.arg = undefined; + maybeInvokeDelegate(delegate, context); + + if (context.method === "throw") { + // If maybeInvokeDelegate(context) changed context.method from + // "return" to "throw", let that override the TypeError below. + return ContinueSentinel; + } + } + + context.method = "throw"; + context.arg = new TypeError("The iterator does not provide a 'throw' method"); + } + + return ContinueSentinel; + } + + var record = tryCatch(method, delegate.iterator, context.arg); + + if (record.type === "throw") { + context.method = "throw"; + context.arg = record.arg; + context.delegate = null; + return ContinueSentinel; + } + + var info = record.arg; + + if (!info) { + context.method = "throw"; + context.arg = new TypeError("iterator result is not an object"); + context.delegate = null; + return ContinueSentinel; + } + + if (info.done) { + // Assign the result of the finished delegate to the temporary + // variable specified by delegate.resultName (see delegateYield). + context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield). + + context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the + // exception, let the outer generator proceed normally. If + // context.method was "next", forget context.arg since it has been + // "consumed" by the delegate iterator. If context.method was + // "return", allow the original .return call to continue in the + // outer generator. + + if (context.method !== "return") { + context.method = "next"; + context.arg = undefined; + } + } else { + // Re-yield the result returned by the delegate method. + return info; + } // The delegate iterator is finished, so forget it and continue with + // the outer generator. + + + context.delegate = null; + return ContinueSentinel; + } // Define Generator.prototype.{next,throw,return} in terms of the + // unified ._invoke helper method. + + + defineIteratorMethods(Gp); + define(Gp, toStringTagSymbol, "Generator"); // A Generator should always return itself as the iterator object when the + // @@iterator function is called on it. Some browsers' implementations of the + // iterator prototype chain incorrectly implement this, causing the Generator + // object to not be returned from this call. This ensures that doesn't happen. + // See https://github.com/facebook/regenerator/issues/274 for more details. + + define(Gp, iteratorSymbol, function () { + return this; + }); + define(Gp, "toString", function () { + return "[object Generator]"; + }); + + function pushTryEntry(locs) { + var entry = { + tryLoc: locs[0] + }; + + if (1 in locs) { + entry.catchLoc = locs[1]; + } + + if (2 in locs) { + entry.finallyLoc = locs[2]; + entry.afterLoc = locs[3]; + } + + this.tryEntries.push(entry); + } + + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal"; + delete record.arg; + entry.completion = record; + } + + function Context(tryLocsList) { + // The root entry object (effectively a try statement without a catch + // or a finally block) gives us a place to store values thrown from + // locations where there is no enclosing try statement. + this.tryEntries = [{ + tryLoc: "root" + }]; + tryLocsList.forEach(pushTryEntry, this); + this.reset(true); + } + + exports.keys = function (object) { + var keys = []; + + for (var key in object) { + keys.push(key); + } + + keys.reverse(); // Rather than returning an object with a next method, we keep + // things simple and return the next function itself. + + return function next() { + while (keys.length) { + var key = keys.pop(); + + if (key in object) { + next.value = key; + next.done = false; + return next; + } + } // To avoid creating an additional object, we just hang the .value + // and .done properties off the next function object itself. This + // also ensures that the minifier will not anonymize the function. + + + next.done = true; + return next; + }; + }; + + function values(iterable) { + if (iterable) { + var iteratorMethod = iterable[iteratorSymbol]; + + if (iteratorMethod) { + return iteratorMethod.call(iterable); + } + + if (typeof iterable.next === "function") { + return iterable; + } + + if (!isNaN(iterable.length)) { + var i = -1, + next = function next() { + while (++i < iterable.length) { + if (hasOwn.call(iterable, i)) { + next.value = iterable[i]; + next.done = false; + return next; + } + } + + next.value = undefined; + next.done = true; + return next; + }; + + return next.next = next; + } + } // Return an iterator with no values. + + + return { + next: doneResult + }; + } + + exports.values = values; + + function doneResult() { + return { + value: undefined, + done: true + }; + } + + Context.prototype = { + constructor: Context, + reset: function reset(skipTempReset) { + this.prev = 0; + this.next = 0; // Resetting context._sent for legacy support of Babel's + // function.sent implementation. + + this.sent = this._sent = undefined; + this.done = false; + this.delegate = null; + this.method = "next"; + this.arg = undefined; + this.tryEntries.forEach(resetTryEntry); + + if (!skipTempReset) { + for (var name in this) { + // Not sure about the optimal order of these conditions: + if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) { + this[name] = undefined; + } + } + } + }, + stop: function stop() { + this.done = true; + var rootEntry = this.tryEntries[0]; + var rootRecord = rootEntry.completion; + + if (rootRecord.type === "throw") { + throw rootRecord.arg; + } + + return this.rval; + }, + dispatchException: function dispatchException(exception) { + if (this.done) { + throw exception; + } + + var context = this; + + function handle(loc, caught) { + record.type = "throw"; + record.arg = exception; + context.next = loc; + + if (caught) { + // If the dispatched exception was caught by a catch block, + // then let that catch block handle the exception normally. + context.method = "next"; + context.arg = undefined; + } + + return !!caught; + } + + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + var record = entry.completion; + + if (entry.tryLoc === "root") { + // Exception thrown outside of any try block that could handle + // it, so set the completion value of the entire function to + // throw the exception. + return handle("end"); + } + + if (entry.tryLoc <= this.prev) { + var hasCatch = hasOwn.call(entry, "catchLoc"); + var hasFinally = hasOwn.call(entry, "finallyLoc"); + + if (hasCatch && hasFinally) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } else if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + } else if (hasCatch) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } + } else if (hasFinally) { + if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + } else { + throw new Error("try statement without catch or finally"); + } + } + } + }, + abrupt: function abrupt(type, arg) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + + if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { + var finallyEntry = entry; + break; + } + } + + if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) { + // Ignore the finally entry if control is not jumping to a + // location outside the try/catch block. + finallyEntry = null; + } + + var record = finallyEntry ? finallyEntry.completion : {}; + record.type = type; + record.arg = arg; + + if (finallyEntry) { + this.method = "next"; + this.next = finallyEntry.finallyLoc; + return ContinueSentinel; + } + + return this.complete(record); + }, + complete: function complete(record, afterLoc) { + if (record.type === "throw") { + throw record.arg; + } + + if (record.type === "break" || record.type === "continue") { + this.next = record.arg; + } else if (record.type === "return") { + this.rval = this.arg = record.arg; + this.method = "return"; + this.next = "end"; + } else if (record.type === "normal" && afterLoc) { + this.next = afterLoc; + } + + return ContinueSentinel; + }, + finish: function finish(finallyLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + + if (entry.finallyLoc === finallyLoc) { + this.complete(entry.completion, entry.afterLoc); + resetTryEntry(entry); + return ContinueSentinel; + } + } + }, + "catch": function _catch(tryLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + + if (entry.tryLoc === tryLoc) { + var record = entry.completion; + + if (record.type === "throw") { + var thrown = record.arg; + resetTryEntry(entry); + } + + return thrown; + } + } // The context.catch method must only be called with a location + // argument that corresponds to a known catch block. + + + throw new Error("illegal catch attempt"); + }, + delegateYield: function delegateYield(iterable, resultName, nextLoc) { + this.delegate = { + iterator: values(iterable), + resultName: resultName, + nextLoc: nextLoc + }; + + if (this.method === "next") { + // Deliberately forget the last sent value so that we don't + // accidentally pass it on to the delegate. + this.arg = undefined; + } + + return ContinueSentinel; + } + }; // Regardless of whether this script is executing as a CommonJS module + // or not, return the runtime object so that we can declare the variable + // regeneratorRuntime in the outer scope, which allows this module to be + // injected easily by `bin/regenerator --include-runtime script.js`. + + return exports; +}( // If this script is executing as a CommonJS module, use module.exports +// as the regeneratorRuntime namespace. Otherwise create a new empty +// object. Either way, the resulting object will be used to initialize +// the regeneratorRuntime variable at the top of this file. + true ? module.exports : undefined); + +try { + regeneratorRuntime = runtime; +} catch (accidentalStrictMode) { + // This module should not be running in strict mode, so the above + // assignment should always work unless something is misconfigured. Just + // in case runtime.js accidentally runs in strict mode, in modern engines + // we can explicitly access globalThis. In older engines we can escape + // strict mode using a global Function call. This could conceivably fail + // if a Content Security Policy forbids using Function, but in that case + // the proper solution is to fix the accidental strict mode problem. If + // you've misconfigured your bundler to force strict mode and applied a + // CSP to forbid Function, and you're not willing to fix either of those + // problems, please detail your unique predicament in a GitHub issue. + if (typeof globalThis === "object") { + globalThis.regeneratorRuntime = runtime; + } else { + Function("r", "regeneratorRuntime = r")(runtime); + } +} + +/***/ }), + +/***/ "./src/forum/addNotifications.js": +/*!***************************************!*\ + !*** ./src/forum/addNotifications.js ***! + \***************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); +/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _components_DiscussionMergedNotification__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./components/DiscussionMergedNotification */ "./src/forum/components/DiscussionMergedNotification.js"); +/* harmony import */ var _extend_extendNotifications__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./extend/extendNotifications */ "./src/forum/extend/extendNotifications.ts"); + + + +/* harmony default export */ __webpack_exports__["default"] = (function () { + flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default.a.notificationComponents.discussionMerged = _components_DiscussionMergedNotification__WEBPACK_IMPORTED_MODULE_1__["default"]; + Object(_extend_extendNotifications__WEBPACK_IMPORTED_MODULE_2__["default"])(); +}); + +/***/ }), + +/***/ "./src/forum/components/DiscussionMergeModal.js": +/*!******************************************************!*\ + !*** ./src/forum/components/DiscussionMergeModal.js ***! + \******************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DiscussionMergeModal; }); +/* harmony import */ var _babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"); +/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); +/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js"); +/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); +/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var flarum_forum_components_DiscussionPage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/forum/components/DiscussionPage */ "flarum/forum/components/DiscussionPage"); +/* harmony import */ var flarum_forum_components_DiscussionPage__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_DiscussionPage__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! flarum/forum/components/IndexPage */ "flarum/forum/components/IndexPage"); +/* harmony import */ var flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! flarum/common/components/Button */ "flarum/common/components/Button"); +/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var flarum_common_components_Modal__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! flarum/common/components/Modal */ "flarum/common/components/Modal"); +/* harmony import */ var flarum_common_components_Modal__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Modal__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var flarum_forum_components_PostStream__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! flarum/forum/components/PostStream */ "flarum/forum/components/PostStream"); +/* harmony import */ var flarum_forum_components_PostStream__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_PostStream__WEBPACK_IMPORTED_MODULE_8__); +/* harmony import */ var flarum_forum_states_PostStreamState__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! flarum/forum/states/PostStreamState */ "flarum/forum/states/PostStreamState"); +/* harmony import */ var flarum_forum_states_PostStreamState__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_states_PostStreamState__WEBPACK_IMPORTED_MODULE_9__); +/* harmony import */ var flarum_forum_states_GlobalSearchState__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! flarum/forum/states/GlobalSearchState */ "flarum/forum/states/GlobalSearchState"); +/* harmony import */ var flarum_forum_states_GlobalSearchState__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_states_GlobalSearchState__WEBPACK_IMPORTED_MODULE_10__); +/* harmony import */ var flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! flarum/common/utils/Stream */ "flarum/common/utils/Stream"); +/* harmony import */ var flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_11__); +/* harmony import */ var flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! flarum/common/utils/classList */ "flarum/common/utils/classList"); +/* harmony import */ var flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_12__); +/* harmony import */ var _DiscussionSearch__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./DiscussionSearch */ "./src/forum/components/DiscussionSearch.js"); + + + + + + + + + + + + + + + +var DiscussionMergeModal = /*#__PURE__*/function (_Modal) { + Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(DiscussionMergeModal, _Modal); + + function DiscussionMergeModal() { + return _Modal.apply(this, arguments) || this; + } + + var _proto = DiscussionMergeModal.prototype; + + _proto.oninit = function oninit(vnode) { + _Modal.prototype.oninit.call(this, vnode); + + this.discussion = this.attrs.discussion; + this.type = flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_11___default()('target'); + this.merging = []; + + if (this.attrs.preselect) { + this.merging.push(this.attrs.preselect); + } + + this.results = []; + this.preview = null; + this.loadingPreview = false; + this.search = new flarum_forum_states_GlobalSearchState__WEBPACK_IMPORTED_MODULE_10___default.a(); + }; + + _proto.title = function title() { + return flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default.a.translator.trans('fof-merge-discussions.forum.modal.title'); + }; + + _proto.className = function className() { + return 'FoFMergeDiscussionsModal Modal--large'; + }; + + _proto.content = function content() { + var _this = this; + + return m("div", { + className: "Modal-body" + }, m("div", { + className: "Form" + }, m("div", { + className: "Form-group" + }, ['target', 'from'].map(function (key) { + return m("div", null, m("input", { + type: "radio", + id: "type_" + key, + checked: _this.type() === key, + onclick: _this.changeType.bind(_this, key) + }), "\xA0", m("label", { + htmlFor: "type_" + key + }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default.a.translator.trans("fof-merge-discussions.forum.modal.type_" + key + "_label"))); + })), m("p", { + className: "help" + }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default.a.translator.trans("fof-merge-discussions.forum.modal.type_" + this.type() + "_help_text", { + title: this.discussion.title() + })), m("div", { + className: flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_12___default()('FormGroup', this.disabled() && 'hidden') + }, m(_DiscussionSearch__WEBPACK_IMPORTED_MODULE_13__["default"], { + state: this.search, + onSelect: this.select.bind(this), + ignore: this.discussion.id() + })), m("div", { + className: "Form-group MergeDiscussions-Discussions" + }, m("ul", null, this.merging.map(function (d) { + return m("li", null, m("i", { + className: "fas fa-trash DeleteEntry-Button", + onclick: function onclick() { + return _this.remove(d); + } + }), "\xA0", m("a", { + href: flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default.a.forum.attribute('baseUrl') + "/d/" + d.id(), + target: "_blank" + }, m("i", null, d.id()), " ~ ", d.title())); + }))), m("div", { + className: "Form-group MergeDiscussions-Preview" + }, m(flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_6___default.a, { + className: "Button Button--danger", + onclick: this.loadPreview.bind(this), + loading: this.loadingPreview, + disabled: !this.discussion || !this.merging.length + }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default.a.translator.trans('fof-merge-discussions.forum.modal.load_preview_button')), this.preview && m("div", { + className: "MergeDiscussions-PostStream" + }, m("div", { + className: "Hero" + }, m("h2", null, this.type() === 'target' ? this.discussion.title() : this.merging[0].title())), m(flarum_forum_components_PostStream__WEBPACK_IMPORTED_MODULE_8___default.a, { + stream: this.preview, + discussion: this.preview.discussion, + onPositionChange: function onPositionChange() {} + }))), m("div", { + className: "Form-group" + }, m(flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_6___default.a, { + className: "Button Button--primary Button--block", + type: "submit", + onclick: this.submit.bind(this), + loading: this.loading, + disabled: !this.discussion || !this.merging.length + }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default.a.translator.trans('fof-merge-discussions.forum.modal.submit_button'))))); + }; + + _proto.disabled = function disabled() { + return this.type() === 'from' && this.merging.length !== 0; + }; + + _proto.select = function select(discussion) { + if (discussion && discussion.id() === this.discussion.id()) return; + + if (!this.merging.includes(discussion) && !this.disabled()) { + this.merging.push(discussion); + delete this.preview; + } + }; + + _proto.remove = function remove(discussion) { + delete this.preview; + this.merging.splice(this.merging.indexOf(this.merging.filter(function (d) { + return d.id() === discussion.id(); + })[0]), 1); + }; + + _proto.changeType = function changeType(key) { + this.type(key); + if (this.merging.length > 1) this.merging = []; + }; + + _proto.loadPreview = function loadPreview() { + var _this2 = this; + + this.loadingPreview = true; + return flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default.a.request(this.getRequestData('GET')).then(function (payload) { + var number = 1; + if (payload.included) payload.included.map(flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default.a.store.pushObject.bind(flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default.a.store)); + payload.data.relationships.posts.data.map(function (record) { + return flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default.a.store.getById('posts', record.id); + }).sort(function (a, b) { + return a.createdAt() - b.createdAt(); + }).forEach(function (p, i) { + p.number(number++); + payload.data.relationships.posts.data[i] = { + type: 'posts', + id: p.id() + }; + }); + var discussion = flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default.a.store.createRecord(payload.data.type, payload.data); + discussion.payload = payload; + _this2.loadingPreview = false; + var includedPosts = discussion.posts(); + _this2.preview = new flarum_forum_states_PostStreamState__WEBPACK_IMPORTED_MODULE_9___default.a(discussion, includedPosts); + m.redraw(); + })["catch"](function () { + return _this2.loadingPreview = false; + }); + }; + + _proto.submit = function submit(e) { + var _this3 = this; + + e.preventDefault(); + this.loading = true; + return flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default.a.request(this.getRequestData()).then( /*#__PURE__*/Object(_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.mark(function _callee() { + var _final; + + return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _final = _this3.type() === 'target' ? _this3.discussion : _this3.merging[0]; + + if (!flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default.a.current.matches(flarum_forum_components_DiscussionPage__WEBPACK_IMPORTED_MODULE_4___default.a)) { + _context.next = 12; + break; + } + + if (!(_this3.type() === 'target')) { + _context.next = 9; + break; + } + + _context.next = 5; + return flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default.a.store.find('discussions', _final.id()); + + case 5: + _context.next = 7; + return flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default.a.current.get('stream').update(); + + case 7: + _context.next = 10; + break; + + case 9: + m.route.set(flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default.a.route.discussion(_final)); + + case 10: + _context.next = 15; + break; + + case 12: + if (!flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default.a.current.matches(flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_5___default.a)) { + _context.next = 15; + break; + } + + _context.next = 15; + return flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default.a.store.find('discussions', _final.id()); + + case 15: + if (_this3.type() === 'target') { + _this3.merging.forEach(function (d) { + return flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default.a.discussions.removeDiscussion(d); + }); + } else { + flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default.a.discussions.removeDiscussion(_this3.discussion); + } + + flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default.a.modal.close(); + + case 17: + case "end": + return _context.stop(); + } + } + }, _callee); + })))["catch"](console.error).then(this.loaded.bind(this)); + }; + + _proto.getRequestData = function getRequestData(method) { + if (method === void 0) { + method = 'POST'; + } + + var isTarget = this.type() === 'target'; + var endpoint = isTarget ? this.discussion.apiEndpoint() : this.merging[0].apiEndpoint(); + var merging = isTarget ? this.merging.map(function (d) { + return d.id(); + }) : this.discussion.id(); + return { + method: method, + url: "" + flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default.a.forum.attribute('apiUrl') + endpoint + "/merge", + params: { + ids: merging + }, + body: { + ids: merging + }, + errorHandler: this.onerror.bind(this) + }; + }; + + return DiscussionMergeModal; +}(flarum_common_components_Modal__WEBPACK_IMPORTED_MODULE_7___default.a); + + + +/***/ }), + +/***/ "./src/forum/components/DiscussionMergePost.js": +/*!*****************************************************!*\ + !*** ./src/forum/components/DiscussionMergePost.js ***! + \*****************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DiscussionMergePost; }); +/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); +/* harmony import */ var flarum_forum_components_EventPost__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/forum/components/EventPost */ "flarum/forum/components/EventPost"); +/* harmony import */ var flarum_forum_components_EventPost__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_EventPost__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var flarum_common_helpers_punctuateSeries__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/helpers/punctuateSeries */ "flarum/common/helpers/punctuateSeries"); +/* harmony import */ var flarum_common_helpers_punctuateSeries__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_helpers_punctuateSeries__WEBPACK_IMPORTED_MODULE_2__); + + + + +var DiscussionMergePost = /*#__PURE__*/function (_EventPost) { + Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(DiscussionMergePost, _EventPost); + + function DiscussionMergePost() { + return _EventPost.apply(this, arguments) || this; + } + + var _proto = DiscussionMergePost.prototype; + + /** + * Get the name of the event icon. + * + * @return {String} + */ + _proto.icon = function icon() { + return 'fas fa-code-branch fa-flip-vertical'; + } + /** + * Get the translation key for the description of the event. + * + * @return {String} + */ + ; + + _proto.descriptionKey = function descriptionKey() { + return 'fof-merge-discussions.forum.post.merged'; + } + /** + * Get the translation data for the description of the event. + * + * @return {Object} + */ + ; + + _proto.descriptionData = function descriptionData() { + var data = this.attrs.post.content(); + if (Array.isArray(data.titles)) data.titles = flarum_common_helpers_punctuateSeries__WEBPACK_IMPORTED_MODULE_2___default()(data.titles).join(''); + return data; + }; + + return DiscussionMergePost; +}(flarum_forum_components_EventPost__WEBPACK_IMPORTED_MODULE_1___default.a); + + + +/***/ }), + +/***/ "./src/forum/components/DiscussionMergedNotification.js": +/*!**************************************************************!*\ + !*** ./src/forum/components/DiscussionMergedNotification.js ***! + \**************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DiscussionMergedNotification; }); +/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); +/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); +/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var flarum_forum_components_Notification__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/forum/components/Notification */ "flarum/forum/components/Notification"); +/* harmony import */ var flarum_forum_components_Notification__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_Notification__WEBPACK_IMPORTED_MODULE_2__); + + + + +var DiscussionMergedNotification = /*#__PURE__*/function (_Notification) { + Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(DiscussionMergedNotification, _Notification); + + function DiscussionMergedNotification() { + return _Notification.apply(this, arguments) || this; + } + + var _proto = DiscussionMergedNotification.prototype; + + _proto.icon = function icon() { + return 'fas fa-code-branch fa-flip-vertical'; + }; + + _proto.href = function href() { + var notification = this.attrs.notification; + var discussion = notification.subject(); + return flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default.a.route.discussion(discussion); + }; + + _proto.content = function content() { + var notification = this.attrs.notification; + var user = notification.fromUser(); + var oldDiscussion = notification.content(); + var oldTitle = oldDiscussion.merged_title; + return flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default.a.translator.trans('fof-merge-discussions.forum.notification.discussion_merged', { + user: user, + oldTitle: oldTitle + }); + }; + + return DiscussionMergedNotification; +}(flarum_forum_components_Notification__WEBPACK_IMPORTED_MODULE_2___default.a); + + + +/***/ }), + +/***/ "./src/forum/components/DiscussionSearch.js": +/*!**************************************************!*\ + !*** ./src/forum/components/DiscussionSearch.js ***! + \**************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DiscussionSearch; }); +/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); +/* harmony import */ var flarum_forum_components_Search__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/forum/components/Search */ "flarum/forum/components/Search"); +/* harmony import */ var flarum_forum_components_Search__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_Search__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/utils/ItemList */ "flarum/common/utils/ItemList"); +/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _DiscussionSearchSource__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./DiscussionSearchSource */ "./src/forum/components/DiscussionSearchSource.js"); + + + + + +var DiscussionSearch = /*#__PURE__*/function (_Search) { + Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(DiscussionSearch, _Search); + + function DiscussionSearch() { + return _Search.apply(this, arguments) || this; + } + + var _proto = DiscussionSearch.prototype; + + _proto.oncreate = function oncreate(vnode) { + _Search.prototype.oncreate.call(this, vnode); + + console.log(this.attrs); + this.navigator.onSelect(this.attrs.onSelect); + }; + + _proto.view = function view() { + this.hasFocus = true; + + var vdom = _Search.prototype.view.call(this); + + vdom.attrs.className = "MergeDiscussions-Search " + (this.state.getValue() && 'open') + " " + vdom.attrs.className.replace(/(focused|open)/g, ''); + return vdom; + }; + + _proto.sourceItems = function sourceItems() { + var items = new flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2___default.a(); + items.add('discussions', new _DiscussionSearchSource__WEBPACK_IMPORTED_MODULE_3__["default"](this.attrs.onSelect, this.attrs.ignore)); + return items; + }; + + return DiscussionSearch; +}(flarum_forum_components_Search__WEBPACK_IMPORTED_MODULE_1___default.a); + + + +/***/ }), + +/***/ "./src/forum/components/DiscussionSearchSource.js": +/*!********************************************************!*\ + !*** ./src/forum/components/DiscussionSearchSource.js ***! + \********************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DiscussionSearchSource; }); +/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); +/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var flarum_common_helpers_highlight__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/helpers/highlight */ "flarum/common/helpers/highlight"); +/* harmony import */ var flarum_common_helpers_highlight__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_helpers_highlight__WEBPACK_IMPORTED_MODULE_1__); + + + +var DiscussionSearchSource = /*#__PURE__*/function () { + function DiscussionSearchSource(onSelect, ignore) { + this.results = new Map(); + this.onSelect = onSelect; + this.ignore = ignore; + } + + var _proto = DiscussionSearchSource.prototype; + + _proto.search = function search(query) { + var _this = this; + + query = query.toLowerCase(); + var limit = flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default.a.forum.attribute('fof-merge-discussions.search_limit') || 4; + this.results.set(query, []); + var params = { + filter: { + q: query + }, + page: { + limit: limit + } + }; + var id = Number(query); + + if (!Number.isNaN(id) && id !== this.ignore) { + return flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default.a.store.find('discussions', id).then(function (d) { + _this.results.set(query, [d]); + })["catch"](function () { + return []; + }); + } + + return flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default.a.store.find('discussions', params).then(function (results) { + _this.results.set(query, results.filter(function (d) { + return d.id() !== _this.ignore; + })); + }); + }; + + _proto.view = function view(query) { + var _this2 = this; + + query = query.toLowerCase(); + var results = this.results.get(query) || []; + return [results.map(function (discussion) { + return m("li", { + className: "DiscussionSearchResult", + "data-index": 'discussions' + discussion.id() + }, m("button", { + className: "Button--ua-reset", + type: "button", + onclick: function onclick(e) { + e.stopPropagation(); + + _this2.onSelect(discussion); + } + }, m("div", { + className: "DiscussionSearchResult-title" + }, m("i", null, flarum_common_helpers_highlight__WEBPACK_IMPORTED_MODULE_1___default()(discussion.id(), query)), " ~ ", flarum_common_helpers_highlight__WEBPACK_IMPORTED_MODULE_1___default()(discussion.title(), query)))); + })]; + }; + + return DiscussionSearchSource; +}(); + + + +/***/ }), + +/***/ "./src/forum/components/index.js": +/*!***************************************!*\ + !*** ./src/forum/components/index.js ***! + \***************************************/ +/*! exports provided: components */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "components", function() { return components; }); +/* harmony import */ var _DiscussionMergedNotification__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DiscussionMergedNotification */ "./src/forum/components/DiscussionMergedNotification.js"); +/* harmony import */ var _DiscussionMergeModal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DiscussionMergeModal */ "./src/forum/components/DiscussionMergeModal.js"); +/* harmony import */ var _DiscussionMergePost__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./DiscussionMergePost */ "./src/forum/components/DiscussionMergePost.js"); +/* harmony import */ var _DiscussionSearch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./DiscussionSearch */ "./src/forum/components/DiscussionSearch.js"); +/* harmony import */ var _DiscussionSearchSource__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./DiscussionSearchSource */ "./src/forum/components/DiscussionSearchSource.js"); + + + + + +var components = { + DiscussionMergedNotification: _DiscussionMergedNotification__WEBPACK_IMPORTED_MODULE_0__["default"], + DiscussionMergeModal: _DiscussionMergeModal__WEBPACK_IMPORTED_MODULE_1__["default"], + DiscussionMergePost: _DiscussionMergePost__WEBPACK_IMPORTED_MODULE_2__["default"], + DiscussionSearch: _DiscussionSearch__WEBPACK_IMPORTED_MODULE_3__["default"], + DiscussionSearchSource: _DiscussionSearchSource__WEBPACK_IMPORTED_MODULE_4__["default"] +}; + +/***/ }), + +/***/ "./src/forum/extend/extendNotifications.ts": +/*!*************************************************!*\ + !*** ./src/forum/extend/extendNotifications.ts ***! + \*************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); +/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/extend */ "flarum/common/extend"); +/* harmony import */ var flarum_common_extend__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var flarum_forum_components_NotificationGrid__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/forum/components/NotificationGrid */ "flarum/forum/components/NotificationGrid"); +/* harmony import */ var flarum_forum_components_NotificationGrid__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_NotificationGrid__WEBPACK_IMPORTED_MODULE_2__); + + + +/* harmony default export */ __webpack_exports__["default"] = (function () { + Object(flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__["extend"])(flarum_forum_components_NotificationGrid__WEBPACK_IMPORTED_MODULE_2___default.a.prototype, 'notificationTypes', function (items) { + items.add('discussionMerged', { + name: 'discussionMerged', + icon: 'fas fa-code-branch fa-flip-vertical', + label: flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default.a.translator.trans('fof-merge-discussions.forum.notification.preferences.discussion_merged') + }); + }); +}); + +/***/ }), + +/***/ "./src/forum/index.js": +/*!****************************!*\ + !*** ./src/forum/index.js ***! + \****************************/ +/*! exports provided: components */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); +/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/extend */ "flarum/common/extend"); +/* harmony import */ var flarum_common_extend__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var flarum_common_Model__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/Model */ "flarum/common/Model"); +/* harmony import */ var flarum_common_Model__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Model__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/common/components/Button */ "flarum/common/components/Button"); +/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var flarum_forum_utils_DiscussionControls__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/forum/utils/DiscussionControls */ "flarum/forum/utils/DiscussionControls"); +/* harmony import */ var flarum_forum_utils_DiscussionControls__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_utils_DiscussionControls__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var _components_DiscussionMergeModal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./components/DiscussionMergeModal */ "./src/forum/components/DiscussionMergeModal.js"); +/* harmony import */ var _components_DiscussionMergePost__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./components/DiscussionMergePost */ "./src/forum/components/DiscussionMergePost.js"); +/* harmony import */ var _addNotifications__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./addNotifications */ "./src/forum/addNotifications.js"); +/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./components */ "./src/forum/components/index.js"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "components", function() { return _components__WEBPACK_IMPORTED_MODULE_8__["components"]; }); + + + + + + + + + + +flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default.a.initializers.add('fof/merge-discussions', function () { + flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default.a.store.models.discussions.prototype.canMerge = flarum_common_Model__WEBPACK_IMPORTED_MODULE_2___default.a.attribute('canMerge'); + flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default.a.postComponents.discussionMerged = _components_DiscussionMergePost__WEBPACK_IMPORTED_MODULE_6__["default"]; + Object(flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__["extend"])(flarum_forum_utils_DiscussionControls__WEBPACK_IMPORTED_MODULE_4___default.a, 'moderationControls', function (items, discussion) { + if (!discussion.canMerge()) return; + items.add('fof-merge', flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3___default.a.component({ + icon: 'fas fa-code-branch fa-flip-vertical', + onclick: function onclick() { + return flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default.a.modal.show(_components_DiscussionMergeModal__WEBPACK_IMPORTED_MODULE_5__["default"], { + discussion: discussion + }); + } + }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default.a.translator.trans('fof-merge-discussions.forum.discussion.merge'))); + }); + Object(_addNotifications__WEBPACK_IMPORTED_MODULE_7__["default"])(); +}); + +/***/ }), + +/***/ "flarum/common/Model": +/*!*****************************************************!*\ + !*** external "flarum.core.compat['common/Model']" ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['common/Model']; + +/***/ }), + +/***/ "flarum/common/components/Button": +/*!*****************************************************************!*\ + !*** external "flarum.core.compat['common/components/Button']" ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['common/components/Button']; + +/***/ }), + +/***/ "flarum/common/components/Modal": +/*!****************************************************************!*\ + !*** external "flarum.core.compat['common/components/Modal']" ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['common/components/Modal']; + +/***/ }), + +/***/ "flarum/common/extend": +/*!******************************************************!*\ + !*** external "flarum.core.compat['common/extend']" ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['common/extend']; + +/***/ }), + +/***/ "flarum/common/helpers/highlight": +/*!*****************************************************************!*\ + !*** external "flarum.core.compat['common/helpers/highlight']" ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['common/helpers/highlight']; + +/***/ }), + +/***/ "flarum/common/helpers/punctuateSeries": +/*!***********************************************************************!*\ + !*** external "flarum.core.compat['common/helpers/punctuateSeries']" ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['common/helpers/punctuateSeries']; + +/***/ }), + +/***/ "flarum/common/utils/ItemList": +/*!**************************************************************!*\ + !*** external "flarum.core.compat['common/utils/ItemList']" ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['common/utils/ItemList']; + +/***/ }), + +/***/ "flarum/common/utils/Stream": +/*!************************************************************!*\ + !*** external "flarum.core.compat['common/utils/Stream']" ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['common/utils/Stream']; + +/***/ }), + +/***/ "flarum/common/utils/classList": +/*!***************************************************************!*\ + !*** external "flarum.core.compat['common/utils/classList']" ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['common/utils/classList']; + +/***/ }), + +/***/ "flarum/forum/app": +/*!**************************************************!*\ + !*** external "flarum.core.compat['forum/app']" ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['forum/app']; + +/***/ }), + +/***/ "flarum/forum/components/DiscussionPage": +/*!************************************************************************!*\ + !*** external "flarum.core.compat['forum/components/DiscussionPage']" ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['forum/components/DiscussionPage']; + +/***/ }), + +/***/ "flarum/forum/components/EventPost": +/*!*******************************************************************!*\ + !*** external "flarum.core.compat['forum/components/EventPost']" ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['forum/components/EventPost']; + +/***/ }), + +/***/ "flarum/forum/components/IndexPage": +/*!*******************************************************************!*\ + !*** external "flarum.core.compat['forum/components/IndexPage']" ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['forum/components/IndexPage']; + +/***/ }), + +/***/ "flarum/forum/components/Notification": +/*!**********************************************************************!*\ + !*** external "flarum.core.compat['forum/components/Notification']" ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['forum/components/Notification']; + +/***/ }), + +/***/ "flarum/forum/components/NotificationGrid": +/*!**************************************************************************!*\ + !*** external "flarum.core.compat['forum/components/NotificationGrid']" ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['forum/components/NotificationGrid']; + +/***/ }), + +/***/ "flarum/forum/components/PostStream": +/*!********************************************************************!*\ + !*** external "flarum.core.compat['forum/components/PostStream']" ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['forum/components/PostStream']; + +/***/ }), + +/***/ "flarum/forum/components/Search": +/*!****************************************************************!*\ + !*** external "flarum.core.compat['forum/components/Search']" ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['forum/components/Search']; + +/***/ }), + +/***/ "flarum/forum/states/GlobalSearchState": +/*!***********************************************************************!*\ + !*** external "flarum.core.compat['forum/states/GlobalSearchState']" ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['forum/states/GlobalSearchState']; + +/***/ }), + +/***/ "flarum/forum/states/PostStreamState": +/*!*********************************************************************!*\ + !*** external "flarum.core.compat['forum/states/PostStreamState']" ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['forum/states/PostStreamState']; + +/***/ }), + +/***/ "flarum/forum/utils/DiscussionControls": +/*!***********************************************************************!*\ + !*** external "flarum.core.compat['forum/utils/DiscussionControls']" ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = flarum.core.compat['forum/utils/DiscussionControls']; + +/***/ }) + +/******/ }); //# sourceMappingURL=forum.js.map \ No newline at end of file diff --git a/js/dist/forum.js.map b/js/dist/forum.js.map index d16c521..400f018 100644 --- a/js/dist/forum.js.map +++ b/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://@fof/merge-discussions/webpack/bootstrap","webpack://@fof/merge-discussions/external \"flarum.core.compat['forum/app']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['common/components/Button']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['common/extend']\"","webpack://@fof/merge-discussions/./node_modules/@babel/runtime/regenerator/index.js","webpack://@fof/merge-discussions/external \"flarum.core.compat['common/helpers/highlight']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['common/Model']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['forum/utils/DiscussionControls']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['forum/components/DiscussionPage']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['forum/components/IndexPage']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['common/components/Modal']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['forum/components/PostStream']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['forum/states/PostStreamState']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['forum/states/GlobalSearchState']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['common/utils/Stream']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['common/utils/classList']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['forum/components/Search']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['common/utils/ItemList']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['forum/components/EventPost']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['common/helpers/punctuateSeries']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['forum/components/Notification']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['forum/components/NotificationGrid']\"","webpack://@fof/merge-discussions/./node_modules/regenerator-runtime/runtime.js","webpack://@fof/merge-discussions/./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","webpack://@fof/merge-discussions/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/merge-discussions/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/merge-discussions/./src/forum/components/DiscussionSearchSource.js","webpack://@fof/merge-discussions/./src/forum/components/DiscussionSearch.js","webpack://@fof/merge-discussions/./src/forum/components/DiscussionMergeModal.js","webpack://@fof/merge-discussions/./src/forum/components/DiscussionMergePost.js","webpack://@fof/merge-discussions/./src/forum/components/DiscussionMergedNotification.js","webpack://@fof/merge-discussions/./src/forum/addNotifications.js","webpack://@fof/merge-discussions/./src/forum/extend/extendNotifications.ts","webpack://@fof/merge-discussions/./src/forum/components/index.js","webpack://@fof/merge-discussions/./src/forum/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","require","runtime","Op","hasOwn","$Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","define","obj","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","context","Context","_invoke","state","method","arg","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","type","done","makeInvokeMethod","fn","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","this","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","PromiseImpl","previousPromise","callInvokeWithMethodAndArg","resolve","reject","invoke","result","__await","then","unwrapped","error","undefined","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","displayName","isGeneratorFunction","genFun","ctor","constructor","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","regeneratorRuntime","accidentalStrictMode","globalThis","Function","asyncGeneratorStep","gen","_next","_throw","_asyncToGenerator","args","arguments","apply","_setPrototypeOf","_inheritsLoose","subClass","superClass","DiscussionSearchSource","onSelect","ignore","results","Map","search","query","toLowerCase","limit","app","forum","attribute","set","params","filter","q","page","id","Number","store","find","view","map","discussion","className","data-index","onclick","highlight","title","DiscussionSearch","hasFocus","vdom","attrs","getValue","replace","sourceItems","items","ItemList","add","Search","DiscussionMergeModal","oninit","vnode","Stream","merging","preselect","preview","loadingPreview","GlobalSearchState","translator","trans","content","checked","changeType","htmlFor","classList","disabled","select","remove","href","target","loadPreview","loading","stream","onPositionChange","submit","includes","splice","indexOf","request","getRequestData","payload","number","included","pushObject","data","relationships","posts","getById","sort","a","b","createdAt","createRecord","includedPosts","PostStreamState","redraw","e","preventDefault","final","current","matches","DiscussionPage","update","route","IndexPage","discussions","removeDiscussion","modal","close","console","loaded","isTarget","endpoint","apiEndpoint","url","ids","body","errorHandler","onerror","Modal","DiscussionMergePost","icon","descriptionKey","descriptionData","post","Array","isArray","titles","punctuateSeries","join","EventPost","DiscussionMergedNotification","notification","subject","user","fromUser","oldTitle","merged_title","Notification","notificationComponents","discussionMerged","extend","NotificationGrid","label","components","initializers","models","canMerge","Model","postComponents","DiscussionControls","Button","component","show","addNotifications"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAo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B,iBAAOS,IAAoB,sBAAsB,SAAUzG,EAAOb,GAC3DA,EAAWmH,YAEhBtG,EAAME,IACJ,YACAwG,IAAOC,UACL,CACE/B,KAAM,sCACNtF,QAAS,kBAAMjB,IAAIyF,MAAM8C,KAAKxG,EAAsB,CAAEjB,iBAExDd,IAAIwC,WAAWC,MAAM,qDAK3B+F","file":"forum.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 23);\n","module.exports = flarum.core.compat['forum/app'];","module.exports = flarum.core.compat['common/components/Button'];","module.exports = flarum.core.compat['common/extend'];","module.exports = require(\"regenerator-runtime\");\n","module.exports = flarum.core.compat['common/helpers/highlight'];","module.exports = flarum.core.compat['common/Model'];","module.exports = flarum.core.compat['forum/utils/DiscussionControls'];","module.exports = flarum.core.compat['forum/components/DiscussionPage'];","module.exports = flarum.core.compat['forum/components/IndexPage'];","module.exports = flarum.core.compat['common/components/Modal'];","module.exports = flarum.core.compat['forum/components/PostStream'];","module.exports = flarum.core.compat['forum/states/PostStreamState'];","module.exports = flarum.core.compat['forum/states/GlobalSearchState'];","module.exports = flarum.core.compat['common/utils/Stream'];","module.exports = flarum.core.compat['common/utils/classList'];","module.exports = flarum.core.compat['forum/components/Search'];","module.exports = flarum.core.compat['common/utils/ItemList'];","module.exports = flarum.core.compat['forum/components/EventPost'];","module.exports = flarum.core.compat['common/helpers/punctuateSeries'];","module.exports = flarum.core.compat['forum/components/Notification'];","module.exports = flarum.core.compat['forum/components/NotificationGrid'];","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","import app from 'flarum/forum/app';\nimport highlight from 'flarum/common/helpers/highlight';\n\nexport default class DiscussionSearchSource {\n constructor(onSelect, ignore) {\n this.results = new Map();\n\n this.onSelect = onSelect;\n this.ignore = ignore;\n }\n\n search(query) {\n query = query.toLowerCase();\n const limit = app.forum.attribute('fof-merge-discussions.search_limit') || 4;\n\n this.results.set(query, []);\n\n const params = {\n filter: { q: query },\n page: { limit },\n };\n\n const id = Number(query);\n\n if (!Number.isNaN(id) && id !== this.ignore) {\n return app.store\n .find('discussions', id)\n .then((d) => {\n this.results.set(query, [d]);\n })\n .catch(() => []);\n }\n\n return app.store.find('discussions', params).then((results) => {\n this.results.set(\n query,\n results.filter((d) => d.id() !== this.ignore)\n );\n });\n }\n\n view(query) {\n query = query.toLowerCase();\n\n const results = this.results.get(query) || [];\n\n return [\n results.map((discussion) => {\n return (\n
  • \n this.onSelect(discussion)}>\n
    \n {highlight(discussion.id(), query)} ~ {highlight(discussion.title(), query)}\n
    \n
    \n
  • \n );\n }),\n ];\n }\n}\n","import Search from 'flarum/forum/components/Search';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport DiscussionSearchSource from './DiscussionSearchSource';\n\nexport default class DiscussionSearch extends Search {\n view() {\n this.hasFocus = true;\n\n const vdom = super.view();\n\n vdom.attrs.className = `MergeDiscussions-Search ${this.state.getValue() && 'open'} ` + vdom.attrs.className.replace(/(focused|open)/g, '');\n\n return vdom;\n }\n\n sourceItems() {\n const items = new ItemList();\n\n items.add('discussions', new DiscussionSearchSource(this.attrs.onSelect, this.attrs.ignore));\n\n return items;\n }\n}\n","import app from 'flarum/forum/app';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport Button from 'flarum/common/components/Button';\nimport Modal from 'flarum/common/components/Modal';\nimport PostStream from 'flarum/forum/components/PostStream';\nimport PostStreamState from 'flarum/forum/states/PostStreamState';\nimport GlobalSearchState from 'flarum/forum/states/GlobalSearchState';\nimport Stream from 'flarum/common/utils/Stream';\nimport classList from 'flarum/common/utils/classList';\n\nimport DiscussionSearch from './DiscussionSearch';\n\nexport default class DiscussionMergeModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.discussion = this.attrs.discussion;\n \n this.type = Stream('target');\n this.merging = [];\n\n if (this.attrs.preselect) {\n this.merging.push(this.attrs.preselect);\n }\n\n this.results = [];\n this.preview = null;\n\n this.loadingPreview = false;\n\n this.search = new GlobalSearchState();\n }\n\n title() {\n return app.translator.trans('fof-merge-discussions.forum.modal.title');\n }\n\n className() {\n return 'FoFMergeDiscussionsModal Modal--large';\n }\n\n content() {\n return (\n
    \n
    \n
    \n {['target', 'from'].map((key) => (\n
    \n \n  \n \n
    \n ))}\n
    \n\n

    \n {app.translator.trans(`fof-merge-discussions.forum.modal.type_${this.type()}_help_text`, {\n title: this.discussion.title(),\n })}\n

    \n\n
    \n \n
    \n\n
    \n \n
    \n
    \n \n {app.translator.trans('fof-merge-discussions.forum.modal.load_preview_button')}\n \n\n {this.preview && (\n
    \n
    \n

    {this.type() === 'target' ? this.discussion.title() : this.merging[0].title()}

    \n
    \n {}} />\n
    \n )}\n
    \n
    \n \n {app.translator.trans('fof-merge-discussions.forum.modal.submit_button')}\n \n
    \n
    \n
    \n );\n }\n\n disabled() {\n return this.type() === 'from' && this.merging.length !== 0;\n }\n\n select(discussion) {\n if (discussion && discussion.id() === this.discussion.id()) return;\n\n if (!this.merging.includes(discussion) && !this.disabled()) {\n this.merging.push(discussion);\n delete this.preview;\n }\n }\n\n remove(discussion) {\n delete this.preview;\n\n this.merging.splice(this.merging.indexOf(this.merging.filter((d) => d.id() === discussion.id())[0]), 1);\n }\n\n changeType(key) {\n this.type(key);\n\n if (this.merging.length > 1) this.merging = [];\n }\n\n loadPreview() {\n this.loadingPreview = true;\n\n return app\n .request(this.getRequestData('GET'))\n .then((payload) => {\n let number = 1;\n\n if (payload.included) payload.included.map(app.store.pushObject.bind(app.store));\n\n payload.data.relationships.posts.data\n .map((record) => app.store.getById('posts', record.id))\n .sort((a, b) => a.createdAt() - b.createdAt())\n .forEach((p, i) => {\n p.number(number++);\n\n payload.data.relationships.posts.data[i] = {\n type: 'posts',\n id: p.id(),\n };\n });\n\n const discussion = app.store.createRecord(payload.data.type, payload.data);\n discussion.payload = payload;\n\n this.loadingPreview = false;\n const includedPosts = discussion.posts();\n\n this.preview = new PostStreamState(discussion, includedPosts);\n\n m.redraw();\n })\n .catch(() => (this.loadingPreview = false));\n }\n\n submit(e) {\n e.preventDefault();\n\n this.loading = true;\n\n return app\n .request(this.getRequestData())\n .then(async () => {\n const final = this.type() === 'target' ? this.discussion : this.merging[0];\n\n if (app.current.matches(DiscussionPage)) {\n if (this.type() === 'target') {\n await app.store.find('discussions', final.id());\n\n await app.current.get('stream').update();\n } else {\n m.route.set(app.route.discussion(final));\n }\n } else if (app.current.matches(IndexPage)) {\n await app.store.find('discussions', final.id());\n }\n\n if (this.type() === 'target') {\n this.merging.forEach((d) => app.discussions.removeDiscussion(d));\n } else {\n app.discussions.removeDiscussion(this.discussion);\n }\n\n app.modal.close();\n })\n .catch(console.error)\n .then(this.loaded.bind(this));\n }\n\n getRequestData(method = 'POST') {\n const isTarget = this.type() === 'target';\n const endpoint = isTarget ? this.discussion.apiEndpoint() : this.merging[0].apiEndpoint();\n const merging = isTarget ? this.merging.map((d) => d.id()) : this.discussion.id();\n\n return {\n method,\n url: `${app.forum.attribute('apiUrl')}${endpoint}/merge`,\n params: {\n ids: merging,\n },\n body: {\n ids: merging,\n },\n errorHandler: this.onerror.bind(this),\n };\n }\n}\n","import EventPost from 'flarum/forum/components/EventPost';\nimport punctuateSeries from 'flarum/common/helpers/punctuateSeries';\n\nexport default class DiscussionMergePost extends EventPost {\n /**\n * Get the name of the event icon.\n *\n * @return {String}\n */\n icon() {\n return 'fas fa-code-branch fa-flip-vertical';\n }\n\n /**\n * Get the translation key for the description of the event.\n *\n * @return {String}\n */\n descriptionKey() {\n return 'fof-merge-discussions.forum.post.merged';\n }\n\n /**\n * Get the translation data for the description of the event.\n *\n * @return {Object}\n */\n descriptionData() {\n const data = this.attrs.post.content();\n\n if (Array.isArray(data.titles)) data.titles = punctuateSeries(data.titles).join('');\n\n return data;\n }\n}\n","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\n\nexport default class DiscussionMergedNotification extends Notification {\n icon() {\n return 'fas fa-code-branch fa-flip-vertical';\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 notification = this.attrs.notification;\n const user = notification.fromUser();\n const oldDiscussion = notification.content();\n const oldTitle = oldDiscussion.merged_title;\n\n return app.translator.trans('fof-merge-discussions.forum.notification.discussion_merged', {\n user,\n oldTitle,\n });\n }\n}\n","import app from 'flarum/forum/app';\nimport DiscussionMergedNotification from './components/DiscussionMergedNotification';\nimport extendNotifications from './extend/extendNotifications';\n\nexport default function () {\n app.notificationComponents.discussionMerged = DiscussionMergedNotification;\n extendNotifications();\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport NotificationGrid from 'flarum/forum/components/NotificationGrid';\n\nexport default function () {\n extend(NotificationGrid.prototype, 'notificationTypes', function (items: ItemList) {\n items.add('discussionMerged', {\n name: 'discussionMerged',\n icon: 'fas fa-code-branch fa-flip-vertical',\n label: app.translator.trans('fof-merge-discussions.forum.notification.preferences.discussion_merged'),\n });\n });\n}\n","import DiscussionMergedNotification from './DiscussionMergedNotification';\nimport DiscussionMergeModal from './DiscussionMergeModal';\nimport DiscussionMergePost from './DiscussionMergePost';\nimport DiscussionSearch from './DiscussionSearch';\nimport DiscussionSearchSource from './DiscussionSearchSource';\n\nexport const components = {\n DiscussionMergedNotification,\n DiscussionMergeModal,\n DiscussionMergePost,\n DiscussionSearch,\n DiscussionSearchSource,\n};\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Model from 'flarum/common/Model';\nimport Button from 'flarum/common/components/Button';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\n\nimport DiscussionMergeModal from './components/DiscussionMergeModal';\nimport DiscussionMergePost from './components/DiscussionMergePost';\nimport addNotifications from './addNotifications';\n\nexport * from './components';\n\napp.initializers.add('fof/merge-discussions', () => {\n app.store.models.discussions.prototype.canMerge = Model.attribute('canMerge');\n\n app.postComponents.discussionMerged = DiscussionMergePost;\n\n extend(DiscussionControls, 'moderationControls', function (items, discussion) {\n if (!discussion.canMerge()) return;\n\n items.add(\n 'fof-merge',\n Button.component(\n {\n icon: 'fas fa-code-branch fa-flip-vertical',\n onclick: () => app.modal.show(DiscussionMergeModal, { discussion }),\n },\n app.translator.trans('fof-merge-discussions.forum.discussion.merge')\n )\n );\n });\n\n addNotifications();\n});\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://@fof/merge-discussions/webpack/bootstrap","webpack://@fof/merge-discussions/./forum.js","webpack://@fof/merge-discussions/./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","webpack://@fof/merge-discussions/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/merge-discussions/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/merge-discussions/./node_modules/@babel/runtime/regenerator/index.js","webpack://@fof/merge-discussions/./node_modules/regenerator-runtime/runtime.js","webpack://@fof/merge-discussions/./src/forum/addNotifications.js","webpack://@fof/merge-discussions/./src/forum/components/DiscussionMergeModal.js","webpack://@fof/merge-discussions/./src/forum/components/DiscussionMergePost.js","webpack://@fof/merge-discussions/./src/forum/components/DiscussionMergedNotification.js","webpack://@fof/merge-discussions/./src/forum/components/DiscussionSearch.js","webpack://@fof/merge-discussions/./src/forum/components/DiscussionSearchSource.js","webpack://@fof/merge-discussions/./src/forum/components/index.js","webpack://@fof/merge-discussions/./src/forum/extend/extendNotifications.ts","webpack://@fof/merge-discussions/./src/forum/index.js","webpack://@fof/merge-discussions/external \"flarum.core.compat['common/Model']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['common/components/Button']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['common/components/Modal']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['common/extend']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['common/helpers/highlight']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['common/helpers/punctuateSeries']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['common/utils/ItemList']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['common/utils/Stream']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['common/utils/classList']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['forum/app']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['forum/components/DiscussionPage']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['forum/components/EventPost']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['forum/components/IndexPage']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['forum/components/Notification']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['forum/components/NotificationGrid']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['forum/components/PostStream']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['forum/components/Search']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['forum/states/GlobalSearchState']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['forum/states/PostStreamState']\"","webpack://@fof/merge-discussions/external \"flarum.core.compat['forum/utils/DiscussionControls']\""],"names":["asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined","_inheritsLoose","subClass","superClass","prototype","Object","create","constructor","setPrototypeOf","_setPrototypeOf","o","p","__proto__","module","exports","require","runtime","Op","hasOwn","hasOwnProperty","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","obj","defineProperty","enumerable","configurable","writable","wrap","innerFn","outerFn","tryLocsList","protoGenerator","Generator","generator","context","Context","_invoke","makeInvokeMethod","tryCatch","type","call","GenStateSuspendedStart","GenStateSuspendedYield","GenStateExecuting","GenStateCompleted","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","displayName","defineIteratorMethods","forEach","method","isGeneratorFunction","genFun","ctor","name","mark","awrap","__await","AsyncIterator","PromiseImpl","invoke","record","result","unwrapped","previousPromise","enqueue","callInvokeWithMethodAndArg","async","iter","next","state","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","TypeError","resultName","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","keys","object","reverse","length","pop","iterable","iteratorMethod","isNaN","i","skipTempReset","prev","charAt","slice","stop","rootEntry","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","regeneratorRuntime","accidentalStrictMode","globalThis","Function","app","notificationComponents","discussionMerged","DiscussionMergedNotification","extendNotifications","DiscussionMergeModal","oninit","vnode","discussion","attrs","Stream","merging","preselect","results","preview","loadingPreview","search","GlobalSearchState","title","translator","trans","className","content","map","changeType","bind","classList","disabled","select","id","d","remove","forum","attribute","loadPreview","submit","loading","includes","splice","indexOf","filter","request","getRequestData","payload","number","included","store","pushObject","data","relationships","posts","getById","sort","a","b","createdAt","createRecord","includedPosts","PostStreamState","m","redraw","e","preventDefault","final","current","matches","DiscussionPage","find","get","update","route","set","IndexPage","discussions","removeDiscussion","modal","close","console","loaded","isTarget","endpoint","apiEndpoint","url","params","ids","body","errorHandler","onerror","Modal","DiscussionMergePost","icon","descriptionKey","descriptionData","post","Array","isArray","titles","punctuateSeries","join","EventPost","href","notification","subject","user","fromUser","oldDiscussion","oldTitle","merged_title","Notification","DiscussionSearch","oncreate","log","navigator","onSelect","view","hasFocus","vdom","getValue","replace","sourceItems","items","ItemList","add","DiscussionSearchSource","ignore","Search","Map","query","toLowerCase","limit","q","page","Number","stopPropagation","highlight","components","extend","NotificationGrid","label","initializers","models","canMerge","Model","postComponents","DiscussionControls","Button","component","onclick","show","addNotifications"],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;Q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ACAA,oE;;;;;;;;;;;ACAA,sE","file":"forum.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./forum.js\");\n","export * from './src/forum';\n","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\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}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","module.exports = require(\"regenerator-runtime\");\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","import app from 'flarum/forum/app';\nimport DiscussionMergedNotification from './components/DiscussionMergedNotification';\nimport extendNotifications from './extend/extendNotifications';\n\nexport default function () {\n app.notificationComponents.discussionMerged = DiscussionMergedNotification;\n extendNotifications();\n}\n","import app from 'flarum/forum/app';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport Button from 'flarum/common/components/Button';\nimport Modal from 'flarum/common/components/Modal';\nimport PostStream from 'flarum/forum/components/PostStream';\nimport PostStreamState from 'flarum/forum/states/PostStreamState';\nimport GlobalSearchState from 'flarum/forum/states/GlobalSearchState';\nimport Stream from 'flarum/common/utils/Stream';\nimport classList from 'flarum/common/utils/classList';\n\nimport DiscussionSearch from './DiscussionSearch';\n\nexport default class DiscussionMergeModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.discussion = this.attrs.discussion;\n \n this.type = Stream('target');\n this.merging = [];\n\n if (this.attrs.preselect) {\n this.merging.push(this.attrs.preselect);\n }\n\n this.results = [];\n this.preview = null;\n\n this.loadingPreview = false;\n\n this.search = new GlobalSearchState();\n }\n\n title() {\n return app.translator.trans('fof-merge-discussions.forum.modal.title');\n }\n\n className() {\n return 'FoFMergeDiscussionsModal Modal--large';\n }\n\n content() {\n return (\n
    \n
    \n
    \n {['target', 'from'].map((key) => (\n
    \n \n  \n \n
    \n ))}\n
    \n\n

    \n {app.translator.trans(`fof-merge-discussions.forum.modal.type_${this.type()}_help_text`, {\n title: this.discussion.title(),\n })}\n

    \n\n
    \n \n
    \n\n
    \n \n
    \n
    \n \n {app.translator.trans('fof-merge-discussions.forum.modal.load_preview_button')}\n \n\n {this.preview && (\n
    \n
    \n

    {this.type() === 'target' ? this.discussion.title() : this.merging[0].title()}

    \n
    \n {}} />\n
    \n )}\n
    \n
    \n \n {app.translator.trans('fof-merge-discussions.forum.modal.submit_button')}\n \n
    \n
    \n
    \n );\n }\n\n disabled() {\n return this.type() === 'from' && this.merging.length !== 0;\n }\n\n select(discussion) {\n if (discussion && discussion.id() === this.discussion.id()) return;\n\n if (!this.merging.includes(discussion) && !this.disabled()) {\n this.merging.push(discussion);\n delete this.preview;\n }\n }\n\n remove(discussion) {\n delete this.preview;\n\n this.merging.splice(this.merging.indexOf(this.merging.filter((d) => d.id() === discussion.id())[0]), 1);\n }\n\n changeType(key) {\n this.type(key);\n\n if (this.merging.length > 1) this.merging = [];\n }\n\n loadPreview() {\n this.loadingPreview = true;\n\n return app\n .request(this.getRequestData('GET'))\n .then((payload) => {\n let number = 1;\n\n if (payload.included) payload.included.map(app.store.pushObject.bind(app.store));\n\n payload.data.relationships.posts.data\n .map((record) => app.store.getById('posts', record.id))\n .sort((a, b) => a.createdAt() - b.createdAt())\n .forEach((p, i) => {\n p.number(number++);\n\n payload.data.relationships.posts.data[i] = {\n type: 'posts',\n id: p.id(),\n };\n });\n\n const discussion = app.store.createRecord(payload.data.type, payload.data);\n discussion.payload = payload;\n\n this.loadingPreview = false;\n const includedPosts = discussion.posts();\n\n this.preview = new PostStreamState(discussion, includedPosts);\n\n m.redraw();\n })\n .catch(() => (this.loadingPreview = false));\n }\n\n submit(e) {\n e.preventDefault();\n\n this.loading = true;\n\n return app\n .request(this.getRequestData())\n .then(async () => {\n const final = this.type() === 'target' ? this.discussion : this.merging[0];\n\n if (app.current.matches(DiscussionPage)) {\n if (this.type() === 'target') {\n await app.store.find('discussions', final.id());\n\n await app.current.get('stream').update();\n } else {\n m.route.set(app.route.discussion(final));\n }\n } else if (app.current.matches(IndexPage)) {\n await app.store.find('discussions', final.id());\n }\n\n if (this.type() === 'target') {\n this.merging.forEach((d) => app.discussions.removeDiscussion(d));\n } else {\n app.discussions.removeDiscussion(this.discussion);\n }\n\n app.modal.close();\n })\n .catch(console.error)\n .then(this.loaded.bind(this));\n }\n\n getRequestData(method = 'POST') {\n const isTarget = this.type() === 'target';\n const endpoint = isTarget ? this.discussion.apiEndpoint() : this.merging[0].apiEndpoint();\n const merging = isTarget ? this.merging.map((d) => d.id()) : this.discussion.id();\n\n return {\n method,\n url: `${app.forum.attribute('apiUrl')}${endpoint}/merge`,\n params: {\n ids: merging,\n },\n body: {\n ids: merging,\n },\n errorHandler: this.onerror.bind(this),\n };\n }\n}\n","import EventPost from 'flarum/forum/components/EventPost';\nimport punctuateSeries from 'flarum/common/helpers/punctuateSeries';\n\nexport default class DiscussionMergePost extends EventPost {\n /**\n * Get the name of the event icon.\n *\n * @return {String}\n */\n icon() {\n return 'fas fa-code-branch fa-flip-vertical';\n }\n\n /**\n * Get the translation key for the description of the event.\n *\n * @return {String}\n */\n descriptionKey() {\n return 'fof-merge-discussions.forum.post.merged';\n }\n\n /**\n * Get the translation data for the description of the event.\n *\n * @return {Object}\n */\n descriptionData() {\n const data = this.attrs.post.content();\n\n if (Array.isArray(data.titles)) data.titles = punctuateSeries(data.titles).join('');\n\n return data;\n }\n}\n","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\n\nexport default class DiscussionMergedNotification extends Notification {\n icon() {\n return 'fas fa-code-branch fa-flip-vertical';\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 notification = this.attrs.notification;\n const user = notification.fromUser();\n const oldDiscussion = notification.content();\n const oldTitle = oldDiscussion.merged_title;\n\n return app.translator.trans('fof-merge-discussions.forum.notification.discussion_merged', {\n user,\n oldTitle,\n });\n }\n}\n","import Search from 'flarum/forum/components/Search';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport DiscussionSearchSource from './DiscussionSearchSource';\n\nexport default class DiscussionSearch extends Search {\n oncreate(vnode) {\n super.oncreate(vnode);\nconsole.log(this.attrs);\n this.navigator.onSelect(this.attrs.onSelect);\n }\n\n view() {\n this.hasFocus = true;\n\n const vdom = super.view();\n\n vdom.attrs.className = `MergeDiscussions-Search ${this.state.getValue() && 'open'} ` + vdom.attrs.className.replace(/(focused|open)/g, '');\n\n return vdom;\n }\n\n sourceItems() {\n const items = new ItemList();\n\n items.add('discussions', new DiscussionSearchSource(this.attrs.onSelect, this.attrs.ignore));\n\n return items;\n }\n}\n","import app from 'flarum/forum/app';\nimport highlight from 'flarum/common/helpers/highlight';\n\nexport default class DiscussionSearchSource {\n constructor(onSelect, ignore) {\n this.results = new Map();\n\n this.onSelect = onSelect;\n this.ignore = ignore;\n }\n\n search(query) {\n query = query.toLowerCase();\n const limit = app.forum.attribute('fof-merge-discussions.search_limit') || 4;\n\n this.results.set(query, []);\n\n const params = {\n filter: { q: query },\n page: { limit },\n };\n\n const id = Number(query);\n\n if (!Number.isNaN(id) && id !== this.ignore) {\n return app.store\n .find('discussions', id)\n .then((d) => {\n this.results.set(query, [d]);\n })\n .catch(() => []);\n }\n\n return app.store.find('discussions', params).then((results) => {\n this.results.set(\n query,\n results.filter((d) => d.id() !== this.ignore)\n );\n });\n }\n\n view(query) {\n query = query.toLowerCase();\n\n const results = this.results.get(query) || [];\n\n return [\n results.map((discussion) => {\n return (\n
  • \n \n
  • \n );\n }),\n ];\n }\n}\n","import DiscussionMergedNotification from './DiscussionMergedNotification';\nimport DiscussionMergeModal from './DiscussionMergeModal';\nimport DiscussionMergePost from './DiscussionMergePost';\nimport DiscussionSearch from './DiscussionSearch';\nimport DiscussionSearchSource from './DiscussionSearchSource';\n\nexport const components = {\n DiscussionMergedNotification,\n DiscussionMergeModal,\n DiscussionMergePost,\n DiscussionSearch,\n DiscussionSearchSource,\n};\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport NotificationGrid from 'flarum/forum/components/NotificationGrid';\n\nexport default function () {\n extend(NotificationGrid.prototype, 'notificationTypes', function (items: ItemList) {\n items.add('discussionMerged', {\n name: 'discussionMerged',\n icon: 'fas fa-code-branch fa-flip-vertical',\n label: app.translator.trans('fof-merge-discussions.forum.notification.preferences.discussion_merged'),\n });\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Model from 'flarum/common/Model';\nimport Button from 'flarum/common/components/Button';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\n\nimport DiscussionMergeModal from './components/DiscussionMergeModal';\nimport DiscussionMergePost from './components/DiscussionMergePost';\nimport addNotifications from './addNotifications';\n\nexport * from './components';\n\napp.initializers.add('fof/merge-discussions', () => {\n app.store.models.discussions.prototype.canMerge = Model.attribute('canMerge');\n\n app.postComponents.discussionMerged = DiscussionMergePost;\n\n extend(DiscussionControls, 'moderationControls', function (items, discussion) {\n if (!discussion.canMerge()) return;\n\n items.add(\n 'fof-merge',\n Button.component(\n {\n icon: 'fas fa-code-branch fa-flip-vertical',\n onclick: () => app.modal.show(DiscussionMergeModal, { discussion }),\n },\n app.translator.trans('fof-merge-discussions.forum.discussion.merge')\n )\n );\n });\n\n addNotifications();\n});\n","module.exports = flarum.core.compat['common/Model'];","module.exports = flarum.core.compat['common/components/Button'];","module.exports = flarum.core.compat['common/components/Modal'];","module.exports = flarum.core.compat['common/extend'];","module.exports = flarum.core.compat['common/helpers/highlight'];","module.exports = flarum.core.compat['common/helpers/punctuateSeries'];","module.exports = flarum.core.compat['common/utils/ItemList'];","module.exports = flarum.core.compat['common/utils/Stream'];","module.exports = flarum.core.compat['common/utils/classList'];","module.exports = flarum.core.compat['forum/app'];","module.exports = flarum.core.compat['forum/components/DiscussionPage'];","module.exports = flarum.core.compat['forum/components/EventPost'];","module.exports = flarum.core.compat['forum/components/IndexPage'];","module.exports = flarum.core.compat['forum/components/Notification'];","module.exports = flarum.core.compat['forum/components/NotificationGrid'];","module.exports = flarum.core.compat['forum/components/PostStream'];","module.exports = flarum.core.compat['forum/components/Search'];","module.exports = flarum.core.compat['forum/states/GlobalSearchState'];","module.exports = flarum.core.compat['forum/states/PostStreamState'];","module.exports = flarum.core.compat['forum/utils/DiscussionControls'];"],"sourceRoot":""} \ No newline at end of file diff --git a/js/src/forum/components/DiscussionMergeModal.js b/js/src/forum/components/DiscussionMergeModal.js index af2a0c1..9db38d2 100644 --- a/js/src/forum/components/DiscussionMergeModal.js +++ b/js/src/forum/components/DiscussionMergeModal.js @@ -32,6 +32,10 @@ export default class DiscussionMergeModal extends Modal { this.search = new GlobalSearchState(); } + onready() { + this.$('.Search-input .FormControl').focus(); + } + title() { return app.translator.trans('fof-merge-discussions.forum.modal.title'); } diff --git a/js/src/forum/components/DiscussionSearch.js b/js/src/forum/components/DiscussionSearch.js index d4276e2..f631a73 100644 --- a/js/src/forum/components/DiscussionSearch.js +++ b/js/src/forum/components/DiscussionSearch.js @@ -3,6 +3,15 @@ import ItemList from 'flarum/common/utils/ItemList'; import DiscussionSearchSource from './DiscussionSearchSource'; export default class DiscussionSearch extends Search { + oncreate(vnode) { + super.oncreate(vnode); + + this.navigator.onSelect(() => { + this.attrs.onSelect(app.store.getById('discussions', this.getItem(this.index).attr('data-id'))); + m.redraw(); + }); + } + view() { this.hasFocus = true; diff --git a/js/src/forum/components/DiscussionSearchSource.js b/js/src/forum/components/DiscussionSearchSource.js index 72cf081..166e43a 100644 --- a/js/src/forum/components/DiscussionSearchSource.js +++ b/js/src/forum/components/DiscussionSearchSource.js @@ -47,12 +47,12 @@ export default class DiscussionSearchSource { return [ results.map((discussion) => { return ( -
  • - this.onSelect(discussion)}> +
  • +
  • ); }), diff --git a/resources/less/forum.less b/resources/less/forum.less index 4d8702a..53d135c 100644 --- a/resources/less/forum.less +++ b/resources/less/forum.less @@ -51,3 +51,36 @@ } } } + +// Remove for Flarum 1.2 +.Button--ua-reset { + border: none; + margin: 0; + padding: 0; + width: auto; + overflow: visible; + text-align: inherit; + vertical-align: inherit; + + background: transparent; + + /* inherit font & color from ancestor */ + color: inherit; + font: inherit; + + /* Normalize `line-height`. Cannot be changed from `normal` in Firefox 4+. */ + line-height: normal; + + /* Corrects font smoothing for webkit */ + -webkit-font-smoothing: inherit; + -moz-osx-font-smoothing: inherit; + + /* Corrects inability to style clickable `input` types in iOS */ + -webkit-appearance: none; + appearance: none; + + &::-moz-focus-inner { + border: 0; + padding: 0; + } +}