diff --git a/js/dist/admin.js b/js/dist/admin.js index 61ba85e..311c3d1 100644 --- a/js/dist/admin.js +++ b/js/dist/admin.js @@ -1,2 +1,2 @@ -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=22)}({1:function(e,r){e.exports=flarum.core.compat["admin/app"]},22: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(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})}))}}); //# 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 fd33c77..c950884 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,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAAS1B,GAChC,IAAIS,EAAST,GAAUA,EAAOqB,WAC7B,WAAwB,OAAOrB,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAH,EAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG/B,EAAoBkC,EAAI,GAIjBlC,EAAoBA,EAAoBmC,EAAI,I,kBClFrDhC,EAAOD,QAAUkC,OAAOC,KAAKC,OAAO,c,2DCEpCC,IAAIC,aAAaC,IAAI,yBAAyB,WAC5CF,IAAIG,cAAJ,IACO,yBACJC,mBACC,CACEC,KAAM,sCACNC,MAAON,IAAIO,WAAWC,MAAM,mEAC5BC,WAAY,oBAEd,YAEDC,gBAAgB,CACfJ,MAAON,IAAIO,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 = 22);\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/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,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAAS1B,GAChC,IAAIS,EAAST,GAAUA,EAAOqB,WAC7B,WAAwB,OAAOrB,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAH,EAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG/B,EAAoBkC,EAAI,GAIjBlC,EAAoBA,EAAoBmC,EAAI,I,kBClFrDhC,EAAOD,QAAUkC,OAAOC,KAAKC,OAAO,c,2DCEpCC,IAAIC,aAAaC,IAAI,yBAAyB,WAC5CF,IAAIG,cAAJ,IACO,yBACJC,mBACC,CACEC,KAAM,sCACNC,MAAON,IAAIO,WAAWC,MAAM,mEAC5BC,WAAY,oBAEd,YAEDC,gBAAgB,CACfJ,MAAON,IAAIO,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 diff --git a/js/dist/forum.js b/js/dist/forum.js index aa931a1..11084aa 100644 --- a/js/dist/forum.js +++ b/js/dist/forum.js @@ -1,2 +1,2 @@ -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=21)}([function(t,e){t.exports=flarum.core.compat["forum/app"]},,function(t,e){t.exports=flarum.core.compat["common/components/Button"]},function(t,e,r){t.exports=r(20)},function(t,e){t.exports=flarum.core.compat["common/helpers/highlight"]},function(t,e){t.exports=flarum.core.compat["common/extend"]},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,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 f?e:f,i=Object.create(o.prototype),s=new L(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 P()}for(r.method=o,r.arg=i;;){var s=r.delegate;if(s){var a=w(s,r);if(a){if(a===l)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===l)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 l={};function f(){}function h(){}function m(){}var p={};a(p,o,(function(){return this}));var d=Object.getPrototypeOf,g=d&&d(d(N([])));g&&g!==e&&r.call(g,o)&&(p=g);var v=m.prototype=f.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 l=c.arg,f=l.value;return f&&"object"==typeof f&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,s,a)}),(function(t){n("throw",t,s,a)})):e.resolve(f).then((function(t){l.value=t,s(l)}),(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 l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;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,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}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 L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function N(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),l}},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:N(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},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);var n=r(0),o=r.n(n),i=r(5),s=r(6),a=r.n(s),c=r(2),u=r.n(c),l=r(7),f=r.n(l);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(3),y=r.n(v),b=r(8),w=r.n(b),x=r(9),_=r.n(x),L=r(10),N=r.n(L),P=r(11),E=r.n(P),S=r(12),O=r.n(S),j=r(13),k=r.n(j),M=r(14),D=r.n(M),F=r(15),T=r.n(F),G=r(16),R=r.n(G),B=r(17),I=r.n(B),q=r(4),A=r.n(q),C=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,A()(r.id(),t))," ~ ",A()(r.title(),t))))}))]},t}(),H=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 I.a;return t.add("discussions",new C(this.attrs.onSelect,this.attrs.ignore)),t},e}(R.a),U=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.results=[],this.preview=null,this.loadingPreview=!1,this.search=new k.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(H,{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(E.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}(N.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);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)(f.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(U,{discussion:e})}},o.a.translator.trans("fof-merge-discussions.forum.discussion.merge")))}))}))}]); +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 L(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 P()}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 d(){}var h={};a(h,o,(function(){return this}));var p=Object.getPrototypeOf,g=p&&p(p(N([])));g&&g!==e&&r.call(g,o)&&(h=g);var v=d.prototype=l.prototype=Object.create(h);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 L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function N(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:N(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);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 d(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 h(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function s(t){d(i,n,o,s,a,"next",t)}function a(t){d(i,n,o,s,a,"throw",t)}s(void 0)}))}}function p(t,e){return(p=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,p(t,e)}var v=r(4),y=r.n(v),b=r(8),w=r.n(b),x=r(9),_=r.n(x),L=r(10),N=r.n(L),P=r(11),E=r.n(P),S=r(12),O=r.n(S),j=r(13),k=r.n(j),M=r(14),D=r.n(M),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.results=[],this.preview=null,this.loadingPreview=!1,this.search=new k.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(E.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(h(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}(N.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")})}))};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")))})),$()}))}]); //# 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 5c6136f..8055a34 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/./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/extend']\"","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/./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/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","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","initializers","models","canMerge","Model","postComponents","discussionMerged","extend","DiscussionControls","Button","component","show"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SA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,EAAWhM,KAAKkH,WAAWgF,cAAgBlM,KAAKuI,QAAQ,GAAG2D,cACtE3D,EAAUyD,EAAWhM,KAAKuI,QAAQtB,KAAI,SAAC9L,GAAD,OAAOA,EAAEyL,QAAQ5G,KAAKkH,WAAWN,KAE7E,MAAO,CACLjI,SACAwN,IAAK,GAAG/F,IAAIC,MAAMC,UAAU,UAAY2F,EAArC,SACHzF,OAAQ,CACN4F,IAAK7D,GAEP8D,KAAM,CACJD,IAAK7D,GAEP+D,aAActM,KAAKuM,QAAQlQ,KAAK2D,Q,GA5MYwM,K,kCCV7BC,E,gGAMnBC,KAAA,WACE,MAAO,uC,EAQTC,eAAA,WACE,MAAO,2C,EAQTC,gBAAA,WACE,IAAMvC,EAAOrK,KAAK2H,MAAMkF,KAAKhE,UAI7B,OAFIiE,MAAMC,QAAQ1C,EAAK2C,UAAS3C,EAAK2C,OAASC,IAAgB5C,EAAK2C,QAAQE,KAAK,KAEzE7C,G,GA7BsC8C,KCMjD/G,IAAIgH,aAAanF,IAAI,yBAAyB,WAC5C7B,IAAIU,MAAMuG,OAAO3B,YAAYjP,UAAU6Q,SAAWC,IAAMjH,UAAU,YAElEF,IAAIoH,eAAeC,iBAAmBhB,EAEtCiB,iBAAOC,IAAoB,sBAAsB,SAAU5F,EAAOb,GAC3DA,EAAWoG,YAEhBvF,EAAME,IACJ,YACA2F,IAAOC,UACL,CACEnB,KAAM,sCACNrF,QAAS,kBAAMjB,IAAIwF,MAAMkC,KAAK3F,EAAsB,CAAEjB,iBAExDd,IAAIuC,WAAWC,MAAM","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 = 21);\n","module.exports = flarum.core.compat['forum/app'];","module.exports = flarum.core.compat['common/components/Button'];","module.exports = require(\"regenerator-runtime\");\n","module.exports = flarum.core.compat['common/helpers/highlight'];","module.exports = flarum.core.compat['common/extend'];","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'];","/**\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 this.type = Stream('target');\n this.merging = [];\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 { 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';\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"],"sourceRoot":""} \ No newline at end of file +{"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/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","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","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,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EA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MAAM0F,aACAC,UAEhC,OAAOlH,IAAIoF,MAAMtE,WAAWA,I,EAG9B2B,QAAA,WACE,IAAMwE,EAAerN,KAAK2H,MAAM0F,aAC1BE,EAAOF,EAAaG,WAEpBC,EADgBJ,EAAaxE,UACJ6E,aAE/B,OAAOtH,IAAIuC,WAAWC,MAAM,6DAA8D,CACxF2E,OACAE,c,UApBoDE,G,iBCC3C,aACXvH,IAAIwH,uBAAuBC,iBAAmBT,ECChDU,iBAAOC,IAAiBtR,UAAW,qBAAqB,SAAUsL,GAChEA,EAAME,IAAI,mBAAoB,CAC5B7M,KAAM,mBACNsR,KAAM,sCACNsB,MAAO5H,IAAIuC,WAAWC,MAAM,gFCAlCxC,IAAI6H,aAAahG,IAAI,yBAAyB,WAC5C7B,IAAIU,MAAMoH,OAAOxC,YAAYjP,UAAU0R,SAAWC,IAAM9H,UAAU,YAElEF,IAAIiI,eAAeR,iBAAmBpB,EAEtCqB,iBAAOQ,IAAoB,sBAAsB,SAAUvG,EAAOb,GAC3DA,EAAWiH,YAEhBpG,EAAME,IACJ,YACAsG,IAAOC,UACL,CACE9B,KAAM,sCACNrF,QAAS,kBAAMjB,IAAIwF,MAAM6C,KAAKtG,EAAsB,CAAEjB,iBAExDd,IAAIuC,WAAWC,MAAM,qDAK3B8F","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 this.type = Stream('target');\n this.merging = [];\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 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\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