From 432b0329151265dc8832ea943164f191941e4155 Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Tue, 7 May 2024 07:45:22 +0000 Subject: [PATCH] Bundled output for commit 269bffc79d345e88a0aa67fe93bc7b42504ece78 Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] --- js/dist/admin.js | 176 +- js/dist/admin.js.map | 2 +- js/dist/forum.js | 5653 +----------------------------------------- js/dist/forum.js.map | 2 +- 4 files changed, 5 insertions(+), 5828 deletions(-) diff --git a/js/dist/admin.js b/js/dist/admin.js index 6bd0a4b1..d0bae3d1 100644 --- a/js/dist/admin.js +++ b/js/dist/admin.js @@ -1,176 +1,2 @@ -/******/ (() => { // webpackBootstrap -/******/ // runtime can't be in strict mode because a global variable is assign and maybe created. -/******/ var __webpack_modules__ = ({ - -/***/ "./src/admin/index.ts": -/*!****************************!*\ - !*** ./src/admin/index.ts ***! - \****************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var flarum_admin_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! flarum/admin/app */ "flarum/admin/app"); -/* harmony import */ var flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(flarum_admin_app__WEBPACK_IMPORTED_MODULE_0__); - -flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().initializers.add('fof/polls', function () { - flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().extensionData["for"]('fof-polls').registerSetting({ - setting: 'fof-polls.allowOptionImage', - type: 'switch', - label: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.admin.settings.allow_option_image') - }).registerSetting({ - setting: 'fof-polls.optionsColorBlend', - type: 'switch', - label: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.admin.settings.options_color_blend'), - help: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.admin.settings.options_color_blend_help') - }).registerSetting({ - setting: 'fof-polls.maxOptions', - type: 'number', - label: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.admin.settings.max_options'), - min: 2 - }).registerSetting({ - setting: 'fof-polls.enableGlobalPolls', - type: 'boolean', - label: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.admin.settings.enable_global_polls'), - help: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.admin.settings.enable_global_polls_help') - }).registerSetting({ - setting: 'fof-polls.image_height', - type: 'number', - label: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.admin.settings.image_height') - }).registerSetting({ - setting: 'fof-polls.image_width', - type: 'number', - label: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.admin.settings.image_width') - }).registerPermission({ - icon: 'fas fa-poll', - label: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.admin.permissions.view_results_without_voting'), - permission: 'discussion.polls.viewResultsWithoutVoting', - allowGuest: true - }, 'view').registerPermission({ - icon: 'fas fa-poll', - label: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.admin.permissions.start'), - permission: 'discussion.polls.start' - }, 'start').registerPermission({ - icon: 'fas fa-poll', - label: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.admin.permissions.start_global'), - permission: 'startGlobalPoll' - }, 'start').registerPermission({ - icon: 'fas fa-pencil-alt', - label: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.admin.permissions.self_edit'), - permission: 'polls.selfEdit' - }, 'start').registerPermission({ - icon: 'fas fa-pencil-alt', - label: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.admin.permissions.self_post_edit'), - permission: 'polls.selfPostEdit' - }, 'start').registerPermission({ - icon: 'fas fa-poll', - label: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.admin.permissions.vote'), - permission: 'discussion.polls.vote' - }, 'reply').registerPermission({ - icon: 'fas fa-poll', - label: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.admin.permissions.change_vote'), - permission: 'polls.changeVote' - }, 'reply').registerPermission({ - icon: 'fas fa-pencil-alt', - label: flarum_admin_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.admin.permissions.moderate'), - permission: 'discussion.polls.moderate' - }, 'moderate'); -}); - -/***/ }), - -/***/ "flarum/admin/app": -/*!**************************************************!*\ - !*** external "flarum.core.compat['admin/app']" ***! - \**************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['admin/app']; - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/compat get default export */ -/******/ (() => { -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = (module) => { -/******/ var getter = module && module.__esModule ? -/******/ () => (module['default']) : -/******/ () => (module); -/******/ __webpack_require__.d(getter, { a: getter }); -/******/ return getter; -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/define property getters */ -/******/ (() => { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = (exports, definition) => { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) -/******/ })(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ (() => { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = (exports) => { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ })(); -/******/ -/************************************************************************/ -var __webpack_exports__ = {}; -// This entry need to be wrapped in an IIFE because it need to be in strict mode. -(() => { -"use strict"; -/*!******************!*\ - !*** ./admin.ts ***! - \******************/ -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _src_admin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./src/admin */ "./src/admin/index.ts"); - -})(); - -module.exports = __webpack_exports__; -/******/ })() -; +(()=>{var s={n:t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},d:(t,e)=>{for(var o in e)s.o(e,o)&&!s.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},o:(s,t)=>Object.prototype.hasOwnProperty.call(s,t),r:s=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})}},t={};(()=>{"use strict";s.r(t);const e=flarum.core.compat["admin/app"];var o=s.n(e);o().initializers.add("fof/polls",(function(){o().extensionData.for("fof-polls").registerSetting({setting:"fof-polls.allowOptionImage",type:"switch",label:o().translator.trans("fof-polls.admin.settings.allow_option_image")}).registerSetting({setting:"fof-polls.optionsColorBlend",type:"switch",label:o().translator.trans("fof-polls.admin.settings.options_color_blend"),help:o().translator.trans("fof-polls.admin.settings.options_color_blend_help")}).registerSetting({setting:"fof-polls.maxOptions",type:"number",label:o().translator.trans("fof-polls.admin.settings.max_options"),min:2}).registerSetting({setting:"fof-polls.enableGlobalPolls",type:"boolean",label:o().translator.trans("fof-polls.admin.settings.enable_global_polls"),help:o().translator.trans("fof-polls.admin.settings.enable_global_polls_help")}).registerSetting({setting:"fof-polls.image_height",type:"number",label:o().translator.trans("fof-polls.admin.settings.image_height")}).registerSetting({setting:"fof-polls.image_width",type:"number",label:o().translator.trans("fof-polls.admin.settings.image_width")}).registerPermission({icon:"fas fa-poll",label:o().translator.trans("fof-polls.admin.permissions.view_results_without_voting"),permission:"discussion.polls.viewResultsWithoutVoting",allowGuest:!0},"view").registerPermission({icon:"fas fa-poll",label:o().translator.trans("fof-polls.admin.permissions.start"),permission:"discussion.polls.start"},"start").registerPermission({icon:"fas fa-poll",label:o().translator.trans("fof-polls.admin.permissions.start_global"),permission:"startGlobalPoll"},"start").registerPermission({icon:"fas fa-pencil-alt",label:o().translator.trans("fof-polls.admin.permissions.self_edit"),permission:"polls.selfEdit"},"start").registerPermission({icon:"fas fa-pencil-alt",label:o().translator.trans("fof-polls.admin.permissions.self_post_edit"),permission:"polls.selfPostEdit"},"start").registerPermission({icon:"fas fa-poll",label:o().translator.trans("fof-polls.admin.permissions.vote"),permission:"discussion.polls.vote"},"reply").registerPermission({icon:"fas fa-poll",label:o().translator.trans("fof-polls.admin.permissions.change_vote"),permission:"polls.changeVote"},"reply").registerPermission({icon:"fas fa-pencil-alt",label:o().translator.trans("fof-polls.admin.permissions.moderate"),permission:"discussion.polls.moderate"},"moderate")}))})(),module.exports=t})(); //# 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 aa3e2fd7..a63b2479 100644 --- a/js/dist/admin.js.map +++ b/js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A;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D","sources":["webpack://@fof/polls/./src/admin/index.ts","webpack://@fof/polls/external root \"flarum.core.compat['admin/app']\"","webpack://@fof/polls/webpack/bootstrap","webpack://@fof/polls/webpack/runtime/compat get default export","webpack://@fof/polls/webpack/runtime/define property getters","webpack://@fof/polls/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/polls/webpack/runtime/make namespace object","webpack://@fof/polls/./admin.ts"],"sourcesContent":["import app from 'flarum/admin/app';\n\napp.initializers.add('fof/polls', () => {\n app.extensionData\n .for('fof-polls')\n .registerSetting({\n setting: 'fof-polls.allowOptionImage',\n type: 'switch',\n label: app.translator.trans('fof-polls.admin.settings.allow_option_image'),\n })\n .registerSetting({\n setting: 'fof-polls.optionsColorBlend',\n type: 'switch',\n label: app.translator.trans('fof-polls.admin.settings.options_color_blend'),\n help: app.translator.trans('fof-polls.admin.settings.options_color_blend_help'),\n })\n .registerSetting({\n setting: 'fof-polls.maxOptions',\n type: 'number',\n label: app.translator.trans('fof-polls.admin.settings.max_options'),\n min: 2,\n })\n .registerSetting({\n setting: 'fof-polls.enableGlobalPolls',\n type: 'boolean',\n label: app.translator.trans('fof-polls.admin.settings.enable_global_polls'),\n help: app.translator.trans('fof-polls.admin.settings.enable_global_polls_help'),\n })\n .registerSetting({\n setting: 'fof-polls.image_height',\n type: 'number',\n label: app.translator.trans('fof-polls.admin.settings.image_height'),\n })\n .registerSetting({\n setting: 'fof-polls.image_width',\n type: 'number',\n label: app.translator.trans('fof-polls.admin.settings.image_width'),\n })\n .registerPermission(\n {\n icon: 'fas fa-poll',\n label: app.translator.trans('fof-polls.admin.permissions.view_results_without_voting'),\n permission: 'discussion.polls.viewResultsWithoutVoting',\n allowGuest: true,\n },\n 'view'\n )\n .registerPermission(\n {\n icon: 'fas fa-poll',\n label: app.translator.trans('fof-polls.admin.permissions.start'),\n permission: 'discussion.polls.start',\n },\n 'start'\n )\n .registerPermission(\n {\n icon: 'fas fa-poll',\n label: app.translator.trans('fof-polls.admin.permissions.start_global'),\n permission: 'startGlobalPoll',\n },\n 'start'\n )\n .registerPermission(\n {\n icon: 'fas fa-pencil-alt',\n label: app.translator.trans('fof-polls.admin.permissions.self_edit'),\n permission: 'polls.selfEdit',\n },\n 'start'\n )\n .registerPermission(\n {\n icon: 'fas fa-pencil-alt',\n label: app.translator.trans('fof-polls.admin.permissions.self_post_edit'),\n permission: 'polls.selfPostEdit',\n },\n 'start'\n )\n .registerPermission(\n {\n icon: 'fas fa-poll',\n label: app.translator.trans('fof-polls.admin.permissions.vote'),\n permission: 'discussion.polls.vote',\n },\n 'reply'\n )\n .registerPermission(\n {\n icon: 'fas fa-poll',\n label: app.translator.trans('fof-polls.admin.permissions.change_vote'),\n permission: 'polls.changeVote',\n },\n 'reply'\n )\n .registerPermission(\n {\n icon: 'fas fa-pencil-alt',\n label: app.translator.trans('fof-polls.admin.permissions.moderate'),\n permission: 'discussion.polls.moderate',\n },\n 'moderate'\n );\n});\n","module.exports = flarum.core.compat['admin/app'];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export * from './src/admin';\n"],"names":["app","initializers","add","extensionData","registerSetting","setting","type","label","translator","trans","help","min","registerPermission","icon","permission","allowGuest"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,O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AAM,cACNL,MAAOL,IAAAA,WAAeM,MAAM,2CAC5BK,WAAY,oBAEd,SAEDF,mBACC,CACEC,KAAM,oBACNL,MAAOL,IAAAA,WAAeM,MAAM,wCAC5BK,WAAY,6BAEd,WAEN,G","sources":["webpack://@fof/polls/webpack/bootstrap","webpack://@fof/polls/webpack/runtime/compat get default export","webpack://@fof/polls/webpack/runtime/define property getters","webpack://@fof/polls/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/polls/webpack/runtime/make namespace object","webpack://@fof/polls/external root \"flarum.core.compat['admin/app']\"","webpack://@fof/polls/./src/admin/index.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","import app from 'flarum/admin/app';\n\napp.initializers.add('fof/polls', () => {\n app.extensionData\n .for('fof-polls')\n .registerSetting({\n setting: 'fof-polls.allowOptionImage',\n type: 'switch',\n label: app.translator.trans('fof-polls.admin.settings.allow_option_image'),\n })\n .registerSetting({\n setting: 'fof-polls.optionsColorBlend',\n type: 'switch',\n label: app.translator.trans('fof-polls.admin.settings.options_color_blend'),\n help: app.translator.trans('fof-polls.admin.settings.options_color_blend_help'),\n })\n .registerSetting({\n setting: 'fof-polls.maxOptions',\n type: 'number',\n label: app.translator.trans('fof-polls.admin.settings.max_options'),\n min: 2,\n })\n .registerSetting({\n setting: 'fof-polls.enableGlobalPolls',\n type: 'boolean',\n label: app.translator.trans('fof-polls.admin.settings.enable_global_polls'),\n help: app.translator.trans('fof-polls.admin.settings.enable_global_polls_help'),\n })\n .registerSetting({\n setting: 'fof-polls.image_height',\n type: 'number',\n label: app.translator.trans('fof-polls.admin.settings.image_height'),\n })\n .registerSetting({\n setting: 'fof-polls.image_width',\n type: 'number',\n label: app.translator.trans('fof-polls.admin.settings.image_width'),\n })\n .registerPermission(\n {\n icon: 'fas fa-poll',\n label: app.translator.trans('fof-polls.admin.permissions.view_results_without_voting'),\n permission: 'discussion.polls.viewResultsWithoutVoting',\n allowGuest: true,\n },\n 'view'\n )\n .registerPermission(\n {\n icon: 'fas fa-poll',\n label: app.translator.trans('fof-polls.admin.permissions.start'),\n permission: 'discussion.polls.start',\n },\n 'start'\n )\n .registerPermission(\n {\n icon: 'fas fa-poll',\n label: app.translator.trans('fof-polls.admin.permissions.start_global'),\n permission: 'startGlobalPoll',\n },\n 'start'\n )\n .registerPermission(\n {\n icon: 'fas fa-pencil-alt',\n label: app.translator.trans('fof-polls.admin.permissions.self_edit'),\n permission: 'polls.selfEdit',\n },\n 'start'\n )\n .registerPermission(\n {\n icon: 'fas fa-pencil-alt',\n label: app.translator.trans('fof-polls.admin.permissions.self_post_edit'),\n permission: 'polls.selfPostEdit',\n },\n 'start'\n )\n .registerPermission(\n {\n icon: 'fas fa-poll',\n label: app.translator.trans('fof-polls.admin.permissions.vote'),\n permission: 'discussion.polls.vote',\n },\n 'reply'\n )\n .registerPermission(\n {\n icon: 'fas fa-poll',\n label: app.translator.trans('fof-polls.admin.permissions.change_vote'),\n permission: 'polls.changeVote',\n },\n 'reply'\n )\n .registerPermission(\n {\n icon: 'fas fa-pencil-alt',\n label: app.translator.trans('fof-polls.admin.permissions.moderate'),\n permission: 'discussion.polls.moderate',\n },\n 'moderate'\n );\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","app","add","registerSetting","setting","type","label","trans","help","min","registerPermission","icon","permission","allowGuest"],"sourceRoot":""} \ No newline at end of file diff --git a/js/dist/forum.js b/js/dist/forum.js index 40f30f2d..82eaae55 100644 --- a/js/dist/forum.js +++ b/js/dist/forum.js @@ -1,5652 +1,3 @@ -/******/ (() => { // webpackBootstrap -/******/ var __webpack_modules__ = ({ - -/***/ "./src/forum/addComposerItems.tsx": -/*!****************************************!*\ - !*** ./src/forum/addComposerItems.tsx ***! - \****************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ addToComposer: () => (/* binding */ addToComposer), -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/extend */ "flarum/common/extend"); -/* harmony import */ var flarum_common_extend__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/utils/classList */ "flarum/common/utils/classList"); -/* harmony import */ var flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_forum_components_DiscussionComposer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/forum/components/DiscussionComposer */ "flarum/forum/components/DiscussionComposer"); -/* harmony import */ var flarum_forum_components_DiscussionComposer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_DiscussionComposer__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var flarum_forum_components_ReplyComposer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/forum/components/ReplyComposer */ "flarum/forum/components/ReplyComposer"); -/* harmony import */ var flarum_forum_components_ReplyComposer__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_ReplyComposer__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var _components_CreatePollModal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./components/CreatePollModal */ "./src/forum/components/CreatePollModal.tsx"); - - - - - - -function toPoll(data) { - if (data) { - var poll = flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().store.createRecord('polls'); - poll.tempOptions = data.options.map(function (option) { - var pollOption = flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().store.createRecord('poll_options'); - pollOption.pushAttributes(option); - return pollOption; - }); - poll.pushAttributes(data); - return poll; - } - return data; -} -var addToComposer = function addToComposer(composer) { - // @ts-ignore - composer.prototype.addPoll = function () { - var _this = this; - flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().modal.show(_components_CreatePollModal__WEBPACK_IMPORTED_MODULE_5__["default"], { - poll: toPoll(this.composer.fields.poll), - onsubmit: function onsubmit(poll) { - return _this.composer.fields.poll = poll; - } - }); - }; - - // Add button to DiscussionComposer header - (0,flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__.extend)(composer.prototype, 'headerItems', function (items) { - var _this$composer$body, _discussion$canStartP; - var discussion = (_this$composer$body = this.composer.body) == null || (_this$composer$body = _this$composer$body.attrs) == null ? void 0 : _this$composer$body.discussion; - - // @ts-ignore - var canStartPoll = (_discussion$canStartP = discussion == null ? void 0 : discussion.canStartPoll()) != null ? _discussion$canStartP : flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().forum.canStartPolls(); - if (canStartPoll) { - items.add('polls', m("a", { - className: "ComposerBody-poll", - onclick: this.addPoll.bind(this) - }, m("span", { - className: flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_2___default()('PollLabel', !this.composer.fields.poll && 'none') - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans("fof-polls.forum.composer_discussion." + (this.composer.fields.poll ? 'edit' : 'add') + "_poll"))), 1); - } - }); - (0,flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__.extend)(composer.prototype, 'data', function (data) { - if (this.composer.fields.poll) { - data.poll = this.composer.fields.poll; - } - }); -}; -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (function () { - addToComposer((flarum_forum_components_DiscussionComposer__WEBPACK_IMPORTED_MODULE_3___default())); - addToComposer((flarum_forum_components_ReplyComposer__WEBPACK_IMPORTED_MODULE_4___default())); -}); - -/***/ }), - -/***/ "./src/forum/addDiscussionBadge.tsx": -/*!******************************************!*\ - !*** ./src/forum/addDiscussionBadge.tsx ***! - \******************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/extend */ "flarum/common/extend"); -/* harmony import */ var flarum_common_extend__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_components_Badge__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/components/Badge */ "flarum/common/components/Badge"); -/* harmony import */ var flarum_common_components_Badge__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Badge__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_forum_components_DiscussionList__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/forum/components/DiscussionList */ "flarum/forum/components/DiscussionList"); -/* harmony import */ var flarum_forum_components_DiscussionList__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_DiscussionList__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var flarum_common_models_Discussion__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/common/models/Discussion */ "flarum/common/models/Discussion"); -/* harmony import */ var flarum_common_models_Discussion__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_common_models_Discussion__WEBPACK_IMPORTED_MODULE_4__); - - - - - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (function () { - // @ts-ignore - (0,flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__.extend)((flarum_forum_components_DiscussionList__WEBPACK_IMPORTED_MODULE_3___default().prototype), 'requestParams', function (params) { - params.include.push('poll'); - }); - (0,flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__.extend)((flarum_common_models_Discussion__WEBPACK_IMPORTED_MODULE_4___default().prototype), 'badges', function (badges) { - // @ts-ignore - if (this.hasPoll()) { - badges.add('poll', flarum_common_components_Badge__WEBPACK_IMPORTED_MODULE_2___default().component({ - type: 'poll', - label: flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.forum.tooltip.badge'), - icon: 'fas fa-poll' - }), 5); - } - }); -}); - -/***/ }), - -/***/ "./src/forum/addNavItem.ts": -/*!*********************************!*\ - !*** ./src/forum/addNavItem.ts ***! - \*********************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ addNavItem) -/* harmony export */ }); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/extend */ "flarum/common/extend"); -/* harmony import */ var flarum_common_extend__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/forum/components/IndexPage */ "flarum/forum/components/IndexPage"); -/* harmony import */ var flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_common_components_LinkButton__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/common/components/LinkButton */ "flarum/common/components/LinkButton"); -/* harmony import */ var flarum_common_components_LinkButton__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_LinkButton__WEBPACK_IMPORTED_MODULE_3__); - - - - -function addNavItem() { - (0,flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__.extend)((flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_2___default().prototype), 'navItems', function (items) { - if (!flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().forum.attribute('globalPollsEnabled')) { - return; - } - items.add('fof-polls-showcase', flarum_common_components_LinkButton__WEBPACK_IMPORTED_MODULE_3___default().component({ - href: flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().route('fof.polls.showcase'), - icon: 'fas fa-poll' - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.forum.page.nav')), 35); - var showAllGlobalPolls = flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().forum.attribute('canStartGlobalPolls'); - if (showAllGlobalPolls) { - items.add('fof-polls-list', flarum_common_components_LinkButton__WEBPACK_IMPORTED_MODULE_3___default().component({ - href: flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().route('fof.polls.list'), - icon: 'fas fa-list' - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().translator.trans('fof-polls.forum.page.nav-all')), 32); - } - }); -} - -/***/ }), - -/***/ "./src/forum/addPollsToPost.tsx": -/*!**************************************!*\ - !*** ./src/forum/addPollsToPost.tsx ***! - \**************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/extend */ "flarum/common/extend"); -/* harmony import */ var flarum_common_extend__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_forum_components_CommentPost__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/forum/components/CommentPost */ "flarum/forum/components/CommentPost"); -/* harmony import */ var flarum_forum_components_CommentPost__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_CommentPost__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _components_PollView__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components/PollView */ "./src/forum/components/PollView.tsx"); -/* harmony import */ var flarum_forum_components_DiscussionPage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/forum/components/DiscussionPage */ "flarum/forum/components/DiscussionPage"); -/* harmony import */ var flarum_forum_components_DiscussionPage__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_DiscussionPage__WEBPACK_IMPORTED_MODULE_4__); -function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } - - - - - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (function () { - (0,flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__.extend)((flarum_forum_components_CommentPost__WEBPACK_IMPORTED_MODULE_2___default().prototype), 'content', function (content) { - var post = this.attrs.post; - if ((!post.isHidden() || this.revealContent) && post.polls()) { - for (var _iterator = _createForOfIteratorHelperLoose(post.polls()), _step; !(_step = _iterator()).done;) { - var poll = _step.value; - if (poll) { - content.push(m(_components_PollView__WEBPACK_IMPORTED_MODULE_3__["default"], { - poll: poll - })); - } - } - } - }); - (0,flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__.extend)((flarum_forum_components_CommentPost__WEBPACK_IMPORTED_MODULE_2___default().prototype), 'oninit', function () { - var _this = this; - this.subtree.check(function () { - var polls = _this.attrs.post.polls(); - var checks = polls == null || polls.map == null ? void 0 : polls.map(function (poll) { - var _poll$data, _poll$options$map, _poll$options, _poll$myVotes$map, _poll$myVotes; - return poll && [(_poll$data = poll.data) == null ? void 0 : _poll$data.attributes, (_poll$options$map = (_poll$options = poll.options()).map) == null ? void 0 : _poll$options$map.call(_poll$options, function (option) { - var _option$data; - return option == null || (_option$data = option.data) == null ? void 0 : _option$data.attributes; - }), (_poll$myVotes$map = (_poll$myVotes = poll.myVotes()).map) == null ? void 0 : _poll$myVotes$map.call(_poll$myVotes, function (vote) { - var _vote$option; - return (_vote$option = vote.option()) == null ? void 0 : _vote$option.id(); - })]; - }); - return JSON.stringify(checks); - }); - }); - (0,flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__.extend)((flarum_forum_components_DiscussionPage__WEBPACK_IMPORTED_MODULE_4___default().prototype), 'oncreate', function () { - // @ts-ignore - if ((flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().pusher)) { - // @ts-ignore - flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().pusher.then(function (binding) { - // We will listen for updates to all polls and options - // Even if that model is not in the current discussion, it doesn't really matter - binding.channels.main.bind('updatedPollOptions', function (data) { - var poll = flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().store.getById('polls', data['pollId']); - if (poll) { - poll.pushAttributes({ - voteCount: data['pollVoteCount'] - }); - - // Not redrawing here, as the option below should trigger the redraw already - } - var changedOptions = data['options']; - for (var optionId in changedOptions) { - var option = flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().store.getById('poll_options', optionId); - if (option && option.voteCount() !== undefined) { - option.pushAttributes({ - voteCount: changedOptions[optionId] - }); - } - } - m.redraw(); - }); - }); - } - }); - (0,flarum_common_extend__WEBPACK_IMPORTED_MODULE_1__.extend)((flarum_forum_components_DiscussionPage__WEBPACK_IMPORTED_MODULE_4___default().prototype), 'onremove', function () { - // @ts-ignore - if ((flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().pusher)) { - // @ts-ignore - flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().pusher.then(function (binding) { - binding.channels.main.unbind('updatedPollOptions'); - }); - } - }); -}); - -/***/ }), - -/***/ "./src/forum/addPostControls.tsx": -/*!***************************************!*\ - !*** ./src/forum/addPostControls.tsx ***! - \***************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_extend__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/extend */ "flarum/common/extend"); -/* harmony import */ var flarum_common_extend__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_extend__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_forum_utils_PostControls__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/forum/utils/PostControls */ "flarum/forum/utils/PostControls"); -/* harmony import */ var flarum_forum_utils_PostControls__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_utils_PostControls__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _components_CreatePollModal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components/CreatePollModal */ "./src/forum/components/CreatePollModal.tsx"); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! flarum/common/components/Button */ "flarum/common/components/Button"); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_5__); - - - - - - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (function () { - var createPoll = function createPoll(post) { - return flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().modal.show(_components_CreatePollModal__WEBPACK_IMPORTED_MODULE_4__["default"], { - onsubmit: function onsubmit(data) { - return flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().store.createRecord('polls').save((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, data, { - relationships: { - post: post - } - }), { - data: { - include: 'options,myVotes,myVotes.option' - } - }).then(function (poll) { - var _post$rawRelationship; - // @ts-ignore - (_post$rawRelationship = post.rawRelationship('polls')) == null || _post$rawRelationship.push == null || _post$rawRelationship.push({ - type: 'polls', - id: poll.id() - }); - return poll; - }); - } - }); - }; - (0,flarum_common_extend__WEBPACK_IMPORTED_MODULE_2__.extend)((flarum_forum_utils_PostControls__WEBPACK_IMPORTED_MODULE_3___default()), 'moderationControls', function (items, post) { - // @ts-ignore - if (!post.isHidden() && post.canStartPoll()) { - items.add('addPoll', m((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_5___default()), { - icon: "fas fa-poll", - onclick: createPoll.bind(this, post) - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.moderation.add'))); - } - }); -}); - -/***/ }), - -/***/ "./src/forum/components/AbstractPollPage.tsx": -/*!***************************************************!*\ - !*** ./src/forum/components/AbstractPollPage.tsx ***! - \***************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ AbstractPollPage: () => (/* binding */ AbstractPollPage) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_common_components_Page__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/components/Page */ "flarum/common/components/Page"); -/* harmony import */ var flarum_common_components_Page__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Page__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/utils/ItemList */ "flarum/common/utils/ItemList"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/common/components/LoadingIndicator */ "flarum/common/components/LoadingIndicator"); -/* harmony import */ var flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/forum/components/IndexPage */ "flarum/forum/components/IndexPage"); -/* harmony import */ var flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! flarum/common/helpers/listItems */ "flarum/common/helpers/listItems"); -/* harmony import */ var flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_6__); -/* harmony import */ var flarum_common_components_SelectDropdown__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! flarum/common/components/SelectDropdown */ "flarum/common/components/SelectDropdown"); -/* harmony import */ var flarum_common_components_SelectDropdown__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_SelectDropdown__WEBPACK_IMPORTED_MODULE_7__); -/* harmony import */ var _PollPageHero__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./PollPageHero */ "./src/forum/components/PollPageHero.tsx"); - - - - - - - - - -var AbstractPollPage = /*#__PURE__*/function (_Page) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(AbstractPollPage, _Page); - function AbstractPollPage() { - var _this; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _Page.call.apply(_Page, [this].concat(args)) || this; - _this.loading = false; - _this.poll = null; - _this.polls = []; - return _this; - } - var _proto = AbstractPollPage.prototype; - _proto.view = function view() { - return m("div", { - className: "PollsPage" - }, this.pageContent().toArray()); - }; - _proto.pageContent = function pageContent() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2___default())(); - items.add('hero', this.hero(), 100); - items.add('main', m("div", { - className: "container" - }, this.mainContent().toArray()), 10); - return items; - }; - _proto.mainContent = function mainContent() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2___default())(); - items.add('sidebar', this.sidebar(), 100); - items.add('content', this.content(), 10); - return items; - }; - _proto.content = function content() { - return m("div", { - className: "PollsPage-content sideNavOffset" - }, this.contentItems().toArray()); - }; - _proto.contentItems = function contentItems() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2___default())(); - if (this.loading) { - items.add('loading', m((flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_3___default()), null)); - } - return items; - }; - _proto.hero = function hero() { - return m(_PollPageHero__WEBPACK_IMPORTED_MODULE_8__["default"], null); - }; - _proto.sidebar = function sidebar() { - return m("nav", { - className: "PollsPage-nav IndexPage-nav sideNav" - }, m("ul", null, flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_5___default()(this.sidebarItems().toArray()))); - }; - _proto.sidebarItems = function sidebarItems() { - var items = flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_4___default().prototype.sidebarItems(); - items.setContent('nav', m((flarum_common_components_SelectDropdown__WEBPACK_IMPORTED_MODULE_7___default()), { - buttonClassName: "Button", - className: "App-titleControl", - accessibleToggleLabel: flarum_forum_app__WEBPACK_IMPORTED_MODULE_6___default().translator.trans('core.forum.index.toggle_sidenav_dropdown_accessible_label') - }, this.navItems().toArray())); - return items; - }; - _proto.navItems = function navItems() { - var items = flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_4___default().prototype.navItems(); - if (flarum_forum_app__WEBPACK_IMPORTED_MODULE_6___default().initializers.has('flarum-tags')) { - // remove the tags from the nav items - items.remove('separator'); - items.remove('moreTags'); - - // each tag is added using the key "tag{id}". We need to remove all of them - for (var key in items.toObject()) { - if (key.startsWith('tag') && key !== 'tags') { - items.remove(key); - } - } - } - return items; - }; - return AbstractPollPage; -}((flarum_common_components_Page__WEBPACK_IMPORTED_MODULE_1___default())); - -/***/ }), - -/***/ "./src/forum/components/ComposePollHero.tsx": -/*!**************************************************!*\ - !*** ./src/forum/components/ComposePollHero.tsx ***! - \**************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ ComposePollHero) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/Component */ "flarum/common/Component"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Component__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_common_components_LinkButton__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/common/components/LinkButton */ "flarum/common/components/LinkButton"); -/* harmony import */ var flarum_common_components_LinkButton__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_LinkButton__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/common/utils/ItemList */ "flarum/common/utils/ItemList"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_4__); - - - - - -var ComposePollHero = /*#__PURE__*/function (_Component) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(ComposePollHero, _Component); - function ComposePollHero() { - var _this; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _Component.call.apply(_Component, [this].concat(args)) || this; - _this.poll = void 0; - return _this; - } - var _proto = ComposePollHero.prototype; - _proto.oninit = function oninit(vnode) { - _Component.prototype.oninit.call(this, vnode); - this.poll = this.attrs.poll; - }; - _proto.view = function view() { - return m("div", { - className: "ComposePollHero Hero" - }, m("div", { - className: "container" - }, m("div", { - className: "containerNarrow" - }, m("h2", { - className: "Hero-title" - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans("fof-polls.forum.compose." + (!!this.poll.id() ? 'edit' : 'add') + "_title")), m("div", { - className: "ComposePollHero-controls" - }, this.controlItems().toArray())))); - }; - _proto.controlItems = function controlItems() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_4___default())(); - items.add('edit', m((flarum_common_components_LinkButton__WEBPACK_IMPORTED_MODULE_3___default()), { - icon: "far fa-edit", - className: "Button Button--secondary GlobalPollListLink", - itemClassName: "App-primaryControl", - href: flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().route('fof.polls.list') - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.compose.polls_manager'))); - if (this.poll.exists) { - items.add('view', m((flarum_common_components_LinkButton__WEBPACK_IMPORTED_MODULE_3___default()), { - icon: "far fa-arrow-up-right-from-square", - className: "Button Button--secondary PollPreviewLink", - itemClassName: "App-primaryControl", - href: flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().route('fof.polls.view', { - id: this.poll.id() - }) - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.compose.polls_preview'))); - } - return items; - }; - return ComposePollHero; -}((flarum_common_Component__WEBPACK_IMPORTED_MODULE_2___default())); - - -/***/ }), - -/***/ "./src/forum/components/ComposePollPage.tsx": -/*!**************************************************!*\ - !*** ./src/forum/components/ComposePollPage.tsx ***! - \**************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ ComposePollPage) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js"); -/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var flarum_common_components_Page__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/common/components/Page */ "flarum/common/components/Page"); -/* harmony import */ var flarum_common_components_Page__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Page__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! flarum/common/components/LoadingIndicator */ "flarum/common/components/LoadingIndicator"); -/* harmony import */ var flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var _PollForm__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./PollForm */ "./src/forum/components/PollForm.tsx"); -/* harmony import */ var _states_PollFormState__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../states/PollFormState */ "./src/forum/states/PollFormState.ts"); -/* harmony import */ var _ComposePollHero__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./ComposePollHero */ "./src/forum/components/ComposePollHero.tsx"); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! flarum/common/components/Button */ "flarum/common/components/Button"); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_9__); -/* harmony import */ var flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! flarum/common/helpers/listItems */ "flarum/common/helpers/listItems"); -/* harmony import */ var flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_10__); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! flarum/common/utils/ItemList */ "flarum/common/utils/ItemList"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_11__); -/* harmony import */ var flarum_common_components_SelectDropdown__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! flarum/common/components/SelectDropdown */ "flarum/common/components/SelectDropdown"); -/* harmony import */ var flarum_common_components_SelectDropdown__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_SelectDropdown__WEBPACK_IMPORTED_MODULE_12__); -/* harmony import */ var flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! flarum/forum/components/IndexPage */ "flarum/forum/components/IndexPage"); -/* harmony import */ var flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_13__); - - - - - - - - - - - - - - -var ComposePollPage = /*#__PURE__*/function (_Page) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(ComposePollPage, _Page); - function ComposePollPage() { - var _this; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _Page.call.apply(_Page, [this].concat(args)) || this; - _this.poll = null; - _this.loading = false; - return _this; - } - var _proto = ComposePollPage.prototype; - _proto.oninit = function oninit(vnode) { - var _this2 = this, - _this$poll, - _this$poll2; - _Page.prototype.oninit.call(this, vnode); - if (!flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().forum.attribute('globalPollsEnabled')) { - m.route.set('/'); - return; - } - - // Get the `edit` parameter from the URL - var editId = m.route.param('id'); - if (editId) { - this.poll = flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().store.getById('poll', editId); - if (!this.poll) { - this.loading = true; - flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().store.find('fof/polls', editId).then(function (item) { - var _this2$poll; - _this2.poll = item; - _this2.loading = false; - flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().setTitle(flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().translator.trans("fof-polls.forum.compose." + (!!((_this2$poll = _this2.poll) != null && _this2$poll.id()) ? 'edit' : 'add') + "_title")); - m.redraw(); - }); - } - } else { - this.poll = _states_PollFormState__WEBPACK_IMPORTED_MODULE_7__["default"].createNewPoll(); - } - flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().history.push('compose-poll', flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().translator.trans("fof-polls.forum.compose." + (!!((_this$poll = this.poll) != null && _this$poll.id()) ? 'edit' : 'add') + "_title")); - this.bodyClass = 'App--compose-poll'; - flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().setTitle(flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().translator.trans("fof-polls.forum.compose." + (!!((_this$poll2 = this.poll) != null && _this$poll2.id()) ? 'edit' : 'add') + "_title")); - }; - _proto.view = function view() { - // prevent users from accessing the page if they can't start global polls - if (!flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().forum.attribute('canStartGlobalPolls')) { - m.route.set('/'); - return; - } - if (this.loading) { - return m((flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_5___default()), null); - } - return m("div", { - className: "ComposePollPage" - }, m(_ComposePollHero__WEBPACK_IMPORTED_MODULE_8__["default"], { - poll: this.poll - }), m("div", { - className: "container" - }, m("div", { - className: "sideNavContainer" - }, m("nav", { - className: "PollsPage-nav sideNav" - }, m("ul", null, flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_10___default()(this.sidebarItems().toArray()))), m("div", { - className: "sideNavOffset" - }, m(_PollForm__WEBPACK_IMPORTED_MODULE_6__["default"], { - poll: this.poll, - onsubmit: this.onsubmit.bind(this) - }))))); - }; - _proto.onsubmit = /*#__PURE__*/function () { - var _onsubmit = (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(data, state) { - var isNew, alertAttrs, alertId; - return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee$(_context) { - while (1) switch (_context.prev = _context.next) { - case 0: - isNew = state.poll.id() === undefined; - _context.next = 3; - return state.save(data); - case 3: - alertAttrs = isNew ? { - type: 'success', - controls: [m((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_9___default()), { - className: "Button Button--link", - onclick: function onclick() { - return m.route.set(flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().route('fof.polls.compose', { - id: state.poll.id() - })); - } - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().translator.trans('fof-polls.forum.compose.continue_editing'))] - } : { - type: 'success' - }; // Show success alert - alertId = flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().alerts.show(alertAttrs, flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().translator.trans('fof-polls.forum.compose.success')); // Hide alert after 10 seconds - setTimeout(function () { - return flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().alerts.dismiss(alertId); - }, 10000); - if (isNew) { - m.route.set(flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().route('fof.polls.list')); - } - case 7: - case "end": - return _context.stop(); - } - }, _callee); - })); - function onsubmit(_x, _x2) { - return _onsubmit.apply(this, arguments); - } - return onsubmit; - }(); - _proto.sidebarItems = function sidebarItems() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_11___default())(); - items.add('nav', m((flarum_common_components_SelectDropdown__WEBPACK_IMPORTED_MODULE_12___default()), { - buttonClassName: "Button", - className: "App-titleControl", - accessibleToggleLabel: flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().translator.trans('core.forum.index.toggle_sidenav_dropdown_accessible_label') - }, this.navItems().toArray())); - return items; - }; - _proto.navItems = function navItems() { - return flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_13___default().prototype.navItems(); - }; - return ComposePollPage; -}((flarum_common_components_Page__WEBPACK_IMPORTED_MODULE_4___default())); - - -/***/ }), - -/***/ "./src/forum/components/CreatePollModal.tsx": -/*!**************************************************!*\ - !*** ./src/forum/components/CreatePollModal.tsx ***! - \**************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ CreatePollModal) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js"); -/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var flarum_common_components_Modal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/common/components/Modal */ "flarum/common/components/Modal"); -/* harmony import */ var flarum_common_components_Modal__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Modal__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var _PollForm__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./PollForm */ "./src/forum/components/PollForm.tsx"); - - - - - - -var CreatePollModal = /*#__PURE__*/function (_Modal) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(CreatePollModal, _Modal); - function CreatePollModal() { - return _Modal.apply(this, arguments) || this; - } - var _proto = CreatePollModal.prototype; - _proto.title = function title() { - return flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().translator.trans('fof-polls.forum.modal.add_title'); - }; - _proto.className = function className() { - return 'PollDiscussionModal Modal--medium'; - }; - _proto.content = function content() { - return [m("div", { - className: "Modal-body" - }, m(_PollForm__WEBPACK_IMPORTED_MODULE_5__["default"], { - poll: this.attrs.poll, - onsubmit: this.onFormSubmit.bind(this) - }))]; - }; - _proto.onFormSubmit = /*#__PURE__*/function () { - var _onFormSubmit = (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(data, state) { - return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee$(_context) { - while (1) switch (_context.prev = _context.next) { - case 0: - this.hide(); - _context.next = 3; - return this.attrs.onsubmit(data); - case 3: - case "end": - return _context.stop(); - } - }, _callee, this); - })); - function onFormSubmit(_x, _x2) { - return _onFormSubmit.apply(this, arguments); - } - return onFormSubmit; - }(); - return CreatePollModal; -}((flarum_common_components_Modal__WEBPACK_IMPORTED_MODULE_4___default())); - - -/***/ }), - -/***/ "./src/forum/components/EditPollModal.tsx": -/*!************************************************!*\ - !*** ./src/forum/components/EditPollModal.tsx ***! - \************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ EditPollModal) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js"); -/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _CreatePollModal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./CreatePollModal */ "./src/forum/components/CreatePollModal.tsx"); - - - - - -var EditPollModal = /*#__PURE__*/function (_CreatePollModal) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(EditPollModal, _CreatePollModal); - function EditPollModal() { - return _CreatePollModal.apply(this, arguments) || this; - } - var _proto = EditPollModal.prototype; - _proto.title = function title() { - return flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().translator.trans('fof-polls.forum.modal.edit_title'); - }; - _proto.onFormSubmit = /*#__PURE__*/function () { - var _onFormSubmit = (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(data, state) { - var alertId; - return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee$(_context) { - while (1) switch (_context.prev = _context.next) { - case 0: - _context.next = 2; - return state.save(data); - case 2: - // Show success alert - alertId = flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().alerts.show({ - type: 'success' - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().translator.trans('fof-polls.forum.compose.success')); // Hide alert after 10 seconds - setTimeout(function () { - return flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().alerts.dismiss(alertId); - }, 10000); - case 4: - case "end": - return _context.stop(); - } - }, _callee); - })); - function onFormSubmit(_x, _x2) { - return _onFormSubmit.apply(this, arguments); - } - return onFormSubmit; - }(); - return EditPollModal; -}(_CreatePollModal__WEBPACK_IMPORTED_MODULE_4__["default"]); - - -/***/ }), - -/***/ "./src/forum/components/ListVotersModal.tsx": -/*!**************************************************!*\ - !*** ./src/forum/components/ListVotersModal.tsx ***! - \**************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ ListVotersModal) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_components_Modal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/components/Modal */ "flarum/common/components/Modal"); -/* harmony import */ var flarum_common_components_Modal__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Modal__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_common_helpers_avatar__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/common/helpers/avatar */ "flarum/common/helpers/avatar"); -/* harmony import */ var flarum_common_helpers_avatar__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_common_helpers_avatar__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var flarum_common_helpers_username__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/common/helpers/username */ "flarum/common/helpers/username"); -/* harmony import */ var flarum_common_helpers_username__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_common_helpers_username__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var flarum_common_components_Link__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! flarum/common/components/Link */ "flarum/common/components/Link"); -/* harmony import */ var flarum_common_components_Link__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Link__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! flarum/common/components/LoadingIndicator */ "flarum/common/components/LoadingIndicator"); -/* harmony import */ var flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_6__); - - - - - - - -var ListVotersModal = /*#__PURE__*/function (_Modal) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(ListVotersModal, _Modal); - function ListVotersModal() { - return _Modal.apply(this, arguments) || this; - } - var _proto = ListVotersModal.prototype; - _proto.oninit = function oninit(vnode) { - var _this = this; - _Modal.prototype.oninit.call(this, vnode); - this.loading = true; - flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().store.find('fof/polls', this.attrs.poll.id(), { - include: 'votes,votes.user,votes.option' - }).then(function () { - return _this.loading = false; - })["finally"](function () { - return m.redraw(); - }); - }; - _proto.className = function className() { - return 'Modal--medium VotesModal'; - }; - _proto.title = function title() { - return flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.votes_modal.title'); - }; - _proto.content = function content() { - var options = this.attrs.poll.options(); - return m("div", { - className: "Modal-body" - }, this.loading ? m((flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_6___default()), null) : options.map(this.optionContent.bind(this))); - }; - _proto.optionContent = function optionContent(opt) { - var votes = (this.attrs.poll.votes() || []).filter(function (v) { - return opt.id() === v.option().id(); - }); - return m("div", { - className: "VotesModal-option" - }, m("h3", null, this.optionAnswer(opt) + ':'), votes.length ? m("div", { - className: "VotesModal-list" - }, votes.map(this.voteContent.bind(this))) : m("h4", null, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.modal.no_voters'))); - }; - _proto.optionAnswer = function optionAnswer(opt) { - return opt.answer(); - }; - _proto.voteContent = function voteContent(vote) { - var user = vote.user(); - var attrs = user && { - href: flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().route.user(user) - }; - return m((flarum_common_components_Link__WEBPACK_IMPORTED_MODULE_5___default()), attrs, flarum_common_helpers_avatar__WEBPACK_IMPORTED_MODULE_3___default()(user), " ", flarum_common_helpers_username__WEBPACK_IMPORTED_MODULE_4___default()(user)); - }; - return ListVotersModal; -}((flarum_common_components_Modal__WEBPACK_IMPORTED_MODULE_2___default())); - - -/***/ }), - -/***/ "./src/forum/components/Poll/PollImage.tsx": -/*!*************************************************!*\ - !*** ./src/forum/components/Poll/PollImage.tsx ***! - \*************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollImage) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/Component */ "flarum/common/Component"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Component__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/utils/ItemList */ "flarum/common/utils/ItemList"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2__); - - - -var PollImage = /*#__PURE__*/function (_Component) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PollImage, _Component); - function PollImage() { - var _this; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _Component.call.apply(_Component, [this].concat(args)) || this; - _this.imageUrl = null; - _this.imageAlt = null; - return _this; - } - var _proto = PollImage.prototype; - _proto.oninit = function oninit(vnode) { - _Component.prototype.oninit.call(this, vnode); - this.imageUrl = this.attrs.poll.imageUrl(); - this.imageAlt = this.attrs.poll.imageAlt(); - }; - _proto.view = function view() { - if (!this.imageUrl) { - return; - } - return m("div", { - className: "PollImage" - }, this.imageItems().toArray()); - }; - _proto.imageItems = function imageItems() { - var _this$imageAlt; - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2___default())(); - items.add('image', m("img", { - src: this.imageUrl, - alt: (_this$imageAlt = this.imageAlt) != null ? _this$imageAlt : '', - className: "PollImage-image", - loading: "lazy" - })); - return items; - }; - return PollImage; -}((flarum_common_Component__WEBPACK_IMPORTED_MODULE_1___default())); - - -/***/ }), - -/***/ "./src/forum/components/Poll/PollList.tsx": -/*!************************************************!*\ - !*** ./src/forum/components/Poll/PollList.tsx ***! - \************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollList) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/Component */ "flarum/common/Component"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Component__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _PollListItem__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PollListItem */ "./src/forum/components/Poll/PollListItem.tsx"); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/common/components/Button */ "flarum/common/components/Button"); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! flarum/common/components/LoadingIndicator */ "flarum/common/components/LoadingIndicator"); -/* harmony import */ var flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var flarum_common_components_Placeholder__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! flarum/common/components/Placeholder */ "flarum/common/components/Placeholder"); -/* harmony import */ var flarum_common_components_Placeholder__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Placeholder__WEBPACK_IMPORTED_MODULE_6__); -/* harmony import */ var flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! flarum/common/utils/classList */ "flarum/common/utils/classList"); -/* harmony import */ var flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_7__); - - - - - - - - -/** - * The `PollList` component displays a list of polls. - */ -var PollList = /*#__PURE__*/function (_Component) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PollList, _Component); - function PollList() { - return _Component.apply(this, arguments) || this; - } - var _proto = PollList.prototype; - _proto.view = function view() { - var state = this.attrs.state; - var params = state.getParams(); - var isLoading = state.isInitialLoading() || state.isLoadingNext(); - var loading; - if (isLoading) { - loading = m((flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_5___default()), null); - } else if (state.hasNext()) { - loading = m((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_4___default()), { - className: "Button", - onclick: state.loadNext.bind(state) - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.polls_list.load_more_button')); - } - if (state.isEmpty()) { - var text = flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.polls_list.empty_text'); - return m("div", { - className: "PollList" - }, m((flarum_common_components_Placeholder__WEBPACK_IMPORTED_MODULE_6___default()), { - text: text - })); - } - return m("div", { - className: flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_7___default()('PollList', { - 'PollList--searchResults': state.isSearchResults() - }) - }, m("ul", { - "aria-busy": isLoading, - className: "PollList-polls" - }, state.getPages().map(function (pg) { - return pg.items.map(function (poll) { - return m("li", { - key: poll.id(), - "data-id": poll.id() - }, m(_PollListItem__WEBPACK_IMPORTED_MODULE_3__["default"], { - poll: poll, - params: params - })); - }); - })), m("div", { - className: "PollList-loadMore" - }, loading)); - }; - return PollList; -}((flarum_common_Component__WEBPACK_IMPORTED_MODULE_2___default())); - - -/***/ }), - -/***/ "./src/forum/components/Poll/PollListItem.tsx": -/*!****************************************************!*\ - !*** ./src/forum/components/Poll/PollListItem.tsx ***! - \****************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollListItem) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/Component */ "flarum/common/Component"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Component__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_common_utils_SubtreeRetainer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/common/utils/SubtreeRetainer */ "flarum/common/utils/SubtreeRetainer"); -/* harmony import */ var flarum_common_utils_SubtreeRetainer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_SubtreeRetainer__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/common/utils/classList */ "flarum/common/utils/classList"); -/* harmony import */ var flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var flarum_common_components_Dropdown__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! flarum/common/components/Dropdown */ "flarum/common/components/Dropdown"); -/* harmony import */ var flarum_common_components_Dropdown__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Dropdown__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var flarum_common_components_Link__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! flarum/common/components/Link */ "flarum/common/components/Link"); -/* harmony import */ var flarum_common_components_Link__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Link__WEBPACK_IMPORTED_MODULE_6__); -/* harmony import */ var flarum_common_helpers_highlight__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! flarum/common/helpers/highlight */ "flarum/common/helpers/highlight"); -/* harmony import */ var flarum_common_helpers_highlight__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(flarum_common_helpers_highlight__WEBPACK_IMPORTED_MODULE_7__); -/* harmony import */ var flarum_forum_utils_slidable__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! flarum/forum/utils/slidable */ "flarum/forum/utils/slidable"); -/* harmony import */ var flarum_forum_utils_slidable__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_utils_slidable__WEBPACK_IMPORTED_MODULE_8__); -/* harmony import */ var flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! flarum/common/helpers/icon */ "flarum/common/helpers/icon"); -/* harmony import */ var flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_9__); -/* harmony import */ var flarum_common_utils_abbreviateNumber__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! flarum/common/utils/abbreviateNumber */ "flarum/common/utils/abbreviateNumber"); -/* harmony import */ var flarum_common_utils_abbreviateNumber__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_abbreviateNumber__WEBPACK_IMPORTED_MODULE_10__); -/* harmony import */ var _utils_PollControls__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../utils/PollControls */ "./src/forum/utils/PollControls.tsx"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! flarum/common/utils/ItemList */ "flarum/common/utils/ItemList"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_12__); -/* harmony import */ var flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! flarum/common/helpers/listItems */ "flarum/common/helpers/listItems"); -/* harmony import */ var flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_13__); -/* harmony import */ var _PollViewPage__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../PollViewPage */ "./src/forum/components/PollViewPage.tsx"); - - - - - - - - - - - - - - - -/** - * The `PollListItem` component shows a single poll in the - * poll list. - */ -var PollListItem = /*#__PURE__*/function (_Component) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PollListItem, _Component); - function PollListItem() { - var _this; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _Component.call.apply(_Component, [this].concat(args)) || this; - /** - * Ensures that the poll will not be redrawn - * unless new data comes in. - */ - _this.subtree = void 0; - _this.poll = void 0; - _this.highlightRegExp = void 0; - return _this; - } - var _proto = PollListItem.prototype; - _proto.oninit = function oninit(vnode) { - var _this2 = this; - _Component.prototype.oninit.call(this, vnode); - this.poll = this.attrs.poll; - this.subtree = new (flarum_common_utils_SubtreeRetainer__WEBPACK_IMPORTED_MODULE_3___default())(function () { - return _this2.poll.freshness; - }, function () { - var time = (flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().session).user && flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().session.user.markedAllAsReadAt(); - return time && time.getTime(); - }, function () { - return _this2.active(); - }); - }; - _proto.elementAttrs = function elementAttrs() { - return { - className: flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_4___default()('PollListItem', { - active: this.active(), - 'PollListItem--hidden': this.poll.isHidden(), - Slidable: 'ontouchstart' in window - }) - }; - }; - _proto.view = function view() { - var controls = _utils_PollControls__WEBPACK_IMPORTED_MODULE_11__["default"].controls(this.poll, this).toArray(); - var attrs = this.elementAttrs(); - return m("div", attrs, this.controlsView(controls), this.contentView(), this.slidableUnderneathView()); - }; - _proto.controlsView = function controlsView(controls) { - return !!controls.length && m((flarum_common_components_Dropdown__WEBPACK_IMPORTED_MODULE_5___default()), { - icon: "fas fa-ellipsis-v", - className: "PollListItem-controls", - menuClassName: "Dropdown-menu--right", - buttonClassName: "Button Button--icon Button--flat", - accessibleToggleLabel: flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.poll_controls.toggle_dropdown_accessible_label') - }, controls); - }; - _proto.slidableUnderneathView = function slidableUnderneathView() { - var isUnread = this.poll.isUnread(); - return m("span", { - className: flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_4___default()('Slidable-underneath Slidable-underneath--left Slidable-underneath--elastic', { - disabled: !isUnread - }), - onclick: this.markAsRead.bind(this) - }, flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_9___default()('fas fa-check')); - }; - _proto.contentView = function contentView() { - // const isUnread = this.poll.isUnread(); - // const isRead = this.poll.isRead(); - - return ( - //
- m("div", { - className: flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_4___default()('PollListItem-content') - }, this.mainView()) - ); - }; - _proto.mainView = function mainView() { - return m((flarum_common_components_Link__WEBPACK_IMPORTED_MODULE_6___default()), { - href: flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().route('fof.polls.view', { - id: this.poll.id() - }), - className: "PollListItem-main" - }, m("h2", { - className: "PollListItem-title" - }, flarum_common_helpers_highlight__WEBPACK_IMPORTED_MODULE_7___default()(this.poll.question(), this.highlightRegExp)), this.poll.subtitle() && m("p", { - className: "PollListItem-subtitle helpText" - }, this.poll.subtitle()), m("ul", { - className: "PollListItem-info" - }, flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_13___default()(this.infoItems().toArray()))); - } - - // infoView() { - // return ( - //
- // {this.poll.subtitle() &&

{this.poll.subtitle()}

} - //
    {listItems(this.infoItems().toArray())}
- //
- // ); - // } - ; - _proto.oncreate = function oncreate(vnode) { - _Component.prototype.oncreate.call(this, vnode); - - // If we're on a touch device, set up the discussion row to be slidable. - // This allows the user to drag the row to either side of the screen to - // reveal controls. - if ('ontouchstart' in window) { - var slidableInstance = flarum_forum_utils_slidable__WEBPACK_IMPORTED_MODULE_8___default()(this.element); - this.$('.PollListItem-controls').on('hidden.bs.dropdown', function () { - return slidableInstance.reset(); - }); - } - }; - _proto.onbeforeupdate = function onbeforeupdate(vnode) { - _Component.prototype.onbeforeupdate.call(this, vnode); - return this.subtree.needsRebuild(); - } - - /** - * Determine whether or not the discussion is currently being viewed. - */; - _proto.active = function active() { - return flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().current.matches(_PollViewPage__WEBPACK_IMPORTED_MODULE_14__["default"], { - poll: this.poll - }); - } - - /** - * Mark the poll as read. - */; - _proto.markAsRead = function markAsRead() { - if (this.poll.isUnread()) { - this.poll.save({ - lastVotedNumber: this.poll.voteCount() - }); - m.redraw(); - } - }; - _proto.infoItems = function infoItems() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_12___default())(); - var active = !this.poll.hasEnded(); - var activeView = this.poll.endDate() ? [flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_9___default()('fas fa-clock'), ' ', active ? flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.days_remaining', { - time: dayjs(this.poll.endDate()).fromNow() - }) : flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.poll_ended')] : [flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_9___default()('fas fa-infinity'), ' ', flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.poll_never_ends')]; - items.add('active', m("span", { - className: flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_4___default()('PollListItem-endStatus', { - active: active - }) - }, activeView)); - var voteCount = this.poll.voteCount(); - if (voteCount !== undefined) { - items.add('voteCount', m("span", null, flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_9___default()('fas fa-poll fa-fw'), [' ', flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.polls_count', { - count: flarum_common_utils_abbreviateNumber__WEBPACK_IMPORTED_MODULE_10___default()(voteCount) - })]), 70); - } - return items; - }; - return PollListItem; -}((flarum_common_Component__WEBPACK_IMPORTED_MODULE_2___default())); - - -/***/ }), - -/***/ "./src/forum/components/Poll/PollOption.tsx": -/*!**************************************************!*\ - !*** ./src/forum/components/Poll/PollOption.tsx ***! - \**************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollOption) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/Component */ "flarum/common/Component"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Component__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_common_components_Tooltip__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/common/components/Tooltip */ "flarum/common/components/Tooltip"); -/* harmony import */ var flarum_common_components_Tooltip__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Tooltip__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/common/helpers/icon */ "flarum/common/helpers/icon"); -/* harmony import */ var flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! flarum/common/utils/classList */ "flarum/common/utils/classList"); -/* harmony import */ var flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! flarum/common/utils/ItemList */ "flarum/common/utils/ItemList"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_6__); - - - - - - - -var PollOption = /*#__PURE__*/function (_Component) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PollOption, _Component); - function PollOption() { - var _this; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _Component.call.apply(_Component, [this].concat(args)) || this; - _this.option = void 0; - _this.name = void 0; - _this.state = void 0; - _this.hasVoted = false; - _this.totalVotes = 0; - _this.votes = 0; - _this.voted = false; - _this.poll = void 0; - _this.canSeeVoteCount = false; - _this.answer = void 0; - return _this; - } - var _proto = PollOption.prototype; - _proto.oninit = function oninit(vnode) { - _Component.prototype.oninit.call(this, vnode); - this.option = this.attrs.option; - this.name = this.attrs.name; - this.state = this.attrs.state; - this.poll = this.state.poll; - - // isNaN(null) is false, so we have to check type directly now that API always returns the field - this.canSeeVoteCount = typeof this.votes === 'number'; - this.answer = this.option.answer(); - }; - _proto.percent = function percent() { - return this.totalVotes > 0 ? Math.round(this.votes / this.totalVotes * 100) : 0; - }; - _proto.view = function view() { - var _this$poll$myVotes; - // following values can be changed by ui interactions, so we need to update them on every render - this.hasVoted = this.state.hasVoted(); - this.totalVotes = this.state.overallVoteCount(); - this.votes = this.option.voteCount(); - this.voted = this.state.hasVotedFor(this.option); - var isDisabled = this.state.loadingOptions || this.hasVoted && !this.poll.canChangeVote(); - var width = this.canSeeVoteCount ? this.percent() : Number(this.voted) / (((_this$poll$myVotes = this.poll.myVotes()) == null ? void 0 : _this$poll$myVotes.length) || 1) * 100; - var bar = m("label", { - className: "PollBar", - "data-selected": !!this.voted, - style: "--poll-option-width: " + width + "%" - }, this.state.showCheckMarks && m("div", { - className: "PollAnswer-checkbox" - }, m("input", { - className: "PollAnswer-input sr-only", - type: "checkbox", - id: this.option.id(), - name: this.name, - value: this.answer, - checked: this.voted, - disabled: isDisabled, - "aria-labelledby": this.name + "-" + this.option.id() + "-label", - onchange: this.state.changeVote.bind(this.state, this.option) - }), m("span", { - className: "checkmark" - })), m("div", { - className: "PollAnswer-text" - }, this.optionDisplayItems().toArray()), this.option.imageUrl() ? m("img", { - className: "PollAnswer-image", - src: this.option.imageUrl(), - alt: this.option.answer() - }) : null); - return m("div", { - className: flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_5___default()('PollOption', this.hasVoted && 'PollVoted', this.option.imageUrl() && 'PollOption-hasImage'), - "data-id": this.option.id() - }, this.canSeeVoteCount ? m((flarum_common_components_Tooltip__WEBPACK_IMPORTED_MODULE_3___default()), { - text: flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.tooltip.votes', { - count: this.votes - }), - onremove: this.hideOptionTooltip - }, bar) : bar); - } - - /** - * Attempting to use the `tooltipVisible` attr on the Tooltip component set to 'false' when no vote count - * caused the tooltip to break on click. This is a workaround to hide the tooltip when no vote count is available, - * called on 'onremove' of the Tooltip component. It doesn't always work as intended either, but it does the job. - */; - _proto.hideOptionTooltip = function hideOptionTooltip(vnode) { - vnode.attrs.tooltipVisible = false; - - // @ts-ignore - vnode.state.updateVisibility(); - }; - _proto.optionDisplayItems = function optionDisplayItems() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_6___default())(); - items.add('answer', m("span", { - className: "PollAnswer-text-answer", - id: this.name + "-" + this.option.id() + "-label" - }, this.answer)); - this.voted && !this.state.showCheckMarks && items.add('check', flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_4___default()('fas fa-check-circle', { - className: 'PollAnswer-check' - })); - this.canSeeVoteCount && items.add('percent', m("span", { - className: flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_5___default()('PollPercent', this.percent() !== 100 && 'PollPercent--option') - }, this.percent(), "%")); - return items; - }; - return PollOption; -}((flarum_common_Component__WEBPACK_IMPORTED_MODULE_2___default())); - - -/***/ }), - -/***/ "./src/forum/components/Poll/PollOptions.tsx": -/*!***************************************************!*\ - !*** ./src/forum/components/Poll/PollOptions.tsx ***! - \***************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollOptions) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/Component */ "flarum/common/Component"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Component__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _PollOption__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PollOption */ "./src/forum/components/Poll/PollOption.tsx"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/common/utils/ItemList */ "flarum/common/utils/ItemList"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_3__); - - - - -var PollOptions = /*#__PURE__*/function (_Component) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PollOptions, _Component); - function PollOptions() { - return _Component.apply(this, arguments) || this; - } - var _proto = PollOptions.prototype; - _proto.view = function view() { - return m("div", { - className: "Poll-options list-layout" - }, this.pollOptions().toArray()); - }; - _proto.pollOptions = function pollOptions() { - var _this = this; - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_3___default())(); - this.attrs.options.forEach(function (option) { - items.add('option' + option.id(), _this.createOptionView(option)); - }); - return items; - }; - _proto.createOptionView = function createOptionView(option) { - return m(_PollOption__WEBPACK_IMPORTED_MODULE_2__["default"], { - name: this.attrs.name, - option: option, - state: this.attrs.state - }); - }; - return PollOptions; -}((flarum_common_Component__WEBPACK_IMPORTED_MODULE_1___default())); - - -/***/ }), - -/***/ "./src/forum/components/Poll/PollSubmitButton.tsx": -/*!********************************************************!*\ - !*** ./src/forum/components/Poll/PollSubmitButton.tsx ***! - \********************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollSubmitButton) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/Component */ "flarum/common/Component"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Component__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/common/components/Button */ "flarum/common/components/Button"); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3__); - - - - -var PollSubmitButton = /*#__PURE__*/function (_Component) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PollSubmitButton, _Component); - function PollSubmitButton() { - return _Component.apply(this, arguments) || this; - } - var _proto = PollSubmitButton.prototype; - _proto.view = function view() { - var _this = this; - var state = this.attrs.state; - return m((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3___default()), { - className: "Button Button--primary Poll-submit", - loading: state.loadingOptions, - onclick: function onclick(event) { - return _this.pollButtonSubmit(state, event); - }, - disabled: !state.hasSelectedOptions() - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.poll.submit_button')); - } - - /** - * Event handler for submit button being clicked - */; - _proto.pollButtonSubmit = function pollButtonSubmit(state, event) { - state.onsubmit(); - }; - return PollSubmitButton; -}((flarum_common_Component__WEBPACK_IMPORTED_MODULE_2___default())); - - -/***/ }), - -/***/ "./src/forum/components/Poll/PollSubtitle.tsx": -/*!****************************************************!*\ - !*** ./src/forum/components/Poll/PollSubtitle.tsx ***! - \****************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollSubtitle) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/Component */ "flarum/common/Component"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Component__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/utils/ItemList */ "flarum/common/utils/ItemList"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2__); - - - -var PollSubtitle = /*#__PURE__*/function (_Component) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PollSubtitle, _Component); - function PollSubtitle() { - return _Component.apply(this, arguments) || this; - } - var _proto = PollSubtitle.prototype; - _proto.view = function view() { - if (!this.attrs.poll.subtitle()) { - return; - } - return m("div", { - className: "Poll-subtitle-component" - }, this.pollSubtitleItems().toArray()); - }; - _proto.pollSubtitleItems = function pollSubtitleItems() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2___default())(); - items.add('subtitle', m("p", { - className: "Poll-subtitle" - }, this.attrs.poll.subtitle())); - return items; - }; - return PollSubtitle; -}((flarum_common_Component__WEBPACK_IMPORTED_MODULE_1___default())); - - -/***/ }), - -/***/ "./src/forum/components/Poll/PollTitle.tsx": -/*!*************************************************!*\ - !*** ./src/forum/components/Poll/PollTitle.tsx ***! - \*************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollTitle) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/Component */ "flarum/common/Component"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Component__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/utils/ItemList */ "flarum/common/utils/ItemList"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2__); - - - -var PollTitle = /*#__PURE__*/function (_Component) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PollTitle, _Component); - function PollTitle() { - return _Component.apply(this, arguments) || this; - } - var _proto = PollTitle.prototype; - _proto.view = function view() { - return m("div", { - className: "Poll-title-component" - }, this.pollTitleItems().toArray()); - }; - _proto.pollTitleItems = function pollTitleItems() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2___default())(); - items.add('title', m("h3", { - className: "Poll-title" - }, this.attrs.poll.question())); - return items; - }; - return PollTitle; -}((flarum_common_Component__WEBPACK_IMPORTED_MODULE_1___default())); - - -/***/ }), - -/***/ "./src/forum/components/PollForm.tsx": -/*!*******************************************!*\ - !*** ./src/forum/components/PollForm.tsx ***! - \*******************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollForm) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js"); -/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/common/Component */ "flarum/common/Component"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Component__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! flarum/common/components/Button */ "flarum/common/components/Button"); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var flarum_common_components_Switch__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! flarum/common/components/Switch */ "flarum/common/components/Switch"); -/* harmony import */ var flarum_common_components_Switch__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Switch__WEBPACK_IMPORTED_MODULE_6__); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! flarum/common/utils/ItemList */ "flarum/common/utils/ItemList"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7__); -/* harmony import */ var flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! flarum/common/utils/Stream */ "flarum/common/utils/Stream"); -/* harmony import */ var flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8__); -/* harmony import */ var flarum_common_utils_extractText__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! flarum/common/utils/extractText */ "flarum/common/utils/extractText"); -/* harmony import */ var flarum_common_utils_extractText__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_extractText__WEBPACK_IMPORTED_MODULE_9__); -/* harmony import */ var _form_FormError__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./form/FormError */ "./src/forum/components/form/FormError.tsx"); -/* harmony import */ var _states_PollFormState__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../states/PollFormState */ "./src/forum/states/PollFormState.ts"); -/* harmony import */ var _utils_PollControls__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../utils/PollControls */ "./src/forum/utils/PollControls.tsx"); -/* harmony import */ var _UploadPollImageButton__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./UploadPollImageButton */ "./src/forum/components/UploadPollImageButton.tsx"); -/* harmony import */ var flarum_common_components_Tooltip__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! flarum/common/components/Tooltip */ "flarum/common/components/Tooltip"); -/* harmony import */ var flarum_common_components_Tooltip__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Tooltip__WEBPACK_IMPORTED_MODULE_14__); -/* harmony import */ var flarum_common_utils_RequestError__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! flarum/common/utils/RequestError */ "flarum/common/utils/RequestError"); -/* harmony import */ var flarum_common_utils_RequestError__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_RequestError__WEBPACK_IMPORTED_MODULE_15__); - - - - - - - - - - - - - - - - -var PollForm = /*#__PURE__*/function (_Component) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(PollForm, _Component); - function PollForm() { - var _this; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _Component.call.apply(_Component, [this].concat(args)) || this; - _this.options = []; - _this.optionAnswers = []; - _this.optionImageUrls = []; - _this.question = void 0; - _this.subtitle = void 0; - _this.image = void 0; - _this.imageAlt = void 0; - _this.endDate = void 0; - _this.publicPoll = void 0; - _this.allowMultipleVotes = void 0; - _this.hideVotes = void 0; - _this.allowChangeVote = void 0; - _this.maxVotes = void 0; - _this.datepickerMinDate = ''; - return _this; - } - var _proto = PollForm.prototype; - _proto.oninit = function oninit(vnode) { - var _poll$tempOptions; - _Component.prototype.oninit.call(this, vnode); - this.state = new _states_PollFormState__WEBPACK_IMPORTED_MODULE_11__["default"](this.attrs.poll); - - // state handles poll initialization - var poll = this.state.poll; - this.options = (_poll$tempOptions = poll.tempOptions) != null ? _poll$tempOptions : poll.options(); - this.optionAnswers = this.options.map(function (o) { - return flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8___default()(o.answer()); - }); - this.optionImageUrls = this.options.map(function (o) { - return flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8___default()(o.imageUrl()); - }); - this.question = flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8___default()(poll.question()); - this.subtitle = flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8___default()(poll.subtitle()); - this.image = flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8___default()(poll.image()); - this.imageAlt = flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8___default()(poll.imageAlt()); - this.endDate = flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8___default()(this.formatDate(poll.endDate())); - this.publicPoll = flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8___default()(poll.publicPoll()); - this.allowMultipleVotes = flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8___default()(poll.allowMultipleVotes()); - this.hideVotes = flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8___default()(poll.hideVotes()); - this.allowChangeVote = flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8___default()(poll.allowChangeVote()); - this.maxVotes = flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8___default()(poll.maxVotes() || 0); - - // Set minimum date for datepicker to current date - this.datepickerMinDate = this.formatDate(); - - // Replace minimum of 'today' for poll end date only if the poll is not already closed - if (this.endDate() && dayjs(poll.endDate).isAfter(dayjs())) { - // We know that endDate is set, so we can safely cast the result to string - this.datepickerMinDate = this.formatDate(poll.endDate()); - } - }; - _proto.view = function view() { - return m("form", { - onsubmit: this.onsubmit.bind(this) - }, m("div", { - className: "PollDiscussionModal-form" - }, this.fields().toArray())); - }; - _proto.fields = function fields() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7___default())(); - items.add('question', m("div", { - className: "Form-group" - }, m("label", { - className: "label" - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.question_placeholder')), m("input", { - type: "text", - name: "question", - className: "FormControl", - bidi: this.question - })), 100); - items.add('subtitle', m("div", { - className: "Form-group" - }, m("label", { - className: "label" - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.subtitle_placeholder')), m("input", { - type: "text", - name: "subtitle", - className: "FormControl", - bidi: this.subtitle - })), 95); - items.add('poll_image', m("div", { - className: "Form-group" - }, m("label", { - className: "label" - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.poll_image.label')), m("p", { - className: "helpText" - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.poll_image.help')), m(_UploadPollImageButton__WEBPACK_IMPORTED_MODULE_13__["default"], { - name: "pollImage", - poll: this.state.poll, - onUpload: this.pollImageUploadSuccess.bind(this) - }), m("input", { - type: "hidden", - name: "pollImage", - value: this.image() - })), 90); - if (this.image()) { - items.add('poll_image_alt', m("div", { - className: "Form-group" - }, m("label", { - className: "label" - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.poll_image.alt_label')), m("input", { - type: "text", - required: true, - name: "imageAlt", - className: "FormControl", - bidi: this.imageAlt - }), m("p", { - className: "helpText" - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.poll_image.alt_help_text'))), 90); - } - items.add('answers', m("div", { - className: "PollModal--answers Form-group" - }, m("label", { - className: "label PollModal--answers-title" - }, m("span", null, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.options_label'))), this.displayOptions().toArray(), m((flarum_common_components_Tooltip__WEBPACK_IMPORTED_MODULE_14___default()), { - text: flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.tooltip.options.add-button') - }, m((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_5___default()), { - className: "Button PollModal--button Button--icon PollModal--add-button", - icon: "fas fa-plus", - onclick: this.addOption.bind(this) - }))), 80); - items.add('date', m("div", { - className: "Form-group" - }, m("label", { - className: "label" - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.date_placeholder')), m("div", { - className: "PollModal--date" - }, m("input", { - className: "FormControl", - type: "datetime-local", - name: "date", - bidi: this.endDate, - min: this.datepickerMinDate, - max: this.formatDate('2038') - }), flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_5___default().component({ - className: 'Button PollModal--button Button--icon', - icon: 'fas fa-times', - onclick: this.endDate.bind(this, null) - })), this.endDate() && m("p", { - className: "helpText" - }, m("i", { - "class": "icon fas fa-clock" - }), "\xA0", dayjs(this.endDate()).isBefore(dayjs()) ? flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.poll_ended') : flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.days_remaining', { - time: dayjs(this.endDate()).fromNow() - }))), 40); - items.add('public', m("div", { - className: "Form-group" - }, flarum_common_components_Switch__WEBPACK_IMPORTED_MODULE_6___default().component({ - state: this.publicPoll() || false, - onchange: this.publicPoll - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.public_poll_label'))), 20); - items.add('hide-votes', m("div", { - className: "Form-group" - }, m((flarum_common_components_Switch__WEBPACK_IMPORTED_MODULE_6___default()), { - state: this.endDate() && this.hideVotes(), - onchange: this.hideVotes, - disabled: !this.endDate() - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.hide_votes_label'))), 20); - items.add('allow-change-vote', m("div", { - className: "Form-group" - }, m((flarum_common_components_Switch__WEBPACK_IMPORTED_MODULE_6___default()), { - state: this.allowChangeVote(), - onchange: this.allowChangeVote - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.allow_change_vote_label'))), 20); - items.add('allow-multiple-votes', m("div", { - className: "Form-group" - }, flarum_common_components_Switch__WEBPACK_IMPORTED_MODULE_6___default().component({ - state: this.allowMultipleVotes() || false, - onchange: this.allowMultipleVotes - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.allow_multiple_votes_label'))), 15); - if (this.allowMultipleVotes()) { - items.add('max-votes', m("div", { - className: "Form-group" - }, m("label", { - className: "label" - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.max_votes_label')), m("input", { - type: "number", - min: "0", - max: this.options.length, - name: "maxVotes", - className: "FormControl", - bidi: this.maxVotes - }), m("p", { - className: "helpText" - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.max_votes_help'))), 15); - } - items.add('submit', m("div", { - className: "Form-group" - }, m((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_5___default()), { - type: "submit", - className: "Button Button--primary PollModal-SubmitButton", - icon: "fas fa-save", - loading: this.state.loading - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.submit')), this.state.poll.exists && m((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_5___default()), { - className: "Button Button--secondary PollModal-deleteButton", - icon: "fas fa-trash-alt", - loading: this.state.deleting, - onclick: this["delete"].bind(this) - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.delete'))), -10); - return items; - }; - _proto.displayOptions = function displayOptions() { - var _this2 = this; - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7___default())(); - this.options.forEach(function (option, i) { - items.add('option-' + i, m("div", { - className: "Form-group" - }, m("fieldset", { - className: "Poll-answer-input" - }, m("input", { - className: "FormControl", - type: "text", - name: 'answer' + (i + 1), - bidi: _this2.optionAnswers[i], - placeholder: flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.option_placeholder') + ' #' + (i + 1) - }), flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().forum.attribute('allowPollOptionImage') && m("div", { - className: "Poll-answer-image" - }, m("label", { - className: "label" - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.poll_option_image.label')), m("p", { - className: "helpText" - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.poll_option_image.help')), m(_UploadPollImageButton__WEBPACK_IMPORTED_MODULE_13__["default"], { - name: "pollOptionImage", - option: option, - onUpload: _this2.pollOptionImageUploadSuccess.bind(_this2, i) - }), m("input", { - type: "hidden", - name: 'answerImage' + (i + 1), - value: _this2.optionImageUrls[i]() - }))), i >= 2 ? flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_5___default().component({ - type: 'button', - className: 'Button PollModal--button Button--icon', - icon: 'fas fa-minus', - onclick: i >= 2 ? _this2.removeOption.bind(_this2, i) : '' - }) : '')); - }); - return items; - }; - _proto.addOption = function addOption() { - var max = Math.max(flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().forum.attribute('pollMaxOptions'), 2); - if (this.options.length < max) { - this.options.push(flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().store.createRecord('poll_options')); - this.optionAnswers.push(flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8___default()('')); - this.optionImageUrls.push(flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8___default()('')); - } else { - alert(flarum_common_utils_extractText__WEBPACK_IMPORTED_MODULE_9___default()(flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.max', { - max: max - }))); - } - }; - _proto.removeOption = function removeOption(i) { - this.options.splice(i, 1); - this.optionAnswers.splice(i, 1); - this.optionImageUrls.splice(i, 1); - }; - _proto.data = function data() { - var _this3 = this, - _this$dateToTimestamp; - if (this.question() === '') { - throw new _form_FormError__WEBPACK_IMPORTED_MODULE_10__["default"](flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.include_question')); - } - if (this.options.length < 2) { - throw new _form_FormError__WEBPACK_IMPORTED_MODULE_10__["default"](flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.min')); - } - var pollExists = this.state.poll.exists; - var options = this.options.map(function (option, i) { - option.pushAttributes({ - answer: _this3.optionAnswers[i](), - imageUrl: _this3.optionImageUrls[i]() - }); - return pollExists ? option.data : option.data.attributes; - }); - return { - question: this.question(), - subtitle: this.subtitle(), - pollImage: this.image(), - imageAlt: this.imageAlt(), - endDate: (_this$dateToTimestamp = this.dateToTimestamp(this.endDate())) != null ? _this$dateToTimestamp : false, - publicPoll: this.publicPoll(), - hideVotes: this.hideVotes(), - allowChangeVote: this.allowChangeVote(), - allowMultipleVotes: this.allowMultipleVotes(), - maxVotes: this.maxVotes(), - options: options - }; - }; - _proto.onsubmit = /*#__PURE__*/function () { - var _onsubmit = (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(event) { - return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee$(_context) { - while (1) switch (_context.prev = _context.next) { - case 0: - event.preventDefault(); - _context.prev = 1; - _context.next = 4; - return this.attrs.onsubmit(this.data(), this.state); - case 4: - _context.next = 9; - break; - case 6: - _context.prev = 6; - _context.t0 = _context["catch"](1); - if (_context.t0 instanceof _form_FormError__WEBPACK_IMPORTED_MODULE_10__["default"]) { - flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().alerts.show({ - type: 'error' - }, _context.t0.message); - } else if (_context.t0 instanceof (flarum_common_utils_RequestError__WEBPACK_IMPORTED_MODULE_15___default())) { - console.error(_context.t0); - flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().alerts.show({ - type: 'error' - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_4___default().translator.trans('fof-polls.forum.modal.error')); - } - case 9: - case "end": - return _context.stop(); - } - }, _callee, this, [[1, 6]]); - })); - function onsubmit(_x) { - return _onsubmit.apply(this, arguments); - } - return onsubmit; - }(); - _proto["delete"] = /*#__PURE__*/function () { - var _delete2 = (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee2() { - return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee2$(_context2) { - while (1) switch (_context2.prev = _context2.next) { - case 0: - this.state.loading = true; - _context2.prev = 1; - _context2.next = 4; - return _utils_PollControls__WEBPACK_IMPORTED_MODULE_12__["default"].deleteAction(this.state.poll); - case 4: - this.state.deleting = true; - case 5: - _context2.prev = 5; - this.state.loading = false; - m.redraw(); - return _context2.finish(5); - case 9: - case "end": - return _context2.stop(); - } - }, _callee2, this, [[1,, 5, 9]]); - })); - function _delete() { - return _delete2.apply(this, arguments); - } - return _delete; - }(); - _proto.formatDate = function formatDate(date, def) { - if (date === void 0) { - date = undefined; - } - if (def === void 0) { - def = false; - } - var dayjsDate = dayjs(date); - if (date === false || !dayjsDate.isValid()) return def !== false ? this.formatDate(def) : false; - return dayjsDate.format('YYYY-MM-DDTHH:mm'); - }; - _proto.dateToTimestamp = function dateToTimestamp(date) { - var dayjsDate = dayjs(date); - if (!date || !dayjsDate.isValid()) return null; - return dayjsDate.format(); - }; - _proto.pollImageUploadSuccess = function pollImageUploadSuccess(fileName) { - this.image(fileName); - }; - _proto.pollOptionImageUploadSuccess = function pollOptionImageUploadSuccess(index, fileName) { - this.optionImageUrls[index] = flarum_common_utils_Stream__WEBPACK_IMPORTED_MODULE_8___default()(fileName); - }; - return PollForm; -}((flarum_common_Component__WEBPACK_IMPORTED_MODULE_3___default())); - - -/***/ }), - -/***/ "./src/forum/components/PollPageHero.tsx": -/*!***********************************************!*\ - !*** ./src/forum/components/PollPageHero.tsx ***! - \***********************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollPageHero) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/common/Component */ "flarum/common/Component"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Component__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/common/utils/classList */ "flarum/common/utils/classList"); -/* harmony import */ var flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! flarum/common/helpers/icon */ "flarum/common/helpers/icon"); -/* harmony import */ var flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! flarum/common/utils/ItemList */ "flarum/common/utils/ItemList"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_6__); - - - - - - - -var PollPageHero = /*#__PURE__*/function (_Component) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(PollPageHero, _Component); - function PollPageHero() { - return _Component.apply(this, arguments) || this; - } - var _proto = PollPageHero.prototype; - _proto.oninit = function oninit(vnode) { - _Component.prototype.oninit.call(this, vnode); - }; - _proto.oncreate = function oncreate(vnode) { - _Component.prototype.oncreate.call(this, vnode); - }; - _proto.view = function view() { - return m("div", { - className: this.wrapperClasses - }, m("header", { - className: this.classNames - }, m("div", { - className: "container" - }, m("div", { - className: "containerNarrow" - }, this.items().toArray())))); - }; - _proto.items = function items() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_6___default())(); - items.add('title', m("h2", { - className: "Hero-title" - }, [flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_5___default()(this.icon), ' ', this.title]), 50); - return items; - }; - (0,_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_0__["default"])(PollPageHero, [{ - key: "classNames", - get: function get() { - return flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_4___default()({ - PollPageHero: true, - Hero: true - }); - } - }, { - key: "wrapperClasses", - get: function get() { - return flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_4___default()({ - 'PollPageHero--wrapper': true - }); - } - }, { - key: "title", - get: function get() { - return this.attrs.title || flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().translator.trans('fof-polls.forum.polls_page.title'); - } - }, { - key: "icon", - get: function get() { - return this.attrs.icon || 'fas fa-poll'; - } - }]); - return PollPageHero; -}((flarum_common_Component__WEBPACK_IMPORTED_MODULE_3___default())); - - -/***/ }), - -/***/ "./src/forum/components/PollShowcase.tsx": -/*!***********************************************!*\ - !*** ./src/forum/components/PollShowcase.tsx ***! - \***********************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollShowcase) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/Component */ "flarum/common/Component"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Component__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/utils/ItemList */ "flarum/common/utils/ItemList"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _PollShowcaseItem__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PollShowcaseItem */ "./src/forum/components/PollShowcaseItem.tsx"); -/* harmony import */ var flarum_common_components_Placeholder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/common/components/Placeholder */ "flarum/common/components/Placeholder"); -/* harmony import */ var flarum_common_components_Placeholder__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Placeholder__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_5__); - - - - - - -var PollShowcase = /*#__PURE__*/function (_Component) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PollShowcase, _Component); - function PollShowcase() { - return _Component.apply(this, arguments) || this; - } - var _proto = PollShowcase.prototype; - _proto.oninit = function oninit(vnode) { - _Component.prototype.oninit.call(this, vnode); - this.attrs.state.refresh(); - }; - _proto.view = function view() { - return m("div", { - className: "PollShowcase" - }, m("div", { - className: "PollShowcase--active" - }, m("h2", { - className: "PollShowcase-title PollShowcase-title--active" - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_5___default().translator.trans('fof-polls.forum.showcase.active-polls')), this.showcaseItems().toArray(), this.showcaseItems().toArray().length === 0 && m((flarum_common_components_Placeholder__WEBPACK_IMPORTED_MODULE_4___default()), { - text: flarum_forum_app__WEBPACK_IMPORTED_MODULE_5___default().translator.trans('fof-polls.forum.showcase.no-active-polls') - })), m("div", { - className: "PollShowcase--ended" - }, m("h2", { - className: "PollShowcase-title PollShowcase-title--ended" - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_5___default().translator.trans('fof-polls.forum.showcase.ended-polls')), this.endedItems().toArray(), this.endedItems().toArray().length === 0 && m((flarum_common_components_Placeholder__WEBPACK_IMPORTED_MODULE_4___default()), { - text: flarum_forum_app__WEBPACK_IMPORTED_MODULE_5___default().translator.trans('fof-polls.forum.showcase.no-recent-polls') - }))); - }; - _proto.showcaseItems = function showcaseItems() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2___default())(); - this.attrs.state.getPages().map(function (page) { - page.items.map(function (poll) { - if (!poll.hasEnded()) { - items.add('poll-active-' + poll.id(), m(_PollShowcaseItem__WEBPACK_IMPORTED_MODULE_3__["default"], { - poll: poll - })); - } - }); - }); - return items; - }; - _proto.endedItems = function endedItems() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_2___default())(); - this.attrs.state.getPages().map(function (page) { - page.items.map(function (poll) { - if (poll.hasEnded()) { - items.add('poll-ended-' + poll.id(), m(_PollShowcaseItem__WEBPACK_IMPORTED_MODULE_3__["default"], { - poll: poll - })); - } - }); - }); - return items; - }; - return PollShowcase; -}((flarum_common_Component__WEBPACK_IMPORTED_MODULE_1___default())); - - -/***/ }), - -/***/ "./src/forum/components/PollShowcaseItem.tsx": -/*!***************************************************!*\ - !*** ./src/forum/components/PollShowcaseItem.tsx ***! - \***************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollShowcaseItem) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/Component */ "flarum/common/Component"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Component__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _PollView__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PollView */ "./src/forum/components/PollView.tsx"); - - - -var PollShowcaseItem = /*#__PURE__*/function (_Component) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PollShowcaseItem, _Component); - function PollShowcaseItem() { - var _this; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _Component.call.apply(_Component, [this].concat(args)) || this; - _this.poll = void 0; - return _this; - } - var _proto = PollShowcaseItem.prototype; - _proto.oninit = function oninit(vnode) { - _Component.prototype.oninit.call(this, vnode); - this.poll = this.attrs.poll; - }; - _proto.view = function view() { - return m("div", { - className: "PollShowcase--item" - }, m(_PollView__WEBPACK_IMPORTED_MODULE_2__["default"], { - poll: this.poll - })); - }; - return PollShowcaseItem; -}((flarum_common_Component__WEBPACK_IMPORTED_MODULE_1___default())); - - -/***/ }), - -/***/ "./src/forum/components/PollView.tsx": -/*!*******************************************!*\ - !*** ./src/forum/components/PollView.tsx ***! - \*******************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollView) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/Component */ "flarum/common/Component"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Component__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _Poll_PollOptions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Poll/PollOptions */ "./src/forum/components/Poll/PollOptions.tsx"); -/* harmony import */ var _Poll_PollImage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Poll/PollImage */ "./src/forum/components/Poll/PollImage.tsx"); -/* harmony import */ var _states_PollState__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../states/PollState */ "./src/forum/states/PollState.ts"); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! flarum/common/components/Button */ "flarum/common/components/Button"); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_6__); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! flarum/common/utils/ItemList */ "flarum/common/utils/ItemList"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7__); -/* harmony import */ var _utils_PollControls__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utils/PollControls */ "./src/forum/utils/PollControls.tsx"); -/* harmony import */ var flarum_common_components_Dropdown__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! flarum/common/components/Dropdown */ "flarum/common/components/Dropdown"); -/* harmony import */ var flarum_common_components_Dropdown__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Dropdown__WEBPACK_IMPORTED_MODULE_9__); -/* harmony import */ var _Poll_PollSubmitButton__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Poll/PollSubmitButton */ "./src/forum/components/Poll/PollSubmitButton.tsx"); -/* harmony import */ var flarum_common_utils_string__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! flarum/common/utils/string */ "flarum/common/utils/string"); -/* harmony import */ var flarum_common_utils_string__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_string__WEBPACK_IMPORTED_MODULE_11__); -/* harmony import */ var flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! flarum/common/utils/classList */ "flarum/common/utils/classList"); -/* harmony import */ var flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_12__); -/* harmony import */ var _Poll_PollTitle__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./Poll/PollTitle */ "./src/forum/components/Poll/PollTitle.tsx"); -/* harmony import */ var _Poll_PollSubtitle__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./Poll/PollSubtitle */ "./src/forum/components/Poll/PollSubtitle.tsx"); - - - - - - - - - - - - - - - -var PollView = /*#__PURE__*/function (_Component) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PollView, _Component); - function PollView() { - var _this; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _Component.call.apply(_Component, [this].concat(args)) || this; - _this.state = void 0; - /** - * Alert before navigating away using browser's 'beforeunload' event - */ - _this.preventClose = function (e) { - if (_this.state.hasSelectedOptions()) { - e.preventDefault(); - return true; - } - }; - return _this; - } - var _proto = PollView.prototype; - _proto.oninit = function oninit(vnode) { - _Component.prototype.oninit.call(this, vnode); - this.state = new _states_PollState__WEBPACK_IMPORTED_MODULE_5__["default"](this.attrs.poll); - }; - _proto.oncreate = function oncreate(vnode) { - _Component.prototype.oncreate.call(this, vnode); - this.preventClose = this.preventClose.bind(this); - window.addEventListener('beforeunload', this.preventClose); - }; - _proto.onremove = function onremove(vnode) { - _Component.prototype.onremove.call(this, vnode); - window.removeEventListener('beforeunload', this.preventClose); - }; - _proto.view = function view() { - var poll = this.attrs.poll; - var state = this.state; - var controls = _utils_PollControls__WEBPACK_IMPORTED_MODULE_8__["default"].controls(poll, this); - (poll.publicPoll() || poll.canEdit()) && controls.add('view', m((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_6___default()), { - onclick: state.showVoters, - icon: "fas fa-poll" - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().translator.trans('fof-polls.forum.public_poll'))); - return m("div", { - className: flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_12___default()('Poll', poll.imageUrl() && 'Poll--image'), - "data-id": poll.id() - }, this.controlsView(controls.toArray()), m("div", { - className: "Poll-wrapper" - }, this.createMainView().toArray())); - }; - _proto.createMainView = function createMainView() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7___default())(); - items.add('header', m("div", { - className: "Poll-header" - }, this.createPollHeader().toArray())); - items.add('content', m("div", { - className: "Poll-content" - }, this.createPollContent().toArray())); - items.add('footer', m("div", { - className: "Poll-footer" - }, this.createPollFooter().toArray())); - return items; - }; - _proto.createPollHeader = function createPollHeader() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7___default())(); - var poll = this.attrs.poll; - items.add('title', m(_Poll_PollTitle__WEBPACK_IMPORTED_MODULE_13__["default"], { - poll: poll - })); - if (poll.subtitle()) items.add('subtitle', m(_Poll_PollSubtitle__WEBPACK_IMPORTED_MODULE_14__["default"], { - poll: poll - })); - return items; - }; - _proto.createPollContent = function createPollContent() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7___default())(); - var poll = this.attrs.poll; - if (poll.imageUrl()) { - items.add('image', m(_Poll_PollImage__WEBPACK_IMPORTED_MODULE_4__["default"], { - poll: poll - })); - } - items.add('form', m("form", { - className: "Poll-form" - }, this.createFormItems().toArray())); - return items; - }; - _proto.createPollFooter = function createPollFooter() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7___default())(); - var state = this.state; - var infoItems = this.infoItems(state.getMaxVotes()); - items.add('sticky', m("div", { - className: "Poll-sticky" - }, !infoItems.isEmpty() && m("div", { - className: "helpText PollInfoText" - }, infoItems.toArray()), state.showButton() && m(_Poll_PollSubmitButton__WEBPACK_IMPORTED_MODULE_10__["default"], { - state: state - }))); - return items; - }; - _proto.createFormItems = function createFormItems() { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7___default())(); - var poll = this.attrs.poll; - var state = this.state; - var questionSlug = (0,flarum_common_utils_string__WEBPACK_IMPORTED_MODULE_11__.slug)(poll.question()); - items.add('elements', m("fieldset", null, m("legend", { - className: "sr-only" - }, poll.question()), m(_Poll_PollOptions__WEBPACK_IMPORTED_MODULE_3__["default"], { - name: questionSlug, - options: poll.options(), - state: state - }))); - return items; - }; - _proto.controlsView = function controlsView(controls) { - return !!controls.length && m((flarum_common_components_Dropdown__WEBPACK_IMPORTED_MODULE_9___default()), { - icon: "fas fa-ellipsis-v", - className: "PollListItem-controls", - menuClassName: "Dropdown-menu--right", - buttonClassName: "Button Button--icon Button--flat", - accessibleToggleLabel: flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().translator.trans('fof-polls.forum.poll_controls.toggle_dropdown_accessible_label') - }, controls); - }; - _proto.infoItems = function infoItems(maxVotes) { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7___default())(); - var poll = this.attrs.poll; - if ((flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().session).user && !poll.canVote() && !poll.hasEnded()) { - items.add('no-permission', m("span", null, m("i", { - className: "icon fas fa-times-circle fa-fw" - }), flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().translator.trans('fof-polls.forum.no_permission'))); - } - if (poll.endDate()) { - items.add('end-date', m("span", null, m("i", { - "class": "icon fas fa-clock fa-fw" - }), poll.hasEnded() ? flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().translator.trans('fof-polls.forum.poll_ended') : flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().translator.trans('fof-polls.forum.days_remaining', { - time: dayjs(poll.endDate()).fromNow() - }))); - } - if (poll.canVote()) { - items.add('max-votes', m("span", null, m("i", { - className: "icon fas fa-poll fa-fw" - }), flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().translator.trans('fof-polls.forum.max_votes_allowed', { - max: maxVotes - }))); - if (!poll.canChangeVote()) { - items.add('cannot-change-vote', m("span", null, m("i", { - className: "icon fas fa-" + (this.state.hasVoted() ? 'times' : 'exclamation') + "-circle fa-fw" - }), flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().translator.trans('fof-polls.forum.poll.cannot_change_vote'))); - } - } - return items; - }; - return PollView; -}((flarum_common_Component__WEBPACK_IMPORTED_MODULE_1___default())); - - -/***/ }), - -/***/ "./src/forum/components/PollViewPage.tsx": -/*!***********************************************!*\ - !*** ./src/forum/components/PollViewPage.tsx ***! - \***********************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollViewPage) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _PollView__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PollView */ "./src/forum/components/PollView.tsx"); -/* harmony import */ var _AbstractPollPage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./AbstractPollPage */ "./src/forum/components/AbstractPollPage.tsx"); - - - - -var PollViewPage = /*#__PURE__*/function (_AbstractPollPage) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PollViewPage, _AbstractPollPage); - function PollViewPage() { - return _AbstractPollPage.apply(this, arguments) || this; - } - var _proto = PollViewPage.prototype; - _proto.oninit = function oninit(vnode) { - var _this = this; - _AbstractPollPage.prototype.oninit.call(this, vnode); - if (!flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().forum.attribute('globalPollsEnabled')) { - m.route.set('/'); - return; - } - var editId = m.route.param('id'); - this.poll = flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().store.getById('poll', editId); - if (!this.poll) { - this.loading = true; - flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().store.find('fof/polls', editId).then(function (item) { - _this.poll = item; - _this.loading = false; - flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().setTitle(_this.poll.question()); - m.redraw(); - }); - } - }; - _proto.contentItems = function contentItems() { - var items = _AbstractPollPage.prototype.contentItems.call(this); - if (!this.loading) { - items.add('poll', m(_PollView__WEBPACK_IMPORTED_MODULE_2__["default"], { - poll: this.poll - })); - } - return items; - }; - return PollViewPage; -}(_AbstractPollPage__WEBPACK_IMPORTED_MODULE_3__.AbstractPollPage); - - -/***/ }), - -/***/ "./src/forum/components/PollsPage.tsx": -/*!********************************************!*\ - !*** ./src/forum/components/PollsPage.tsx ***! - \********************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollsPage) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/helpers/listItems */ "flarum/common/helpers/listItems"); -/* harmony import */ var flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/common/utils/ItemList */ "flarum/common/utils/ItemList"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/forum/components/IndexPage */ "flarum/forum/components/IndexPage"); -/* harmony import */ var flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var _Poll_PollList__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Poll/PollList */ "./src/forum/components/Poll/PollList.tsx"); -/* harmony import */ var flarum_forum_components_LogInModal__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! flarum/forum/components/LogInModal */ "flarum/forum/components/LogInModal"); -/* harmony import */ var flarum_forum_components_LogInModal__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_LogInModal__WEBPACK_IMPORTED_MODULE_6__); -/* harmony import */ var flarum_common_utils_extractText__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! flarum/common/utils/extractText */ "flarum/common/utils/extractText"); -/* harmony import */ var flarum_common_utils_extractText__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_extractText__WEBPACK_IMPORTED_MODULE_7__); -/* harmony import */ var _states_PollListState__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../states/PollListState */ "./src/forum/states/PollListState.ts"); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! flarum/common/components/Button */ "flarum/common/components/Button"); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_9__); -/* harmony import */ var flarum_common_components_SelectDropdown__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! flarum/common/components/SelectDropdown */ "flarum/common/components/SelectDropdown"); -/* harmony import */ var flarum_common_components_SelectDropdown__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_SelectDropdown__WEBPACK_IMPORTED_MODULE_10__); -/* harmony import */ var flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! flarum/common/components/LoadingIndicator */ "flarum/common/components/LoadingIndicator"); -/* harmony import */ var flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_11__); -/* harmony import */ var _PollView__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./PollView */ "./src/forum/components/PollView.tsx"); -/* harmony import */ var _AbstractPollPage__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./AbstractPollPage */ "./src/forum/components/AbstractPollPage.tsx"); - - - - - - - - - - - - - - -var PollsPage = /*#__PURE__*/function (_AbstractPollPage) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PollsPage, _AbstractPollPage); - function PollsPage() { - return _AbstractPollPage.apply(this, arguments) || this; - } - var _proto = PollsPage.prototype; - _proto.oninit = function oninit(vnode) { - _AbstractPollPage.prototype.oninit.call(this, vnode); - if (!flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().forum.attribute('globalPollsEnabled')) { - m.route.set('/'); - return; - } - this.state = new _states_PollListState__WEBPACK_IMPORTED_MODULE_8__["default"]({ - sort: m.route.param('sort'), - filter: m.route.param('filter') - }); - this.state.refresh(); - flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().setTitle(flarum_common_utils_extractText__WEBPACK_IMPORTED_MODULE_7___default()(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.page.nav'))); - }; - _proto.view = function view() { - if (this.loading) { - return m((flarum_common_components_LoadingIndicator__WEBPACK_IMPORTED_MODULE_11___default()), null); - } - if (this.poll) { - return m("div", { - className: "PollsListPage" - }, m("div", { - className: "container" - }, m(_PollView__WEBPACK_IMPORTED_MODULE_12__["default"], { - poll: this.poll - }))); - } - return m("div", { - className: "PollsListPage" - }, _AbstractPollPage.prototype.hero.call(this), m("div", { - className: "container" - }, m("div", { - className: "sideNavContainer" - }, m("nav", { - className: "PollsListPage-nav sideNav" - }, m("ul", null, flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_2___default()(this.sidebarItems().toArray()))), m("div", { - className: "PollsPage-results sideNavOffset" - }, m("div", { - className: "IndexPage-toolbar" - }, m("ul", { - className: "IndexPage-toolbar-view" - }, flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_2___default()(this.viewItems().toArray())), m("ul", { - className: "IndexPage-toolbar-action" - }, flarum_common_helpers_listItems__WEBPACK_IMPORTED_MODULE_2___default()(this.actionItems().toArray()))), m(_Poll_PollList__WEBPACK_IMPORTED_MODULE_5__["default"], { - state: this.state - }))))); - }; - _proto.sidebarItems = function sidebarItems() { - var _this = this; - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_3___default())(); - var canStartPoll = flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().forum.attribute('canStartGlobalPolls'); - items.add('newGlobalPoll', m((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_9___default()), { - icon: "fas fa-edit", - className: "Button Button--primary App-primaryControl PollsPage-newPoll", - itemClassName: "App-primaryControl", - onclick: function onclick() { - _this.newPollAction(); - }, - disabled: !canStartPoll - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans("fof-polls.forum.poll." + (canStartPoll ? 'start_poll_button' : 'cannot_start_poll_button')))); - items.add('nav', m((flarum_common_components_SelectDropdown__WEBPACK_IMPORTED_MODULE_10___default()), { - buttonClassName: "Button", - className: "App-titleControl", - accessibleToggleLabel: flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('core.forum.index.toggle_sidenav_dropdown_accessible_label') - }, this.navItems().toArray())); - return items; - }; - _proto.actionItems = function actionItems() { - var _this2 = this; - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_3___default())(); - items.add('refresh', flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_9___default().component({ - title: flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.page.refresh_tooltip'), - icon: 'fas fa-sync', - className: 'Button Button--icon', - onclick: function onclick() { - _this2.state.refresh(); - } - })); - return items; - }; - _proto.viewItems = function viewItems() { - return flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_4___default().prototype.viewItems(); - }; - _proto.navItems = function navItems() { - return flarum_forum_components_IndexPage__WEBPACK_IMPORTED_MODULE_4___default().prototype.navItems(); - } - - /** - * Change to create new poll page - */; - _proto.newPollAction = function newPollAction() { - if (!(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().session).user) { - flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().modal.show((flarum_forum_components_LogInModal__WEBPACK_IMPORTED_MODULE_6___default())); - return; - } - m.route.set(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().route('fof.polls.compose')); - }; - return PollsPage; -}(_AbstractPollPage__WEBPACK_IMPORTED_MODULE_13__.AbstractPollPage); - - -/***/ }), - -/***/ "./src/forum/components/PollsShowcasePage.tsx": -/*!****************************************************!*\ - !*** ./src/forum/components/PollsShowcasePage.tsx ***! - \****************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollsShowcasePage) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _states_PollListState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../states/PollListState */ "./src/forum/states/PollListState.ts"); -/* harmony import */ var flarum_common_utils_extractText__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/common/utils/extractText */ "flarum/common/utils/extractText"); -/* harmony import */ var flarum_common_utils_extractText__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_extractText__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/common/components/Button */ "flarum/common/components/Button"); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var flarum_forum_components_LogInModal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! flarum/forum/components/LogInModal */ "flarum/forum/components/LogInModal"); -/* harmony import */ var flarum_forum_components_LogInModal__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_LogInModal__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var _AbstractPollPage__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./AbstractPollPage */ "./src/forum/components/AbstractPollPage.tsx"); -/* harmony import */ var _PollShowcase__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./PollShowcase */ "./src/forum/components/PollShowcase.tsx"); - - - - - - - - -var PollsShowcasePage = /*#__PURE__*/function (_AbstractPollPage) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PollsShowcasePage, _AbstractPollPage); - function PollsShowcasePage() { - return _AbstractPollPage.apply(this, arguments) || this; - } - var _proto = PollsShowcasePage.prototype; - _proto.oninit = function oninit(vnode) { - _AbstractPollPage.prototype.oninit.call(this, vnode); - if (!flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().forum.attribute('globalPollsEnabled')) { - m.route.set('/'); - return; - } - this.state = new _states_PollListState__WEBPACK_IMPORTED_MODULE_2__["default"]({ - sort: m.route.param('sort'), - filter: m.route.param('filter'), - include: this.includeParams() - }); - this.state.refresh(); - flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().setTitle(flarum_common_utils_extractText__WEBPACK_IMPORTED_MODULE_3___default()(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.page.nav'))); - }; - _proto.includeParams = function includeParams() { - return ['options', 'votes', 'myVotes', 'myVotes.option']; - }; - _proto.contentItems = function contentItems() { - var items = _AbstractPollPage.prototype.contentItems.call(this); - if (!this.loading) { - items.add('poll-showcase', m(_PollShowcase__WEBPACK_IMPORTED_MODULE_7__["default"], { - state: this.state - })); - } - return items; - }; - _proto.sidebarItems = function sidebarItems() { - var _this = this; - var items = _AbstractPollPage.prototype.sidebarItems.call(this); - var canStartPoll = flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().forum.attribute('canStartGlobalPolls'); - if (canStartPoll) { - items.remove('newDiscussion'); - items.add('newGlobalPoll', m((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_4___default()), { - icon: "fas fa-edit", - className: "Button Button--primary App-primaryControl PollsPage-newPoll", - itemClassName: "App-primaryControl", - onclick: function onclick() { - _this.newPollAction(); - }, - disabled: !canStartPoll - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans("fof-polls.forum.poll." + (canStartPoll ? 'start_poll_button' : 'cannot_start_poll_button'))), 100); - } - return items; - }; - _proto.newPollAction = function newPollAction() { - if (!(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().session).user) { - flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().modal.show((flarum_forum_components_LogInModal__WEBPACK_IMPORTED_MODULE_5___default())); - return; - } - m.route.set(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().route('fof.polls.compose')); - }; - return PollsShowcasePage; -}(_AbstractPollPage__WEBPACK_IMPORTED_MODULE_6__.AbstractPollPage); - - -/***/ }), - -/***/ "./src/forum/components/PostPoll.tsx": -/*!*******************************************!*\ - !*** ./src/forum/components/PostPoll.tsx ***! - \*******************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PostPoll) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/Component */ "flarum/common/Component"); -/* harmony import */ var flarum_common_Component__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Component__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/common/components/Button */ "flarum/common/components/Button"); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var flarum_forum_components_LogInModal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/forum/components/LogInModal */ "flarum/forum/components/LogInModal"); -/* harmony import */ var flarum_forum_components_LogInModal__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_LogInModal__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var _ListVotersModal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ListVotersModal */ "./src/forum/components/ListVotersModal.tsx"); -/* harmony import */ var flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! flarum/common/utils/classList */ "flarum/common/utils/classList"); -/* harmony import */ var flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_6__); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! flarum/common/utils/ItemList */ "flarum/common/utils/ItemList"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7__); -/* harmony import */ var flarum_common_components_Tooltip__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! flarum/common/components/Tooltip */ "flarum/common/components/Tooltip"); -/* harmony import */ var flarum_common_components_Tooltip__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Tooltip__WEBPACK_IMPORTED_MODULE_8__); -/* harmony import */ var flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! flarum/common/helpers/icon */ "flarum/common/helpers/icon"); -/* harmony import */ var flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_9__); -/* harmony import */ var _EditPollModal__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./EditPollModal */ "./src/forum/components/EditPollModal.tsx"); -/* harmony import */ var flarum_common_utils_extractText__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! flarum/common/utils/extractText */ "flarum/common/utils/extractText"); -/* harmony import */ var flarum_common_utils_extractText__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_extractText__WEBPACK_IMPORTED_MODULE_11__); - - - - - - - - - - - - -var PostPoll = /*#__PURE__*/function (_Component) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PostPoll, _Component); - function PostPoll() { - var _this; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _Component.call.apply(_Component, [this].concat(args)) || this; - _this.loadingOptions = false; - _this.useSubmitUI = void 0; - _this.pendingSubmit = false; - _this.pendingOptions = void 0; - return _this; - } - var _proto = PostPoll.prototype; - _proto.oninit = function oninit(vnode) { - var _this$attrs$poll, _this$attrs$poll2; - _Component.prototype.oninit.call(this, vnode); - this.useSubmitUI = !((_this$attrs$poll = this.attrs.poll) != null && _this$attrs$poll.canChangeVote()) && ((_this$attrs$poll2 = this.attrs.poll) == null ? void 0 : _this$attrs$poll2.allowMultipleVotes()); - this.pendingOptions = null; - }; - _proto.oncreate = function oncreate(vnode) { - _Component.prototype.oncreate.call(this, vnode); - this.preventClose = this.preventClose.bind(this); - window.addEventListener('beforeunload', this.preventClose); - }; - _proto.onremove = function onremove(vnode) { - _Component.prototype.onremove.call(this, vnode); - window.removeEventListener('beforeunload', this.preventClose); - }; - _proto.view = function view() { - var poll = this.attrs.poll; - var options = poll.options() || []; - var maxVotes = poll.allowMultipleVotes() ? poll.maxVotes() : 1; - if (maxVotes === 0) maxVotes = options.length; - var infoItems = this.infoItems(maxVotes); - return m("div", { - className: "Post-poll", - "data-id": poll.id() - }, m("div", { - className: "PollHeading" - }, m("div", { - className: "PollHeading-title-container" - }, m("h3", { - className: "PollHeading-title" - }, poll.question()), poll.subtitle() && m("p", { - className: "helpText PollHeading-subtitle" - }, poll.subtitle())), m("div", { - className: "PollHeading-actions" - }, poll.canSeeVoters() && m((flarum_common_components_Tooltip__WEBPACK_IMPORTED_MODULE_8___default()), { - text: flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.public_poll') - }, m((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3___default()), { - className: "Button PollHeading-voters", - onclick: this.showVoters.bind(this), - icon: "fas fa-poll" - })), poll.canEdit() && m((flarum_common_components_Tooltip__WEBPACK_IMPORTED_MODULE_8___default()), { - text: flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.moderation.edit') - }, m((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3___default()), { - className: "Button PollHeading-edit", - onclick: flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().modal.show.bind((flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().modal), _EditPollModal__WEBPACK_IMPORTED_MODULE_10__["default"], { - poll: poll - }), - icon: "fas fa-pen" - })), poll.canDelete() && m((flarum_common_components_Tooltip__WEBPACK_IMPORTED_MODULE_8___default()), { - text: flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.moderation.delete') - }, m((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3___default()), { - className: "Button PollHeading-delete", - onclick: this.deletePoll.bind(this), - icon: "fas fa-trash" - })))), m("div", null, m("div", { - className: "PollOptions" - }, options.map(this.viewOption.bind(this))), m("div", { - className: "Poll-sticky" - }, !infoItems.isEmpty() && m("div", { - className: "helpText PollInfoText" - }, infoItems.toArray()), this.useSubmitUI && this.pendingSubmit && m((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3___default()), { - className: "Button Button--primary Poll-submit", - loading: this.loadingOptions, - onclick: this.onsubmit.bind(this) - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.poll.submit_button'))))); - }; - _proto.infoItems = function infoItems(maxVotes) { - var _poll$myVotes; - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_7___default())(); - var poll = this.attrs.poll; - var hasVoted = ((_poll$myVotes = poll.myVotes()) == null ? void 0 : _poll$myVotes.length) > 0; - if ((flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().session).user && !poll.canVote() && !poll.hasEnded()) { - items.add('no-permission', m("span", null, m("i", { - className: "icon fas fa-times-circle fa-fw" - }), flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.no_permission'))); - } - if (poll.endDate()) { - items.add('end-date', m("span", null, m("i", { - "class": "icon fas fa-clock fa-fw" - }), poll.hasEnded() ? flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.poll_ended') : flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.days_remaining', { - time: dayjs(poll.endDate()).fromNow() - }))); - } - if (poll.canVote()) { - items.add('max-votes', m("span", null, m("i", { - className: "icon fas fa-poll fa-fw" - }), flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.max_votes_allowed', { - max: maxVotes - }))); - if (!poll.canChangeVote()) { - items.add('cannot-change-vote', m("span", null, m("i", { - className: "icon fas fa-" + (hasVoted ? 'times' : 'exclamation') + "-circle fa-fw" - }), flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.poll.cannot_change_vote'))); - } - } - return items; - }; - _proto.viewOption = function viewOption(opt) { - var _poll$myVotes2, _poll$myVotes3, _poll$myVotes4; - var poll = this.attrs.poll; - var hasVoted = ((_poll$myVotes2 = poll.myVotes()) == null ? void 0 : _poll$myVotes2.length) > 0; - var totalVotes = poll.voteCount(); - var voted = this.pendingOptions ? this.pendingOptions.has(opt.id()) : (_poll$myVotes3 = poll.myVotes()) == null || _poll$myVotes3.some == null ? void 0 : _poll$myVotes3.some(function (vote) { - return vote.option() === opt; - }); - var votes = opt.voteCount(); - var percent = totalVotes > 0 ? Math.round(votes / totalVotes * 100) : 0; - - // isNaN(null) is false, so we have to check type directly now that API always returns the field - var canSeeVoteCount = typeof votes === 'number'; - var isDisabled = this.loadingOptions || hasVoted && !poll.canChangeVote(); - var width = canSeeVoteCount ? percent : Number(voted) / (((_poll$myVotes4 = poll.myVotes()) == null ? void 0 : _poll$myVotes4.length) || 1) * 100; - var showCheckmark = !(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().session).user || !poll.hasEnded() && poll.canVote() && (!hasVoted || poll.canChangeVote()); - var bar = m("div", { - className: "PollBar", - "data-selected": !!voted, - style: "--poll-option-width: " + width + "%" - }, showCheckmark && m("label", { - className: "PollAnswer-checkbox checkbox" - }, m("input", { - onchange: this.changeVote.bind(this, opt), - type: "checkbox", - checked: voted, - disabled: isDisabled - }), m("span", { - className: "checkmark" - })), m("div", { - className: "PollAnswer-text" - }, m("span", { - className: "PollAnswer-text-answer" - }, opt.answer()), voted && !showCheckmark && flarum_common_helpers_icon__WEBPACK_IMPORTED_MODULE_9___default()('fas fa-check-circle', { - className: 'PollAnswer-check' - }), canSeeVoteCount && m("span", { - className: flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_6___default()('PollPercent', percent !== 100 && 'PollPercent--option') - }, percent, "%")), opt.imageUrl() ? m("img", { - className: "PollAnswer-image", - src: opt.imageUrl(), - alt: opt.answer() - }) : null); - return m("div", { - className: flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_6___default()('PollOption', hasVoted && 'PollVoted', poll.hasEnded() && 'PollEnded', opt.imageUrl() && 'PollOption-hasImage'), - "data-id": opt.id() - }, canSeeVoteCount ? m((flarum_common_components_Tooltip__WEBPACK_IMPORTED_MODULE_8___default()), { - text: flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.tooltip.votes', { - count: votes - }), - onremove: this.hideOptionTooltip - }, bar) : bar); - }; - _proto.changeVote = function changeVote(option, evt) { - var _this$attrs$poll$myVo, _this$attrs$poll$myVo2; - if (!(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().session).user) { - flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().modal.show((flarum_forum_components_LogInModal__WEBPACK_IMPORTED_MODULE_4___default())); - evt.target.checked = false; - return; - } - var optionIds = this.pendingOptions || new Set((_this$attrs$poll$myVo = (_this$attrs$poll$myVo2 = this.attrs.poll.myVotes()).map) == null ? void 0 : _this$attrs$poll$myVo.call(_this$attrs$poll$myVo2, function (v) { - return v.option().id(); - })); - var isUnvoting = optionIds["delete"](option.id()); - var allowsMultiple = this.attrs.poll.allowMultipleVotes(); - if (!allowsMultiple) { - optionIds.clear(); - } - if (!isUnvoting) { - optionIds.add(option.id()); - } - if (this.useSubmitUI) { - this.pendingOptions = optionIds.size ? optionIds : null; - this.pendingSubmit = !!this.pendingOptions; - return; - } - return this.submit(optionIds, null, function () { - return evt.target.checked = isUnvoting; - }); - }; - _proto.onsubmit = function onsubmit() { - var _this2 = this; - return this.submit(this.pendingOptions, function () { - _this2.pendingOptions = null; - _this2.pendingSubmit = false; - }); - }; - _proto.submit = function submit(optionIds, cb, onerror) { - var _this3 = this; - this.loadingOptions = true; - m.redraw(); - return flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().request({ - method: 'PATCH', - url: flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().forum.attribute('apiUrl') + "/fof/polls/" + this.attrs.poll.id() + "/votes", - body: { - data: { - optionIds: Array.from(optionIds) - } - } - }).then(function (res) { - flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().store.pushPayload(res); - cb == null || cb(); - })["catch"](function (err) { - onerror == null || onerror(err); - })["finally"](function () { - _this3.loadingOptions = false; - m.redraw(); - }); - }; - _proto.showVoters = function showVoters() { - // Load all the votes only when opening the votes list - flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().modal.show(_ListVotersModal__WEBPACK_IMPORTED_MODULE_5__["default"], { - poll: this.attrs.poll, - post: this.attrs.post - }); - }; - _proto.deletePoll = function deletePoll() { - if (confirm(flarum_common_utils_extractText__WEBPACK_IMPORTED_MODULE_11___default()(flarum_forum_app__WEBPACK_IMPORTED_MODULE_1___default().translator.trans('fof-polls.forum.moderation.delete_confirm')))) { - this.attrs.poll["delete"]().then(function () { - m.redraw.sync(); - }); - } - } - - /** - * Attempting to use the `tooltipVisible` attr on the Tooltip component set to 'false' when no vote count - * caused the tooltip to break on click. This is a workaround to hide the tooltip when no vote count is available, - * called on 'onremove' of the Tooltip component. It doesn't always work as intended either, but it does the job. - */; - _proto.hideOptionTooltip = function hideOptionTooltip(vnode) { - vnode.attrs.tooltipVisible = false; - vnode.state.updateVisibility(); - } - - /** - * Alert before navigating away using browser's 'beforeunload' event - */; - _proto.preventClose = function preventClose(e) { - if (this.pendingOptions) { - e.preventDefault(); - return true; - } - }; - return PostPoll; -}((flarum_common_Component__WEBPACK_IMPORTED_MODULE_2___default())); - - -/***/ }), - -/***/ "./src/forum/components/UploadPollImageButton.tsx": -/*!********************************************************!*\ - !*** ./src/forum/components/UploadPollImageButton.tsx ***! - \********************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ UploadPollImageButton) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/common/components/Button */ "flarum/common/components/Button"); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/common/utils/classList */ "flarum/common/utils/classList"); -/* harmony import */ var flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_4__); - - - - - -var UploadPollImageButton = /*#__PURE__*/function (_Button) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(UploadPollImageButton, _Button); - function UploadPollImageButton() { - var _this; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _Button.call.apply(_Button, [this].concat(args)) || this; - _this.loading = false; - _this.uploadedImageUrl = false; - _this.fileName = undefined; - _this.$input = void 0; - return _this; - } - var _proto = UploadPollImageButton.prototype; - _proto.view = function view(vnode) { - this.attrs.loading = this.loading; - this.attrs.className = flarum_common_utils_classList__WEBPACK_IMPORTED_MODULE_4___default()(this.attrs.className, 'Button'); - var imageUrl = this.getImageUrl(); - if (imageUrl) { - this.attrs.onclick = this.remove.bind(this); - return m("div", null, m("p", null, m("img", { - src: imageUrl, - alt: "" - })), m("p", null, _Button.prototype.view.call(this, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, vnode, { - children: flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().translator.trans('fof-polls.forum.upload_image.remove_button') - })))); - } else { - this.attrs.onclick = this.upload.bind(this); - } - return _Button.prototype.view.call(this, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, vnode, { - children: flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().translator.trans('fof-polls.forum.upload_image.upload_button') - })); - } - - /** - * Prompt the user to upload an image. - */; - _proto.upload = function upload() { - var _this2 = this; - if (this.loading) return; - this.$input = $(''); - this.$input.appendTo('body').hide().trigger('click').on('change', function (e) { - var body = new FormData(); - body.append(_this2.attrs.name, $(e.target)[0].files[0]); - _this2.loading = true; - m.redraw(); - flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().request({ - method: 'POST', - url: _this2.resourceUrl(), - serialize: function serialize(raw) { - return raw; - }, - body: body - }).then(_this2.success.bind(_this2), _this2.failure.bind(_this2)); - }); - } - - /** - * Remove the image. - */; - _proto.remove = function remove() { - var _this$attrs$poll, _this$attrs$option; - this.loading = true; - m.redraw(); - var fileName = undefined; - if (!((_this$attrs$poll = this.attrs.poll) != null && _this$attrs$poll.exists) && !((_this$attrs$option = this.attrs.option) != null && _this$attrs$option.exists)) { - fileName = this.fileName; - } - flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().request({ - method: 'DELETE', - url: this.resourceUrl(fileName) - }).then(this.success.bind(this), this.failure.bind(this)); - }; - _proto.resourceUrl = function resourceUrl(fileName) { - if (fileName === void 0) { - fileName = undefined; - } - var url = flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().forum.attribute('apiUrl') + '/fof/polls/' + this.attrs.name; - var poll = this.attrs.poll; - var option = this.attrs.option; - if (fileName) { - url += '/name/' + fileName; - } else { - if (poll != null && poll.exists) url += '/' + (poll == null ? void 0 : poll.id()); - if (option != null && option.exists) url += '/' + (option == null ? void 0 : option.id()); - } - return url; - }; - _proto.getImageUrl = function getImageUrl() { - var _this$attrs$poll2, _this$attrs$option2; - if (this.uploadedImageUrl !== false) { - return this.uploadedImageUrl; - } - return ((_this$attrs$poll2 = this.attrs.poll) == null ? void 0 : _this$attrs$poll2.imageUrl()) || ((_this$attrs$option2 = this.attrs.option) == null ? void 0 : _this$attrs$option2.imageUrl()); - } - - /** - * After a successful upload/removal, redraw the page. - * - * @param {PollUploadObject} response - * @protected - */; - _proto.success = function success(response) { - var _this$attrs$onUpload, _this$attrs, _this$$input; - this.loading = false; - this.uploadedImageUrl = response == null ? void 0 : response.fileUrl; - this.fileName = response == null ? void 0 : response.fileName; - (_this$attrs$onUpload = (_this$attrs = this.attrs).onUpload) == null || _this$attrs$onUpload.call(_this$attrs, response == null ? void 0 : response.fileName); - m.redraw(); - (_this$$input = this.$input) == null || _this$$input.remove(); - } - - /** - * If upload/removal fails, stop loading. - * - * @param {object} response - * @protected - */; - _proto.failure = function failure(response) { - var _this$$input2; - this.loading = false; - m.redraw(); - (_this$$input2 = this.$input) == null || _this$$input2.remove(); - }; - return UploadPollImageButton; -}((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_3___default())); - - -/***/ }), - -/***/ "./src/forum/components/form/FormError.tsx": -/*!*************************************************!*\ - !*** ./src/forum/components/form/FormError.tsx ***! - \*************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ FormError) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var _babel_runtime_helpers_esm_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/wrapNativeSuper */ "./node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js"); - - -var FormError = /*#__PURE__*/function (_Error) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(FormError, _Error); - function FormError(props) { - return _Error.call(this, props + '') || this; - } - return FormError; -}( /*#__PURE__*/(0,_babel_runtime_helpers_esm_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_1__["default"])(Error)); - - -/***/ }), - -/***/ "./src/forum/components/index.ts": -/*!***************************************!*\ - !*** ./src/forum/components/index.ts ***! - \***************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ components: () => (/* binding */ components) -/* harmony export */ }); -/* harmony import */ var _CreatePollModal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CreatePollModal */ "./src/forum/components/CreatePollModal.tsx"); -/* harmony import */ var _PostPoll__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PostPoll */ "./src/forum/components/PostPoll.tsx"); -/* harmony import */ var _EditPollModal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./EditPollModal */ "./src/forum/components/EditPollModal.tsx"); -/* harmony import */ var _ListVotersModal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ListVotersModal */ "./src/forum/components/ListVotersModal.tsx"); -/* harmony import */ var _PollForm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./PollForm */ "./src/forum/components/PollForm.tsx"); -/* harmony import */ var _ComposePollHero__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ComposePollHero */ "./src/forum/components/ComposePollHero.tsx"); -/* harmony import */ var _ComposePollPage__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ComposePollPage */ "./src/forum/components/ComposePollPage.tsx"); -/* harmony import */ var _PollsPage__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./PollsPage */ "./src/forum/components/PollsPage.tsx"); -/* harmony import */ var _PollView__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./PollView */ "./src/forum/components/PollView.tsx"); -/* harmony import */ var _PollViewPage__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./PollViewPage */ "./src/forum/components/PollViewPage.tsx"); -/* harmony import */ var _Poll_PollSubmitButton__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Poll/PollSubmitButton */ "./src/forum/components/Poll/PollSubmitButton.tsx"); -/* harmony import */ var _Poll_PollOption__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./Poll/PollOption */ "./src/forum/components/Poll/PollOption.tsx"); -/* harmony import */ var _Poll_PollOptions__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./Poll/PollOptions */ "./src/forum/components/Poll/PollOptions.tsx"); -/* harmony import */ var _PollsShowcasePage__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./PollsShowcasePage */ "./src/forum/components/PollsShowcasePage.tsx"); -/* harmony import */ var _PollShowcase__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./PollShowcase */ "./src/forum/components/PollShowcase.tsx"); -/* harmony import */ var _PollShowcaseItem__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./PollShowcaseItem */ "./src/forum/components/PollShowcaseItem.tsx"); -/* harmony import */ var _AbstractPollPage__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./AbstractPollPage */ "./src/forum/components/AbstractPollPage.tsx"); -/* harmony import */ var _Poll_PollTitle__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./Poll/PollTitle */ "./src/forum/components/Poll/PollTitle.tsx"); -/* harmony import */ var _Poll_PollSubtitle__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./Poll/PollSubtitle */ "./src/forum/components/Poll/PollSubtitle.tsx"); -/* harmony import */ var _Poll_PollImage__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./Poll/PollImage */ "./src/forum/components/Poll/PollImage.tsx"); - - - - - - - - - - - - - - - - - - - - -var components = { - CreatePollModal: _CreatePollModal__WEBPACK_IMPORTED_MODULE_0__["default"], - PostPoll: _PostPoll__WEBPACK_IMPORTED_MODULE_1__["default"], - EditPollModal: _EditPollModal__WEBPACK_IMPORTED_MODULE_2__["default"], - ListVotersModal: _ListVotersModal__WEBPACK_IMPORTED_MODULE_3__["default"], - PollForm: _PollForm__WEBPACK_IMPORTED_MODULE_4__["default"], - ComposePollHero: _ComposePollHero__WEBPACK_IMPORTED_MODULE_5__["default"], - ComposePollPage: _ComposePollPage__WEBPACK_IMPORTED_MODULE_6__["default"], - PollsPage: _PollsPage__WEBPACK_IMPORTED_MODULE_7__["default"], - PollView: _PollView__WEBPACK_IMPORTED_MODULE_8__["default"], - PollViewPage: _PollViewPage__WEBPACK_IMPORTED_MODULE_9__["default"], - PollSubmitButton: _Poll_PollSubmitButton__WEBPACK_IMPORTED_MODULE_10__["default"], - PollOption: _Poll_PollOption__WEBPACK_IMPORTED_MODULE_11__["default"], - PollOptions: _Poll_PollOptions__WEBPACK_IMPORTED_MODULE_12__["default"], - PollsShowcasePage: _PollsShowcasePage__WEBPACK_IMPORTED_MODULE_13__["default"], - PollShowcase: _PollShowcase__WEBPACK_IMPORTED_MODULE_14__["default"], - PollShowcaseItem: _PollShowcaseItem__WEBPACK_IMPORTED_MODULE_15__["default"], - AbstractPollPage: _AbstractPollPage__WEBPACK_IMPORTED_MODULE_16__.AbstractPollPage, - PollTitle: _Poll_PollTitle__WEBPACK_IMPORTED_MODULE_17__["default"], - PollSubtitle: _Poll_PollSubtitle__WEBPACK_IMPORTED_MODULE_18__["default"], - PollImage: _Poll_PollImage__WEBPACK_IMPORTED_MODULE_19__["default"] -}; - -/***/ }), - -/***/ "./src/forum/extend.ts": -/*!*****************************!*\ - !*** ./src/forum/extend.ts ***! - \*****************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var flarum_common_extenders__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! flarum/common/extenders */ "flarum/common/extenders"); -/* harmony import */ var flarum_common_extenders__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(flarum_common_extenders__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var flarum_common_models_Post__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/models/Post */ "flarum/common/models/Post"); -/* harmony import */ var flarum_common_models_Post__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_models_Post__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_models_Forum__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/models/Forum */ "flarum/common/models/Forum"); -/* harmony import */ var flarum_common_models_Forum__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_models_Forum__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var flarum_common_models_Discussion__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/common/models/Discussion */ "flarum/common/models/Discussion"); -/* harmony import */ var flarum_common_models_Discussion__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_common_models_Discussion__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _models_Poll__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./models/Poll */ "./src/forum/models/Poll.ts"); -/* harmony import */ var _models_PollOption__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./models/PollOption */ "./src/forum/models/PollOption.ts"); -/* harmony import */ var _models_PollVote__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./models/PollVote */ "./src/forum/models/PollVote.ts"); -/* harmony import */ var _components_PollsPage__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./components/PollsPage */ "./src/forum/components/PollsPage.tsx"); -/* harmony import */ var _components_ComposePollPage__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./components/ComposePollPage */ "./src/forum/components/ComposePollPage.tsx"); -/* harmony import */ var _components_PollViewPage__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./components/PollViewPage */ "./src/forum/components/PollViewPage.tsx"); -/* harmony import */ var _components_PollsShowcasePage__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./components/PollsShowcasePage */ "./src/forum/components/PollsShowcasePage.tsx"); - - - - - - - - - - - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([new (flarum_common_extenders__WEBPACK_IMPORTED_MODULE_0___default().Routes)() // -.add('fof.polls.showcase', '/polls', _components_PollsShowcasePage__WEBPACK_IMPORTED_MODULE_10__["default"]).add('fof.polls.list', '/polls/all', _components_PollsPage__WEBPACK_IMPORTED_MODULE_7__["default"]).add('fof.polls.view', '/polls/view/:id', _components_PollViewPage__WEBPACK_IMPORTED_MODULE_9__["default"]).add('fof.polls.compose', '/polls/composer', _components_ComposePollPage__WEBPACK_IMPORTED_MODULE_8__["default"]), new (flarum_common_extenders__WEBPACK_IMPORTED_MODULE_0___default().Store)() // -.add('polls', _models_Poll__WEBPACK_IMPORTED_MODULE_4__["default"]).add('poll_options', _models_PollOption__WEBPACK_IMPORTED_MODULE_5__["default"]).add('poll_votes', _models_PollVote__WEBPACK_IMPORTED_MODULE_6__["default"]), new (flarum_common_extenders__WEBPACK_IMPORTED_MODULE_0___default().Model)((flarum_common_models_Post__WEBPACK_IMPORTED_MODULE_1___default())) // -.hasMany('polls').attribute('canStartPoll'), new (flarum_common_extenders__WEBPACK_IMPORTED_MODULE_0___default().Model)((flarum_common_models_Forum__WEBPACK_IMPORTED_MODULE_2___default())) // -.attribute('canStartPolls'), new (flarum_common_extenders__WEBPACK_IMPORTED_MODULE_0___default().Model)((flarum_common_models_Discussion__WEBPACK_IMPORTED_MODULE_3___default())) // -.attribute('hasPoll').attribute('canStartPoll')]); - -/***/ }), - -/***/ "./src/forum/index.ts": -/*!****************************!*\ - !*** ./src/forum/index.ts ***! - \****************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ components: () => (/* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_6__.components), -/* harmony export */ extend: () => (/* reexport safe */ _extend__WEBPACK_IMPORTED_MODULE_10__["default"]), -/* harmony export */ models: () => (/* reexport safe */ _models__WEBPACK_IMPORTED_MODULE_7__.models), -/* harmony export */ states: () => (/* reexport safe */ _states__WEBPACK_IMPORTED_MODULE_8__.states), -/* harmony export */ utils: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_9__.utils) -/* harmony export */ }); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _addDiscussionBadge__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./addDiscussionBadge */ "./src/forum/addDiscussionBadge.tsx"); -/* harmony import */ var _addComposerItems__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./addComposerItems */ "./src/forum/addComposerItems.tsx"); -/* harmony import */ var _addPollsToPost__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./addPollsToPost */ "./src/forum/addPollsToPost.tsx"); -/* harmony import */ var _addPostControls__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./addPostControls */ "./src/forum/addPostControls.tsx"); -/* harmony import */ var _addNavItem__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./addNavItem */ "./src/forum/addNavItem.ts"); -/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./components */ "./src/forum/components/index.ts"); -/* harmony import */ var _models__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./models */ "./src/forum/models/index.ts"); -/* harmony import */ var _states__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./states */ "./src/forum/states/index.ts"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils */ "./src/forum/utils/index.ts"); -/* harmony import */ var _extend__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./extend */ "./src/forum/extend.ts"); - - - - - - - - - - -flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().initializers.add('fof/polls', function () { - (0,_addDiscussionBadge__WEBPACK_IMPORTED_MODULE_1__["default"])(); - (0,_addComposerItems__WEBPACK_IMPORTED_MODULE_2__["default"])(); - (0,_addPollsToPost__WEBPACK_IMPORTED_MODULE_3__["default"])(); - (0,_addPostControls__WEBPACK_IMPORTED_MODULE_4__["default"])(); - (0,_addNavItem__WEBPACK_IMPORTED_MODULE_5__["default"])(); -}); - - -/***/ }), - -/***/ "./src/forum/models/Poll.ts": -/*!**********************************!*\ - !*** ./src/forum/models/Poll.ts ***! - \**********************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ Poll) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_common_Model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/Model */ "flarum/common/Model"); -/* harmony import */ var flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Model__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_common_utils_computed__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/common/utils/computed */ "flarum/common/utils/computed"); -/* harmony import */ var flarum_common_utils_computed__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_computed__WEBPACK_IMPORTED_MODULE_2__); - - - -var Poll = /*#__PURE__*/function (_Model) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(Poll, _Model); - function Poll() { - var _this; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = _Model.call.apply(_Model, [this].concat(args)) || this; - _this.tempOptions = void 0; - return _this; - } - var _proto = Poll.prototype; - _proto.question = function question() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('question').call(this); - }; - _proto.subtitle = function subtitle() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('subtitle').call(this); - }; - _proto.image = function image() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('image').call(this); - }; - _proto.imageUrl = function imageUrl() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('imageUrl').call(this); - }; - _proto.imageAlt = function imageAlt() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('imageAlt').call(this); - }; - _proto.hasEnded = function hasEnded() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('hasEnded').call(this); - }; - _proto.endDate = function endDate() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('endDate', (flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().transformDate)).call(this); - }; - _proto.publicPoll = function publicPoll() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('publicPoll').call(this); - }; - _proto.hideVotes = function hideVotes() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('hideVotes').call(this); - }; - _proto.allowChangeVote = function allowChangeVote() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('allowChangeVote').call(this); - }; - _proto.allowMultipleVotes = function allowMultipleVotes() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('allowMultipleVotes').call(this); - }; - _proto.maxVotes = function maxVotes() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('maxVotes').call(this); - }; - _proto.voteCount = function voteCount() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('voteCount').call(this); - }; - _proto.canVote = function canVote() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('canVote').call(this); - }; - _proto.canEdit = function canEdit() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('canEdit').call(this); - }; - _proto.canDelete = function canDelete() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('canDelete').call(this); - }; - _proto.canSeeVoters = function canSeeVoters() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('canSeeVoters').call(this); - }; - _proto.canChangeVote = function canChangeVote() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('canChangeVote').call(this); - }; - _proto.options = function options() { - var options = flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().hasMany('options').call(this); - return options ? options : []; - }; - _proto.votes = function votes() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().hasMany('votes').call(this); - }; - _proto.myVotes = function myVotes() { - var myVotes = flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().hasMany('myVotes').call(this); - return myVotes ? myVotes : []; - }; - _proto.isGlobal = function isGlobal() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('isGlobal').call(this); - }; - _proto.isHidden = function isHidden() { - return flarum_common_utils_computed__WEBPACK_IMPORTED_MODULE_2___default()('hiddenAt', function (hiddenAt) { - return !!hiddenAt; - }).call(this); - } - - // TODO: These two don't make sense as of now - ; - _proto.isUnread = function isUnread() { - return false; - }; - _proto.apiEndpoint = function apiEndpoint() { - /** @ts-ignore */ - return "/fof/polls" + (this.exists ? "/" + this.data.id : ''); - }; - return Poll; -}((flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default())); - - -/***/ }), - -/***/ "./src/forum/models/PollOption.ts": -/*!****************************************!*\ - !*** ./src/forum/models/PollOption.ts ***! - \****************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollOption) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_common_Model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/Model */ "flarum/common/Model"); -/* harmony import */ var flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Model__WEBPACK_IMPORTED_MODULE_1__); - - -var PollOption = /*#__PURE__*/function (_Model) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PollOption, _Model); - function PollOption() { - return _Model.apply(this, arguments) || this; - } - var _proto = PollOption.prototype; - _proto.answer = function answer() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('answer').call(this); - }; - _proto.imageUrl = function imageUrl() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('imageUrl').call(this); - }; - _proto.voteCount = function voteCount() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('voteCount').call(this); - }; - _proto.poll = function poll() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().hasOne('polls').call(this); - }; - _proto.votes = function votes() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().hasMany('votes').call(this); - }; - _proto.apiEndpoint = function apiEndpoint() { - /** @ts-ignore */ - return "/fof/polls/answers" + (this.exists ? "/" + this.data.id : ''); - }; - return PollOption; -}((flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default())); - - -/***/ }), - -/***/ "./src/forum/models/PollVote.ts": -/*!**************************************!*\ - !*** ./src/forum/models/PollVote.ts ***! - \**************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollVote) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_common_Model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/common/Model */ "flarum/common/Model"); -/* harmony import */ var flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_common_Model__WEBPACK_IMPORTED_MODULE_1__); - - -var PollVote = /*#__PURE__*/function (_Model) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(PollVote, _Model); - function PollVote() { - return _Model.apply(this, arguments) || this; - } - var _proto = PollVote.prototype; - _proto.poll = function poll() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().hasOne('poll').call(this); - }; - _proto.option = function option() { - var result = flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().hasOne('option').call(this); - return result === false ? null : result; - }; - _proto.user = function user() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().hasOne('user').call(this); - }; - _proto.pollId = function pollId() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('pollId').call(this); - }; - _proto.optionId = function optionId() { - return flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default().attribute('optionId').call(this); - }; - _proto.apiEndpoint = function apiEndpoint() { - return "/fof/polls/" + this.pollId() + "/vote"; - }; - return PollVote; -}((flarum_common_Model__WEBPACK_IMPORTED_MODULE_1___default())); - - -/***/ }), - -/***/ "./src/forum/models/index.ts": -/*!***********************************!*\ - !*** ./src/forum/models/index.ts ***! - \***********************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ models: () => (/* binding */ models) -/* harmony export */ }); -/* harmony import */ var _Poll__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Poll */ "./src/forum/models/Poll.ts"); -/* harmony import */ var _PollOption__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PollOption */ "./src/forum/models/PollOption.ts"); -/* harmony import */ var _PollVote__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PollVote */ "./src/forum/models/PollVote.ts"); - - - -var models = { - Poll: _Poll__WEBPACK_IMPORTED_MODULE_0__["default"], - PollOption: _PollOption__WEBPACK_IMPORTED_MODULE_1__["default"], - PollVote: _PollVote__WEBPACK_IMPORTED_MODULE_2__["default"] -}; - -/***/ }), - -/***/ "./src/forum/states/PollFormState.ts": -/*!*******************************************!*\ - !*** ./src/forum/states/PollFormState.ts ***! - \*******************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollFormState) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"); -/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js"); -/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_2__); - - - -var PollFormState = /*#__PURE__*/function () { - PollFormState.createNewPoll = function createNewPoll() { - var poll = flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().store.createRecord('polls'); - poll.pushAttributes({ - question: '', - endDate: '', - publicPoll: false, - allowMultipleVotes: false, - hideVotes: false, - allowChangeVote: false, - maxVotes: 0 - }); - poll.tempOptions = [flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().store.createRecord('poll_options'), flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().store.createRecord('poll_options')]; - return poll; - }; - function PollFormState(poll) { - this.poll = void 0; - this.loading = void 0; - this.deleting = void 0; - this.expandedGroup = void 0; - if (!poll) { - poll = PollFormState.createNewPoll(); - } - this.loading = false; - this.deleting = false; - this.poll = poll; - this.expandedGroup = 'setup'; - } - var _proto = PollFormState.prototype; - _proto.isExpanded = function isExpanded(groupKey) { - return this.expandedGroup === groupKey; - }; - _proto.expand = function expand(groupKey) { - this.expandedGroup = groupKey; - m.redraw(); - }; - _proto.save = /*#__PURE__*/function () { - var _save = (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(data) { - return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function _callee$(_context) { - while (1) switch (_context.prev = _context.next) { - case 0: - this.loading = true; - m.redraw(); - _context.prev = 2; - _context.next = 5; - return this.poll.save(data); - case 5: - this.poll = _context.sent; - /** - * Cleanup attributes: - * For the saving process, we add the options directly to the attributes. - * As we currently cannot add new PollOptions as relationships. - */ - delete this.poll.data.attributes.options; - case 7: - _context.prev = 7; - this.loading = false; - m.redraw(); - return _context.finish(7); - case 11: - case "end": - return _context.stop(); - } - }, _callee, this, [[2,, 7, 11]]); - })); - function save(_x) { - return _save.apply(this, arguments); - } - return save; - }(); - _proto["delete"] = /*#__PURE__*/function () { - var _delete2 = (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee2() { - return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function _callee2$(_context2) { - while (1) switch (_context2.prev = _context2.next) { - case 0: - this.loading = true; - m.redraw(); - _context2.prev = 2; - _context2.next = 5; - return this.poll["delete"](); - case 5: - this.deleting = true; - case 6: - _context2.prev = 6; - this.loading = false; - m.redraw(); - return _context2.finish(6); - case 10: - case "end": - return _context2.stop(); - } - }, _callee2, this, [[2,, 6, 10]]); - })); - function _delete() { - return _delete2.apply(this, arguments); - } - return _delete; - }(); - return PollFormState; -}(); - - -/***/ }), - -/***/ "./src/forum/states/PollListState.ts": -/*!*******************************************!*\ - !*** ./src/forum/states/PollListState.ts ***! - \*******************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollListState) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); -/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"); -/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var flarum_common_states_PaginatedListState__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! flarum/common/states/PaginatedListState */ "flarum/common/states/PaginatedListState"); -/* harmony import */ var flarum_common_states_PaginatedListState__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(flarum_common_states_PaginatedListState__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var flarum_common_utils_EventEmitter__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! flarum/common/utils/EventEmitter */ "flarum/common/utils/EventEmitter"); -/* harmony import */ var flarum_common_utils_EventEmitter__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_EventEmitter__WEBPACK_IMPORTED_MODULE_5__); - - - -function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } - - - -var globalEventEmitter = new (flarum_common_utils_EventEmitter__WEBPACK_IMPORTED_MODULE_5___default())(); -var PollListState = /*#__PURE__*/function (_PaginatedListState) { - (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(PollListState, _PaginatedListState); - function PollListState(params, page) { - var _this; - if (page === void 0) { - page = 1; - } - _this = _PaginatedListState.call(this, params, page, 20) || this; - _this.extraPolls = []; - _this.eventEmitter = void 0; - _this.eventEmitter = globalEventEmitter.on('poll.deleted', _this.deletePoll.bind((0,_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__["default"])(_this))); - return _this; - } - var _proto = PollListState.prototype; - _proto.requestParams = function requestParams() { - var _this$params$sort; - var params = { - include: this.params.include || ['options', 'votes'], - filter: this.params.filter || {}, - sort: this.sortMap()[(_this$params$sort = this.params.sort) != null ? _this$params$sort : ''] - }; - if (this.params.q) { - params.filter.q = this.params.q; - } - return params; - }; - _proto.loadPage = function loadPage(page) { - if (page === void 0) { - page = 1; - } - var preloadedPolls = flarum_forum_app__WEBPACK_IMPORTED_MODULE_3___default().preloadedApiDocument(); - if (preloadedPolls) { - this.initialLoading = false; - return Promise.resolve(preloadedPolls); - } - return _PaginatedListState.prototype.loadPage.call(this, page); - }; - _proto.clear = function clear() { - _PaginatedListState.prototype.clear.call(this); - this.extraPolls = []; - } - - /** - * Get a map of sort keys (which appear in the URL, and are used for - * translation) to the API sort value that they represent. - */; - _proto.sortMap = function sortMap() { - var map = {}; - if (this.params.q) { - map.relevance = ''; - } - map.newest = '-createdAt'; - map.oldest = 'createdAt'; - return map; - } - - /** - * In the last request, has the user searched for a poll? - */; - _proto.isSearchResults = function isSearchResults() { - return !!this.params.q; - }; - _proto.removePoll = function removePoll(poll) { - this.eventEmitter.emit('poll.deleted', poll); - }; - _proto.deletePoll = function deletePoll(poll) { - for (var _iterator = _createForOfIteratorHelperLoose(this.pages), _step; !(_step = _iterator()).done;) { - var page = _step.value; - var _index = page.items.indexOf(poll); - if (_index !== -1) { - page.items.splice(_index, 1); - break; - } - } - var index = this.extraPolls.indexOf(poll); - if (index !== -1) { - this.extraPolls.splice(index); - } - m.redraw(); - } - - /** - * Add a poll to the top of the list. - */; - _proto.addPoll = function addPoll(poll) { - this.removePoll(poll); - this.extraPolls.unshift(poll); - m.redraw(); - }; - _proto.getAllItems = function getAllItems() { - return this.extraPolls.concat(_PaginatedListState.prototype.getAllItems.call(this)); - }; - _proto.getPages = function getPages() { - var pages = _PaginatedListState.prototype.getPages.call(this); - if (this.extraPolls.length) { - return [{ - number: -1, - items: this.extraPolls - }].concat(pages); - } - return pages; - }; - (0,_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_0__["default"])(PollListState, [{ - key: "type", - get: function get() { - return 'fof/polls'; - } - }]); - return PollListState; -}((flarum_common_states_PaginatedListState__WEBPACK_IMPORTED_MODULE_4___default())); - - -/***/ }), - -/***/ "./src/forum/states/PollState.ts": -/*!***************************************!*\ - !*** ./src/forum/states/PollState.ts ***! - \***************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ PollState) -/* harmony export */ }); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var flarum_forum_components_LogInModal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! flarum/forum/components/LogInModal */ "flarum/forum/components/LogInModal"); -/* harmony import */ var flarum_forum_components_LogInModal__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_components_LogInModal__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _components_ListVotersModal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/ListVotersModal */ "./src/forum/components/ListVotersModal.tsx"); - - - -var PollState = /*#__PURE__*/function () { - function PollState(poll) { - var _this = this; - this.poll = void 0; - this.pendingSubmit = false; - this.pendingOptions = null; - this.loadingOptions = false; - this.useSubmitUI = void 0; - this.showCheckMarks = void 0; - this.canSeeVoteCount = void 0; - this.showVoters = function () { - // Load all the votes only when opening the votes list - flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().modal.show(_components_ListVotersModal__WEBPACK_IMPORTED_MODULE_2__["default"], { - poll: _this.poll - }); - }; - this.poll = poll; - this.useSubmitUI = !(poll != null && poll.canChangeVote()) && (poll == null ? void 0 : poll.allowMultipleVotes()); - this.showCheckMarks = !(flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().session).user || !poll.hasEnded() && poll.canVote() && (!this.hasVoted() || poll.canChangeVote()); - this.canSeeVoteCount = typeof poll.voteCount() === 'number'; - this.init(); - } - - /** - * used as en extendable entry point for init customizations - */ - var _proto = PollState.prototype; - _proto.init = function init() {}; - _proto.isShowResult = function isShowResult() { - return this.poll.hasEnded() || this.canSeeVoteCount && !!(flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().session).user && this.hasVoted(); - }; - _proto.hasVoted = function hasVoted() { - return this.poll.myVotes().length > 0; - }; - _proto.overallVoteCount = function overallVoteCount() { - return this.poll.voteCount(); - }; - _proto.hasVotedFor = function hasVotedFor(option) { - return this.pendingOptions ? this.pendingOptions.has(option.id()) : this.poll.myVotes().some(function (vote) { - return vote.option() === option; - }); - }; - _proto.getMaxVotes = function getMaxVotes() { - var poll = this.poll; - var maxVotes = poll.allowMultipleVotes() ? poll.maxVotes() : 1; - if (maxVotes === 0) maxVotes = poll.options().length; - return maxVotes; - }; - _proto.showButton = function showButton() { - return this.useSubmitUI && this.pendingSubmit; - }; - _proto.changeVote = function changeVote(option, evt) { - var target = evt.target; - if (!(flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().session).user) { - flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().modal.show((flarum_forum_components_LogInModal__WEBPACK_IMPORTED_MODULE_1___default())); - target.checked = false; - return; - } - var optionIds = this.pendingOptions || new Set(this.poll.myVotes().map(function (v) { - return v.option().id(); - })); - var isUnvoting = optionIds["delete"](option.id()); - var allowsMultiple = this.poll.allowMultipleVotes(); - if (!allowsMultiple) { - optionIds.clear(); - } - if (!isUnvoting) { - optionIds.add(option.id()); - } - this.pendingOptions = optionIds.size ? optionIds : null; - this.pendingSubmit = !!this.pendingOptions; - if (this.useSubmitUI) { - this.pendingOptions = optionIds.size ? optionIds : null; - this.pendingSubmit = !!this.pendingOptions; - m.redraw(); - return; - } - this.submit(optionIds, null, function () { - return target.checked = isUnvoting; - }); - }; - _proto.hasSelectedOptions = function hasSelectedOptions() { - return this.pendingSubmit; - }; - _proto.onsubmit = function onsubmit() { - var _this2 = this; - return this.submit(this.pendingOptions, function () { - _this2.pendingOptions = null; - _this2.pendingSubmit = false; - }); - }; - _proto.submit = function submit(optionIds, cb, onerror) { - var _this3 = this; - if (onerror === void 0) { - onerror = null; - } - this.loadingOptions = true; - m.redraw(); - return flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().request({ - method: 'PATCH', - url: flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().forum.attribute('apiUrl') + "/fof/polls/" + this.poll.id() + "/votes", - body: { - data: { - optionIds: Array.from(optionIds) - } - } - }).then(function (res) { - flarum_forum_app__WEBPACK_IMPORTED_MODULE_0___default().store.pushPayload(res); - cb == null || cb(); - })["catch"](function (err) { - onerror == null || onerror(err); - })["finally"](function () { - _this3.loadingOptions = false; - _this3.canSeeVoteCount = typeof _this3.poll.voteCount() === 'number'; - m.redraw(); - }); - }; - return PollState; -}(); - - -/***/ }), - -/***/ "./src/forum/states/index.ts": -/*!***********************************!*\ - !*** ./src/forum/states/index.ts ***! - \***********************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ states: () => (/* binding */ states) -/* harmony export */ }); -/* harmony import */ var _PollFormState__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./PollFormState */ "./src/forum/states/PollFormState.ts"); -/* harmony import */ var _PollListState__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PollListState */ "./src/forum/states/PollListState.ts"); -/* harmony import */ var _PollState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PollState */ "./src/forum/states/PollState.ts"); - - - -var states = { - PollFormState: _PollFormState__WEBPACK_IMPORTED_MODULE_0__["default"], - PollListState: _PollListState__WEBPACK_IMPORTED_MODULE_1__["default"], - PollState: _PollState__WEBPACK_IMPORTED_MODULE_2__["default"] -}; - -/***/ }), - -/***/ "./src/forum/utils/PollControls.tsx": -/*!******************************************!*\ - !*** ./src/forum/utils/PollControls.tsx ***! - \******************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"); -/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js"); -/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flarum/forum/app */ "flarum/forum/app"); -/* harmony import */ var flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(flarum_forum_app__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _components_ComposePollPage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/ComposePollPage */ "./src/forum/components/ComposePollPage.tsx"); -/* harmony import */ var _components_PollsPage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../components/PollsPage */ "./src/forum/components/PollsPage.tsx"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! flarum/common/utils/ItemList */ "flarum/common/utils/ItemList"); -/* harmony import */ var flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var flarum_common_components_Separator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! flarum/common/components/Separator */ "flarum/common/components/Separator"); -/* harmony import */ var flarum_common_components_Separator__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Separator__WEBPACK_IMPORTED_MODULE_6__); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! flarum/common/components/Button */ "flarum/common/components/Button"); -/* harmony import */ var flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_7__); - - - - - - - - - -/** - * The `UserControls` utility constructs a list of buttons for a user which - * perform actions on it. - */ -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - /** - * Get a list of controls for a user. - */ - controls: function controls(poll, context) { - var _this = this; - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_5___default())(); - ['poll', 'moderation', 'destructive'].forEach(function (section) { - var controls = _this[section + 'Controls'](poll, context).toArray(); - if (controls.length) { - controls.forEach(function (item) { - return items.add(item.itemName, item); - }); - items.add(section + 'Separator', m((flarum_common_components_Separator__WEBPACK_IMPORTED_MODULE_6___default()), null)); - } - }); - return items; - }, - /** - * Get controls for direct modifcation actions on polls (e.g. vote, view voters). - */ - pollControls: function pollControls(poll, context) { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_5___default())(); - return items; - }, - /** - * Get controls for a user pertaining to moderation (e.g. suspend, edit). - */ - moderationControls: function moderationControls(poll, context) { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_5___default())(); - if (poll.canEdit()) { - items.add('edit', m((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_7___default()), { - icon: "fas fa-pencil-alt", - onclick: this.editAction.bind(this, poll) - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().translator.trans("fof-polls.forum.poll_controls.edit_label"))); - } - return items; - }, - /** - * Get controls for a user which are destructive (e.g. delete). - * @protected - */ - destructiveControls: function destructiveControls(poll, context) { - var items = new (flarum_common_utils_ItemList__WEBPACK_IMPORTED_MODULE_5___default())(); - if (poll.canDelete()) { - items.add('delete', m((flarum_common_components_Button__WEBPACK_IMPORTED_MODULE_7___default()), { - icon: "far fa-trash-alt", - onclick: this.deleteAction.bind(this, poll) - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().translator.trans("fof-polls.forum.poll_controls.delete_label"))); - } - return items; - }, - /** - * Delete the poll. - */ - deleteAction: function deleteAction(poll) { - var _this2 = this; - return (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee() { - return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function _callee$(_context) { - while (1) switch (_context.prev = _context.next) { - case 0: - if (confirm(flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().translator.trans("fof-polls.forum.poll_controls.delete_confirmation"))) { - _context.next = 2; - break; - } - return _context.abrupt("return"); - case 2: - return _context.abrupt("return", poll["delete"]().then(function () { - _this2.showDeletionAlert(poll, 'success'); - if (flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().current.matches(_components_ComposePollPage__WEBPACK_IMPORTED_MODULE_3__["default"], { - id: poll.id() - }) || flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().current.matches(_components_PollsPage__WEBPACK_IMPORTED_MODULE_4__["default"], { - id: poll.id() - })) { - flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().history.back(); - } else { - window.location.reload(); - } - })["catch"](function () { - return _this2.showDeletionAlert(poll, 'error'); - })); - case 3: - case "end": - return _context.stop(); - } - }, _callee); - }))(); - }, - /** - * Show deletion alert of poll - */ - showDeletionAlert: function showDeletionAlert(poll, type) { - var message = { - success: "fof-polls.forum.poll_controls.delete_success_message", - error: "fof-polls.forum.poll_controls.delete_error_message" - }[type]; - flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().alerts.show({ - type: type - }, flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().translator.trans(message, { - poll: poll - })); - }, - /** - * Edit the poll. - */ - editAction: function editAction(poll) { - m.route.set(flarum_forum_app__WEBPACK_IMPORTED_MODULE_2___default().route('fof.polls.compose', { - id: poll.id() - })); - } -}); - -/***/ }), - -/***/ "./src/forum/utils/index.ts": -/*!**********************************!*\ - !*** ./src/forum/utils/index.ts ***! - \**********************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ utils: () => (/* binding */ utils) -/* harmony export */ }); -/* harmony import */ var _PollControls__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./PollControls */ "./src/forum/utils/PollControls.tsx"); - -var utils = { - PollControls: _PollControls__WEBPACK_IMPORTED_MODULE_0__["default"] -}; - -/***/ }), - -/***/ "flarum/common/Component": -/*!*********************************************************!*\ - !*** external "flarum.core.compat['common/Component']" ***! - \*********************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/Component']; - -/***/ }), - -/***/ "flarum/common/Model": -/*!*****************************************************!*\ - !*** external "flarum.core.compat['common/Model']" ***! - \*****************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/Model']; - -/***/ }), - -/***/ "flarum/common/components/Badge": -/*!****************************************************************!*\ - !*** external "flarum.core.compat['common/components/Badge']" ***! - \****************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/components/Badge']; - -/***/ }), - -/***/ "flarum/common/components/Button": -/*!*****************************************************************!*\ - !*** external "flarum.core.compat['common/components/Button']" ***! - \*****************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/components/Button']; - -/***/ }), - -/***/ "flarum/common/components/Dropdown": -/*!*******************************************************************!*\ - !*** external "flarum.core.compat['common/components/Dropdown']" ***! - \*******************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/components/Dropdown']; - -/***/ }), - -/***/ "flarum/common/components/Link": -/*!***************************************************************!*\ - !*** external "flarum.core.compat['common/components/Link']" ***! - \***************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/components/Link']; - -/***/ }), - -/***/ "flarum/common/components/LinkButton": -/*!*********************************************************************!*\ - !*** external "flarum.core.compat['common/components/LinkButton']" ***! - \*********************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/components/LinkButton']; - -/***/ }), - -/***/ "flarum/common/components/LoadingIndicator": -/*!***************************************************************************!*\ - !*** external "flarum.core.compat['common/components/LoadingIndicator']" ***! - \***************************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/components/LoadingIndicator']; - -/***/ }), - -/***/ "flarum/common/components/Modal": -/*!****************************************************************!*\ - !*** external "flarum.core.compat['common/components/Modal']" ***! - \****************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/components/Modal']; - -/***/ }), - -/***/ "flarum/common/components/Page": -/*!***************************************************************!*\ - !*** external "flarum.core.compat['common/components/Page']" ***! - \***************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/components/Page']; - -/***/ }), - -/***/ "flarum/common/components/Placeholder": -/*!**********************************************************************!*\ - !*** external "flarum.core.compat['common/components/Placeholder']" ***! - \**********************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/components/Placeholder']; - -/***/ }), - -/***/ "flarum/common/components/SelectDropdown": -/*!*************************************************************************!*\ - !*** external "flarum.core.compat['common/components/SelectDropdown']" ***! - \*************************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/components/SelectDropdown']; - -/***/ }), - -/***/ "flarum/common/components/Separator": -/*!********************************************************************!*\ - !*** external "flarum.core.compat['common/components/Separator']" ***! - \********************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/components/Separator']; - -/***/ }), - -/***/ "flarum/common/components/Switch": -/*!*****************************************************************!*\ - !*** external "flarum.core.compat['common/components/Switch']" ***! - \*****************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/components/Switch']; - -/***/ }), - -/***/ "flarum/common/components/Tooltip": -/*!******************************************************************!*\ - !*** external "flarum.core.compat['common/components/Tooltip']" ***! - \******************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/components/Tooltip']; - -/***/ }), - -/***/ "flarum/common/extend": -/*!******************************************************!*\ - !*** external "flarum.core.compat['common/extend']" ***! - \******************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/extend']; - -/***/ }), - -/***/ "flarum/common/extenders": -/*!*********************************************************!*\ - !*** external "flarum.core.compat['common/extenders']" ***! - \*********************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/extenders']; - -/***/ }), - -/***/ "flarum/common/helpers/avatar": -/*!**************************************************************!*\ - !*** external "flarum.core.compat['common/helpers/avatar']" ***! - \**************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/helpers/avatar']; - -/***/ }), - -/***/ "flarum/common/helpers/highlight": -/*!*****************************************************************!*\ - !*** external "flarum.core.compat['common/helpers/highlight']" ***! - \*****************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/helpers/highlight']; - -/***/ }), - -/***/ "flarum/common/helpers/icon": -/*!************************************************************!*\ - !*** external "flarum.core.compat['common/helpers/icon']" ***! - \************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/helpers/icon']; - -/***/ }), - -/***/ "flarum/common/helpers/listItems": -/*!*****************************************************************!*\ - !*** external "flarum.core.compat['common/helpers/listItems']" ***! - \*****************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/helpers/listItems']; - -/***/ }), - -/***/ "flarum/common/helpers/username": -/*!****************************************************************!*\ - !*** external "flarum.core.compat['common/helpers/username']" ***! - \****************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/helpers/username']; - -/***/ }), - -/***/ "flarum/common/models/Discussion": -/*!*****************************************************************!*\ - !*** external "flarum.core.compat['common/models/Discussion']" ***! - \*****************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/models/Discussion']; - -/***/ }), - -/***/ "flarum/common/models/Forum": -/*!************************************************************!*\ - !*** external "flarum.core.compat['common/models/Forum']" ***! - \************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/models/Forum']; - -/***/ }), - -/***/ "flarum/common/models/Post": -/*!***********************************************************!*\ - !*** external "flarum.core.compat['common/models/Post']" ***! - \***********************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/models/Post']; - -/***/ }), - -/***/ "flarum/common/states/PaginatedListState": -/*!*************************************************************************!*\ - !*** external "flarum.core.compat['common/states/PaginatedListState']" ***! - \*************************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/states/PaginatedListState']; - -/***/ }), - -/***/ "flarum/common/utils/EventEmitter": -/*!******************************************************************!*\ - !*** external "flarum.core.compat['common/utils/EventEmitter']" ***! - \******************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/utils/EventEmitter']; - -/***/ }), - -/***/ "flarum/common/utils/ItemList": -/*!**************************************************************!*\ - !*** external "flarum.core.compat['common/utils/ItemList']" ***! - \**************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/utils/ItemList']; - -/***/ }), - -/***/ "flarum/common/utils/RequestError": -/*!******************************************************************!*\ - !*** external "flarum.core.compat['common/utils/RequestError']" ***! - \******************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/utils/RequestError']; - -/***/ }), - -/***/ "flarum/common/utils/Stream": -/*!************************************************************!*\ - !*** external "flarum.core.compat['common/utils/Stream']" ***! - \************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/utils/Stream']; - -/***/ }), - -/***/ "flarum/common/utils/SubtreeRetainer": -/*!*********************************************************************!*\ - !*** external "flarum.core.compat['common/utils/SubtreeRetainer']" ***! - \*********************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/utils/SubtreeRetainer']; - -/***/ }), - -/***/ "flarum/common/utils/abbreviateNumber": -/*!**********************************************************************!*\ - !*** external "flarum.core.compat['common/utils/abbreviateNumber']" ***! - \**********************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/utils/abbreviateNumber']; - -/***/ }), - -/***/ "flarum/common/utils/classList": -/*!***************************************************************!*\ - !*** external "flarum.core.compat['common/utils/classList']" ***! - \***************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/utils/classList']; - -/***/ }), - -/***/ "flarum/common/utils/computed": -/*!**************************************************************!*\ - !*** external "flarum.core.compat['common/utils/computed']" ***! - \**************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/utils/computed']; - -/***/ }), - -/***/ "flarum/common/utils/extractText": -/*!*****************************************************************!*\ - !*** external "flarum.core.compat['common/utils/extractText']" ***! - \*****************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/utils/extractText']; - -/***/ }), - -/***/ "flarum/common/utils/string": -/*!************************************************************!*\ - !*** external "flarum.core.compat['common/utils/string']" ***! - \************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['common/utils/string']; - -/***/ }), - -/***/ "flarum/forum/app": -/*!**************************************************!*\ - !*** external "flarum.core.compat['forum/app']" ***! - \**************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['forum/app']; - -/***/ }), - -/***/ "flarum/forum/components/CommentPost": -/*!*********************************************************************!*\ - !*** external "flarum.core.compat['forum/components/CommentPost']" ***! - \*********************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['forum/components/CommentPost']; - -/***/ }), - -/***/ "flarum/forum/components/DiscussionComposer": -/*!****************************************************************************!*\ - !*** external "flarum.core.compat['forum/components/DiscussionComposer']" ***! - \****************************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['forum/components/DiscussionComposer']; - -/***/ }), - -/***/ "flarum/forum/components/DiscussionList": -/*!************************************************************************!*\ - !*** external "flarum.core.compat['forum/components/DiscussionList']" ***! - \************************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['forum/components/DiscussionList']; - -/***/ }), - -/***/ "flarum/forum/components/DiscussionPage": -/*!************************************************************************!*\ - !*** external "flarum.core.compat['forum/components/DiscussionPage']" ***! - \************************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['forum/components/DiscussionPage']; - -/***/ }), - -/***/ "flarum/forum/components/IndexPage": -/*!*******************************************************************!*\ - !*** external "flarum.core.compat['forum/components/IndexPage']" ***! - \*******************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['forum/components/IndexPage']; - -/***/ }), - -/***/ "flarum/forum/components/LogInModal": -/*!********************************************************************!*\ - !*** external "flarum.core.compat['forum/components/LogInModal']" ***! - \********************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['forum/components/LogInModal']; - -/***/ }), - -/***/ "flarum/forum/components/ReplyComposer": -/*!***********************************************************************!*\ - !*** external "flarum.core.compat['forum/components/ReplyComposer']" ***! - \***********************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['forum/components/ReplyComposer']; - -/***/ }), - -/***/ "flarum/forum/utils/PostControls": -/*!*****************************************************************!*\ - !*** external "flarum.core.compat['forum/utils/PostControls']" ***! - \*****************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['forum/utils/PostControls']; - -/***/ }), - -/***/ "flarum/forum/utils/slidable": -/*!*************************************************************!*\ - !*** external "flarum.core.compat['forum/utils/slidable']" ***! - \*************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = flarum.core.compat['forum/utils/slidable']; - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/regeneratorRuntime.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***! - \*******************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var _typeof = (__webpack_require__(/*! ./typeof.js */ "./node_modules/@babel/runtime/helpers/typeof.js")["default"]); -function _regeneratorRuntime() { - "use strict"; - - /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ - module.exports = _regeneratorRuntime = function _regeneratorRuntime() { - return e; - }, module.exports.__esModule = true, module.exports["default"] = module.exports; - var t, - e = {}, - r = Object.prototype, - n = r.hasOwnProperty, - o = Object.defineProperty || function (t, e, r) { - t[e] = r.value; - }, - i = "function" == typeof Symbol ? Symbol : {}, - a = i.iterator || "@@iterator", - c = i.asyncIterator || "@@asyncIterator", - u = i.toStringTag || "@@toStringTag"; - function define(t, e, r) { - return Object.defineProperty(t, e, { - value: r, - enumerable: !0, - configurable: !0, - writable: !0 - }), t[e]; - } - try { - define({}, ""); - } catch (t) { - define = function define(t, e, r) { - return t[e] = r; - }; - } - function wrap(t, e, r, n) { - var i = e && e.prototype instanceof Generator ? e : Generator, - a = Object.create(i.prototype), - c = new Context(n || []); - return o(a, "_invoke", { - value: makeInvokeMethod(t, r, c) - }), a; - } - function tryCatch(t, e, r) { - try { - return { - type: "normal", - arg: t.call(e, r) - }; - } catch (t) { - return { - type: "throw", - arg: t - }; - } - } - e.wrap = wrap; - var h = "suspendedStart", - l = "suspendedYield", - f = "executing", - s = "completed", - y = {}; - function Generator() {} - function GeneratorFunction() {} - function GeneratorFunctionPrototype() {} - var p = {}; - define(p, a, function () { - return this; - }); - var d = Object.getPrototypeOf, - v = d && d(d(values([]))); - v && v !== r && n.call(v, a) && (p = v); - var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); - function defineIteratorMethods(t) { - ["next", "throw", "return"].forEach(function (e) { - define(t, e, function (t) { - return this._invoke(e, t); - }); - }); - } - function AsyncIterator(t, e) { - function invoke(r, o, i, a) { - var c = tryCatch(t[r], t, o); - if ("throw" !== c.type) { - var u = c.arg, - h = u.value; - return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { - invoke("next", t, i, a); - }, function (t) { - invoke("throw", t, i, a); - }) : e.resolve(h).then(function (t) { - u.value = t, i(u); - }, function (t) { - return invoke("throw", t, i, a); - }); - } - a(c.arg); - } - var r; - o(this, "_invoke", { - value: function value(t, n) { - function callInvokeWithMethodAndArg() { - return new e(function (e, r) { - invoke(t, n, e, r); - }); - } - return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); - } - }); - } - function makeInvokeMethod(e, r, n) { - var o = h; - return function (i, a) { - if (o === f) throw new Error("Generator is already running"); - if (o === s) { - if ("throw" === i) throw a; - return { - value: t, - done: !0 - }; - } - for (n.method = i, n.arg = a;;) { - var c = n.delegate; - if (c) { - var u = maybeInvokeDelegate(c, n); - if (u) { - if (u === y) continue; - return u; - } - } - if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { - if (o === h) throw o = s, n.arg; - n.dispatchException(n.arg); - } else "return" === n.method && n.abrupt("return", n.arg); - o = f; - var p = tryCatch(e, r, n); - if ("normal" === p.type) { - if (o = n.done ? s : l, p.arg === y) continue; - return { - value: p.arg, - done: n.done - }; - } - "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); - } - }; - } - function maybeInvokeDelegate(e, r) { - var n = r.method, - o = e.iterator[n]; - if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; - var i = tryCatch(o, e.iterator, r.arg); - if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; - var a = i.arg; - return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); - } - function pushTryEntry(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 resetTryEntry(t) { - var e = t.completion || {}; - e.type = "normal", delete e.arg, t.completion = e; - } - function Context(t) { - this.tryEntries = [{ - tryLoc: "root" - }], t.forEach(pushTryEntry, this), this.reset(!0); - } - function values(e) { - if (e || "" === e) { - var r = e[a]; - if (r) return r.call(e); - if ("function" == typeof e.next) return e; - if (!isNaN(e.length)) { - var o = -1, - i = function next() { - for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; - return next.value = t, next.done = !0, next; - }; - return i.next = i; - } - } - throw new TypeError(_typeof(e) + " is not iterable"); - } - return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { - value: GeneratorFunctionPrototype, - configurable: !0 - }), o(GeneratorFunctionPrototype, "constructor", { - value: GeneratorFunction, - configurable: !0 - }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { - var e = "function" == typeof t && t.constructor; - return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); - }, e.mark = function (t) { - return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; - }, e.awrap = function (t) { - return { - __await: t - }; - }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { - return this; - }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { - void 0 === i && (i = Promise); - var a = new AsyncIterator(wrap(t, r, n, o), i); - return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { - return t.done ? t.value : a.next(); - }); - }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { - return this; - }), define(g, "toString", function () { - return "[object Generator]"; - }), e.keys = function (t) { - var e = Object(t), - r = []; - for (var n in e) r.push(n); - return r.reverse(), function next() { - for (; r.length;) { - var t = r.pop(); - if (t in e) return next.value = t, next.done = !1, next; - } - return next.done = !0, next; - }; - }, e.values = values, Context.prototype = { - constructor: Context, - reset: function reset(e) { - if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); - }, - stop: function stop() { - this.done = !0; - var t = this.tryEntries[0].completion; - if ("throw" === t.type) throw t.arg; - return this.rval; - }, - dispatchException: function dispatchException(e) { - if (this.done) throw e; - var r = this; - function handle(n, o) { - return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; - } - for (var o = this.tryEntries.length - 1; o >= 0; --o) { - var i = this.tryEntries[o], - a = i.completion; - if ("root" === i.tryLoc) return handle("end"); - if (i.tryLoc <= this.prev) { - var c = n.call(i, "catchLoc"), - u = n.call(i, "finallyLoc"); - if (c && u) { - if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); - if (this.prev < i.finallyLoc) return handle(i.finallyLoc); - } else if (c) { - if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); - } else { - if (!u) throw new Error("try statement without catch or finally"); - if (this.prev < i.finallyLoc) return handle(i.finallyLoc); - } - } - } - }, - abrupt: function abrupt(t, e) { - for (var r = this.tryEntries.length - 1; r >= 0; --r) { - var o = this.tryEntries[r]; - if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { - var i = o; - break; - } - } - i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); - var a = i ? i.completion : {}; - return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); - }, - complete: function complete(t, e) { - if ("throw" === t.type) throw t.arg; - return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; - }, - finish: function finish(t) { - for (var e = this.tryEntries.length - 1; e >= 0; --e) { - var r = this.tryEntries[e]; - if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; - } - }, - "catch": function _catch(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; - resetTryEntry(r); - } - return o; - } - } - throw new Error("illegal catch attempt"); - }, - delegateYield: function delegateYield(e, r, n) { - return this.delegate = { - iterator: values(e), - resultName: r, - nextLoc: n - }, "next" === this.method && (this.arg = t), y; - } - }, e; -} -module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports; - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/typeof.js": -/*!*******************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/typeof.js ***! - \*******************************************************/ -/***/ ((module) => { - -function _typeof(o) { - "@babel/helpers - typeof"; - - return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { - return typeof o; - } : function (o) { - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; - }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o); -} -module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; - -/***/ }), - -/***/ "./node_modules/@babel/runtime/regenerator/index.js": -/*!**********************************************************!*\ - !*** ./node_modules/@babel/runtime/regenerator/index.js ***! - \**********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -// TODO(Babel 8): Remove this file. - -var runtime = __webpack_require__(/*! ../helpers/regeneratorRuntime */ "./node_modules/@babel/runtime/helpers/regeneratorRuntime.js")(); -module.exports = runtime; - -// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736= -try { - regeneratorRuntime = runtime; -} catch (accidentalStrictMode) { - if (typeof globalThis === "object") { - globalThis.regeneratorRuntime = runtime; - } else { - Function("r", "regeneratorRuntime = r")(runtime); - } -} - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js": -/*!**************************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js ***! - \**************************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ _assertThisInitialized) -/* harmony export */ }); -function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; -} - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js": -/*!*********************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js ***! - \*********************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ _asyncToGenerator) -/* harmony export */ }); -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { - try { - var info = gen[key](arg); - var value = info.value; - } catch (error) { - reject(error); - return; - } - if (info.done) { - resolve(value); - } else { - Promise.resolve(value).then(_next, _throw); - } -} -function _asyncToGenerator(fn) { - return function () { - var self = this, - args = arguments; - return new Promise(function (resolve, reject) { - var gen = fn.apply(self, args); - function _next(value) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); - } - function _throw(err) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); - } - _next(undefined); - }); - }; -} - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/esm/construct.js": -/*!**************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/construct.js ***! - \**************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ _construct) -/* harmony export */ }); -/* harmony import */ var _setPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./setPrototypeOf.js */ "./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js"); -/* harmony import */ var _isNativeReflectConstruct_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isNativeReflectConstruct.js */ "./node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js"); - - -function _construct(t, e, r) { - if ((0,_isNativeReflectConstruct_js__WEBPACK_IMPORTED_MODULE_1__["default"])()) return Reflect.construct.apply(null, arguments); - var o = [null]; - o.push.apply(o, e); - var p = new (t.bind.apply(t, o))(); - return r && (0,_setPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(p, r.prototype), p; -} - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/esm/createClass.js": -/*!****************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/createClass.js ***! - \****************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ _createClass) -/* harmony export */ }); -/* harmony import */ var _toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toPropertyKey.js */ "./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js"); - -function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, (0,_toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__["default"])(descriptor.key), descriptor); - } -} -function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, "prototype", { - writable: false - }); - return Constructor; -} - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/esm/extends.js": -/*!************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/extends.js ***! - \************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ _extends) -/* harmony export */ }); -function _extends() { - _extends = Object.assign ? Object.assign.bind() : function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - return target; - }; - return _extends.apply(this, arguments); -} - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js ***! - \*******************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ _getPrototypeOf) -/* harmony export */ }); -function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); -} - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js": -/*!******************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js ***! - \******************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ _inheritsLoose) -/* harmony export */ }); -/* harmony import */ var _setPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./setPrototypeOf.js */ "./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js"); - -function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - (0,_setPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(subClass, superClass); -} - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/esm/isNativeFunction.js": -/*!*********************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/isNativeFunction.js ***! - \*********************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ _isNativeFunction) -/* harmony export */ }); -function _isNativeFunction(fn) { - try { - return Function.toString.call(fn).indexOf("[native code]") !== -1; - } catch (e) { - return typeof fn === "function"; - } -} - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js ***! - \*****************************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ _isNativeReflectConstruct) -/* harmony export */ }); -function _isNativeReflectConstruct() { - try { - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); - } catch (t) {} - return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { - return !!t; - })(); -} - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js ***! - \*******************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ _setPrototypeOf) -/* harmony export */ }); -function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); -} - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/esm/toPrimitive.js": -/*!****************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/toPrimitive.js ***! - \****************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ toPrimitive) -/* harmony export */ }); -/* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ "./node_modules/@babel/runtime/helpers/esm/typeof.js"); - -function toPrimitive(t, r) { - if ("object" != (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(t) || !t) return t; - var e = t[Symbol.toPrimitive]; - if (void 0 !== e) { - var i = e.call(t, r || "default"); - if ("object" != (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(i)) return i; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return ("string" === r ? String : Number)(t); -} - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js": -/*!******************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js ***! - \******************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ toPropertyKey) -/* harmony export */ }); -/* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ "./node_modules/@babel/runtime/helpers/esm/typeof.js"); -/* harmony import */ var _toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toPrimitive.js */ "./node_modules/@babel/runtime/helpers/esm/toPrimitive.js"); - - -function toPropertyKey(t) { - var i = (0,_toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__["default"])(t, "string"); - return "symbol" == (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(i) ? i : String(i); -} - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/esm/typeof.js": -/*!***********************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/typeof.js ***! - \***********************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ _typeof) -/* harmony export */ }); -function _typeof(o) { - "@babel/helpers - typeof"; - - return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { - return typeof o; - } : function (o) { - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; - }, _typeof(o); -} - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js": -/*!********************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js ***! - \********************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ _wrapNativeSuper) -/* harmony export */ }); -/* harmony import */ var _getPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getPrototypeOf.js */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"); -/* harmony import */ var _setPrototypeOf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./setPrototypeOf.js */ "./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js"); -/* harmony import */ var _isNativeFunction_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isNativeFunction.js */ "./node_modules/@babel/runtime/helpers/esm/isNativeFunction.js"); -/* harmony import */ var _construct_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./construct.js */ "./node_modules/@babel/runtime/helpers/esm/construct.js"); - - - - -function _wrapNativeSuper(Class) { - var _cache = typeof Map === "function" ? new Map() : undefined; - _wrapNativeSuper = function _wrapNativeSuper(Class) { - if (Class === null || !(0,_isNativeFunction_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Class)) return Class; - if (typeof Class !== "function") { - throw new TypeError("Super expression must either be null or a function"); - } - if (typeof _cache !== "undefined") { - if (_cache.has(Class)) return _cache.get(Class); - _cache.set(Class, Wrapper); - } - function Wrapper() { - return (0,_construct_js__WEBPACK_IMPORTED_MODULE_3__["default"])(Class, arguments, (0,_getPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this).constructor); - } - Wrapper.prototype = Object.create(Class.prototype, { - constructor: { - value: Wrapper, - enumerable: false, - writable: true, - configurable: true - } - }); - return (0,_setPrototypeOf_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Wrapper, Class); - }; - return _wrapNativeSuper(Class); -} - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/compat get default export */ -/******/ (() => { -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = (module) => { -/******/ var getter = module && module.__esModule ? -/******/ () => (module['default']) : -/******/ () => (module); -/******/ __webpack_require__.d(getter, { a: getter }); -/******/ return getter; -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/define property getters */ -/******/ (() => { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = (exports, definition) => { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) -/******/ })(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ (() => { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = (exports) => { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ })(); -/******/ -/************************************************************************/ -var __webpack_exports__ = {}; -// This entry need to be wrapped in an IIFE because it need to be in strict mode. -(() => { -"use strict"; -/*!******************!*\ - !*** ./forum.ts ***! - \******************/ -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ components: () => (/* reexport safe */ _src_forum__WEBPACK_IMPORTED_MODULE_0__.components), -/* harmony export */ extend: () => (/* reexport safe */ _src_forum__WEBPACK_IMPORTED_MODULE_0__.extend), -/* harmony export */ models: () => (/* reexport safe */ _src_forum__WEBPACK_IMPORTED_MODULE_0__.models), -/* harmony export */ states: () => (/* reexport safe */ _src_forum__WEBPACK_IMPORTED_MODULE_0__.states), -/* harmony export */ utils: () => (/* reexport safe */ _src_forum__WEBPACK_IMPORTED_MODULE_0__.utils) -/* harmony export */ }); -/* harmony import */ var _src_forum__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./src/forum */ "./src/forum/index.ts"); - -})(); - -module.exports = __webpack_exports__; -/******/ })() -; +/*! For license information please see forum.js.LICENSE.txt */ +(()=>{var t={24:(t,o,e)=>{var n=e(735).default;function r(){"use strict";t.exports=r=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var o,e={},a=Object.prototype,l=a.hasOwnProperty,s=Object.defineProperty||function(t,o,e){t[o]=e.value},i="function"==typeof Symbol?Symbol:{},u=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",p=i.toStringTag||"@@toStringTag";function m(t,o,e){return Object.defineProperty(t,o,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[o]}try{m({},"")}catch(o){m=function(t,o,e){return t[o]=e}}function d(t,o,e,n){var r=o&&o.prototype instanceof w?o:w,a=Object.create(r.prototype),l=new E(n||[]);return s(a,"_invoke",{value:S(t,e,l)}),a}function f(t,o,e){try{return{type:"normal",arg:t.call(o,e)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var h="suspendedStart",v="suspendedYield",g="executing",b="completed",y={};function w(){}function P(){}function N(){}var x={};m(x,u,(function(){return this}));var _=Object.getPrototypeOf,V=_&&_(_(L([])));V&&V!==a&&l.call(V,u)&&(x=V);var A=N.prototype=w.prototype=Object.create(x);function I(t){["next","throw","return"].forEach((function(o){m(t,o,(function(t){return this._invoke(o,t)}))}))}function C(t,o){function e(r,a,s,i){var u=f(t[r],t,a);if("throw"!==u.type){var c=u.arg,p=c.value;return p&&"object"==n(p)&&l.call(p,"__await")?o.resolve(p.__await).then((function(t){e("next",t,s,i)}),(function(t){e("throw",t,s,i)})):o.resolve(p).then((function(t){c.value=t,s(c)}),(function(t){return e("throw",t,s,i)}))}i(u.arg)}var r;s(this,"_invoke",{value:function(t,n){function a(){return new o((function(o,r){e(t,n,o,r)}))}return r=r?r.then(a,a):a()}})}function S(t,e,n){var r=h;return function(a,l){if(r===g)throw new Error("Generator is already running");if(r===b){if("throw"===a)throw l;return{value:o,done:!0}}for(n.method=a,n.arg=l;;){var s=n.delegate;if(s){var i=O(s,n);if(i){if(i===y)continue;return i}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===h)throw r=b,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=g;var u=f(t,e,n);if("normal"===u.type){if(r=n.done?b:v,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=b,n.method="throw",n.arg=u.arg)}}}function O(t,e){var n=e.method,r=t.iterator[n];if(r===o)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=o,O(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=f(r,t.iterator,e.arg);if("throw"===a.type)return e.method="throw",e.arg=a.arg,e.delegate=null,y;var l=a.arg;return l?l.done?(e[t.resultName]=l.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=o),e.delegate=null,y):l:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,y)}function k(t){var o={tryLoc:t[0]};1 in t&&(o.catchLoc=t[1]),2 in t&&(o.finallyLoc=t[2],o.afterLoc=t[3]),this.tryEntries.push(o)}function M(t){var o=t.completion||{};o.type="normal",delete o.arg,t.completion=o}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function L(t){if(t||""===t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,a=function e(){for(;++r=0;--r){var a=this.tryEntries[r],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var i=l.call(a,"catchLoc"),u=l.call(a,"finallyLoc");if(i&&u){if(this.prev=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&l.call(n,"finallyLoc")&&this.prev=0;--o){var e=this.tryEntries[o];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),M(e),y}},catch:function(t){for(var o=this.tryEntries.length-1;o>=0;--o){var e=this.tryEntries[o];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var r=n.arg;M(e)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:L(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=o),y}},e}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},735:t=>{function o(e){return t.exports=o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,o(e)}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},183:(t,o,e)=>{var n=e(24)();t.exports=n;try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},o={};function e(n){var r=o[n];if(void 0!==r)return r.exports;var a=o[n]={exports:{}};return t[n](a,a.exports,e),a.exports}e.n=t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},e.d=(t,o)=>{for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},e.o=(t,o)=>Object.prototype.hasOwnProperty.call(t,o),e.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";e.r(n),e.d(n,{components:()=>_o,extend:()=>qo,models:()=>Mo,states:()=>Eo,utils:()=>Lo});const t=flarum.core.compat["forum/app"];var o=e.n(t);const r=flarum.core.compat["common/extend"],a=flarum.core.compat["common/components/Badge"];var l=e.n(a);const s=flarum.core.compat["forum/components/DiscussionList"];var i=e.n(s);const u=flarum.core.compat["common/models/Discussion"];var c=e.n(u);const p=flarum.core.compat["common/utils/classList"];var d=e.n(p);const f=flarum.core.compat["forum/components/DiscussionComposer"];var h=e.n(f);const v=flarum.core.compat["forum/components/ReplyComposer"];var g=e.n(v);function b(t,o,e,n,r,a,l){try{var s=t[a](l),i=s.value}catch(t){return void e(t)}s.done?o(i):Promise.resolve(i).then(n,r)}function y(t){return function(){var o=this,e=arguments;return new Promise((function(n,r){var a=t.apply(o,e);function l(t){b(a,n,r,l,s,"next",t)}function s(t){b(a,n,r,l,s,"throw",t)}l(void 0)}))}}function w(t,o){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,o){return t.__proto__=o,t},w(t,o)}function P(t,o){t.prototype=Object.create(o.prototype),t.prototype.constructor=t,w(t,o)}var N=e(183),x=e.n(N);const _=flarum.core.compat["common/components/Modal"];var V=e.n(_);const A=flarum.core.compat["common/Component"];var I=e.n(A);const C=flarum.core.compat["common/components/Button"];var S=e.n(C);const O=flarum.core.compat["common/components/Switch"];var k=e.n(O);const M=flarum.core.compat["common/utils/ItemList"];var E=e.n(M);const L=flarum.core.compat["common/utils/Stream"];var D=e.n(L);const U=flarum.core.compat["common/utils/extractText"];var B=e.n(U);function T(t){return T=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},T(t)}function j(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(j=function(){return!!t})()}function F(t){var o="function"==typeof Map?new Map:void 0;return F=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(o){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==o){if(o.has(t))return o.get(t);o.set(t,e)}function e(){return function(t,o,e){if(j())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,o);var r=new(t.bind.apply(t,n));return e&&w(r,e.prototype),r}(t,arguments,T(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),w(e,t)},F(t)}var q=function(t){function o(o){return t.call(this,o+"")||this}return P(o,t),o}(F(Error)),R=function(){function t(o){this.poll=void 0,this.loading=void 0,this.deleting=void 0,this.expandedGroup=void 0,o||(o=t.createNewPoll()),this.loading=!1,this.deleting=!1,this.poll=o,this.expandedGroup="setup"}t.createNewPoll=function(){var t=o().store.createRecord("polls");return t.pushAttributes({question:"",endDate:"",publicPoll:!1,allowMultipleVotes:!1,hideVotes:!1,allowChangeVote:!1,maxVotes:0}),t.tempOptions=[o().store.createRecord("poll_options"),o().store.createRecord("poll_options")],t};var e=t.prototype;return e.isExpanded=function(t){return this.expandedGroup===t},e.expand=function(t){this.expandedGroup=t,m.redraw()},e.save=function(){var t=y(x().mark((function t(o){return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,m.redraw(),t.prev=2,t.next=5,this.poll.save(o);case 5:this.poll=t.sent,delete this.poll.data.attributes.options;case 7:return t.prev=7,this.loading=!1,m.redraw(),t.finish(7);case 11:case"end":return t.stop()}}),t,this,[[2,,7,11]])})));return function(o){return t.apply(this,arguments)}}(),e.delete=function(){var t=y(x().mark((function t(){return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,m.redraw(),t.prev=2,t.next=5,this.poll.delete();case 5:this.deleting=!0;case 6:return t.prev=6,this.loading=!1,m.redraw(),t.finish(6);case 10:case"end":return t.stop()}}),t,this,[[2,,6,10]])})));return function(){return t.apply(this,arguments)}}(),t}();const H=flarum.core.compat["common/components/Page"];var G=e.n(H);const z=flarum.core.compat["common/components/LoadingIndicator"];var Y=e.n(z);const J=flarum.core.compat["common/components/LinkButton"];var W=e.n(J),K=function(t){function e(){for(var o,e=arguments.length,n=new Array(e),r=0;r0?Math.round(this.votes/this.totalVotes*100):0},n.view=function(){var t;this.hasVoted=this.state.hasVoted(),this.totalVotes=this.state.overallVoteCount(),this.votes=this.option.voteCount(),this.voted=this.state.hasVotedFor(this.option);var e=this.state.loadingOptions||this.hasVoted&&!this.poll.canChangeVote(),n=this.canSeeVoteCount?this.percent():Number(this.voted)/((null==(t=this.poll.myVotes())?void 0:t.length)||1)*100,r=m("label",{className:"PollBar","data-selected":!!this.voted,style:"--poll-option-width: "+n+"%"},this.state.showCheckMarks&&m("div",{className:"PollAnswer-checkbox"},m("input",{className:"PollAnswer-input sr-only",type:"checkbox",id:this.option.id(),name:this.name,value:this.answer,checked:this.voted,disabled:e,"aria-labelledby":this.name+"-"+this.option.id()+"-label",onchange:this.state.changeVote.bind(this.state,this.option)}),m("span",{className:"checkmark"})),m("div",{className:"PollAnswer-text"},this.optionDisplayItems().toArray()),this.option.imageUrl()?m("img",{className:"PollAnswer-image",src:this.option.imageUrl(),alt:this.option.answer()}):null);return m("div",{className:d()("PollOption",this.hasVoted&&"PollVoted",this.option.imageUrl()&&"PollOption-hasImage"),"data-id":this.option.id()},this.canSeeVoteCount?m(yt(),{text:o().translator.trans("fof-polls.forum.tooltip.votes",{count:this.votes}),onremove:this.hideOptionTooltip},r):r)},n.hideOptionTooltip=function(t){t.attrs.tooltipVisible=!1,t.state.updateVisibility()},n.optionDisplayItems=function(){var t=new(E());return t.add("answer",m("span",{className:"PollAnswer-text-answer",id:this.name+"-"+this.option.id()+"-label"},this.answer)),this.voted&&!this.state.showCheckMarks&&t.add("check",ht()("fas fa-check-circle",{className:"PollAnswer-check"})),this.canSeeVoteCount&&t.add("percent",m("span",{className:d()("PollPercent",100!==this.percent()&&"PollPercent--option")},this.percent(),"%")),t},e}(I()),Pt=function(t){function o(){return t.apply(this,arguments)||this}P(o,t);var e=o.prototype;return e.view=function(){return m("div",{className:"Poll-options list-layout"},this.pollOptions().toArray())},e.pollOptions=function(){var t=this,o=new(E());return this.attrs.options.forEach((function(e){o.add("option"+e.id(),t.createOptionView(e))})),o},e.createOptionView=function(t){return m(wt,{name:this.attrs.name,option:t,state:this.attrs.state})},o}(I()),Nt=function(t){function o(){for(var o,e=arguments.length,n=new Array(e),r=0;r0},e.overallVoteCount=function(){return this.poll.voteCount()},e.hasVotedFor=function(t){return this.pendingOptions?this.pendingOptions.has(t.id()):this.poll.myVotes().some((function(o){return o.option()===t}))},e.getMaxVotes=function(){var t=this.poll,o=t.allowMultipleVotes()?t.maxVotes():1;return 0===o&&(o=t.options().length),o},e.showButton=function(){return this.useSubmitUI&&this.pendingSubmit},e.changeVote=function(t,e){var n=e.target;if(!o().session.user)return o().modal.show(_t()),void(n.checked=!1);var r=this.pendingOptions||new Set(this.poll.myVotes().map((function(t){return t.option().id()}))),a=r.delete(t.id());if(this.poll.allowMultipleVotes()||r.clear(),a||r.add(t.id()),this.pendingOptions=r.size?r:null,this.pendingSubmit=!!this.pendingOptions,this.useSubmitUI)return this.pendingOptions=r.size?r:null,this.pendingSubmit=!!this.pendingOptions,void m.redraw();this.submit(r,null,(function(){return n.checked=a}))},e.hasSelectedOptions=function(){return this.pendingSubmit},e.onsubmit=function(){var t=this;return this.submit(this.pendingOptions,(function(){t.pendingOptions=null,t.pendingSubmit=!1}))},e.submit=function(t,e,n){var r=this;return void 0===n&&(n=null),this.loadingOptions=!0,m.redraw(),o().request({method:"PATCH",url:o().forum.attribute("apiUrl")+"/fof/polls/"+this.poll.id()+"/votes",body:{data:{optionIds:Array.from(t)}}}).then((function(t){o().store.pushPayload(t),null==e||e()})).catch((function(t){null==n||n(t)})).finally((function(){r.loadingOptions=!1,r.canSeeVoteCount="number"==typeof r.poll.voteCount(),m.redraw()}))},t}(),kt=function(t){function e(){return t.apply(this,arguments)||this}P(e,t);var n=e.prototype;return n.view=function(){var t=this,e=this.attrs.state;return m(S(),{className:"Button Button--primary Poll-submit",loading:e.loadingOptions,onclick:function(o){return t.pollButtonSubmit(e,o)},disabled:!e.hasSelectedOptions()},o().translator.trans("fof-polls.forum.poll.submit_button"))},n.pollButtonSubmit=function(t,o){t.onsubmit()},e}(I());const Mt=flarum.core.compat["common/utils/string"];var Et=function(t){function o(){return t.apply(this,arguments)||this}P(o,t);var e=o.prototype;return e.view=function(){return m("div",{className:"Poll-title-component"},this.pollTitleItems().toArray())},e.pollTitleItems=function(){var t=new(E());return t.add("title",m("h3",{className:"Poll-title"},this.attrs.poll.question())),t},o}(I()),Lt=function(t){function o(){return t.apply(this,arguments)||this}P(o,t);var e=o.prototype;return e.view=function(){if(this.attrs.poll.subtitle())return m("div",{className:"Poll-subtitle-component"},this.pollSubtitleItems().toArray())},e.pollSubtitleItems=function(){var t=new(E());return t.add("subtitle",m("p",{className:"Poll-subtitle"},this.attrs.poll.subtitle())),t},o}(I()),Dt=function(t){function e(){for(var o,e=arguments.length,n=new Array(e),r=0;rt.length)&&(o=t.length);for(var e=0,n=new Array(o);e=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(this.pages);!(o=e()).done;){var n=o.value,r=n.items.indexOf(t);if(-1!==r){n.items.splice(r,1);break}}var a=this.extraPolls.indexOf(t);-1!==a&&this.extraPolls.splice(a),m.redraw()},n.addPoll=function(t){this.removePoll(t),this.extraPolls.unshift(t),m.redraw()},n.getAllItems=function(){return this.extraPolls.concat(t.prototype.getAllItems.call(this))},n.getPages=function(){var o=t.prototype.getPages.call(this);return this.extraPolls.length?[{number:-1,items:this.extraPolls}].concat(o):o},jt(e,[{key:"type",get:function(){return"fof/polls"}}]),e}(Jt()),Zt=function(t){function e(){return t.apply(this,arguments)||this}P(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),o().forum.attribute("globalPollsEnabled")?(this.state=new Xt({sort:m.route.param("sort"),filter:m.route.param("filter")}),this.state.refresh(),o().setTitle(B()(o().translator.trans("fof-polls.forum.page.nav")))):m.route.set("/")},n.view=function(){return this.loading?m(Y(),null):this.poll?m("div",{className:"PollsListPage"},m("div",{className:"container"},m(Dt,{poll:this.poll}))):m("div",{className:"PollsListPage"},t.prototype.hero.call(this),m("div",{className:"container"},m("div",{className:"sideNavContainer"},m("nav",{className:"PollsListPage-nav sideNav"},m("ul",null,X()(this.sidebarItems().toArray()))),m("div",{className:"PollsPage-results sideNavOffset"},m("div",{className:"IndexPage-toolbar"},m("ul",{className:"IndexPage-toolbar-view"},X()(this.viewItems().toArray())),m("ul",{className:"IndexPage-toolbar-action"},X()(this.actionItems().toArray()))),m(zt,{state:this.state})))))},n.sidebarItems=function(){var t=this,e=new(E()),n=o().forum.attribute("canStartGlobalPolls");return e.add("newGlobalPoll",m(S(),{icon:"fas fa-edit",className:"Button Button--primary App-primaryControl PollsPage-newPoll",itemClassName:"App-primaryControl",onclick:function(){t.newPollAction()},disabled:!n},o().translator.trans("fof-polls.forum.poll."+(n?"start_poll_button":"cannot_start_poll_button")))),e.add("nav",m(tt(),{buttonClassName:"Button",className:"App-titleControl",accessibleToggleLabel:o().translator.trans("core.forum.index.toggle_sidenav_dropdown_accessible_label")},this.navItems().toArray())),e},n.actionItems=function(){var t=this,e=new(E());return e.add("refresh",S().component({title:o().translator.trans("fof-polls.forum.page.refresh_tooltip"),icon:"fas fa-sync",className:"Button Button--icon",onclick:function(){t.state.refresh()}})),e},n.viewItems=function(){return et().prototype.viewItems()},n.navItems=function(){return et().prototype.navItems()},n.newPollAction=function(){o().session.user?m.route.set(o().route("fof.polls.compose")):o().modal.show(_t())},e}(qt);const to=flarum.core.compat["common/components/Separator"];var oo=e.n(to);const eo={controls:function(t,o){var e=this,n=new(E());return["poll","moderation","destructive"].forEach((function(r){var a=e[r+"Controls"](t,o).toArray();a.length&&(a.forEach((function(t){return n.add(t.itemName,t)})),n.add(r+"Separator",m(oo(),null)))})),n},pollControls:function(t,o){return new(E())},moderationControls:function(t,e){var n=new(E());return t.canEdit()&&n.add("edit",m(S(),{icon:"fas fa-pencil-alt",onclick:this.editAction.bind(this,t)},o().translator.trans("fof-polls.forum.poll_controls.edit_label"))),n},destructiveControls:function(t,e){var n=new(E());return t.canDelete()&&n.add("delete",m(S(),{icon:"far fa-trash-alt",onclick:this.deleteAction.bind(this,t)},o().translator.trans("fof-polls.forum.poll_controls.delete_label"))),n},deleteAction:function(t){var e=this;return y(x().mark((function n(){return x().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(confirm(o().translator.trans("fof-polls.forum.poll_controls.delete_confirmation"))){n.next=2;break}return n.abrupt("return");case 2:return n.abrupt("return",t.delete().then((function(){e.showDeletionAlert(t,"success"),o().current.matches(nt,{id:t.id()})||o().current.matches(Zt,{id:t.id()})?o().history.back():window.location.reload()})).catch((function(){return e.showDeletionAlert(t,"error")})));case 3:case"end":return n.stop()}}),n)})))()},showDeletionAlert:function(t,e){var n={success:"fof-polls.forum.poll_controls.delete_success_message",error:"fof-polls.forum.poll_controls.delete_error_message"}[e];o().alerts.show({type:e},o().translator.trans(n,{poll:t}))},editAction:function(t){m.route.set(o().route("fof.polls.compose",{id:t.id()}))}};function no(){return no=Object.assign?Object.assign.bind():function(t){for(var o=1;o'),this.$input.appendTo("body").hide().trigger("click").on("change",(function(e){var n=new FormData;n.append(t.attrs.name,$(e.target)[0].files[0]),t.loading=!0,m.redraw(),o().request({method:"POST",url:t.resourceUrl(),serialize:function(t){return t},body:n}).then(t.success.bind(t),t.failure.bind(t))})))},n.remove=function(){var t,e;this.loading=!0,m.redraw();var n=void 0;null!=(t=this.attrs.poll)&&t.exists||null!=(e=this.attrs.option)&&e.exists||(n=this.fileName),o().request({method:"DELETE",url:this.resourceUrl(n)}).then(this.success.bind(this),this.failure.bind(this))},n.resourceUrl=function(t){void 0===t&&(t=void 0);var e=o().forum.attribute("apiUrl")+"/fof/polls/"+this.attrs.name,n=this.attrs.poll,r=this.attrs.option;return t?e+="/name/"+t:(null!=n&&n.exists&&(e+="/"+(null==n?void 0:n.id())),null!=r&&r.exists&&(e+="/"+(null==r?void 0:r.id()))),e},n.getImageUrl=function(){var t,o;return!1!==this.uploadedImageUrl?this.uploadedImageUrl:(null==(t=this.attrs.poll)?void 0:t.imageUrl())||(null==(o=this.attrs.option)?void 0:o.imageUrl())},n.success=function(t){var o,e,n;this.loading=!1,this.uploadedImageUrl=null==t?void 0:t.fileUrl,this.fileName=null==t?void 0:t.fileName,null==(o=(e=this.attrs).onUpload)||o.call(e,null==t?void 0:t.fileName),m.redraw(),null==(n=this.$input)||n.remove()},n.failure=function(t){var o;this.loading=!1,m.redraw(),null==(o=this.$input)||o.remove()},e}(S());const ao=flarum.core.compat["common/utils/RequestError"];var lo=e.n(ao),so=function(t){function e(){for(var o,e=arguments.length,n=new Array(e),r=0;r=2?S().component({type:"button",className:"Button PollModal--button Button--icon",icon:"fas fa-minus",onclick:r>=2?t.removeOption.bind(t,r):""}):""))})),e},n.addOption=function(){var t=Math.max(o().forum.attribute("pollMaxOptions"),2);this.options.lengtht.length)&&(o=t.length);for(var e=0,n=new Array(o);e0;return!o().session.user||r.canVote()||r.hasEnded()||n.add("no-permission",m("span",null,m("i",{className:"icon fas fa-times-circle fa-fw"}),o().translator.trans("fof-polls.forum.no_permission"))),r.endDate()&&n.add("end-date",m("span",null,m("i",{class:"icon fas fa-clock fa-fw"}),r.hasEnded()?o().translator.trans("fof-polls.forum.poll_ended"):o().translator.trans("fof-polls.forum.days_remaining",{time:dayjs(r.endDate()).fromNow()}))),r.canVote()&&(n.add("max-votes",m("span",null,m("i",{className:"icon fas fa-poll fa-fw"}),o().translator.trans("fof-polls.forum.max_votes_allowed",{max:t}))),r.canChangeVote()||n.add("cannot-change-vote",m("span",null,m("i",{className:"icon fas fa-"+(a?"times":"exclamation")+"-circle fa-fw"}),o().translator.trans("fof-polls.forum.poll.cannot_change_vote")))),n},n.viewOption=function(t){var e,n,r,a=this.attrs.poll,l=(null==(e=a.myVotes())?void 0:e.length)>0,s=a.voteCount(),i=this.pendingOptions?this.pendingOptions.has(t.id()):null==(n=a.myVotes())||null==n.some?void 0:n.some((function(o){return o.option()===t})),u=t.voteCount(),c=s>0?Math.round(u/s*100):0,p="number"==typeof u,f=this.loadingOptions||l&&!a.canChangeVote(),h=p?c:Number(i)/((null==(r=a.myVotes())?void 0:r.length)||1)*100,v=!o().session.user||!a.hasEnded()&&a.canVote()&&(!l||a.canChangeVote()),g=m("div",{className:"PollBar","data-selected":!!i,style:"--poll-option-width: "+h+"%"},v&&m("label",{className:"PollAnswer-checkbox checkbox"},m("input",{onchange:this.changeVote.bind(this,t),type:"checkbox",checked:i,disabled:f}),m("span",{className:"checkmark"})),m("div",{className:"PollAnswer-text"},m("span",{className:"PollAnswer-text-answer"},t.answer()),i&&!v&&ht()("fas fa-check-circle",{className:"PollAnswer-check"}),p&&m("span",{className:d()("PollPercent",100!==c&&"PollPercent--option")},c,"%")),t.imageUrl()?m("img",{className:"PollAnswer-image",src:t.imageUrl(),alt:t.answer()}):null);return m("div",{className:d()("PollOption",l&&"PollVoted",a.hasEnded()&&"PollEnded",t.imageUrl()&&"PollOption-hasImage"),"data-id":t.id()},p?m(yt(),{text:o().translator.trans("fof-polls.forum.tooltip.votes",{count:u}),onremove:this.hideOptionTooltip},g):g)},n.changeVote=function(t,e){var n,r;if(!o().session.user)return o().modal.show(_t()),void(e.target.checked=!1);var a=this.pendingOptions||new Set(null==(n=(r=this.attrs.poll.myVotes()).map)?void 0:n.call(r,(function(t){return t.option().id()}))),l=a.delete(t.id());return this.attrs.poll.allowMultipleVotes()||a.clear(),l||a.add(t.id()),this.useSubmitUI?(this.pendingOptions=a.size?a:null,void(this.pendingSubmit=!!this.pendingOptions)):this.submit(a,null,(function(){return e.target.checked=l}))},n.onsubmit=function(){var t=this;return this.submit(this.pendingOptions,(function(){t.pendingOptions=null,t.pendingSubmit=!1}))},n.submit=function(t,e,n){var r=this;return this.loadingOptions=!0,m.redraw(),o().request({method:"PATCH",url:o().forum.attribute("apiUrl")+"/fof/polls/"+this.attrs.poll.id()+"/votes",body:{data:{optionIds:Array.from(t)}}}).then((function(t){o().store.pushPayload(t),null==e||e()})).catch((function(t){null==n||n(t)})).finally((function(){r.loadingOptions=!1,m.redraw()}))},n.showVoters=function(){o().modal.show(St,{poll:this.attrs.poll,post:this.attrs.post})},n.deletePoll=function(){confirm(B()(o().translator.trans("fof-polls.forum.moderation.delete_confirm")))&&this.attrs.poll.delete().then((function(){m.redraw.sync()}))},n.hideOptionTooltip=function(t){t.attrs.tooltipVisible=!1,t.state.updateVisibility()},n.preventClose=function(t){if(this.pendingOptions)return t.preventDefault(),!0},e}(I()),Po=function(t){function o(){for(var o,e=arguments.length,n=new Array(e),r=0;r=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(o.polls());!(e=n()).done;){var r=e.value;r&&t.push(m(Dt,{poll:r}))}})),(0,r.extend)(mo().prototype,"oninit",(function(){var t=this;this.subtree.check((function(){var o=t.attrs.post.polls(),e=null==o||null==o.map?void 0:o.map((function(t){var o,e,n,r,a;return t&&[null==(o=t.data)?void 0:o.attributes,null==(e=(n=t.options()).map)?void 0:e.call(n,(function(t){var o;return null==t||null==(o=t.data)?void 0:o.attributes})),null==(r=(a=t.myVotes()).map)?void 0:r.call(a,(function(t){var o;return null==(o=t.option())?void 0:o.id()}))]}));return JSON.stringify(e)}))})),(0,r.extend)(ho().prototype,"oncreate",(function(){o().pusher&&o().pusher.then((function(t){t.channels.main.bind("updatedPollOptions",(function(t){var e=o().store.getById("polls",t.pollId);e&&e.pushAttributes({voteCount:t.pollVoteCount});var n=t.options;for(var r in n){var a=o().store.getById("poll_options",r);a&&void 0!==a.voteCount()&&a.pushAttributes({voteCount:n[r]})}m.redraw()}))}))})),(0,r.extend)(ho().prototype,"onremove",(function(){o().pusher&&o().pusher.then((function(t){t.channels.main.unbind("updatedPollOptions")}))})),t=function(t){return o().modal.show(io,{onsubmit:function(e){return o().store.createRecord("polls").save(no({},e,{relationships:{post:t}}),{data:{include:"options,myVotes,myVotes.option"}}).then((function(o){var e;return null==(e=t.rawRelationship("polls"))||null==e.push||e.push({type:"polls",id:o.id()}),o}))}})},(0,r.extend)(bo(),"moderationControls",(function(e,n){!n.isHidden()&&n.canStartPoll()&&e.add("addPoll",m(S(),{icon:"fas fa-poll",onclick:t.bind(this,n)},o().translator.trans("fof-polls.forum.moderation.add")))})),(0,r.extend)(et().prototype,"navItems",(function(t){o().forum.attribute("globalPollsEnabled")&&(t.add("fof-polls-showcase",W().component({href:o().route("fof.polls.showcase"),icon:"fas fa-poll"},o().translator.trans("fof-polls.forum.page.nav")),35),o().forum.attribute("canStartGlobalPolls")&&t.add("fof-polls-list",W().component({href:o().route("fof.polls.list"),icon:"fas fa-list"},o().translator.trans("fof-polls.forum.page.nav-all")),32))}))}))})(),module.exports=n})(); //# 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 a7424309..292d888e 100644 --- a/js/dist/forum.js.map +++ b/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"file":"forum.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAmC;AAEW;AACQ;AACsB;AACV;AACP;AAM3D,SAASM,MAAMA,CAACC,IAAyB,EAAE;EACzC,IAAIA,IAAI,EAAE;IACR,IAAMC,IAAI,GAAGR,6DAAS,CAACU,YAAY,CAAO,OAAO,CAAC;IAElDF,IAAI,CAACG,WAAW,GAAGJ,IAAI,CAACK,OAAO,CAACC,GAAG,CAAC,UAACC,MAAuB,EAAK;MAC/D,IAAMC,UAAU,GAAGf,6DAAS,CAACU,YAAY,CAAa,cAAc,CAAC;MACrEK,UAAU,CAACC,cAAc,CAACF,MAAM,CAAC;MACjC,OAAOC,UAAU;IACnB,CAAC,CAAC;IACFP,IAAI,CAACQ,cAAc,CAACT,IAAI,CAAC;IAEzB,OAAOC,IAAI;EACb;EACA,OAAOD,IAAI;AACb;AAEO,IAAMU,aAAa,GAAG,SAAhBA,aAAaA,CAAIC,QAAwB,EAAK;EACzD;EACAA,QAAQ,CAACC,SAAS,CAACC,OAAO,GAAG,YAAY;IAAA,IAAAC,KAAA;IACvCrB,6DAAS,CAACuB,IAAI,CAAClB,mEAAe,EAAE;MAC9BG,IAAI,EAAEF,MAAM,CAAC,IAAI,CAACY,QAAQ,CAACM,MAAM,CAAChB,IAAI,CAAC;MACvCiB,QAAQ,EAAE,SAAAA,SAACjB,IAAyB;QAAA,OAAMa,KAAI,CAACH,QAAQ,CAACM,MAAM,CAAChB,IAAI,GAAGA,IAAI;MAAA;IAC5E,CAAC,CAAC;EACJ,CAAC;;EAED;EACAP,4DAAM,CAACiB,QAAQ,CAACC,SAAS,EAAE,aAAa,EAAE,UAAUO,KAAK,EAAE;IAAA,IAAA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of/polls/./src/forum/addComposerItems.tsx","webpack://@fof/polls/./src/forum/addDiscussionBadge.tsx","webpack://@fof/polls/./src/forum/addNavItem.ts","webpack://@fof/polls/./src/forum/addPollsToPost.tsx","webpack://@fof/polls/./src/forum/addPostControls.tsx","webpack://@fof/polls/./src/forum/components/AbstractPollPage.tsx","webpack://@fof/polls/./src/forum/components/ComposePollHero.tsx","webpack://@fof/polls/./src/forum/components/ComposePollPage.tsx","webpack://@fof/polls/./src/forum/components/CreatePollModal.tsx","webpack://@fof/polls/./src/forum/components/EditPollModal.tsx","webpack://@fof/polls/./src/forum/components/ListVotersModal.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollImage.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollList.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollListItem.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollOption.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollOptions.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollSubmitButton.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollSubtitle.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollTitle.tsx","webpack://@fof/polls/./src/forum/components/PollForm.tsx","webpack://@fof/polls/./src/forum/components/PollPageHero.tsx","webpack://@fof/polls/./src/forum/components/PollShowcase.tsx","webpack://@fof/polls/./src/forum/components/PollShowcaseItem.tsx","webpack://@fof/polls/./src/forum/components/PollView.tsx","webpack://@fof/polls/./src/forum/components/PollViewPage.tsx","webpack://@fof/polls/./src/forum/components/PollsPage.tsx","webpack://@fof/polls/./src/forum/components/PollsShowcasePage.tsx","webpack://@fof/polls/./src/forum/components/PostPoll.tsx","webpack://@fof/polls/./src/forum/components/UploadPollImageButton.tsx","webpack://@fof/polls/./src/forum/components/form/FormError.tsx","webpack://@fof/polls/./src/forum/components/index.ts","webpack://@fof/polls/./src/forum/extend.ts","webpack://@fof/polls/./src/forum/index.ts","webpack://@fof/polls/./src/forum/models/Poll.ts","webpack://@fof/polls/./src/forum/models/PollOption.ts","webpack://@fof/polls/./src/forum/models/PollVote.ts","webpack://@fof/polls/./src/forum/models/index.ts","webpack://@fof/polls/./src/forum/states/PollFormState.ts","webpack://@fof/polls/./src/forum/states/PollListState.ts","webpack://@fof/polls/./src/forum/states/PollState.ts","webpack://@fof/polls/./src/forum/states/index.ts","webpack://@fof/polls/./src/forum/utils/PollControls.tsx","webpack://@fof/polls/./src/forum/utils/index.ts","webpack://@fof/polls/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Badge']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Dropdown']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Link']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/LinkButton']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Page']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Placeholder']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/SelectDropdown']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Separator']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Switch']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Tooltip']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/extend']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/extenders']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/avatar']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/highlight']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/listItems']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/username']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/models/Discussion']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/models/Forum']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/models/Post']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/states/PaginatedListState']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/EventEmitter']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/RequestError']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/SubtreeRetainer']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/abbreviateNumber']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/classList']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/computed']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/extractText']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/string']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/app']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/CommentPost']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/DiscussionComposer']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/DiscussionList']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/DiscussionPage']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/IndexPage']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/LogInModal']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/ReplyComposer']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/utils/PostControls']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/utils/slidable']\"","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/typeof.js","webpack://@fof/polls/./node_modules/@babel/runtime/regenerator/index.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/construct.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/createClass.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/isNativeFunction.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js","webpack://@fof/polls/webpack/bootstrap","webpack://@fof/polls/webpack/runtime/compat get default export","webpack://@fof/polls/webpack/runtime/define property getters","webpack://@fof/polls/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/polls/webpack/runtime/make namespace object"],"sourcesContent":["import app from 'flarum/forum/app';\n\nimport { extend } from 'flarum/common/extend';\nimport classList from 'flarum/common/utils/classList';\nimport DiscussionComposer from 'flarum/forum/components/DiscussionComposer';\nimport ReplyComposer from 'flarum/forum/components/ReplyComposer';\nimport CreatePollModal from './components/CreatePollModal';\nimport Poll from './models/Poll';\nimport PollOption from './models/PollOption';\nimport { ModelAttributes } from 'flarum/common/Model';\nimport PollModelAttributes from './models/PollModelAttributes';\n\nfunction toPoll(data: PollModelAttributes) {\n if (data) {\n const poll = app.store.createRecord('polls');\n\n poll.tempOptions = data.options.map((option: ModelAttributes) => {\n const pollOption = app.store.createRecord('poll_options');\n pollOption.pushAttributes(option);\n return pollOption;\n });\n poll.pushAttributes(data);\n\n return poll;\n }\n return data;\n}\n\nexport const addToComposer = (composer: ComponentClass) => {\n // @ts-ignore\n composer.prototype.addPoll = function () {\n app.modal.show(CreatePollModal, {\n poll: toPoll(this.composer.fields.poll),\n onsubmit: (poll: PollModelAttributes) => (this.composer.fields.poll = poll),\n });\n };\n\n // Add button to DiscussionComposer header\n extend(composer.prototype, 'headerItems', function (items) {\n const discussion = this.composer.body?.attrs?.discussion;\n\n // @ts-ignore\n const canStartPoll = discussion?.canStartPoll() ?? app.forum.canStartPolls();\n\n if (canStartPoll) {\n items.add(\n 'polls',\n \n \n {app.translator.trans(`fof-polls.forum.composer_discussion.${this.composer.fields.poll ? 'edit' : 'add'}_poll`)}\n \n ,\n 1\n );\n }\n });\n\n extend(composer.prototype, 'data', function (data) {\n if (this.composer.fields.poll) {\n data.poll = this.composer.fields.poll;\n }\n });\n};\n\nexport default () => {\n addToComposer(DiscussionComposer);\n addToComposer(ReplyComposer);\n};\n","import app from 'flarum/forum/app';\n\nimport { extend } from 'flarum/common/extend';\nimport Badge from 'flarum/common/components/Badge';\nimport DiscussionList from 'flarum/forum/components/DiscussionList';\nimport Discussion from 'flarum/common/models/Discussion';\nimport { PaginatedListRequestParams } from 'flarum/common/states/PaginatedListState';\n\nexport default () => {\n // @ts-ignore\n extend(DiscussionList.prototype, 'requestParams', (params: PaginatedListRequestParams) => {\n (params.include as string[]).push('poll');\n });\n\n extend(Discussion.prototype, 'badges', function (badges) {\n // @ts-ignore\n if (this.hasPoll()) {\n badges.add(\n 'poll',\n Badge.component({\n type: 'poll',\n label: app.translator.trans('fof-polls.forum.tooltip.badge'),\n icon: 'fas fa-poll',\n }),\n 5\n );\n }\n });\n};\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport LinkButton from 'flarum/common/components/LinkButton';\n\nexport default function addNavItem() {\n extend(IndexPage.prototype, 'navItems', (items) => {\n if (!app.forum.attribute('globalPollsEnabled')) {\n return;\n }\n\n items.add(\n 'fof-polls-showcase',\n LinkButton.component(\n {\n href: app.route('fof.polls.showcase'),\n icon: 'fas fa-poll',\n },\n app.translator.trans('fof-polls.forum.page.nav')\n ),\n 35\n );\n\n const showAllGlobalPolls = app.forum.attribute('canStartGlobalPolls');\n\n if (showAllGlobalPolls) {\n items.add(\n 'fof-polls-list',\n LinkButton.component(\n {\n href: app.route('fof.polls.list'),\n icon: 'fas fa-list',\n },\n app.translator.trans('fof-polls.forum.page.nav-all')\n ),\n 32\n );\n }\n });\n}\n","import app from 'flarum/forum/app';\n\nimport { extend } from 'flarum/common/extend';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport PollView from './components/PollView';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport Poll from './models/Poll';\nimport Post from 'flarum/common/models/Post';\nimport PollOption from './models/PollOption';\n\ninterface PollPost extends Post {\n polls: () => Poll[];\n}\n\ninterface PusherPollDto {\n pollId: string;\n pollVoteCount: number;\n options: { [key: string]: number };\n}\n\nexport default () => {\n extend(CommentPost.prototype, 'content', function (content) {\n const post = this.attrs.post as PollPost;\n\n if ((!post.isHidden() || this.revealContent) && post.polls()) {\n for (const poll of post.polls()) {\n if (poll) {\n content.push();\n }\n }\n }\n });\n\n extend(CommentPost.prototype, 'oninit', function () {\n this.subtree.check(() => {\n const polls = (this.attrs.post as PollPost).polls();\n\n const checks = polls?.map?.(\n (poll) =>\n poll && [\n poll.data?.attributes,\n poll.options().map?.((option) => option?.data?.attributes),\n poll.myVotes().map?.((vote) => vote.option()?.id()),\n ]\n );\n\n return JSON.stringify(checks);\n });\n });\n\n extend(DiscussionPage.prototype, 'oncreate', function () {\n // @ts-ignore\n if (app.pusher) {\n // @ts-ignore\n app.pusher.then((binding) => {\n // We will listen for updates to all polls and options\n // Even if that model is not in the current discussion, it doesn't really matter\n binding.channels.main.bind('updatedPollOptions', (data: PusherPollDto) => {\n const poll = app.store.getById('polls', data['pollId']);\n\n if (poll) {\n poll.pushAttributes({\n voteCount: data['pollVoteCount'],\n });\n\n // Not redrawing here, as the option below should trigger the redraw already\n }\n\n const changedOptions = data['options'];\n\n for (const optionId in changedOptions) {\n const option = app.store.getById('poll_options', optionId);\n\n if (option && option.voteCount() !== undefined) {\n option.pushAttributes({\n voteCount: changedOptions[optionId],\n });\n }\n }\n\n m.redraw();\n });\n });\n }\n });\n\n extend(DiscussionPage.prototype, 'onremove', function () {\n // @ts-ignore\n if (app.pusher) {\n // @ts-ignore\n app.pusher.then((binding) => {\n binding.channels.main.unbind('updatedPollOptions');\n });\n }\n });\n};\n","import app from 'flarum/forum/app';\n\nimport { extend } from 'flarum/common/extend';\nimport PostControls from 'flarum/forum/utils/PostControls';\nimport CreatePollModal from './components/CreatePollModal';\nimport Button from 'flarum/common/components/Button';\nimport Post from 'flarum/common/models/Post';\nimport PollModelAttributes from './models/PollModelAttributes';\n\nexport default () => {\n const createPoll = (post: Post) =>\n app.modal.show(CreatePollModal, {\n onsubmit: (data: PollModelAttributes) =>\n app.store\n .createRecord('polls')\n .save(\n {\n ...data,\n relationships: {\n post,\n },\n },\n {\n data: {\n include: 'options,myVotes,myVotes.option',\n },\n }\n )\n .then((poll) => {\n // @ts-ignore\n post.rawRelationship('polls')?.push?.({ type: 'polls', id: poll.id() });\n\n return poll;\n }),\n });\n\n extend(PostControls, 'moderationControls', function (items, post) {\n // @ts-ignore\n if (!post.isHidden() && post.canStartPoll()) {\n items.add(\n 'addPoll',\n \n );\n }\n });\n};\n","import Page, { IPageAttrs } from 'flarum/common/components/Page';\nimport PollListState from '../states/PollListState';\nimport Poll from '../models/Poll';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport type Mithril from 'mithril';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport listItems from 'flarum/common/helpers/listItems';\nimport app from 'flarum/forum/app';\nimport SelectDropdown from 'flarum/common/components/SelectDropdown';\nimport IndexPageHero from './PollPageHero';\n\nexport abstract class AbstractPollPage extends Page {\n loading: boolean = false;\n poll: Poll | null | undefined = null;\n polls: Poll[] = [];\n\n view(): Mithril.Children {\n return
{this.pageContent().toArray()}
;\n }\n\n pageContent(): ItemList {\n const items = new ItemList();\n\n items.add('hero', this.hero(), 100);\n items.add('main',
{this.mainContent().toArray()}
, 10);\n\n return items;\n }\n\n mainContent(): ItemList {\n const items = new ItemList();\n\n items.add('sidebar', this.sidebar(), 100);\n items.add('content', this.content(), 10);\n\n return items;\n }\n\n content(): Mithril.Children {\n return
{this.contentItems().toArray()}
;\n }\n\n contentItems(): ItemList {\n const items = new ItemList();\n\n if (this.loading) {\n items.add('loading', );\n }\n\n return items;\n }\n\n hero(): Mithril.Children {\n return ;\n }\n\n sidebar(): Mithril.Children {\n return (\n \n );\n }\n\n sidebarItems(): ItemList {\n const items = IndexPage.prototype.sidebarItems();\n\n items.setContent(\n 'nav',\n \n {this.navItems().toArray()}\n \n );\n\n return items;\n }\n\n navItems(): ItemList {\n const items = IndexPage.prototype.navItems();\n\n if (app.initializers.has('flarum-tags')) {\n // remove the tags from the nav items\n items.remove('separator');\n items.remove('moreTags');\n\n // each tag is added using the key \"tag{id}\". We need to remove all of them\n for (const key in items.toObject()) {\n if (key.startsWith('tag') && key !== 'tags') {\n items.remove(key);\n }\n }\n }\n\n return items;\n }\n}\n","import Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport Poll from '../models/Poll';\nimport ItemList from 'flarum/common/utils/ItemList';\n\nexport interface ComposePollHeroAttrs extends ComponentAttrs {\n poll: Poll;\n}\n\nexport default class ComposePollHero extends Component {\n poll!: Poll;\n\n oninit(vnode: Mithril.Vnode): void {\n super.oninit(vnode);\n\n this.poll = this.attrs.poll;\n }\n\n view(): Mithril.Children {\n return (\n
\n
\n
\n

{app.translator.trans(`fof-polls.forum.compose.${!!this.poll.id() ? 'edit' : 'add'}_title`)}

\n
{this.controlItems().toArray()}
\n
\n
\n
\n );\n }\n\n controlItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'edit',\n \n {app.translator.trans('fof-polls.forum.compose.polls_manager')}\n \n );\n\n if (this.poll.exists) {\n items.add(\n 'view',\n \n {app.translator.trans('fof-polls.forum.compose.polls_preview')}\n \n );\n }\n\n return items;\n }\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Page from 'flarum/common/components/Page';\nimport Poll from '../models/Poll';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport PollForm from './PollForm';\nimport PollFormState from '../states/PollFormState';\nimport ComposePollHero from './ComposePollHero';\nimport Button from 'flarum/common/components/Button';\nimport listItems from 'flarum/common/helpers/listItems';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport SelectDropdown from 'flarum/common/components/SelectDropdown';\nimport IndexPage from 'flarum/forum/components/IndexPage';\n\nexport default class ComposePollPage extends Page {\n poll: Poll | null | undefined = null;\n\n loading: boolean = false;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n if (!app.forum.attribute('globalPollsEnabled')) {\n m.route.set('/');\n return;\n }\n\n // Get the `edit` parameter from the URL\n const editId = m.route.param('id');\n if (editId) {\n this.poll = app.store.getById('poll', editId);\n\n if (!this.poll) {\n this.loading = true;\n\n app.store.find('fof/polls', editId).then((item) => {\n this.poll = item;\n this.loading = false;\n app.setTitle(app.translator.trans(`fof-polls.forum.compose.${!!this.poll?.id() ? 'edit' : 'add'}_title`) as string);\n m.redraw();\n });\n }\n } else {\n this.poll = PollFormState.createNewPoll();\n }\n\n app.history.push('compose-poll', app.translator.trans(`fof-polls.forum.compose.${!!this.poll?.id() ? 'edit' : 'add'}_title`) as string);\n this.bodyClass = 'App--compose-poll';\n app.setTitle(app.translator.trans(`fof-polls.forum.compose.${!!this.poll?.id() ? 'edit' : 'add'}_title`) as string);\n }\n\n view(): Mithril.Children {\n // prevent users from accessing the page if they can't start global polls\n if (!app.forum.attribute('canStartGlobalPolls')) {\n m.route.set('/');\n return;\n }\n\n if (this.loading) {\n return ;\n }\n\n return (\n
\n \n
\n
\n \n
\n \n
\n
\n
\n
\n );\n }\n\n async onsubmit(data: Object, state: PollFormState) {\n const isNew = state.poll.id() === undefined;\n await state.save(data);\n\n const alertAttrs = isNew\n ? {\n type: 'success',\n controls: [\n \n m.route.set(\n app.route('fof.polls.compose', {\n id: state.poll.id(),\n })\n )\n }\n >\n {app.translator.trans('fof-polls.forum.compose.continue_editing')}\n ,\n ],\n }\n : {\n type: 'success',\n };\n\n // Show success alert\n const alertId = app.alerts.show(alertAttrs, app.translator.trans('fof-polls.forum.compose.success'));\n\n // Hide alert after 10 seconds\n setTimeout(() => app.alerts.dismiss(alertId), 10000);\n\n if (isNew) {\n m.route.set(app.route('fof.polls.list'));\n }\n }\n\n sidebarItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'nav',\n \n {this.navItems().toArray()}\n \n );\n\n return items;\n }\n\n navItems() {\n return IndexPage.prototype.navItems();\n }\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';\nimport PollForm from './PollForm';\nimport PollModel from '../models/Poll';\nimport PollFormState from '../states/PollFormState';\n\ninterface CreatePollModalAttrs extends IInternalModalAttrs {\n poll: PollModel;\n onsubmit: (data: object) => Promise;\n}\n\nexport default class CreatePollModal extends Modal {\n title(): Mithril.Children {\n return app.translator.trans('fof-polls.forum.modal.add_title');\n }\n\n className(): string {\n return 'PollDiscussionModal Modal--medium';\n }\n\n content(): Mithril.Children {\n return [\n
\n \n
,\n ];\n }\n\n async onFormSubmit(data: object, state: PollFormState): Promise {\n this.hide();\n await this.attrs.onsubmit(data);\n }\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport CreatePollModal from './CreatePollModal';\nimport PollFormState from '../states/PollFormState';\n\nexport default class EditPollModal extends CreatePollModal {\n title(): Mithril.Children {\n return app.translator.trans('fof-polls.forum.modal.edit_title');\n }\n\n async onFormSubmit(data: object, state: PollFormState): Promise {\n await state.save(data);\n\n // Show success alert\n const alertId = app.alerts.show(\n {\n type: 'success',\n },\n app.translator.trans('fof-polls.forum.compose.success')\n );\n\n // Hide alert after 10 seconds\n setTimeout(() => app.alerts.dismiss(alertId), 10000);\n }\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';\nimport avatar from 'flarum/common/helpers/avatar';\nimport username from 'flarum/common/helpers/username';\nimport Link from 'flarum/common/components/Link';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport PollModel from '../models/Poll';\nimport PollVote from '../models/PollVote';\nimport User from 'flarum/common/models/User';\nimport PollOption from '../models/PollOption';\n\ninterface ListVotersModalAttrs extends IInternalModalAttrs {\n poll: PollModel;\n onsubmit: (data: object) => Promise;\n}\n\nexport default class ListVotersModal extends Modal {\n oninit(vnode: Mithril.Vnode): void {\n super.oninit(vnode);\n\n this.loading = true;\n\n app.store\n .find('fof/polls', this.attrs.poll.id()!, {\n include: 'votes,votes.user,votes.option',\n })\n .then(() => (this.loading = false))\n .finally(() => m.redraw());\n }\n\n className(): string {\n return 'Modal--medium VotesModal';\n }\n\n title(): Mithril.Children {\n return app.translator.trans('fof-polls.forum.votes_modal.title');\n }\n\n content(): Mithril.Children {\n const options = this.attrs.poll.options() as PollOption[];\n return
{this.loading ? : options.map(this.optionContent.bind(this))}
;\n }\n\n optionContent(opt: PollOption): Mithril.Children {\n const votes = (this.attrs.poll.votes() || []).filter((v) => opt.id() === v!.option()!.id()) as PollVote[];\n\n return (\n
\n

{this.optionAnswer(opt)! + ':'}

\n\n {votes.length ? (\n
{votes.map(this.voteContent.bind(this))}
\n ) : (\n

{app.translator.trans('fof-polls.forum.modal.no_voters')}

\n )}\n
\n );\n }\n\n optionAnswer(opt: PollOption): string {\n return opt.answer();\n }\n\n voteContent(vote: PollVote): Mithril.Children {\n const user = vote.user() as User;\n const attrs = user && { href: app.route.user(user) };\n\n return (\n \n {avatar(user)} {username(user)}\n \n );\n }\n}\n","import type Mithril from 'mithril';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Poll from 'src/forum/models/Poll';\nimport ItemList from 'flarum/common/utils/ItemList';\n\ninterface PollImageAttrs extends ComponentAttrs {\n poll: Poll;\n}\n\nexport default class PollImage extends Component {\n imageUrl: string | null = null;\n imageAlt: string | null = null;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.imageUrl = this.attrs.poll.imageUrl();\n this.imageAlt = this.attrs.poll.imageAlt();\n }\n\n view(): Mithril.Children {\n if (!this.imageUrl) {\n return;\n }\n\n return
{this.imageItems().toArray()}
;\n }\n\n imageItems(): ItemList {\n const items = new ItemList();\n\n items.add('image', {this.imageAlt);\n\n return items;\n }\n}\n","import app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport PollListItem from './PollListItem';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Placeholder from 'flarum/common/components/Placeholder';\nimport classList from 'flarum/common/utils/classList';\nimport PollListState from '../../states/PollListState';\n\nexport interface PollListAttrs extends ComponentAttrs {\n state: PollListState;\n}\n\n/**\n * The `PollList` component displays a list of polls.\n */\nexport default class PollList extends Component {\n view() {\n const state = this.attrs.state;\n const params = state.getParams();\n const isLoading = state.isInitialLoading() || state.isLoadingNext();\n\n let loading;\n\n if (isLoading) {\n loading = ;\n } else if (state.hasNext()) {\n loading = (\n \n );\n }\n\n if (state.isEmpty()) {\n const text = app.translator.trans('fof-polls.forum.polls_list.empty_text');\n return (\n
\n \n
\n );\n }\n\n return (\n
\n
    \n {state.getPages().map((pg) => {\n return pg.items.map((poll) => (\n
  • \n \n
  • \n ));\n })}\n
\n
{loading}
\n
\n );\n }\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport type { PollListParams } from '../../states/PollListState';\nimport SubtreeRetainer from 'flarum/common/utils/SubtreeRetainer';\nimport classList from 'flarum/common/utils/classList';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport Link from 'flarum/common/components/Link';\nimport highlight from 'flarum/common/helpers/highlight';\nimport slidable from 'flarum/forum/utils/slidable';\nimport icon from 'flarum/common/helpers/icon';\nimport abbreviateNumber from 'flarum/common/utils/abbreviateNumber';\nimport Poll from '../../models/Poll';\nimport PollControls from '../../utils/PollControls';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport listItems from 'flarum/common/helpers/listItems';\nimport PollViewPage from '../PollViewPage';\n\nexport interface IPollListItemAttrs extends ComponentAttrs {\n poll: Poll;\n params: PollListParams;\n}\n\n/**\n * The `PollListItem` component shows a single poll in the\n * poll list.\n */\nexport default class PollListItem extends Component {\n /**\n * Ensures that the poll will not be redrawn\n * unless new data comes in.\n */\n subtree!: SubtreeRetainer;\n poll!: Poll;\n\n highlightRegExp?: RegExp;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.poll = this.attrs.poll;\n\n this.subtree = new SubtreeRetainer(\n () => this.poll.freshness,\n () => {\n const time = app.session.user && app.session.user.markedAllAsReadAt();\n return time && time.getTime();\n },\n () => this.active()\n );\n }\n\n elementAttrs() {\n return {\n className: classList('PollListItem', {\n active: this.active(),\n 'PollListItem--hidden': this.poll.isHidden(),\n Slidable: 'ontouchstart' in window,\n }),\n };\n }\n\n view() {\n const controls = PollControls.controls(this.poll, this).toArray();\n const attrs = this.elementAttrs();\n\n return (\n
\n {this.controlsView(controls)}\n {this.contentView()}\n {this.slidableUnderneathView()}\n
\n );\n }\n\n controlsView(controls: Mithril.ChildArray): Mithril.Children {\n return (\n !!controls.length && (\n \n {controls}\n \n )\n );\n }\n\n slidableUnderneathView(): Mithril.Children {\n const isUnread = this.poll.isUnread();\n\n return (\n \n {icon('fas fa-check')}\n \n );\n }\n\n contentView(): Mithril.Children {\n // const isUnread = this.poll.isUnread();\n // const isRead = this.poll.isRead();\n\n return (\n //
\n
{this.mainView()}
\n );\n }\n\n mainView(): Mithril.Children {\n return (\n \n

{highlight(this.poll.question(), this.highlightRegExp)}

\n {this.poll.subtitle() &&

{this.poll.subtitle()}

}\n
    {listItems(this.infoItems().toArray())}
\n \n );\n }\n\n // infoView() {\n // return (\n //
\n // {this.poll.subtitle() &&

{this.poll.subtitle()}

}\n //
    {listItems(this.infoItems().toArray())}
\n //
\n // );\n // }\n\n oncreate(vnode: Mithril.VnodeDOM) {\n super.oncreate(vnode);\n\n // If we're on a touch device, set up the discussion row to be slidable.\n // This allows the user to drag the row to either side of the screen to\n // reveal controls.\n if ('ontouchstart' in window) {\n const slidableInstance = slidable(this.element);\n\n this.$('.PollListItem-controls').on('hidden.bs.dropdown', () => slidableInstance.reset());\n }\n }\n\n onbeforeupdate(vnode: Mithril.VnodeDOM) {\n super.onbeforeupdate(vnode);\n\n return this.subtree.needsRebuild();\n }\n\n /**\n * Determine whether or not the discussion is currently being viewed.\n */\n active() {\n return app.current.matches(PollViewPage, { poll: this.poll });\n }\n\n /**\n * Mark the poll as read.\n */\n markAsRead() {\n if (this.poll.isUnread()) {\n this.poll.save({ lastVotedNumber: this.poll.voteCount() });\n m.redraw();\n }\n }\n\n infoItems(): ItemList {\n const items = new ItemList();\n const active = !this.poll.hasEnded();\n const activeView = this.poll.endDate()\n ? [\n icon('fas fa-clock'),\n ' ',\n active\n ? app.translator.trans('fof-polls.forum.days_remaining', { time: dayjs(this.poll.endDate()).fromNow() })\n : app.translator.trans('fof-polls.forum.poll_ended'),\n ]\n : [icon('fas fa-infinity'), ' ', app.translator.trans('fof-polls.forum.poll_never_ends')];\n\n items.add('active', {activeView});\n\n const voteCount = this.poll.voteCount();\n if (voteCount !== undefined) {\n items.add(\n 'voteCount',\n \n {icon('fas fa-poll fa-fw')}\n {[\n ' ',\n app.translator.trans('fof-polls.forum.polls_count', {\n count: abbreviateNumber(voteCount),\n }),\n ]}\n ,\n 70\n );\n }\n\n return items;\n }\n}\n","import app from 'flarum/forum/app';\nimport Mithril from 'mithril';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport PollOptionModel from '../../models/PollOption';\nimport PollState from '../../states/PollState';\nimport Tooltip, { TooltipAttrs } from 'flarum/common/components/Tooltip';\nimport icon from 'flarum/common/helpers/icon';\nimport classList from 'flarum/common/utils/classList';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Poll from '../../models/Poll';\n\ninterface PollOptionAttrs extends ComponentAttrs {\n option: PollOptionModel;\n name: string;\n state: PollState;\n}\n\nexport default class PollOption extends Component {\n option!: PollOptionModel;\n name!: string;\n state!: PollState;\n hasVoted: boolean = false;\n totalVotes: number = 0;\n votes: number = 0;\n voted: boolean = false;\n poll!: Poll;\n canSeeVoteCount: boolean = false;\n answer!: string;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n this.option = this.attrs.option;\n this.name = this.attrs.name;\n this.state = this.attrs.state;\n this.poll = this.state.poll;\n\n // isNaN(null) is false, so we have to check type directly now that API always returns the field\n this.canSeeVoteCount = typeof this.votes === 'number';\n\n this.answer = this.option.answer();\n }\n\n percent(): number {\n return this.totalVotes > 0 ? Math.round((this.votes / this.totalVotes) * 100) : 0;\n }\n\n view(): Mithril.Children {\n // following values can be changed by ui interactions, so we need to update them on every render\n this.hasVoted = this.state.hasVoted();\n this.totalVotes = this.state.overallVoteCount();\n this.votes = this.option.voteCount();\n this.voted = this.state.hasVotedFor(this.option);\n\n const isDisabled = this.state.loadingOptions || (this.hasVoted && !this.poll.canChangeVote());\n const width = this.canSeeVoteCount ? this.percent() : (Number(this.voted) / (this.poll.myVotes()?.length || 1)) * 100;\n\n const bar = (\n \n );\n\n return (\n \n {this.canSeeVoteCount ? (\n \n {bar}\n \n ) : (\n bar\n )}\n
\n );\n }\n\n /**\n * Attempting to use the `tooltipVisible` attr on the Tooltip component set to 'false' when no vote count\n * caused the tooltip to break on click. This is a workaround to hide the tooltip when no vote count is available,\n * called on 'onremove' of the Tooltip component. It doesn't always work as intended either, but it does the job.\n */\n hideOptionTooltip(vnode: Mithril.Vnode) {\n vnode.attrs.tooltipVisible = false;\n\n // @ts-ignore\n vnode.state.updateVisibility();\n }\n\n optionDisplayItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'answer',\n \n {this.answer}\n \n );\n\n this.voted && !this.state.showCheckMarks && items.add('check', icon('fas fa-check-circle', { className: 'PollAnswer-check' }));\n\n this.canSeeVoteCount &&\n items.add('percent', {this.percent()}%);\n\n return items;\n }\n}\n","import type Mithril from 'mithril';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport PollOption from './PollOption';\nimport PollOptionModel from '../../models/PollOption';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport PollState from '../../states/PollState';\n\ninterface PollOptionsAttrs extends ComponentAttrs {\n options: PollOptionModel[];\n name: String;\n state: PollState;\n}\n\nexport default class PollOptions extends Component {\n view(): Mithril.Children {\n return
{this.pollOptions().toArray()}
;\n }\n\n pollOptions(): ItemList {\n const items = new ItemList();\n\n this.attrs.options.forEach((option: PollOptionModel): void => {\n items.add('option' + option.id(), this.createOptionView(option));\n });\n\n return items;\n }\n\n createOptionView(option: PollOptionModel): Mithril.Children {\n return ;\n }\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport PollState from '../../states/PollState';\n\ninterface PollSubmitButtonAttrs extends ComponentAttrs {\n state: PollState;\n}\n\nexport default class PollSubmitButton extends Component {\n view(): Mithril.Children {\n const state = this.attrs.state;\n return (\n this.pollButtonSubmit(state, event)}\n disabled={!state.hasSelectedOptions()}\n >\n {app.translator.trans('fof-polls.forum.poll.submit_button')}\n \n );\n }\n\n /**\n * Event handler for submit button being clicked\n */\n\n pollButtonSubmit(state: PollState, event: Event): void {\n state.onsubmit();\n }\n}\n","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Poll from 'src/forum/models/Poll';\nimport Mithril from 'mithril';\n\nexport interface PollSubtitleAttrs extends ComponentAttrs {\n poll: Poll;\n}\n\nexport default class PollSubtitle extends Component {\n view() {\n if (!this.attrs.poll.subtitle()) {\n return;\n }\n\n return
{this.pollSubtitleItems().toArray()}
;\n }\n\n pollSubtitleItems(): ItemList {\n const items = new ItemList();\n\n items.add('subtitle',

{this.attrs.poll.subtitle()}

);\n\n return items;\n }\n}\n","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Poll from 'src/forum/models/Poll';\nimport Mithril from 'mithril';\n\nexport interface PollTitleAttrs extends ComponentAttrs {\n poll: Poll;\n}\n\nexport default class PollTitle extends Component {\n view() {\n return
{this.pollTitleItems().toArray()}
;\n }\n\n pollTitleItems(): ItemList {\n const items = new ItemList();\n\n items.add('title',

{this.attrs.poll.question()}

);\n\n return items;\n }\n}\n","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Button from 'flarum/common/components/Button';\nimport Switch from 'flarum/common/components/Switch';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Stream from 'flarum/common/utils/Stream';\nimport extractText from 'flarum/common/utils/extractText';\nimport FormError from './form/FormError';\nimport PollFormState from '../states/PollFormState';\nimport PollControls from '../utils/PollControls';\nimport PollModel from '../models/Poll';\nimport PollOption from '../models/PollOption';\nimport UploadPollImageButton from './UploadPollImageButton';\nimport Poll from '../models/Poll';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport RequestError from 'flarum/common/utils/RequestError';\n\ninterface PollFormAttrs extends ComponentAttrs {\n poll: PollModel;\n onsubmit: (data: object, state: PollFormState) => Promise;\n}\n\nexport default class PollForm extends Component {\n protected options: PollOption[] = [];\n protected optionAnswers: Stream[] = [];\n protected optionImageUrls: Stream[] = [];\n protected question: Stream;\n protected subtitle: Stream;\n protected image: Stream;\n protected imageAlt: Stream;\n protected endDate: Stream;\n protected publicPoll: Stream;\n protected allowMultipleVotes: Stream;\n protected hideVotes: Stream;\n protected allowChangeVote: Stream;\n protected maxVotes: Stream;\n protected datepickerMinDate: string = '';\n\n oninit(vnode: Mithril.Vnode): void {\n super.oninit(vnode);\n this.state = new PollFormState(this.attrs.poll);\n\n // state handles poll initialization\n const poll = this.state.poll;\n\n this.options = (poll.tempOptions ?? poll.options()) as PollOption[];\n this.optionAnswers = this.options.map((o) => Stream(o.answer()));\n this.optionImageUrls = this.options.map((o) => Stream(o.imageUrl()));\n\n this.question = Stream(poll.question());\n this.subtitle = Stream(poll.subtitle());\n this.image = Stream(poll.image());\n this.imageAlt = Stream(poll.imageAlt());\n this.endDate = Stream(this.formatDate(poll.endDate()));\n this.publicPoll = Stream(poll.publicPoll());\n this.allowMultipleVotes = Stream(poll.allowMultipleVotes());\n this.hideVotes = Stream(poll.hideVotes());\n this.allowChangeVote = Stream(poll.allowChangeVote());\n this.maxVotes = Stream(poll.maxVotes() || 0);\n\n // Set minimum date for datepicker to current date\n this.datepickerMinDate = this.formatDate() as string;\n\n // Replace minimum of 'today' for poll end date only if the poll is not already closed\n if (this.endDate() && dayjs(poll.endDate).isAfter(dayjs())) {\n // We know that endDate is set, so we can safely cast the result to string\n this.datepickerMinDate = this.formatDate(poll.endDate()) as string;\n }\n }\n\n view(): Mithril.Children {\n return (\n
\n
{this.fields().toArray()}
\n
\n );\n }\n\n fields(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'question',\n
\n \n\n \n
,\n 100\n );\n\n items.add(\n 'subtitle',\n
\n \n\n \n
,\n 95\n );\n\n items.add(\n 'poll_image',\n
\n \n

{app.translator.trans('fof-polls.forum.modal.poll_image.help')}

\n \n \n
,\n 90\n );\n\n if (this.image()) {\n items.add(\n 'poll_image_alt',\n
\n \n\n \n\n

{app.translator.trans('fof-polls.forum.modal.poll_image.alt_help_text')}

\n
,\n 90\n );\n }\n\n items.add(\n 'answers',\n
\n \n\n {this.displayOptions().toArray()}\n\n \n
,\n 80\n );\n\n items.add(\n 'date',\n
\n \n\n
\n \n {Button.component({\n className: 'Button PollModal--button Button--icon',\n icon: 'fas fa-times',\n onclick: this.endDate.bind(this, null),\n })}\n
\n\n {this.endDate() && (\n

\n \n  \n {dayjs(this.endDate()).isBefore(dayjs())\n ? app.translator.trans('fof-polls.forum.poll_ended')\n : app.translator.trans('fof-polls.forum.days_remaining', { time: dayjs(this.endDate()).fromNow() })}\n

\n )}\n
,\n 40\n );\n\n items.add(\n 'public',\n
\n {Switch.component(\n {\n state: this.publicPoll() || false,\n onchange: this.publicPoll,\n },\n app.translator.trans('fof-polls.forum.modal.public_poll_label')\n )}\n
,\n 20\n );\n\n items.add(\n 'hide-votes',\n
\n \n {app.translator.trans('fof-polls.forum.modal.hide_votes_label')}\n \n
,\n 20\n );\n\n items.add(\n 'allow-change-vote',\n
\n \n {app.translator.trans('fof-polls.forum.modal.allow_change_vote_label')}\n \n
,\n 20\n );\n\n items.add(\n 'allow-multiple-votes',\n
\n {Switch.component(\n {\n state: this.allowMultipleVotes() || false,\n onchange: this.allowMultipleVotes,\n },\n app.translator.trans('fof-polls.forum.modal.allow_multiple_votes_label')\n )}\n
,\n 15\n );\n\n if (this.allowMultipleVotes()) {\n items.add(\n 'max-votes',\n
\n \n\n \n\n

{app.translator.trans('fof-polls.forum.modal.max_votes_help')}

\n
,\n 15\n );\n }\n\n items.add(\n 'submit',\n
\n \n {this.state.poll.exists && (\n \n {app.translator.trans('fof-polls.forum.modal.delete')}\n \n )}\n
,\n -10\n );\n\n return items;\n }\n\n displayOptions(): ItemList {\n const items = new ItemList();\n\n this.options.forEach((option, i) => {\n items.add(\n 'option-' + i,\n
\n
\n \n {app.forum.attribute('allowPollOptionImage') && (\n
\n \n

{app.translator.trans('fof-polls.forum.modal.poll_option_image.help')}

\n \n \n
\n )}\n
\n {i >= 2\n ? Button.component({\n type: 'button',\n className: 'Button PollModal--button Button--icon',\n icon: 'fas fa-minus',\n onclick: i >= 2 ? this.removeOption.bind(this, i) : '',\n })\n : ''}\n
\n );\n });\n\n return items;\n }\n\n addOption() {\n const max = Math.max(app.forum.attribute('pollMaxOptions'), 2);\n\n if (this.options.length < max) {\n this.options.push(app.store.createRecord('poll_options'));\n this.optionAnswers.push(Stream(''));\n this.optionImageUrls.push(Stream(''));\n } else {\n alert(extractText(app.translator.trans('fof-polls.forum.modal.max', { max })));\n }\n }\n\n removeOption(i: number): void {\n this.options.splice(i, 1);\n this.optionAnswers.splice(i, 1);\n this.optionImageUrls.splice(i, 1);\n }\n\n data(): object {\n if (this.question() === '') {\n throw new FormError(app.translator.trans('fof-polls.forum.modal.include_question'));\n }\n\n if (this.options.length < 2) {\n throw new FormError(app.translator.trans('fof-polls.forum.modal.min'));\n }\n\n const pollExists = this.state.poll.exists;\n const options = this.options.map((option, i) => {\n option.pushAttributes({\n answer: this.optionAnswers[i](),\n imageUrl: this.optionImageUrls[i](),\n });\n\n return pollExists ? option.data : option.data.attributes;\n });\n\n return {\n question: this.question(),\n subtitle: this.subtitle(),\n pollImage: this.image(),\n imageAlt: this.imageAlt(),\n endDate: this.dateToTimestamp(this.endDate()) ?? false,\n publicPoll: this.publicPoll(),\n hideVotes: this.hideVotes(),\n allowChangeVote: this.allowChangeVote(),\n allowMultipleVotes: this.allowMultipleVotes(),\n maxVotes: this.maxVotes(),\n options,\n };\n }\n\n async onsubmit(event: Event) {\n event.preventDefault();\n\n try {\n await this.attrs.onsubmit(this.data(), this.state);\n } catch (error) {\n if (error instanceof FormError) {\n app.alerts.show({ type: 'error' }, error.message);\n } else if (error instanceof RequestError) {\n console.error(error);\n app.alerts.show({ type: 'error' }, app.translator.trans('fof-polls.forum.modal.error'));\n }\n }\n }\n\n async delete(): Promise {\n this.state.loading = true;\n try {\n await PollControls.deleteAction(this.state.poll);\n this.state.deleting = true;\n } finally {\n this.state.loading = false;\n m.redraw();\n }\n }\n\n formatDate(date: Date | string | false | undefined | null = undefined, def: Date | false = false): string | false {\n const dayjsDate = dayjs(date);\n\n if (date === false || !dayjsDate.isValid()) return def !== false ? this.formatDate(def) : false;\n\n return dayjsDate.format('YYYY-MM-DDTHH:mm');\n }\n\n dateToTimestamp(date: Date | false): string | null {\n const dayjsDate = dayjs(date);\n\n if (!date || !dayjsDate.isValid()) return null;\n\n return dayjsDate.format();\n }\n\n pollImageUploadSuccess(fileName: string | null | undefined): void {\n this.image(fileName);\n }\n\n pollOptionImageUploadSuccess(index: number, fileName: string | null | undefined): void {\n this.optionImageUrls[index] = Stream(fileName);\n }\n}\n","import app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport classList from 'flarum/common/utils/classList';\nimport icon from 'flarum/common/helpers/icon';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport type Mithril from 'mithril';\n\ninterface PollPageHeroAttrs extends ComponentAttrs {\n icon?: string;\n title?: string;\n}\n\nexport default class PollPageHero extends Component {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n }\n\n get classNames(): string {\n return classList({\n PollPageHero: true,\n Hero: true,\n });\n }\n\n get wrapperClasses(): string {\n return classList({\n 'PollPageHero--wrapper': true,\n });\n }\n\n oncreate(vnode: Mithril.Vnode): void {\n super.oncreate(vnode);\n }\n\n get title() {\n return this.attrs.title || app.translator.trans('fof-polls.forum.polls_page.title');\n }\n\n get icon() {\n return this.attrs.icon || 'fas fa-poll';\n }\n\n view() {\n return (\n
\n
\n
\n
{this.items().toArray()}
\n
\n
\n
\n );\n }\n\n items() {\n const items = new ItemList();\n items.add('title',

{[icon(this.icon), ' ', this.title]}

, 50);\n\n return items;\n }\n}\n","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport PollListState from '../states/PollListState';\nimport type Mithril from 'mithril';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport PollShowcaseItem from './PollShowcaseItem';\nimport Placeholder from 'flarum/common/components/Placeholder';\nimport app from 'flarum/forum/app';\n\nexport interface PollListAttrs extends ComponentAttrs {\n state: PollListState;\n}\n\nexport default class PollShowcase extends Component {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.attrs.state.refresh();\n }\n\n view(): Mithril.Children {\n return (\n
\n
\n

{app.translator.trans('fof-polls.forum.showcase.active-polls')}

\n {this.showcaseItems().toArray()}\n {this.showcaseItems().toArray().length === 0 && }\n
\n
\n

{app.translator.trans('fof-polls.forum.showcase.ended-polls')}

\n {this.endedItems().toArray()}\n {this.endedItems().toArray().length === 0 && }\n
\n
\n );\n }\n\n showcaseItems(): ItemList {\n const items = new ItemList();\n\n this.attrs.state.getPages().map((page) => {\n page.items.map((poll) => {\n if (!poll.hasEnded()) {\n items.add('poll-active-' + poll.id(), );\n }\n });\n });\n\n return items;\n }\n\n endedItems(): ItemList {\n const items = new ItemList();\n\n this.attrs.state.getPages().map((page) => {\n page.items.map((poll) => {\n if (poll.hasEnded()) {\n items.add('poll-ended-' + poll.id(), );\n }\n });\n });\n\n return items;\n }\n}\n","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Poll from '../models/Poll';\nimport type Mithril from 'mithril';\nimport PollView from './PollView';\n\nexport interface PollShowcaseItemAttrs extends ComponentAttrs {\n poll: Poll;\n}\n\nexport default class PollShowcaseItem extends Component {\n poll!: Poll;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.poll = this.attrs.poll;\n }\n\n view() {\n return (\n
\n \n
\n );\n }\n}\n","import Mithril from 'mithril';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport app from 'flarum/forum/app';\nimport PollOptions from './Poll/PollOptions';\nimport PollImage from './Poll/PollImage';\nimport PollModel from '../models/Poll';\nimport PollState from '../states/PollState';\nimport Button from 'flarum/common/components/Button';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport PollControls from '../utils/PollControls';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport PollSubmitButton from './Poll/PollSubmitButton';\nimport { slug } from 'flarum/common/utils/string';\nimport classList from 'flarum/common/utils/classList';\nimport PollTitle from './Poll/PollTitle';\nimport PollSubtitle from './Poll/PollSubtitle';\n\ninterface PollAttrs extends ComponentAttrs {\n poll: PollModel;\n}\n\nexport default class PollView extends Component {\n state!: PollState;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n this.state = new PollState(this.attrs.poll);\n }\n\n oncreate(vnode: Mithril.Vnode) {\n super.oncreate(vnode);\n\n this.preventClose = this.preventClose.bind(this);\n window.addEventListener('beforeunload', this.preventClose);\n }\n\n onremove(vnode: Mithril.Vnode) {\n super.onremove(vnode);\n\n window.removeEventListener('beforeunload', this.preventClose);\n }\n\n view(): Mithril.Children {\n const poll = this.attrs.poll;\n const state = this.state;\n const controls = PollControls.controls(poll, this);\n\n (poll.publicPoll() || poll.canEdit()) &&\n controls.add(\n 'view',\n \n );\n\n return (\n
\n {this.controlsView(controls.toArray())}\n
{this.createMainView().toArray()}
\n
\n );\n }\n\n createMainView(): ItemList {\n const items = new ItemList();\n\n items.add('header',
{this.createPollHeader().toArray()}
);\n items.add('content',
{this.createPollContent().toArray()}
);\n items.add('footer',
{this.createPollFooter().toArray()}
);\n\n return items;\n }\n\n createPollHeader(): ItemList {\n const items = new ItemList();\n const poll = this.attrs.poll;\n\n items.add('title', );\n if (poll.subtitle()) items.add('subtitle', );\n\n return items;\n }\n\n createPollContent(): ItemList {\n const items = new ItemList();\n const poll = this.attrs.poll;\n\n if (poll.imageUrl()) {\n items.add('image', );\n }\n\n items.add('form',
{this.createFormItems().toArray()}
);\n\n return items;\n }\n\n createPollFooter(): ItemList {\n const items = new ItemList();\n const state = this.state;\n\n const infoItems = this.infoItems(state.getMaxVotes());\n\n items.add(\n 'sticky',\n
\n {!infoItems.isEmpty() &&
{infoItems.toArray()}
}\n {state.showButton() && }\n
\n );\n\n return items;\n }\n\n createFormItems(): ItemList {\n const items = new ItemList();\n const poll = this.attrs.poll;\n const state = this.state;\n const questionSlug = slug(poll.question());\n\n items.add(\n 'elements',\n
\n {poll.question()}\n \n
\n );\n\n return items;\n }\n\n controlsView(controls: Mithril.ChildArray): Mithril.Children {\n return (\n !!controls.length && (\n \n {controls}\n \n )\n );\n }\n\n infoItems(maxVotes: number) {\n const items = new ItemList();\n const poll = this.attrs.poll;\n\n if (app.session.user && !poll.canVote() && !poll.hasEnded()) {\n items.add(\n 'no-permission',\n \n \n {app.translator.trans('fof-polls.forum.no_permission')}\n \n );\n }\n\n if (poll.endDate()) {\n items.add(\n 'end-date',\n \n \n {poll.hasEnded()\n ? app.translator.trans('fof-polls.forum.poll_ended')\n : app.translator.trans('fof-polls.forum.days_remaining', { time: dayjs(poll.endDate()).fromNow() })}\n \n );\n }\n\n if (poll.canVote()) {\n items.add(\n 'max-votes',\n \n \n {app.translator.trans('fof-polls.forum.max_votes_allowed', { max: maxVotes })}\n \n );\n\n if (!poll.canChangeVote()) {\n items.add(\n 'cannot-change-vote',\n \n \n {app.translator.trans('fof-polls.forum.poll.cannot_change_vote')}\n \n );\n }\n }\n\n return items;\n }\n\n /**\n * Alert before navigating away using browser's 'beforeunload' event\n */\n preventClose = (e: Event): boolean | void => {\n if (this.state.hasSelectedOptions()) {\n e.preventDefault();\n return true;\n }\n };\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport PollModel from '../models/Poll';\nimport PollView from './PollView';\nimport { AbstractPollPage } from './AbstractPollPage';\nimport ItemList from 'flarum/common/utils/ItemList';\n\nexport default class PollViewPage extends AbstractPollPage {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n if (!app.forum.attribute('globalPollsEnabled')) {\n m.route.set('/');\n return;\n }\n\n const editId = m.route.param('id');\n this.poll = app.store.getById('poll', editId);\n\n if (!this.poll) {\n this.loading = true;\n\n app.store.find('fof/polls', editId).then((item) => {\n this.poll = item;\n this.loading = false;\n app.setTitle(this.poll.question());\n m.redraw();\n });\n }\n }\n\n contentItems(): ItemList {\n const items = super.contentItems();\n\n if (!this.loading) {\n items.add('poll', );\n }\n\n return items;\n }\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport listItems from 'flarum/common/helpers/listItems';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport PollList from './Poll/PollList';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport extractText from 'flarum/common/utils/extractText';\nimport PollListState from '../states/PollListState';\nimport Button from 'flarum/common/components/Button';\nimport SelectDropdown from 'flarum/common/components/SelectDropdown';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport PollView from './PollView';\nimport { AbstractPollPage } from './AbstractPollPage';\n\nexport default class PollsPage extends AbstractPollPage {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n if (!app.forum.attribute('globalPollsEnabled')) {\n m.route.set('/');\n return;\n }\n\n this.state = new PollListState({\n sort: m.route.param('sort'),\n filter: m.route.param('filter'),\n });\n\n this.state.refresh();\n\n app.setTitle(extractText(app.translator.trans('fof-polls.forum.page.nav')));\n }\n\n view(): Mithril.Children {\n if (this.loading) {\n return ;\n }\n\n if (this.poll) {\n return (\n
\n
\n \n
\n
\n );\n }\n\n return (\n
\n {super.hero()}\n
\n
\n \n
\n
\n
    {listItems(this.viewItems().toArray())}
\n
    {listItems(this.actionItems().toArray())}
\n
\n \n
\n
\n
\n
\n );\n }\n\n sidebarItems(): ItemList {\n const items = new ItemList();\n const canStartPoll = app.forum.attribute('canStartGlobalPolls');\n\n items.add(\n 'newGlobalPoll',\n {\n this.newPollAction();\n }}\n disabled={!canStartPoll}\n >\n {app.translator.trans(`fof-polls.forum.poll.${canStartPoll ? 'start_poll_button' : 'cannot_start_poll_button'}`)}\n \n );\n\n items.add(\n 'nav',\n \n {this.navItems().toArray()}\n \n );\n\n return items;\n }\n\n actionItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'refresh',\n Button.component({\n title: app.translator.trans('fof-polls.forum.page.refresh_tooltip'),\n icon: 'fas fa-sync',\n className: 'Button Button--icon',\n onclick: () => {\n this.state.refresh();\n },\n })\n );\n\n return items;\n }\n\n viewItems() {\n return IndexPage.prototype.viewItems();\n }\n\n navItems() {\n return IndexPage.prototype.navItems();\n }\n\n /**\n * Change to create new poll page\n */\n newPollAction(): void {\n if (!app.session.user) {\n app.modal.show(LogInModal);\n return;\n }\n\n m.route.set(app.route('fof.polls.compose'));\n }\n}\n","import app from 'flarum/forum/app';\nimport { IPageAttrs } from 'flarum/common/components/Page';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Mithril from 'mithril';\nimport PollListState from '../states/PollListState';\nimport extractText from 'flarum/common/utils/extractText';\nimport Button from 'flarum/common/components/Button';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport { AbstractPollPage } from './AbstractPollPage';\nimport PollShowcase from './PollShowcase';\n\nexport default class PollsShowcasePage extends AbstractPollPage {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n if (!app.forum.attribute('globalPollsEnabled')) {\n m.route.set('/');\n return;\n }\n\n this.state = new PollListState({\n sort: m.route.param('sort'),\n filter: m.route.param('filter'),\n include: this.includeParams(),\n });\n\n this.state.refresh();\n\n app.setTitle(extractText(app.translator.trans('fof-polls.forum.page.nav')));\n }\n\n includeParams(): string[] {\n return ['options', 'votes', 'myVotes', 'myVotes.option'];\n }\n\n contentItems(): ItemList {\n const items = super.contentItems();\n\n if (!this.loading) {\n items.add('poll-showcase', );\n }\n\n return items;\n }\n\n sidebarItems(): ItemList {\n const items = super.sidebarItems();\n const canStartPoll = app.forum.attribute('canStartGlobalPolls');\n\n if (canStartPoll) {\n items.remove('newDiscussion');\n items.add(\n 'newGlobalPoll',\n {\n this.newPollAction();\n }}\n disabled={!canStartPoll}\n >\n {app.translator.trans(`fof-polls.forum.poll.${canStartPoll ? 'start_poll_button' : 'cannot_start_poll_button'}`)}\n ,\n 100\n );\n }\n\n return items;\n }\n\n newPollAction(): void {\n if (!app.session.user) {\n app.modal.show(LogInModal);\n return;\n }\n\n m.route.set(app.route('fof.polls.compose'));\n }\n}\n","import app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport ListVotersModal from './ListVotersModal';\nimport classList from 'flarum/common/utils/classList';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport icon from 'flarum/common/helpers/icon';\nimport EditPollModal from './EditPollModal';\nimport Poll from '../models/Poll';\nimport type Mithril from 'mithril';\nimport PollOption from '../models/PollOption';\nimport Post from 'flarum/common/models/Post';\nimport extractText from 'flarum/common/utils/extractText';\n\nexport interface PostPollAttrs extends ComponentAttrs {\n poll: Poll;\n post?: Post;\n}\n\nexport default class PostPoll extends Component {\n loadingOptions: boolean = false;\n useSubmitUI!: boolean;\n pendingSubmit: boolean = false;\n pendingOptions: any;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.useSubmitUI = !this.attrs.poll?.canChangeVote() && this.attrs.poll?.allowMultipleVotes();\n this.pendingOptions = null;\n }\n\n oncreate(vnode: Mithril.Vnode) {\n super.oncreate(vnode);\n\n this.preventClose = this.preventClose.bind(this);\n window.addEventListener('beforeunload', this.preventClose);\n }\n\n onremove(vnode: Mithril.Vnode) {\n super.onremove(vnode);\n\n window.removeEventListener('beforeunload', this.preventClose);\n }\n\n view() {\n const poll = this.attrs.poll;\n const options = poll.options() || [];\n let maxVotes = poll.allowMultipleVotes() ? poll.maxVotes() : 1;\n\n if (maxVotes === 0) maxVotes = options.length;\n\n const infoItems = this.infoItems(maxVotes);\n\n return (\n
\n
\n
\n

{poll.question()}

\n {poll.subtitle() &&

{poll.subtitle()}

}\n
\n\n
\n {poll.canSeeVoters() && (\n \n
\n
\n\n
\n
{options.map(this.viewOption.bind(this))}
\n\n
\n {!infoItems.isEmpty() &&
{infoItems.toArray()}
}\n\n {this.useSubmitUI && this.pendingSubmit && (\n \n )}\n
\n
\n
\n );\n }\n\n infoItems(maxVotes: number) {\n const items = new ItemList();\n const poll = this.attrs.poll;\n const hasVoted = poll.myVotes()?.length > 0;\n\n if (app.session.user && !poll.canVote() && !poll.hasEnded()) {\n items.add(\n 'no-permission',\n \n \n {app.translator.trans('fof-polls.forum.no_permission')}\n \n );\n }\n\n if (poll.endDate()) {\n items.add(\n 'end-date',\n \n \n {poll.hasEnded()\n ? app.translator.trans('fof-polls.forum.poll_ended')\n : app.translator.trans('fof-polls.forum.days_remaining', { time: dayjs(poll.endDate()).fromNow() })}\n \n );\n }\n\n if (poll.canVote()) {\n items.add(\n 'max-votes',\n \n \n {app.translator.trans('fof-polls.forum.max_votes_allowed', { max: maxVotes })}\n \n );\n\n if (!poll.canChangeVote()) {\n items.add(\n 'cannot-change-vote',\n \n \n {app.translator.trans('fof-polls.forum.poll.cannot_change_vote')}\n \n );\n }\n }\n\n return items;\n }\n\n viewOption(opt: PollOption) {\n const poll = this.attrs.poll;\n const hasVoted = poll.myVotes()?.length > 0;\n const totalVotes = poll.voteCount();\n\n const voted = this.pendingOptions ? this.pendingOptions.has(opt.id()) : poll.myVotes()?.some?.((vote) => vote.option() === opt);\n const votes = opt.voteCount();\n const percent = totalVotes > 0 ? Math.round((votes / totalVotes) * 100) : 0;\n\n // isNaN(null) is false, so we have to check type directly now that API always returns the field\n const canSeeVoteCount = typeof votes === 'number';\n const isDisabled = this.loadingOptions || (hasVoted && !poll.canChangeVote());\n const width = canSeeVoteCount ? percent : (Number(voted) / (poll.myVotes()?.length || 1)) * 100;\n\n const showCheckmark = !app.session.user || (!poll.hasEnded() && poll.canVote() && (!hasVoted || poll.canChangeVote()));\n\n const bar = (\n
\n {showCheckmark && (\n \n )}\n\n
\n {opt.answer()}\n {voted && !showCheckmark && icon('fas fa-check-circle', { className: 'PollAnswer-check' })}\n {canSeeVoteCount && {percent}%}\n
\n\n {opt.imageUrl() ? {opt.answer()} : null}\n
\n );\n\n return (\n \n {canSeeVoteCount ? (\n \n {bar}\n \n ) : (\n bar\n )}\n
\n );\n }\n\n changeVote(option: PollOption, evt: Event) {\n if (!app.session.user) {\n app.modal.show(LogInModal);\n evt.target.checked = false;\n return;\n }\n\n const optionIds = this.pendingOptions || new Set(this.attrs.poll.myVotes().map?.((v) => v.option().id()));\n const isUnvoting = optionIds.delete(option.id());\n const allowsMultiple = this.attrs.poll.allowMultipleVotes();\n\n if (!allowsMultiple) {\n optionIds.clear();\n }\n\n if (!isUnvoting) {\n optionIds.add(option.id());\n }\n\n if (this.useSubmitUI) {\n this.pendingOptions = optionIds.size ? optionIds : null;\n this.pendingSubmit = !!this.pendingOptions;\n return;\n }\n\n return this.submit(optionIds, null, () => (evt.target.checked = isUnvoting));\n }\n\n onsubmit() {\n return this.submit(this.pendingOptions, () => {\n this.pendingOptions = null;\n this.pendingSubmit = false;\n });\n }\n\n submit(optionIds, cb, onerror) {\n this.loadingOptions = true;\n m.redraw();\n\n return app\n .request({\n method: 'PATCH',\n url: `${app.forum.attribute('apiUrl')}/fof/polls/${this.attrs.poll.id()}/votes`,\n body: {\n data: {\n optionIds: Array.from(optionIds),\n },\n },\n })\n .then((res) => {\n app.store.pushPayload(res);\n cb?.();\n })\n .catch((err) => {\n onerror?.(err);\n })\n .finally(() => {\n this.loadingOptions = false;\n\n m.redraw();\n });\n }\n\n showVoters() {\n // Load all the votes only when opening the votes list\n app.modal.show(ListVotersModal, {\n poll: this.attrs.poll,\n post: this.attrs.post,\n });\n }\n\n deletePoll() {\n if (confirm(extractText(app.translator.trans('fof-polls.forum.moderation.delete_confirm')))) {\n this.attrs.poll.delete().then(() => {\n m.redraw.sync();\n });\n }\n }\n\n /**\n * Attempting to use the `tooltipVisible` attr on the Tooltip component set to 'false' when no vote count\n * caused the tooltip to break on click. This is a workaround to hide the tooltip when no vote count is available,\n * called on 'onremove' of the Tooltip component. It doesn't always work as intended either, but it does the job.\n */\n hideOptionTooltip(vnode: Mithril.Vnode) {\n vnode.attrs.tooltipVisible = false;\n vnode.state.updateVisibility();\n }\n\n /**\n * Alert before navigating away using browser's 'beforeunload' event\n */\n preventClose(e) {\n if (this.pendingOptions) {\n e.preventDefault();\n return true;\n }\n }\n}\n","import app from 'flarum/forum/app';\nimport Button, { IButtonAttrs } from 'flarum/common/components/Button';\nimport classList from 'flarum/common/utils/classList';\nimport type Mithril from 'mithril';\nimport Poll from '../models/Poll';\nimport PollOption from '../models/PollOption';\n\nexport interface UploadPollImageButtonAttrs extends IButtonAttrs {\n className?: string;\n loading?: boolean;\n name: string;\n onclick: () => void;\n poll?: Poll | null;\n option?: PollOption | null;\n onUpload: (fileName: string | null | undefined) => void;\n}\n\nexport interface PollUploadObject {\n fileUrl: string;\n fileName: string;\n}\n\nexport default class UploadPollImageButton extends Button {\n loading: boolean = false;\n uploadedImageUrl: string | undefined | false = false;\n fileName: string | undefined = undefined;\n $input: JQuery | undefined;\n\n view(vnode: Mithril.Vnode) {\n this.attrs.loading = this.loading;\n this.attrs.className = classList(this.attrs.className, 'Button');\n\n const imageUrl = this.getImageUrl();\n\n if (imageUrl) {\n this.attrs.onclick = this.remove.bind(this);\n\n return (\n
\n

\n \"\"\n

\n

{super.view({ ...vnode, children: app.translator.trans('fof-polls.forum.upload_image.remove_button') })}

\n
\n );\n } else {\n this.attrs.onclick = this.upload.bind(this);\n }\n\n return super.view({ ...vnode, children: app.translator.trans('fof-polls.forum.upload_image.upload_button') });\n }\n\n /**\n * Prompt the user to upload an image.\n */\n upload() {\n if (this.loading) return;\n\n this.$input = $('');\n\n this.$input\n .appendTo('body')\n .hide()\n .trigger('click')\n .on('change', (e) => {\n const body = new FormData();\n body.append(this.attrs.name, $(e.target)[0].files[0]);\n\n this.loading = true;\n m.redraw();\n\n app\n .request({\n method: 'POST',\n url: this.resourceUrl(),\n serialize: (raw) => raw,\n body,\n })\n .then(this.success.bind(this), this.failure.bind(this));\n });\n }\n\n /**\n * Remove the image.\n */\n remove() {\n this.loading = true;\n m.redraw();\n\n let fileName = undefined;\n\n if (!this.attrs.poll?.exists && !this.attrs.option?.exists) {\n fileName = this.fileName;\n }\n\n app\n .request({\n method: 'DELETE',\n url: this.resourceUrl(fileName),\n })\n .then(this.success.bind(this), this.failure.bind(this));\n }\n\n resourceUrl(fileName: string | undefined = undefined) {\n let url = app.forum.attribute('apiUrl') + '/fof/polls/' + this.attrs.name;\n const poll = this.attrs.poll;\n const option = this.attrs.option;\n\n if (fileName) {\n url += '/name/' + fileName;\n } else {\n if (poll?.exists) url += '/' + poll?.id();\n if (option?.exists) url += '/' + option?.id();\n }\n\n return url;\n }\n\n getImageUrl() {\n if (this.uploadedImageUrl !== false) {\n return this.uploadedImageUrl;\n }\n\n return this.attrs.poll?.imageUrl() || this.attrs.option?.imageUrl();\n }\n\n /**\n * After a successful upload/removal, redraw the page.\n *\n * @param {PollUploadObject} response\n * @protected\n */\n success(response: PollUploadObject | null) {\n this.loading = false;\n this.uploadedImageUrl = response?.fileUrl;\n this.fileName = response?.fileName;\n\n this.attrs.onUpload?.(response?.fileName);\n m.redraw();\n this.$input?.remove();\n }\n\n /**\n * If upload/removal fails, stop loading.\n *\n * @param {object} response\n * @protected\n */\n failure(response: object) {\n this.loading = false;\n m.redraw();\n this.$input?.remove();\n }\n}\n","import { NestedStringArray } from '@askvortsov/rich-icu-message-formatter';\n\nexport default class FormError extends Error {\n constructor(props: NestedStringArray | string) {\n super(props + '');\n }\n}\n","import CreatePollModal from './CreatePollModal';\nimport PostPoll from './PostPoll';\nimport EditPollModal from './EditPollModal';\nimport ListVotersModal from './ListVotersModal';\nimport PollForm from './PollForm';\nimport ComposePollHero from './ComposePollHero';\nimport ComposePollPage from './ComposePollPage';\nimport PollsPage from './PollsPage';\nimport PollView from './PollView';\nimport PollViewPage from './PollViewPage';\nimport PollSubmitButton from './Poll/PollSubmitButton';\nimport PollOption from './Poll/PollOption';\nimport PollOptions from './Poll/PollOptions';\nimport PollsShowcasePage from './PollsShowcasePage';\nimport PollShowcase from './PollShowcase';\nimport PollShowcaseItem from './PollShowcaseItem';\nimport { AbstractPollPage } from './AbstractPollPage';\nimport PollTitle from './Poll/PollTitle';\nimport PollSubtitle from './Poll/PollSubtitle';\nimport PollImage from './Poll/PollImage';\n\nexport const components = {\n CreatePollModal,\n PostPoll,\n EditPollModal,\n ListVotersModal,\n PollForm,\n ComposePollHero,\n ComposePollPage,\n PollsPage,\n PollView,\n PollViewPage,\n PollSubmitButton,\n PollOption,\n PollOptions,\n PollsShowcasePage,\n PollShowcase,\n PollShowcaseItem,\n AbstractPollPage,\n PollTitle,\n PollSubtitle,\n PollImage,\n};\n","import Extend from 'flarum/common/extenders';\nimport Post from 'flarum/common/models/Post';\nimport Forum from 'flarum/common/models/Forum';\nimport Discussion from 'flarum/common/models/Discussion';\nimport Poll from './models/Poll';\nimport PollOption from './models/PollOption';\nimport PollVote from './models/PollVote';\nimport PollsPage from './components/PollsPage';\nimport ComposePollPage from './components/ComposePollPage';\nimport PollViewPage from './components/PollViewPage';\nimport PollsShowcasePage from './components/PollsShowcasePage';\n\nexport default [\n new Extend.Routes() //\n .add('fof.polls.showcase', '/polls', PollsShowcasePage)\n .add('fof.polls.list', '/polls/all', PollsPage)\n .add('fof.polls.view', '/polls/view/:id', PollViewPage)\n .add('fof.polls.compose', '/polls/composer', ComposePollPage),\n\n new Extend.Store() //\n .add('polls', Poll)\n .add('poll_options', PollOption)\n .add('poll_votes', PollVote),\n\n new Extend.Model(Post) //\n .hasMany('polls')\n .attribute('canStartPoll'),\n\n new Extend.Model(Forum) //\n .attribute('canStartPolls'),\n\n new Extend.Model(Discussion) //\n .attribute('hasPoll')\n .attribute('canStartPoll'),\n];\n","import app from 'flarum/forum/app';\n\nimport addDiscussionBadge from './addDiscussionBadge';\nimport addComposerItems from './addComposerItems';\nimport addPollsToPost from './addPollsToPost';\nimport addPostControls from './addPostControls';\nimport addNavItem from './addNavItem';\n\nexport * from './components';\nexport * from './models';\nexport * from './states';\nexport * from './utils';\n\napp.initializers.add('fof/polls', () => {\n addDiscussionBadge();\n addComposerItems();\n addPollsToPost();\n addPostControls();\n addNavItem();\n});\n\nexport { default as extend } from './extend';\n","import Model from 'flarum/common/Model';\nimport PollOption from './PollOption';\nimport PollVote from './PollVote';\nimport computed from 'flarum/common/utils/computed';\n\nexport default class Poll extends Model {\n public tempOptions: PollOption[] | undefined;\n\n question() {\n return Model.attribute('question').call(this);\n }\n\n subtitle() {\n return Model.attribute('subtitle').call(this);\n }\n\n image() {\n return Model.attribute('image').call(this);\n }\n\n imageUrl() {\n return Model.attribute('imageUrl').call(this);\n }\n\n imageAlt() {\n return Model.attribute('imageAlt').call(this);\n }\n\n hasEnded() {\n return Model.attribute('hasEnded').call(this);\n }\n\n endDate() {\n return Model.attribute('endDate', Model.transformDate).call(this);\n }\n\n publicPoll() {\n return Model.attribute('publicPoll').call(this);\n }\n\n hideVotes() {\n return Model.attribute('hideVotes').call(this);\n }\n\n allowChangeVote() {\n return Model.attribute('allowChangeVote').call(this);\n }\n\n allowMultipleVotes() {\n return Model.attribute('allowMultipleVotes').call(this);\n }\n\n maxVotes() {\n return Model.attribute('maxVotes').call(this);\n }\n\n voteCount() {\n return Model.attribute('voteCount').call(this);\n }\n\n canVote() {\n return Model.attribute('canVote').call(this);\n }\n\n canEdit() {\n return Model.attribute('canEdit').call(this);\n }\n\n canDelete() {\n return Model.attribute('canDelete').call(this);\n }\n\n canSeeVoters() {\n return Model.attribute('canSeeVoters').call(this);\n }\n\n canChangeVote() {\n return Model.attribute('canChangeVote').call(this);\n }\n\n options() {\n const options = Model.hasMany('options').call(this);\n return options ? (options as PollOption[]) : [];\n }\n\n votes() {\n return Model.hasMany('votes').call(this);\n }\n\n myVotes(): PollVote[] {\n const myVotes = Model.hasMany('myVotes').call(this);\n return myVotes ? (myVotes as PollVote[]) : [];\n }\n\n isGlobal() {\n return Model.attribute('isGlobal').call(this);\n }\n\n isHidden() {\n return computed('hiddenAt', (hiddenAt) => !!hiddenAt).call(this);\n }\n\n // TODO: These two don't make sense as of now\n isUnread() {\n return false;\n }\n\n apiEndpoint() {\n /** @ts-ignore */\n return `/fof/polls${this.exists ? `/${this.data.id}` : ''}`;\n }\n}\n","import Model from 'flarum/common/Model';\nimport Poll from './Poll';\nimport PollVote from './PollVote';\n\nexport default class PollOption extends Model {\n answer() {\n return Model.attribute('answer').call(this);\n }\n\n imageUrl() {\n return Model.attribute('imageUrl').call(this);\n }\n\n voteCount() {\n return Model.attribute('voteCount').call(this);\n }\n\n poll() {\n return Model.hasOne('polls').call(this);\n }\n\n votes() {\n return Model.hasMany('votes').call(this);\n }\n\n apiEndpoint() {\n /** @ts-ignore */\n return `/fof/polls/answers${this.exists ? `/${this.data.id}` : ''}`;\n }\n}\n","import Model from 'flarum/common/Model';\nimport Poll from './Poll';\nimport PollOption from './PollOption';\nimport User from 'flarum/common/models/User';\n\nexport default class PollVote extends Model {\n poll() {\n return Model.hasOne('poll').call(this);\n }\n\n option() {\n const result = Model.hasOne('option').call(this);\n return result === false ? null : result;\n }\n\n user() {\n return Model.hasOne('user').call(this);\n }\n\n pollId() {\n return Model.attribute('pollId').call(this);\n }\n\n optionId() {\n return Model.attribute('optionId').call(this);\n }\n\n apiEndpoint() {\n return `/fof/polls/${this.pollId()}/vote`;\n }\n}\n","import Poll from './Poll';\nimport PollOption from './PollOption';\nimport PollVote from './PollVote';\n\nexport const models = {\n Poll,\n PollOption,\n PollVote,\n};\n","import app from 'flarum/forum/app';\nimport Poll from '../models/Poll';\nimport PollOption from '../models/PollOption';\n\nexport default class PollFormState {\n poll: Poll;\n loading: boolean;\n deleting: boolean;\n expandedGroup: string;\n\n static createNewPoll() {\n const poll = app.store.createRecord('polls');\n\n poll.pushAttributes({\n question: '',\n endDate: '',\n publicPoll: false,\n allowMultipleVotes: false,\n hideVotes: false,\n allowChangeVote: false,\n maxVotes: 0,\n });\n\n poll.tempOptions = [app.store.createRecord('poll_options'), app.store.createRecord('poll_options')];\n\n return poll;\n }\n\n constructor(poll: Poll) {\n if (!poll) {\n poll = PollFormState.createNewPoll();\n }\n\n this.loading = false;\n this.deleting = false;\n this.poll = poll;\n this.expandedGroup = 'setup';\n }\n\n isExpanded(groupKey: string) {\n return this.expandedGroup === groupKey;\n }\n\n expand(groupKey: string) {\n this.expandedGroup = groupKey;\n m.redraw();\n }\n\n async save(data: any) {\n this.loading = true;\n m.redraw();\n\n try {\n this.poll = await this.poll.save(data);\n /**\n * Cleanup attributes:\n * For the saving process, we add the options directly to the attributes.\n * As we currently cannot add new PollOptions as relationships.\n */\n delete this.poll!.data!.attributes!.options;\n } finally {\n this.loading = false;\n m.redraw();\n }\n }\n\n async delete() {\n this.loading = true;\n m.redraw();\n\n try {\n await this.poll.delete();\n this.deleting = true;\n } finally {\n this.loading = false;\n m.redraw();\n }\n }\n}\n","import app from 'flarum/forum/app';\nimport PaginatedListState, { Page, PaginatedListParams, PaginatedListRequestParams } from 'flarum/common/states/PaginatedListState';\nimport Poll from '../models/Poll';\nimport { ApiResponsePlural } from 'flarum/common/Store';\nimport EventEmitter from 'flarum/common/utils/EventEmitter';\n\nexport interface PollListParams extends PaginatedListParams {\n sort?: string;\n}\n\nconst globalEventEmitter = new EventEmitter();\n\nexport default class PollListState

extends PaginatedListState {\n protected extraPolls: Poll[] = [];\n protected eventEmitter: EventEmitter;\n\n constructor(params: P, page: number = 1) {\n super(params, page, 20);\n\n this.eventEmitter = globalEventEmitter.on('poll.deleted', this.deletePoll.bind(this));\n }\n\n get type(): string {\n return 'fof/polls';\n }\n\n requestParams(): PaginatedListRequestParams {\n const params = {\n include: this.params.include || ['options', 'votes'],\n filter: this.params.filter || {},\n sort: this.sortMap()[this.params.sort ?? ''],\n };\n\n if (this.params.q) {\n params.filter.q = this.params.q;\n }\n\n return params;\n }\n\n protected loadPage(page: number = 1): Promise> {\n const preloadedPolls = app.preloadedApiDocument();\n\n if (preloadedPolls) {\n this.initialLoading = false;\n\n return Promise.resolve(preloadedPolls);\n }\n\n return super.loadPage(page);\n }\n\n clear(): void {\n super.clear();\n\n this.extraPolls = [];\n }\n\n /**\n * Get a map of sort keys (which appear in the URL, and are used for\n * translation) to the API sort value that they represent.\n */\n sortMap() {\n const map: any = {};\n\n if (this.params.q) {\n map.relevance = '';\n }\n map.newest = '-createdAt';\n map.oldest = 'createdAt';\n\n return map;\n }\n\n /**\n * In the last request, has the user searched for a poll?\n */\n isSearchResults(): boolean {\n return !!this.params.q;\n }\n\n removePoll(poll: Poll): void {\n this.eventEmitter.emit('poll.deleted', poll);\n }\n\n deletePoll(poll: Poll): void {\n for (const page of this.pages) {\n const index = page.items.indexOf(poll);\n\n if (index !== -1) {\n page.items.splice(index, 1);\n break;\n }\n }\n\n const index = this.extraPolls.indexOf(poll);\n\n if (index !== -1) {\n this.extraPolls.splice(index);\n }\n\n m.redraw();\n }\n\n /**\n * Add a poll to the top of the list.\n */\n addPoll(poll: Poll): void {\n this.removePoll(poll);\n this.extraPolls.unshift(poll);\n\n m.redraw();\n }\n\n protected getAllItems(): Poll[] {\n return this.extraPolls.concat(super.getAllItems());\n }\n\n public getPages(): Page[] {\n const pages = super.getPages();\n\n if (this.extraPolls.length) {\n return [\n {\n number: -1,\n items: this.extraPolls,\n },\n ...pages,\n ];\n }\n\n return pages;\n }\n}\n","import app from 'flarum/forum/app';\nimport Poll from '../models/Poll';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport PollOption from '../models/PollOption';\nimport PollVote from '../models/PollVote';\nimport ListVotersModal from '../components/ListVotersModal';\nimport { ApiPayloadSingle } from 'flarum/common/Store';\n\nexport default class PollState {\n public poll: Poll;\n protected pendingSubmit: boolean = false;\n protected pendingOptions: Set | null = null;\n public loadingOptions: boolean = false;\n public useSubmitUI: boolean;\n public showCheckMarks: boolean;\n public canSeeVoteCount: boolean;\n\n constructor(poll: Poll) {\n this.poll = poll;\n this.useSubmitUI = !poll?.canChangeVote() && poll?.allowMultipleVotes();\n this.showCheckMarks = !app.session.user || (!poll.hasEnded() && poll.canVote() && (!this.hasVoted() || poll.canChangeVote()));\n this.canSeeVoteCount = typeof poll.voteCount() === 'number';\n this.init();\n }\n\n /**\n * used as en extendable entry point for init customizations\n */\n init(): void {}\n\n isShowResult(): boolean {\n return this.poll.hasEnded() || (this.canSeeVoteCount && !!app.session.user && this.hasVoted());\n }\n\n hasVoted(): boolean {\n return this.poll.myVotes().length > 0;\n }\n\n overallVoteCount(): number {\n return this.poll.voteCount();\n }\n\n hasVotedFor(option: PollOption): boolean {\n return this.pendingOptions ? this.pendingOptions.has(option.id()!) : this.poll.myVotes().some((vote: PollVote) => vote.option() === option);\n }\n\n getMaxVotes(): number {\n const poll = this.poll;\n let maxVotes = poll.allowMultipleVotes() ? poll.maxVotes() : 1;\n if (maxVotes === 0) maxVotes = poll.options().length;\n return maxVotes;\n }\n\n showButton(): boolean {\n return this.useSubmitUI && this.pendingSubmit;\n }\n\n changeVote(option: PollOption, evt: Event): void {\n const target = evt.target as HTMLInputElement;\n\n if (!app.session.user) {\n app.modal.show(LogInModal);\n target.checked = false;\n return;\n }\n\n const optionIds = this.pendingOptions || new Set(this.poll.myVotes().map((v: PollVote) => v.option()!.id()!));\n const isUnvoting = optionIds.delete(option.id()!);\n const allowsMultiple = this.poll.allowMultipleVotes();\n\n if (!allowsMultiple) {\n optionIds.clear();\n }\n\n if (!isUnvoting) {\n optionIds.add(option.id()!);\n }\n\n this.pendingOptions = optionIds.size ? optionIds : null;\n this.pendingSubmit = !!this.pendingOptions;\n\n if (this.useSubmitUI) {\n this.pendingOptions = optionIds.size ? optionIds : null;\n this.pendingSubmit = !!this.pendingOptions;\n m.redraw();\n return;\n }\n\n this.submit(optionIds, null, () => (target.checked = isUnvoting));\n }\n\n hasSelectedOptions(): boolean {\n return this.pendingSubmit;\n }\n\n onsubmit(): Promise {\n return this.submit(this.pendingOptions!, () => {\n this.pendingOptions = null;\n this.pendingSubmit = false;\n });\n }\n\n submit(optionIds: Set, cb: Function | null, onerror: Function | null = null) {\n this.loadingOptions = true;\n m.redraw();\n\n return app\n .request({\n method: 'PATCH',\n url: `${app.forum.attribute('apiUrl')}/fof/polls/${this.poll.id()}/votes`,\n body: {\n data: {\n optionIds: Array.from(optionIds),\n },\n },\n })\n .then((res: ApiPayloadSingle) => {\n app.store.pushPayload(res);\n cb?.();\n })\n .catch((err) => {\n onerror?.(err);\n })\n .finally(() => {\n this.loadingOptions = false;\n this.canSeeVoteCount = typeof this.poll.voteCount() === 'number';\n m.redraw();\n });\n }\n\n showVoters = () => {\n // Load all the votes only when opening the votes list\n app.modal.show(ListVotersModal, {\n poll: this.poll,\n });\n };\n}\n","import PollFormState from './PollFormState';\nimport PollListState from './PollListState';\nimport PollState from './PollState';\n\nexport const states = {\n PollFormState,\n PollListState,\n PollState,\n};\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Poll from '../models/Poll';\nimport Component from 'flarum/common/Component';\nimport ComposePollPage from '../components/ComposePollPage';\nimport PollsPage from '../components/PollsPage';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Separator from 'flarum/common/components/Separator';\nimport Button from 'flarum/common/components/Button';\n\n/**\n * The `UserControls` utility constructs a list of buttons for a user which\n * perform actions on it.\n */\nexport default {\n /**\n * Get a list of controls for a user.\n */\n controls(poll: Poll, context: Component): ItemList {\n const items = new ItemList();\n\n ['poll', 'moderation', 'destructive'].forEach((section) => {\n const controls = (this[section + 'Controls'](poll, context) as ItemList).toArray();\n if (controls.length) {\n controls.forEach((item) => items.add(item.itemName, item));\n items.add(section + 'Separator', );\n }\n });\n\n return items;\n },\n\n /**\n * Get controls for direct modifcation actions on polls (e.g. vote, view voters).\n */\n pollControls(poll: Poll, context: Component): ItemList {\n const items = new ItemList();\n\n return items;\n },\n\n /**\n * Get controls for a user pertaining to moderation (e.g. suspend, edit).\n */\n moderationControls(poll: Poll, context: Component): ItemList {\n const items = new ItemList();\n\n if (poll.canEdit()) {\n items.add(\n 'edit',\n \n );\n }\n\n return items;\n },\n\n /**\n * Get controls for a user which are destructive (e.g. delete).\n * @protected\n */\n destructiveControls(poll: Poll, context: Component): ItemList {\n const items = new ItemList();\n\n if (poll.canDelete()) {\n items.add(\n 'delete',\n \n );\n }\n\n return items;\n },\n\n /**\n * Delete the poll.\n */\n async deleteAction(poll: Poll): Promise {\n if (!confirm(app.translator.trans(`fof-polls.forum.poll_controls.delete_confirmation`) as string)) {\n return;\n }\n\n return poll\n .delete()\n .then(() => {\n this.showDeletionAlert(poll, 'success');\n if (app.current.matches(ComposePollPage, { id: poll.id() }) || app.current.matches(PollsPage, { id: poll.id() })) {\n app.history.back();\n } else {\n window.location.reload();\n }\n })\n .catch(() => this.showDeletionAlert(poll, 'error'));\n },\n\n /**\n * Show deletion alert of poll\n */\n showDeletionAlert(poll: Poll, type: string): void {\n const message = {\n success: `fof-polls.forum.poll_controls.delete_success_message`,\n error: `fof-polls.forum.poll_controls.delete_error_message`,\n }[type]!;\n\n app.alerts.show({ type }, app.translator.trans(message, { poll: poll }));\n },\n\n /**\n * Edit the poll.\n */\n editAction(poll: Poll): void {\n m.route.set(app.route('fof.polls.compose', { id: poll.id() }));\n },\n};\n","import PollControls from './PollControls';\n\nexport const utils = {\n PollControls,\n};\n","module.exports = flarum.core.compat['common/Component'];","module.exports = flarum.core.compat['common/Model'];","module.exports = flarum.core.compat['common/components/Badge'];","module.exports = flarum.core.compat['common/components/Button'];","module.exports = flarum.core.compat['common/components/Dropdown'];","module.exports = flarum.core.compat['common/components/Link'];","module.exports = flarum.core.compat['common/components/LinkButton'];","module.exports = flarum.core.compat['common/components/LoadingIndicator'];","module.exports = flarum.core.compat['common/components/Modal'];","module.exports = flarum.core.compat['common/components/Page'];","module.exports = flarum.core.compat['common/components/Placeholder'];","module.exports = flarum.core.compat['common/components/SelectDropdown'];","module.exports = flarum.core.compat['common/components/Separator'];","module.exports = flarum.core.compat['common/components/Switch'];","module.exports = flarum.core.compat['common/components/Tooltip'];","module.exports = flarum.core.compat['common/extend'];","module.exports = flarum.core.compat['common/extenders'];","module.exports = flarum.core.compat['common/helpers/avatar'];","module.exports = flarum.core.compat['common/helpers/highlight'];","module.exports = flarum.core.compat['common/helpers/icon'];","module.exports = flarum.core.compat['common/helpers/listItems'];","module.exports = flarum.core.compat['common/helpers/username'];","module.exports = flarum.core.compat['common/models/Discussion'];","module.exports = flarum.core.compat['common/models/Forum'];","module.exports = flarum.core.compat['common/models/Post'];","module.exports = flarum.core.compat['common/states/PaginatedListState'];","module.exports = flarum.core.compat['common/utils/EventEmitter'];","module.exports = flarum.core.compat['common/utils/ItemList'];","module.exports = flarum.core.compat['common/utils/RequestError'];","module.exports = flarum.core.compat['common/utils/Stream'];","module.exports = flarum.core.compat['common/utils/SubtreeRetainer'];","module.exports = flarum.core.compat['common/utils/abbreviateNumber'];","module.exports = flarum.core.compat['common/utils/classList'];","module.exports = flarum.core.compat['common/utils/computed'];","module.exports = flarum.core.compat['common/utils/extractText'];","module.exports = flarum.core.compat['common/utils/string'];","module.exports = flarum.core.compat['forum/app'];","module.exports = flarum.core.compat['forum/components/CommentPost'];","module.exports = flarum.core.compat['forum/components/DiscussionComposer'];","module.exports = flarum.core.compat['forum/components/DiscussionList'];","module.exports = flarum.core.compat['forum/components/DiscussionPage'];","module.exports = flarum.core.compat['forum/components/IndexPage'];","module.exports = flarum.core.compat['forum/components/LogInModal'];","module.exports = flarum.core.compat['forum/components/ReplyComposer'];","module.exports = flarum.core.compat['forum/utils/PostControls'];","module.exports = flarum.core.compat['forum/utils/slidable'];","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _regeneratorRuntime() {\n \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */\n module.exports = _regeneratorRuntime = function _regeneratorRuntime() {\n return e;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n var t,\n e = {},\n r = Object.prototype,\n n = r.hasOwnProperty,\n o = Object.defineProperty || function (t, e, r) {\n t[e] = r.value;\n },\n i = \"function\" == typeof Symbol ? Symbol : {},\n a = i.iterator || \"@@iterator\",\n c = i.asyncIterator || \"@@asyncIterator\",\n u = i.toStringTag || \"@@toStringTag\";\n function define(t, e, r) {\n return Object.defineProperty(t, e, {\n value: r,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), t[e];\n }\n try {\n define({}, \"\");\n } catch (t) {\n define = function define(t, e, r) {\n return t[e] = r;\n };\n }\n function wrap(t, e, r, n) {\n var i = e && e.prototype instanceof Generator ? e : Generator,\n a = Object.create(i.prototype),\n c = new Context(n || []);\n return o(a, \"_invoke\", {\n value: makeInvokeMethod(t, r, c)\n }), a;\n }\n function tryCatch(t, e, r) {\n try {\n return {\n type: \"normal\",\n arg: t.call(e, r)\n };\n } catch (t) {\n return {\n type: \"throw\",\n arg: t\n };\n }\n }\n e.wrap = wrap;\n var h = \"suspendedStart\",\n l = \"suspendedYield\",\n f = \"executing\",\n s = \"completed\",\n y = {};\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n var p = {};\n define(p, a, function () {\n return this;\n });\n var d = Object.getPrototypeOf,\n v = d && d(d(values([])));\n v && v !== r && n.call(v, a) && (p = v);\n var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);\n function defineIteratorMethods(t) {\n [\"next\", \"throw\", \"return\"].forEach(function (e) {\n define(t, e, function (t) {\n return this._invoke(e, t);\n });\n });\n }\n function AsyncIterator(t, e) {\n function invoke(r, o, i, a) {\n var c = tryCatch(t[r], t, o);\n if (\"throw\" !== c.type) {\n var u = c.arg,\n h = u.value;\n return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) {\n invoke(\"next\", t, i, a);\n }, function (t) {\n invoke(\"throw\", t, i, a);\n }) : e.resolve(h).then(function (t) {\n u.value = t, i(u);\n }, function (t) {\n return invoke(\"throw\", t, i, a);\n });\n }\n a(c.arg);\n }\n var r;\n o(this, \"_invoke\", {\n value: function value(t, n) {\n function callInvokeWithMethodAndArg() {\n return new e(function (e, r) {\n invoke(t, n, e, r);\n });\n }\n return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n }\n });\n }\n function makeInvokeMethod(e, r, n) {\n var o = h;\n return function (i, a) {\n if (o === f) throw new Error(\"Generator is already running\");\n if (o === s) {\n if (\"throw\" === i) throw a;\n return {\n value: t,\n done: !0\n };\n }\n for (n.method = i, n.arg = a;;) {\n var c = n.delegate;\n if (c) {\n var u = maybeInvokeDelegate(c, n);\n if (u) {\n if (u === y) continue;\n return u;\n }\n }\n if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) {\n if (o === h) throw o = s, n.arg;\n n.dispatchException(n.arg);\n } else \"return\" === n.method && n.abrupt(\"return\", n.arg);\n o = f;\n var p = tryCatch(e, r, n);\n if (\"normal\" === p.type) {\n if (o = n.done ? s : l, p.arg === y) continue;\n return {\n value: p.arg,\n done: n.done\n };\n }\n \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg);\n }\n };\n }\n function maybeInvokeDelegate(e, r) {\n var n = r.method,\n o = e.iterator[n];\n if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y;\n var i = tryCatch(o, e.iterator, r.arg);\n if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y;\n var a = i.arg;\n return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y);\n }\n function pushTryEntry(t) {\n var e = {\n tryLoc: t[0]\n };\n 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);\n }\n function resetTryEntry(t) {\n var e = t.completion || {};\n e.type = \"normal\", delete e.arg, t.completion = e;\n }\n function Context(t) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }], t.forEach(pushTryEntry, this), this.reset(!0);\n }\n function values(e) {\n if (e || \"\" === e) {\n var r = e[a];\n if (r) return r.call(e);\n if (\"function\" == typeof e.next) return e;\n if (!isNaN(e.length)) {\n var o = -1,\n i = function next() {\n for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;\n return next.value = t, next.done = !0, next;\n };\n return i.next = i;\n }\n }\n throw new TypeError(_typeof(e) + \" is not iterable\");\n }\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", {\n value: GeneratorFunctionPrototype,\n configurable: !0\n }), o(GeneratorFunctionPrototype, \"constructor\", {\n value: GeneratorFunction,\n configurable: !0\n }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) {\n var e = \"function\" == typeof t && t.constructor;\n return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name));\n }, e.mark = function (t) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t;\n }, e.awrap = function (t) {\n return {\n __await: t\n };\n }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {\n return this;\n }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {\n void 0 === i && (i = Promise);\n var a = new AsyncIterator(wrap(t, r, n, o), i);\n return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {\n return t.done ? t.value : a.next();\n });\n }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () {\n return this;\n }), define(g, \"toString\", function () {\n return \"[object Generator]\";\n }), e.keys = function (t) {\n var e = Object(t),\n r = [];\n for (var n in e) r.push(n);\n return r.reverse(), function next() {\n for (; r.length;) {\n var t = r.pop();\n if (t in e) return next.value = t, next.done = !1, next;\n }\n return next.done = !0, next;\n };\n }, e.values = values, Context.prototype = {\n constructor: Context,\n reset: function reset(e) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);\n },\n stop: function stop() {\n this.done = !0;\n var t = this.tryEntries[0].completion;\n if (\"throw\" === t.type) throw t.arg;\n return this.rval;\n },\n dispatchException: function dispatchException(e) {\n if (this.done) throw e;\n var r = this;\n function handle(n, o) {\n return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o;\n }\n for (var o = this.tryEntries.length - 1; o >= 0; --o) {\n var i = this.tryEntries[o],\n a = i.completion;\n if (\"root\" === i.tryLoc) return handle(\"end\");\n if (i.tryLoc <= this.prev) {\n var c = n.call(i, \"catchLoc\"),\n u = n.call(i, \"finallyLoc\");\n if (c && u) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n } else if (c) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n } else {\n if (!u) throw new Error(\"try statement without catch or finally\");\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(t, e) {\n for (var r = this.tryEntries.length - 1; r >= 0; --r) {\n var o = this.tryEntries[r];\n if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) {\n var i = o;\n break;\n }\n }\n i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);\n var a = i ? i.completion : {};\n return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a);\n },\n complete: function complete(t, e) {\n if (\"throw\" === t.type) throw t.arg;\n return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y;\n },\n finish: function finish(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;\n }\n },\n \"catch\": function _catch(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.tryLoc === t) {\n var n = r.completion;\n if (\"throw\" === n.type) {\n var o = n.arg;\n resetTryEntry(r);\n }\n return o;\n }\n }\n throw new Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(e, r, n) {\n return this.delegate = {\n iterator: values(e),\n resultName: r,\n nextLoc: n\n }, \"next\" === this.method && (this.arg = t), y;\n }\n }, e;\n}\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","// TODO(Babel 8): Remove this file.\n\nvar runtime = require(\"../helpers/regeneratorRuntime\")();\nmodule.exports = runtime;\n\n// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\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 if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\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 function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n _next(undefined);\n });\n };\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nimport isNativeReflectConstruct from \"./isNativeReflectConstruct.js\";\nexport default function _construct(t, e, r) {\n if (isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);\n var o = [null];\n o.push.apply(o, e);\n var p = new (t.bind.apply(t, o))();\n return r && setPrototypeOf(p, r.prototype), p;\n}","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);\n }\n}\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","export default function _isNativeFunction(fn) {\n try {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n } catch (e) {\n return typeof fn === \"function\";\n }\n}","export default function _isNativeReflectConstruct() {\n try {\n var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n } catch (t) {}\n return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {\n return !!t;\n })();\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import _typeof from \"./typeof.js\";\nexport default function toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : String(i);\n}","export default function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}","import getPrototypeOf from \"./getPrototypeOf.js\";\nimport setPrototypeOf from \"./setPrototypeOf.js\";\nimport isNativeFunction from \"./isNativeFunction.js\";\nimport construct from \"./construct.js\";\nexport default function _wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n _cache.set(Class, Wrapper);\n }\n function Wrapper() {\n return construct(Class, arguments, getPrototypeOf(this).constructor);\n }\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return setPrototypeOf(Wrapper, Class);\n };\n return _wrapNativeSuper(Class);\n}","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};"],"names":["app","extend","classList","DiscussionComposer","ReplyComposer","CreatePollModal","toPoll","data","poll","store","createRecord","tempOptions","options","map","option","pollOption","pushAttributes","addToComposer","composer","prototype","addPoll","_this","modal","show","fields","onsubmit","items","_this$composer$body","_discussion$canStartP","discussion","body","attrs","canStartPoll","forum","canStartPolls","add","m","className","onclick","bind","translator","trans","Badge","DiscussionList","Discussion","params","include","push","badges","hasPoll","component","type","label","icon","IndexPage","LinkButton","addNavItem","attribute","href","route","showAllGlobalPolls","CommentPost","PollView","DiscussionPage","content","post","isHidden","revealContent","polls","_iterator","_createForOfIteratorHelperLoose","_step","done","value","subtree","check","checks","_poll$data","_poll$options$map","_poll$options","_poll$myVotes$map","_poll$myVotes","attributes","call","_option$data","myVotes","vote","_vote$option","id","JSON","stringify","pusher","then","binding","channels","main","getById","voteCount","changedOptions","optionId","undefined","redraw","unbind","PostControls","Button","createPoll","save","_extends","relationships","_post$rawRelationship","rawRelationship","Page","ItemList","LoadingIndicator","listItems","SelectDropdown","IndexPageHero","AbstractPollPage","_Page","_inheritsLoose","_len","arguments","length","args","Array","_key","apply","concat","loading","_proto","view","pageContent","toArray","hero","mainContent","sidebar","contentItems","sidebarItems","setContent","buttonClassName","accessibleToggleLabel","navItems","initializers","has","remove","key","toObject","startsWith","Component","ComposePollHero","_Component","oninit","vnode","controlItems","itemClassName","exists","default","PollForm","PollFormState","ComposePollPage","_this2","_this$poll","_this$poll2","set","editId","param","find","item","_this2$poll","setTitle","createNewPoll","history","bodyClass","_onsubmit","_asyncToGenerator","_regeneratorRuntime","mark","_callee","state","isNew","alertAttrs","alertId","wrap","_callee$","_context","prev","next","controls","alerts","setTimeout","dismiss","stop","_x","_x2","Modal","_Modal","title","onFormSubmit","_onFormSubmit","hide","EditPollModal","_CreatePollModal","avatar","username","Link","ListVotersModal","optionContent","opt","votes","filter","v","optionAnswer","voteContent","answer","user","PollImage","imageUrl","imageAlt","imageItems","_this$imageAlt","src","alt","PollListItem","Placeholder","PollList","getParams","isLoading","isInitialLoading","isLoadingNext","hasNext","loadNext","isEmpty","text","isSearchResults","getPages","pg","SubtreeRetainer","Dropdown","highlight","slidable","abbreviateNumber","PollControls","PollViewPage","highlightRegExp","freshness","time","session","markedAllAsReadAt","getTime","active","elementAttrs","Slidable","window","controlsView","contentView","slidableUnderneathView","menuClassName","isUnread","disabled","markAsRead","mainView","question","subtitle","infoItems","oncreate","slidableInstance","element","$","on","reset","onbeforeupdate","needsRebuild","current","matches","lastVotedNumber","hasEnded","activeView","endDate","dayjs","fromNow","count","Tooltip","PollOption","name","hasVoted","totalVotes","voted","canSeeVoteCount","percent","Math","round","_this$poll$myVotes","overallVoteCount","hasVotedFor","isDisabled","loadingOptions","canChangeVote","width","Number","bar","style","showCheckMarks","checked","onchange","changeVote","optionDisplayItems","onremove","hideOptionTooltip","tooltipVisible","updateVisibility","PollOptions","pollOptions","forEach","createOptionView","PollSubmitButton","event","pollButtonSubmit","hasSelectedOptions","PollSubtitle","pollSubtitleItems","PollTitle","pollTitleItems","Switch","Stream","extractText","FormError","UploadPollImageButton","RequestError","optionAnswers","optionImageUrls","image","publicPoll","allowMultipleVotes","hideVotes","allowChangeVote","maxVotes","datepickerMinDate","_poll$tempOptions","o","formatDate","isAfter","bidi","onUpload","pollImageUploadSuccess","required","displayOptions","addOption","min","max","isBefore","deleting","i","placeholder","pollOptionImageUploadSuccess","removeOption","alert","splice","_this3","_this$dateToTimestamp","pollExists","pollImage","dateToTimestamp","preventDefault","t0","message","console","error","_delete2","_callee2","_callee2$","_context2","deleteAction","finish","_delete","date","def","dayjsDate","isValid","format","fileName","index","PollPageHero","wrapperClasses","classNames","_createClass","get","Hero","PollShowcaseItem","PollShowcase","refresh","showcaseItems","endedItems","page","PollState","slug","preventClose","e","addEventListener","removeEventListener","canEdit","showVoters","createMainView","createPollHeader","createPollContent","createPollFooter","createFormItems","getMaxVotes","showButton","questionSlug","canVote","_AbstractPollPage","LogInModal","PollListState","PollsPage","sort","viewItems","actionItems","newPollAction","PollsShowcasePage","includeParams","PostPoll","useSubmitUI","pendingSubmit","pendingOptions","_this$attrs$poll","_this$attrs$poll2","canSeeVoters","canDelete","deletePoll","viewOption","_poll$myVotes2","_poll$myVotes3","_poll$myVotes4","some","showCheckmark","evt","_this$attrs$poll$myVo","_this$attrs$poll$myVo2","target","optionIds","Set","isUnvoting","allowsMultiple","clear","size","submit","cb","onerror","request","method","url","from","res","pushPayload","err","confirm","sync","_Button","uploadedImageUrl","$input","getImageUrl","children","upload","appendTo","trigger","FormData","append","files","resourceUrl","serialize","raw","success","failure","_this$attrs$option","_this$attrs$option2","response","_this$attrs$onUpload","_this$attrs","_this$$input","fileUrl","_this$$input2","_Error","props","_wrapNativeSuper","Error","components","Extend","Post","Forum","Poll","PollVote","Routes","Store","Model","hasMany","addDiscussionBadge","addComposerItems","addPollsToPost","addPostControls","computed","_Model","transformDate","isGlobal","hiddenAt","apiEndpoint","hasOne","result","pollId","models","expandedGroup","isExpanded","groupKey","expand","_save","sent","PaginatedListState","EventEmitter","globalEventEmitter","_PaginatedListState","extraPolls","eventEmitter","_assertThisInitialized","requestParams","_this$params$sort","sortMap","q","loadPage","preloadedPolls","preloadedApiDocument","initialLoading","Promise","resolve","relevance","newest","oldest","removePoll","emit","pages","indexOf","unshift","getAllItems","number","init","isShowResult","states","Separator","context","section","itemName","pollControls","moderationControls","editAction","destructiveControls","abrupt","showDeletionAlert","back","location","reload","utils","_typeof","require","module","exports","__esModule","t","r","Object","n","hasOwnProperty","defineProperty","Symbol","a","iterator","c","asyncIterator","u","toStringTag","define","enumerable","configurable","writable","Generator","create","Context","makeInvokeMethod","tryCatch","arg","h","l","f","s","y","GeneratorFunction","GeneratorFunctionPrototype","p","d","getPrototypeOf","values","g","defineIteratorMethods","_invoke","AsyncIterator","invoke","__await","callInvokeWithMethodAndArg","delegate","maybeInvokeDelegate","_sent","dispatchException","TypeError","resultName","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","isNaN","displayName","isGeneratorFunction","constructor","setPrototypeOf","__proto__","awrap","async","keys","reverse","pop","charAt","slice","rval","handle","complete","_catch","delegateYield","runtime","regeneratorRuntime","accidentalStrictMode","globalThis","Function","self","ReferenceError","asyncGeneratorStep","gen","reject","_next","_throw","info","fn","isNativeReflectConstruct","_construct","Reflect","construct","toPropertyKey","_defineProperties","descriptor","Constructor","protoProps","staticProps","assign","source","_getPrototypeOf","subClass","superClass","_isNativeFunction","toString","_isNativeReflectConstruct","Boolean","valueOf","_setPrototypeOf","toPrimitive","String","isNativeFunction","Class","_cache","Map","Wrapper"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.js","mappings":";0BAAA,IAAIA,EAAUC,EAAAA,KAAAA,QACd,SAASC,IACP,aACAC,EAAOC,QAAUF,EAAsB,WACrC,OAAOG,CACT,EAAGF,EAAOC,QAAQE,YAAa,EAAMH,EAAOC,QAAiB,QAAID,EAAOC,QACxE,IAAIG,EACFF,EAAI,CAAC,EACLG,EAAIC,OAAOC,UACXC,EAAIH,EAAEI,eACNC,EAAIJ,OAAOK,gBAAkB,SAAUP,EAAGF,EAAGG,GAC3CD,EAAEF,GAAKG,EAAEO,KACX,EACAC,EAAI,mBAAqBC,OAASA,OAAS,CAAC,EAC5CC,EAAIF,EAAEG,UAAY,aAClBC,EAAIJ,EAAEK,eAAiB,kBACvBC,EAAIN,EAAEO,aAAe,gBACvB,SAASC,EAAOjB,EAAGF,EAAGG,GACpB,OAAOC,OAAOK,eAAeP,EAAGF,EAAG,CACjCU,MAAOP,EACPiB,YAAY,EACZC,cAAc,EACdC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/B,GAEJ,IqBpFMzB,EAAa,SAAC5B,GAAU,OAC5Bhb,IAAAA,MAAUgF,KAAKwU,GAAiB,CAC9BjV,SAAU,SAACnD,GAAyB,OAClCpB,IAAAA,MACGC,aAAa,SACbgB,KAAIsU,GAAC,CAAD,EAEEnU,EAAI,CACPkd,cAAe,CACbtD,KAAAA,KAGJ,CACE5Z,KAAM,CACJuH,QAAS,oCAId7P,MAAK,SAAC6G,GAAS,IAAA4e,EAId,OAF6B,OAA7BA,EAAAvD,EAAKwD,gBAAgB,WAAc,MAAnCD,EAA+BpkB,MAA/BokB,EAA+BpkB,KAAO,CAAE7C,KAAM,QAASmL,GAAI9C,EAAK8C,OAEzD9C,CACT,GAAE,GACN,GAEJoa,EAAAA,EAAAA,QAAO0E,KAAc,sBAAsB,SAAU7b,EAAOoY,IAErDA,EAAKlL,YAAckL,EAAK5G,gBAC3BxR,EAAME,IACJ,UACA/B,EAAC+D,IAAM,CAAC9B,KAAK,cAAc+B,QAAS6X,EAAW1e,KAAKjG,KAAM+iB,IACvDhb,IAAAA,WAAewC,MAAM,mCAI9B,KCxCAuX,EAAAA,EAAAA,QAAOvU,KAAAA,UAAqB,YAAY,SAAC5C,GAClC5C,IAAAA,MAAU0D,UAAmB,wBAIlCd,EAAME,IACJ,qBACAC,IAAAA,UACE,CACEG,KAAMlD,IAAAA,MAAU,sBAChBgD,KAAM,eAERhD,IAAAA,WAAewC,MAAM,6BAEvB,IAGyBxC,IAAAA,MAAU0D,UAAmB,wBAGtDd,EAAME,IACJ,iBACAC,IAAAA,UACE,CACEG,KAAMlD,IAAAA,MAAU,kBAChBgD,KAAM,eAERhD,IAAAA,WAAewC,MAAM,iCAEvB,IAGN,GFnBF","sources":["webpack://@fof/polls/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/typeof.js","webpack://@fof/polls/./node_modules/@babel/runtime/regenerator/index.js","webpack://@fof/polls/webpack/bootstrap","webpack://@fof/polls/webpack/runtime/compat get default export","webpack://@fof/polls/webpack/runtime/define property getters","webpack://@fof/polls/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/polls/webpack/runtime/make namespace object","webpack://@fof/polls/external root \"flarum.core.compat['forum/app']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/extend']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Badge']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/DiscussionList']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/models/Discussion']\"","webpack://@fof/polls/./src/forum/addDiscussionBadge.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/classList']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/DiscussionComposer']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/ReplyComposer']\"","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Switch']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/extractText']\"","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/isNativeFunction.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/construct.js","webpack://@fof/polls/./src/forum/components/form/FormError.tsx","webpack://@fof/polls/./src/forum/states/PollFormState.ts","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Page']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/LinkButton']\"","webpack://@fof/polls/./src/forum/components/ComposePollHero.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/listItems']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/SelectDropdown']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/IndexPage']\"","webpack://@fof/polls/./src/forum/components/ComposePollPage.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/SubtreeRetainer']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Dropdown']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Link']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/highlight']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/utils/slidable']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/abbreviateNumber']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Tooltip']\"","webpack://@fof/polls/./src/forum/components/Poll/PollOption.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollOptions.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollImage.tsx","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/LogInModal']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/avatar']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/username']\"","webpack://@fof/polls/./src/forum/components/ListVotersModal.tsx","webpack://@fof/polls/./src/forum/states/PollState.ts","webpack://@fof/polls/./src/forum/components/Poll/PollSubmitButton.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/string']\"","webpack://@fof/polls/./src/forum/components/Poll/PollTitle.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollSubtitle.tsx","webpack://@fof/polls/./src/forum/components/PollView.tsx","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/createClass.js","webpack://@fof/polls/./src/forum/components/PollPageHero.tsx","webpack://@fof/polls/./src/forum/components/AbstractPollPage.tsx","webpack://@fof/polls/./src/forum/components/PollViewPage.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollListItem.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Placeholder']\"","webpack://@fof/polls/./src/forum/components/Poll/PollList.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/states/PaginatedListState']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/EventEmitter']\"","webpack://@fof/polls/./src/forum/states/PollListState.ts","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","webpack://@fof/polls/./src/forum/components/PollsPage.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Separator']\"","webpack://@fof/polls/./src/forum/utils/PollControls.tsx","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@fof/polls/./src/forum/components/UploadPollImageButton.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/RequestError']\"","webpack://@fof/polls/./src/forum/components/PollForm.tsx","webpack://@fof/polls/./src/forum/components/CreatePollModal.tsx","webpack://@fof/polls/./src/forum/addComposerItems.tsx","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/CommentPost']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/DiscussionPage']\"","webpack://@fof/polls/./src/forum/addPollsToPost.tsx","webpack://@fof/polls/external root \"flarum.core.compat['forum/utils/PostControls']\"","webpack://@fof/polls/./src/forum/components/EditPollModal.tsx","webpack://@fof/polls/./src/forum/components/PostPoll.tsx","webpack://@fof/polls/./src/forum/components/PollShowcaseItem.tsx","webpack://@fof/polls/./src/forum/components/PollShowcase.tsx","webpack://@fof/polls/./src/forum/components/PollsShowcasePage.tsx","webpack://@fof/polls/./src/forum/components/index.ts","webpack://@fof/polls/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/computed']\"","webpack://@fof/polls/./src/forum/models/Poll.ts","webpack://@fof/polls/./src/forum/models/PollOption.ts","webpack://@fof/polls/./src/forum/models/PollVote.ts","webpack://@fof/polls/./src/forum/models/index.ts","webpack://@fof/polls/./src/forum/states/index.ts","webpack://@fof/polls/./src/forum/utils/index.ts","webpack://@fof/polls/external root \"flarum.core.compat['common/extenders']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/models/Post']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/models/Forum']\"","webpack://@fof/polls/./src/forum/extend.ts","webpack://@fof/polls/./src/forum/index.ts","webpack://@fof/polls/./src/forum/addPostControls.tsx","webpack://@fof/polls/./src/forum/addNavItem.ts"],"sourcesContent":["var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _regeneratorRuntime() {\n \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */\n module.exports = _regeneratorRuntime = function _regeneratorRuntime() {\n return e;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n var t,\n e = {},\n r = Object.prototype,\n n = r.hasOwnProperty,\n o = Object.defineProperty || function (t, e, r) {\n t[e] = r.value;\n },\n i = \"function\" == typeof Symbol ? Symbol : {},\n a = i.iterator || \"@@iterator\",\n c = i.asyncIterator || \"@@asyncIterator\",\n u = i.toStringTag || \"@@toStringTag\";\n function define(t, e, r) {\n return Object.defineProperty(t, e, {\n value: r,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), t[e];\n }\n try {\n define({}, \"\");\n } catch (t) {\n define = function define(t, e, r) {\n return t[e] = r;\n };\n }\n function wrap(t, e, r, n) {\n var i = e && e.prototype instanceof Generator ? e : Generator,\n a = Object.create(i.prototype),\n c = new Context(n || []);\n return o(a, \"_invoke\", {\n value: makeInvokeMethod(t, r, c)\n }), a;\n }\n function tryCatch(t, e, r) {\n try {\n return {\n type: \"normal\",\n arg: t.call(e, r)\n };\n } catch (t) {\n return {\n type: \"throw\",\n arg: t\n };\n }\n }\n e.wrap = wrap;\n var h = \"suspendedStart\",\n l = \"suspendedYield\",\n f = \"executing\",\n s = \"completed\",\n y = {};\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n var p = {};\n define(p, a, function () {\n return this;\n });\n var d = Object.getPrototypeOf,\n v = d && d(d(values([])));\n v && v !== r && n.call(v, a) && (p = v);\n var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);\n function defineIteratorMethods(t) {\n [\"next\", \"throw\", \"return\"].forEach(function (e) {\n define(t, e, function (t) {\n return this._invoke(e, t);\n });\n });\n }\n function AsyncIterator(t, e) {\n function invoke(r, o, i, a) {\n var c = tryCatch(t[r], t, o);\n if (\"throw\" !== c.type) {\n var u = c.arg,\n h = u.value;\n return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) {\n invoke(\"next\", t, i, a);\n }, function (t) {\n invoke(\"throw\", t, i, a);\n }) : e.resolve(h).then(function (t) {\n u.value = t, i(u);\n }, function (t) {\n return invoke(\"throw\", t, i, a);\n });\n }\n a(c.arg);\n }\n var r;\n o(this, \"_invoke\", {\n value: function value(t, n) {\n function callInvokeWithMethodAndArg() {\n return new e(function (e, r) {\n invoke(t, n, e, r);\n });\n }\n return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n }\n });\n }\n function makeInvokeMethod(e, r, n) {\n var o = h;\n return function (i, a) {\n if (o === f) throw new Error(\"Generator is already running\");\n if (o === s) {\n if (\"throw\" === i) throw a;\n return {\n value: t,\n done: !0\n };\n }\n for (n.method = i, n.arg = a;;) {\n var c = n.delegate;\n if (c) {\n var u = maybeInvokeDelegate(c, n);\n if (u) {\n if (u === y) continue;\n return u;\n }\n }\n if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) {\n if (o === h) throw o = s, n.arg;\n n.dispatchException(n.arg);\n } else \"return\" === n.method && n.abrupt(\"return\", n.arg);\n o = f;\n var p = tryCatch(e, r, n);\n if (\"normal\" === p.type) {\n if (o = n.done ? s : l, p.arg === y) continue;\n return {\n value: p.arg,\n done: n.done\n };\n }\n \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg);\n }\n };\n }\n function maybeInvokeDelegate(e, r) {\n var n = r.method,\n o = e.iterator[n];\n if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y;\n var i = tryCatch(o, e.iterator, r.arg);\n if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y;\n var a = i.arg;\n return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y);\n }\n function pushTryEntry(t) {\n var e = {\n tryLoc: t[0]\n };\n 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);\n }\n function resetTryEntry(t) {\n var e = t.completion || {};\n e.type = \"normal\", delete e.arg, t.completion = e;\n }\n function Context(t) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }], t.forEach(pushTryEntry, this), this.reset(!0);\n }\n function values(e) {\n if (e || \"\" === e) {\n var r = e[a];\n if (r) return r.call(e);\n if (\"function\" == typeof e.next) return e;\n if (!isNaN(e.length)) {\n var o = -1,\n i = function next() {\n for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;\n return next.value = t, next.done = !0, next;\n };\n return i.next = i;\n }\n }\n throw new TypeError(_typeof(e) + \" is not iterable\");\n }\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", {\n value: GeneratorFunctionPrototype,\n configurable: !0\n }), o(GeneratorFunctionPrototype, \"constructor\", {\n value: GeneratorFunction,\n configurable: !0\n }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) {\n var e = \"function\" == typeof t && t.constructor;\n return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name));\n }, e.mark = function (t) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t;\n }, e.awrap = function (t) {\n return {\n __await: t\n };\n }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {\n return this;\n }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {\n void 0 === i && (i = Promise);\n var a = new AsyncIterator(wrap(t, r, n, o), i);\n return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {\n return t.done ? t.value : a.next();\n });\n }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () {\n return this;\n }), define(g, \"toString\", function () {\n return \"[object Generator]\";\n }), e.keys = function (t) {\n var e = Object(t),\n r = [];\n for (var n in e) r.push(n);\n return r.reverse(), function next() {\n for (; r.length;) {\n var t = r.pop();\n if (t in e) return next.value = t, next.done = !1, next;\n }\n return next.done = !0, next;\n };\n }, e.values = values, Context.prototype = {\n constructor: Context,\n reset: function reset(e) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);\n },\n stop: function stop() {\n this.done = !0;\n var t = this.tryEntries[0].completion;\n if (\"throw\" === t.type) throw t.arg;\n return this.rval;\n },\n dispatchException: function dispatchException(e) {\n if (this.done) throw e;\n var r = this;\n function handle(n, o) {\n return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o;\n }\n for (var o = this.tryEntries.length - 1; o >= 0; --o) {\n var i = this.tryEntries[o],\n a = i.completion;\n if (\"root\" === i.tryLoc) return handle(\"end\");\n if (i.tryLoc <= this.prev) {\n var c = n.call(i, \"catchLoc\"),\n u = n.call(i, \"finallyLoc\");\n if (c && u) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n } else if (c) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n } else {\n if (!u) throw new Error(\"try statement without catch or finally\");\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(t, e) {\n for (var r = this.tryEntries.length - 1; r >= 0; --r) {\n var o = this.tryEntries[r];\n if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) {\n var i = o;\n break;\n }\n }\n i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);\n var a = i ? i.completion : {};\n return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a);\n },\n complete: function complete(t, e) {\n if (\"throw\" === t.type) throw t.arg;\n return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y;\n },\n finish: function finish(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;\n }\n },\n \"catch\": function _catch(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.tryLoc === t) {\n var n = r.completion;\n if (\"throw\" === n.type) {\n var o = n.arg;\n resetTryEntry(r);\n }\n return o;\n }\n }\n throw new Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(e, r, n) {\n return this.delegate = {\n iterator: values(e),\n resultName: r,\n nextLoc: n\n }, \"next\" === this.method && (this.arg = t), y;\n }\n }, e;\n}\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","// TODO(Babel 8): Remove this file.\n\nvar runtime = require(\"../helpers/regeneratorRuntime\")();\nmodule.exports = runtime;\n\n// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Badge'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Discussion'];","import app from 'flarum/forum/app';\n\nimport { extend } from 'flarum/common/extend';\nimport Badge from 'flarum/common/components/Badge';\nimport DiscussionList from 'flarum/forum/components/DiscussionList';\nimport Discussion from 'flarum/common/models/Discussion';\nimport { PaginatedListRequestParams } from 'flarum/common/states/PaginatedListState';\n\nexport default () => {\n // @ts-ignore\n extend(DiscussionList.prototype, 'requestParams', (params: PaginatedListRequestParams) => {\n (params.include as string[]).push('poll');\n });\n\n extend(Discussion.prototype, 'badges', function (badges) {\n // @ts-ignore\n if (this.hasPoll()) {\n badges.add(\n 'poll',\n Badge.component({\n type: 'poll',\n label: app.translator.trans('fof-polls.forum.tooltip.badge'),\n icon: 'fas fa-poll',\n }),\n 5\n );\n }\n });\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/classList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionComposer'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/ReplyComposer'];","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 if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\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 function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n _next(undefined);\n });\n };\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extractText'];","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}","export default function _isNativeReflectConstruct() {\n try {\n var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n } catch (t) {}\n return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {\n return !!t;\n })();\n}","import getPrototypeOf from \"./getPrototypeOf.js\";\nimport setPrototypeOf from \"./setPrototypeOf.js\";\nimport isNativeFunction from \"./isNativeFunction.js\";\nimport construct from \"./construct.js\";\nexport default function _wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n _cache.set(Class, Wrapper);\n }\n function Wrapper() {\n return construct(Class, arguments, getPrototypeOf(this).constructor);\n }\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return setPrototypeOf(Wrapper, Class);\n };\n return _wrapNativeSuper(Class);\n}","export default function _isNativeFunction(fn) {\n try {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n } catch (e) {\n return typeof fn === \"function\";\n }\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nimport isNativeReflectConstruct from \"./isNativeReflectConstruct.js\";\nexport default function _construct(t, e, r) {\n if (isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);\n var o = [null];\n o.push.apply(o, e);\n var p = new (t.bind.apply(t, o))();\n return r && setPrototypeOf(p, r.prototype), p;\n}","import { NestedStringArray } from '@askvortsov/rich-icu-message-formatter';\n\nexport default class FormError extends Error {\n constructor(props: NestedStringArray | string) {\n super(props + '');\n }\n}\n","import app from 'flarum/forum/app';\nimport Poll from '../models/Poll';\nimport PollOption from '../models/PollOption';\n\nexport default class PollFormState {\n poll: Poll;\n loading: boolean;\n deleting: boolean;\n expandedGroup: string;\n\n static createNewPoll() {\n const poll = app.store.createRecord('polls');\n\n poll.pushAttributes({\n question: '',\n endDate: '',\n publicPoll: false,\n allowMultipleVotes: false,\n hideVotes: false,\n allowChangeVote: false,\n maxVotes: 0,\n });\n\n poll.tempOptions = [app.store.createRecord('poll_options'), app.store.createRecord('poll_options')];\n\n return poll;\n }\n\n constructor(poll: Poll) {\n if (!poll) {\n poll = PollFormState.createNewPoll();\n }\n\n this.loading = false;\n this.deleting = false;\n this.poll = poll;\n this.expandedGroup = 'setup';\n }\n\n isExpanded(groupKey: string) {\n return this.expandedGroup === groupKey;\n }\n\n expand(groupKey: string) {\n this.expandedGroup = groupKey;\n m.redraw();\n }\n\n async save(data: any) {\n this.loading = true;\n m.redraw();\n\n try {\n this.poll = await this.poll.save(data);\n /**\n * Cleanup attributes:\n * For the saving process, we add the options directly to the attributes.\n * As we currently cannot add new PollOptions as relationships.\n */\n delete this.poll!.data!.attributes!.options;\n } finally {\n this.loading = false;\n m.redraw();\n }\n }\n\n async delete() {\n this.loading = true;\n m.redraw();\n\n try {\n await this.poll.delete();\n this.deleting = true;\n } finally {\n this.loading = false;\n m.redraw();\n }\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Page'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","import Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport Poll from '../models/Poll';\nimport ItemList from 'flarum/common/utils/ItemList';\n\nexport interface ComposePollHeroAttrs extends ComponentAttrs {\n poll: Poll;\n}\n\nexport default class ComposePollHero extends Component {\n poll!: Poll;\n\n oninit(vnode: Mithril.Vnode): void {\n super.oninit(vnode);\n\n this.poll = this.attrs.poll;\n }\n\n view(): Mithril.Children {\n return (\n

\n
\n
\n

{app.translator.trans(`fof-polls.forum.compose.${!!this.poll.id() ? 'edit' : 'add'}_title`)}

\n
{this.controlItems().toArray()}
\n
\n
\n
\n );\n }\n\n controlItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'edit',\n \n {app.translator.trans('fof-polls.forum.compose.polls_manager')}\n \n );\n\n if (this.poll.exists) {\n items.add(\n 'view',\n \n {app.translator.trans('fof-polls.forum.compose.polls_preview')}\n \n );\n }\n\n return items;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/listItems'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/SelectDropdown'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/IndexPage'];","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Page from 'flarum/common/components/Page';\nimport Poll from '../models/Poll';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport PollForm from './PollForm';\nimport PollFormState from '../states/PollFormState';\nimport ComposePollHero from './ComposePollHero';\nimport Button from 'flarum/common/components/Button';\nimport listItems from 'flarum/common/helpers/listItems';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport SelectDropdown from 'flarum/common/components/SelectDropdown';\nimport IndexPage from 'flarum/forum/components/IndexPage';\n\nexport default class ComposePollPage extends Page {\n poll: Poll | null | undefined = null;\n\n loading: boolean = false;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n if (!app.forum.attribute('globalPollsEnabled')) {\n m.route.set('/');\n return;\n }\n\n // Get the `edit` parameter from the URL\n const editId = m.route.param('id');\n if (editId) {\n this.poll = app.store.getById('poll', editId);\n\n if (!this.poll) {\n this.loading = true;\n\n app.store.find('fof/polls', editId).then((item) => {\n this.poll = item;\n this.loading = false;\n app.setTitle(app.translator.trans(`fof-polls.forum.compose.${!!this.poll?.id() ? 'edit' : 'add'}_title`) as string);\n m.redraw();\n });\n }\n } else {\n this.poll = PollFormState.createNewPoll();\n }\n\n app.history.push('compose-poll', app.translator.trans(`fof-polls.forum.compose.${!!this.poll?.id() ? 'edit' : 'add'}_title`) as string);\n this.bodyClass = 'App--compose-poll';\n app.setTitle(app.translator.trans(`fof-polls.forum.compose.${!!this.poll?.id() ? 'edit' : 'add'}_title`) as string);\n }\n\n view(): Mithril.Children {\n // prevent users from accessing the page if they can't start global polls\n if (!app.forum.attribute('canStartGlobalPolls')) {\n m.route.set('/');\n return;\n }\n\n if (this.loading) {\n return ;\n }\n\n return (\n
\n \n
\n
\n \n
\n \n
\n
\n
\n
\n );\n }\n\n async onsubmit(data: Object, state: PollFormState) {\n const isNew = state.poll.id() === undefined;\n await state.save(data);\n\n const alertAttrs = isNew\n ? {\n type: 'success',\n controls: [\n \n m.route.set(\n app.route('fof.polls.compose', {\n id: state.poll.id(),\n })\n )\n }\n >\n {app.translator.trans('fof-polls.forum.compose.continue_editing')}\n ,\n ],\n }\n : {\n type: 'success',\n };\n\n // Show success alert\n const alertId = app.alerts.show(alertAttrs, app.translator.trans('fof-polls.forum.compose.success'));\n\n // Hide alert after 10 seconds\n setTimeout(() => app.alerts.dismiss(alertId), 10000);\n\n if (isNew) {\n m.route.set(app.route('fof.polls.list'));\n }\n }\n\n sidebarItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'nav',\n \n {this.navItems().toArray()}\n \n );\n\n return items;\n }\n\n navItems() {\n return IndexPage.prototype.navItems();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/SubtreeRetainer'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Dropdown'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Link'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/highlight'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/slidable'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/abbreviateNumber'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","import app from 'flarum/forum/app';\nimport Mithril from 'mithril';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport PollOptionModel from '../../models/PollOption';\nimport PollState from '../../states/PollState';\nimport Tooltip, { TooltipAttrs } from 'flarum/common/components/Tooltip';\nimport icon from 'flarum/common/helpers/icon';\nimport classList from 'flarum/common/utils/classList';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Poll from '../../models/Poll';\n\ninterface PollOptionAttrs extends ComponentAttrs {\n option: PollOptionModel;\n name: string;\n state: PollState;\n}\n\nexport default class PollOption extends Component {\n option!: PollOptionModel;\n name!: string;\n state!: PollState;\n hasVoted: boolean = false;\n totalVotes: number = 0;\n votes: number = 0;\n voted: boolean = false;\n poll!: Poll;\n canSeeVoteCount: boolean = false;\n answer!: string;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n this.option = this.attrs.option;\n this.name = this.attrs.name;\n this.state = this.attrs.state;\n this.poll = this.state.poll;\n\n // isNaN(null) is false, so we have to check type directly now that API always returns the field\n this.canSeeVoteCount = typeof this.votes === 'number';\n\n this.answer = this.option.answer();\n }\n\n percent(): number {\n return this.totalVotes > 0 ? Math.round((this.votes / this.totalVotes) * 100) : 0;\n }\n\n view(): Mithril.Children {\n // following values can be changed by ui interactions, so we need to update them on every render\n this.hasVoted = this.state.hasVoted();\n this.totalVotes = this.state.overallVoteCount();\n this.votes = this.option.voteCount();\n this.voted = this.state.hasVotedFor(this.option);\n\n const isDisabled = this.state.loadingOptions || (this.hasVoted && !this.poll.canChangeVote());\n const width = this.canSeeVoteCount ? this.percent() : (Number(this.voted) / (this.poll.myVotes()?.length || 1)) * 100;\n\n const bar = (\n \n );\n\n return (\n \n {this.canSeeVoteCount ? (\n \n {bar}\n \n ) : (\n bar\n )}\n \n );\n }\n\n /**\n * Attempting to use the `tooltipVisible` attr on the Tooltip component set to 'false' when no vote count\n * caused the tooltip to break on click. This is a workaround to hide the tooltip when no vote count is available,\n * called on 'onremove' of the Tooltip component. It doesn't always work as intended either, but it does the job.\n */\n hideOptionTooltip(vnode: Mithril.Vnode) {\n vnode.attrs.tooltipVisible = false;\n\n // @ts-ignore\n vnode.state.updateVisibility();\n }\n\n optionDisplayItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'answer',\n \n {this.answer}\n \n );\n\n this.voted && !this.state.showCheckMarks && items.add('check', icon('fas fa-check-circle', { className: 'PollAnswer-check' }));\n\n this.canSeeVoteCount &&\n items.add('percent', {this.percent()}%);\n\n return items;\n }\n}\n","import type Mithril from 'mithril';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport PollOption from './PollOption';\nimport PollOptionModel from '../../models/PollOption';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport PollState from '../../states/PollState';\n\ninterface PollOptionsAttrs extends ComponentAttrs {\n options: PollOptionModel[];\n name: String;\n state: PollState;\n}\n\nexport default class PollOptions extends Component {\n view(): Mithril.Children {\n return
{this.pollOptions().toArray()}
;\n }\n\n pollOptions(): ItemList {\n const items = new ItemList();\n\n this.attrs.options.forEach((option: PollOptionModel): void => {\n items.add('option' + option.id(), this.createOptionView(option));\n });\n\n return items;\n }\n\n createOptionView(option: PollOptionModel): Mithril.Children {\n return ;\n }\n}\n","import type Mithril from 'mithril';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Poll from 'src/forum/models/Poll';\nimport ItemList from 'flarum/common/utils/ItemList';\n\ninterface PollImageAttrs extends ComponentAttrs {\n poll: Poll;\n}\n\nexport default class PollImage extends Component {\n imageUrl: string | null = null;\n imageAlt: string | null = null;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.imageUrl = this.attrs.poll.imageUrl();\n this.imageAlt = this.attrs.poll.imageAlt();\n }\n\n view(): Mithril.Children {\n if (!this.imageUrl) {\n return;\n }\n\n return
{this.imageItems().toArray()}
;\n }\n\n imageItems(): ItemList {\n const items = new ItemList();\n\n items.add('image', {this.imageAlt);\n\n return items;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/LogInModal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/avatar'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/username'];","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';\nimport avatar from 'flarum/common/helpers/avatar';\nimport username from 'flarum/common/helpers/username';\nimport Link from 'flarum/common/components/Link';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport PollModel from '../models/Poll';\nimport PollVote from '../models/PollVote';\nimport User from 'flarum/common/models/User';\nimport PollOption from '../models/PollOption';\n\ninterface ListVotersModalAttrs extends IInternalModalAttrs {\n poll: PollModel;\n onsubmit: (data: object) => Promise;\n}\n\nexport default class ListVotersModal extends Modal {\n oninit(vnode: Mithril.Vnode): void {\n super.oninit(vnode);\n\n this.loading = true;\n\n app.store\n .find('fof/polls', this.attrs.poll.id()!, {\n include: 'votes,votes.user,votes.option',\n })\n .then(() => (this.loading = false))\n .finally(() => m.redraw());\n }\n\n className(): string {\n return 'Modal--medium VotesModal';\n }\n\n title(): Mithril.Children {\n return app.translator.trans('fof-polls.forum.votes_modal.title');\n }\n\n content(): Mithril.Children {\n const options = this.attrs.poll.options() as PollOption[];\n return
{this.loading ? : options.map(this.optionContent.bind(this))}
;\n }\n\n optionContent(opt: PollOption): Mithril.Children {\n const votes = (this.attrs.poll.votes() || []).filter((v) => opt.id() === v!.option()!.id()) as PollVote[];\n\n return (\n
\n

{this.optionAnswer(opt)! + ':'}

\n\n {votes.length ? (\n
{votes.map(this.voteContent.bind(this))}
\n ) : (\n

{app.translator.trans('fof-polls.forum.modal.no_voters')}

\n )}\n
\n );\n }\n\n optionAnswer(opt: PollOption): string {\n return opt.answer();\n }\n\n voteContent(vote: PollVote): Mithril.Children {\n const user = vote.user() as User;\n const attrs = user && { href: app.route.user(user) };\n\n return (\n \n {avatar(user)} {username(user)}\n \n );\n }\n}\n","import app from 'flarum/forum/app';\nimport Poll from '../models/Poll';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport PollOption from '../models/PollOption';\nimport PollVote from '../models/PollVote';\nimport ListVotersModal from '../components/ListVotersModal';\nimport { ApiPayloadSingle } from 'flarum/common/Store';\n\nexport default class PollState {\n public poll: Poll;\n protected pendingSubmit: boolean = false;\n protected pendingOptions: Set | null = null;\n public loadingOptions: boolean = false;\n public useSubmitUI: boolean;\n public showCheckMarks: boolean;\n public canSeeVoteCount: boolean;\n\n constructor(poll: Poll) {\n this.poll = poll;\n this.useSubmitUI = !poll?.canChangeVote() && poll?.allowMultipleVotes();\n this.showCheckMarks = !app.session.user || (!poll.hasEnded() && poll.canVote() && (!this.hasVoted() || poll.canChangeVote()));\n this.canSeeVoteCount = typeof poll.voteCount() === 'number';\n this.init();\n }\n\n /**\n * used as en extendable entry point for init customizations\n */\n init(): void {}\n\n isShowResult(): boolean {\n return this.poll.hasEnded() || (this.canSeeVoteCount && !!app.session.user && this.hasVoted());\n }\n\n hasVoted(): boolean {\n return this.poll.myVotes().length > 0;\n }\n\n overallVoteCount(): number {\n return this.poll.voteCount();\n }\n\n hasVotedFor(option: PollOption): boolean {\n return this.pendingOptions ? this.pendingOptions.has(option.id()!) : this.poll.myVotes().some((vote: PollVote) => vote.option() === option);\n }\n\n getMaxVotes(): number {\n const poll = this.poll;\n let maxVotes = poll.allowMultipleVotes() ? poll.maxVotes() : 1;\n if (maxVotes === 0) maxVotes = poll.options().length;\n return maxVotes;\n }\n\n showButton(): boolean {\n return this.useSubmitUI && this.pendingSubmit;\n }\n\n changeVote(option: PollOption, evt: Event): void {\n const target = evt.target as HTMLInputElement;\n\n if (!app.session.user) {\n app.modal.show(LogInModal);\n target.checked = false;\n return;\n }\n\n const optionIds = this.pendingOptions || new Set(this.poll.myVotes().map((v: PollVote) => v.option()!.id()!));\n const isUnvoting = optionIds.delete(option.id()!);\n const allowsMultiple = this.poll.allowMultipleVotes();\n\n if (!allowsMultiple) {\n optionIds.clear();\n }\n\n if (!isUnvoting) {\n optionIds.add(option.id()!);\n }\n\n this.pendingOptions = optionIds.size ? optionIds : null;\n this.pendingSubmit = !!this.pendingOptions;\n\n if (this.useSubmitUI) {\n this.pendingOptions = optionIds.size ? optionIds : null;\n this.pendingSubmit = !!this.pendingOptions;\n m.redraw();\n return;\n }\n\n this.submit(optionIds, null, () => (target.checked = isUnvoting));\n }\n\n hasSelectedOptions(): boolean {\n return this.pendingSubmit;\n }\n\n onsubmit(): Promise {\n return this.submit(this.pendingOptions!, () => {\n this.pendingOptions = null;\n this.pendingSubmit = false;\n });\n }\n\n submit(optionIds: Set, cb: Function | null, onerror: Function | null = null) {\n this.loadingOptions = true;\n m.redraw();\n\n return app\n .request({\n method: 'PATCH',\n url: `${app.forum.attribute('apiUrl')}/fof/polls/${this.poll.id()}/votes`,\n body: {\n data: {\n optionIds: Array.from(optionIds),\n },\n },\n })\n .then((res: ApiPayloadSingle) => {\n app.store.pushPayload(res);\n cb?.();\n })\n .catch((err) => {\n onerror?.(err);\n })\n .finally(() => {\n this.loadingOptions = false;\n this.canSeeVoteCount = typeof this.poll.voteCount() === 'number';\n m.redraw();\n });\n }\n\n showVoters = () => {\n // Load all the votes only when opening the votes list\n app.modal.show(ListVotersModal, {\n poll: this.poll,\n });\n };\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport PollState from '../../states/PollState';\n\ninterface PollSubmitButtonAttrs extends ComponentAttrs {\n state: PollState;\n}\n\nexport default class PollSubmitButton extends Component {\n view(): Mithril.Children {\n const state = this.attrs.state;\n return (\n this.pollButtonSubmit(state, event)}\n disabled={!state.hasSelectedOptions()}\n >\n {app.translator.trans('fof-polls.forum.poll.submit_button')}\n \n );\n }\n\n /**\n * Event handler for submit button being clicked\n */\n\n pollButtonSubmit(state: PollState, event: Event): void {\n state.onsubmit();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/string'];","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Poll from 'src/forum/models/Poll';\nimport Mithril from 'mithril';\n\nexport interface PollTitleAttrs extends ComponentAttrs {\n poll: Poll;\n}\n\nexport default class PollTitle extends Component {\n view() {\n return
{this.pollTitleItems().toArray()}
;\n }\n\n pollTitleItems(): ItemList {\n const items = new ItemList();\n\n items.add('title',

{this.attrs.poll.question()}

);\n\n return items;\n }\n}\n","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Poll from 'src/forum/models/Poll';\nimport Mithril from 'mithril';\n\nexport interface PollSubtitleAttrs extends ComponentAttrs {\n poll: Poll;\n}\n\nexport default class PollSubtitle extends Component {\n view() {\n if (!this.attrs.poll.subtitle()) {\n return;\n }\n\n return
{this.pollSubtitleItems().toArray()}
;\n }\n\n pollSubtitleItems(): ItemList {\n const items = new ItemList();\n\n items.add('subtitle',

{this.attrs.poll.subtitle()}

);\n\n return items;\n }\n}\n","import Mithril from 'mithril';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport app from 'flarum/forum/app';\nimport PollOptions from './Poll/PollOptions';\nimport PollImage from './Poll/PollImage';\nimport PollModel from '../models/Poll';\nimport PollState from '../states/PollState';\nimport Button from 'flarum/common/components/Button';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport PollControls from '../utils/PollControls';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport PollSubmitButton from './Poll/PollSubmitButton';\nimport { slug } from 'flarum/common/utils/string';\nimport classList from 'flarum/common/utils/classList';\nimport PollTitle from './Poll/PollTitle';\nimport PollSubtitle from './Poll/PollSubtitle';\n\ninterface PollAttrs extends ComponentAttrs {\n poll: PollModel;\n}\n\nexport default class PollView extends Component {\n state!: PollState;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n this.state = new PollState(this.attrs.poll);\n }\n\n oncreate(vnode: Mithril.Vnode) {\n super.oncreate(vnode);\n\n this.preventClose = this.preventClose.bind(this);\n window.addEventListener('beforeunload', this.preventClose);\n }\n\n onremove(vnode: Mithril.Vnode) {\n super.onremove(vnode);\n\n window.removeEventListener('beforeunload', this.preventClose);\n }\n\n view(): Mithril.Children {\n const poll = this.attrs.poll;\n const state = this.state;\n const controls = PollControls.controls(poll, this);\n\n (poll.publicPoll() || poll.canEdit()) &&\n controls.add(\n 'view',\n \n );\n\n return (\n
\n {this.controlsView(controls.toArray())}\n
{this.createMainView().toArray()}
\n
\n );\n }\n\n createMainView(): ItemList {\n const items = new ItemList();\n\n items.add('header',
{this.createPollHeader().toArray()}
);\n items.add('content',
{this.createPollContent().toArray()}
);\n items.add('footer',
{this.createPollFooter().toArray()}
);\n\n return items;\n }\n\n createPollHeader(): ItemList {\n const items = new ItemList();\n const poll = this.attrs.poll;\n\n items.add('title', );\n if (poll.subtitle()) items.add('subtitle', );\n\n return items;\n }\n\n createPollContent(): ItemList {\n const items = new ItemList();\n const poll = this.attrs.poll;\n\n if (poll.imageUrl()) {\n items.add('image', );\n }\n\n items.add('form',
{this.createFormItems().toArray()}
);\n\n return items;\n }\n\n createPollFooter(): ItemList {\n const items = new ItemList();\n const state = this.state;\n\n const infoItems = this.infoItems(state.getMaxVotes());\n\n items.add(\n 'sticky',\n
\n {!infoItems.isEmpty() &&
{infoItems.toArray()}
}\n {state.showButton() && }\n
\n );\n\n return items;\n }\n\n createFormItems(): ItemList {\n const items = new ItemList();\n const poll = this.attrs.poll;\n const state = this.state;\n const questionSlug = slug(poll.question());\n\n items.add(\n 'elements',\n
\n {poll.question()}\n \n
\n );\n\n return items;\n }\n\n controlsView(controls: Mithril.ChildArray): Mithril.Children {\n return (\n !!controls.length && (\n \n {controls}\n \n )\n );\n }\n\n infoItems(maxVotes: number) {\n const items = new ItemList();\n const poll = this.attrs.poll;\n\n if (app.session.user && !poll.canVote() && !poll.hasEnded()) {\n items.add(\n 'no-permission',\n \n \n {app.translator.trans('fof-polls.forum.no_permission')}\n \n );\n }\n\n if (poll.endDate()) {\n items.add(\n 'end-date',\n \n \n {poll.hasEnded()\n ? app.translator.trans('fof-polls.forum.poll_ended')\n : app.translator.trans('fof-polls.forum.days_remaining', { time: dayjs(poll.endDate()).fromNow() })}\n \n );\n }\n\n if (poll.canVote()) {\n items.add(\n 'max-votes',\n \n \n {app.translator.trans('fof-polls.forum.max_votes_allowed', { max: maxVotes })}\n \n );\n\n if (!poll.canChangeVote()) {\n items.add(\n 'cannot-change-vote',\n \n \n {app.translator.trans('fof-polls.forum.poll.cannot_change_vote')}\n \n );\n }\n }\n\n return items;\n }\n\n /**\n * Alert before navigating away using browser's 'beforeunload' event\n */\n preventClose = (e: Event): boolean | void => {\n if (this.state.hasSelectedOptions()) {\n e.preventDefault();\n return true;\n }\n };\n}\n","export default function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : String(i);\n}","import _typeof from \"./typeof.js\";\nexport default function toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);\n }\n}\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}","import app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport classList from 'flarum/common/utils/classList';\nimport icon from 'flarum/common/helpers/icon';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport type Mithril from 'mithril';\n\ninterface PollPageHeroAttrs extends ComponentAttrs {\n icon?: string;\n title?: string;\n}\n\nexport default class PollPageHero extends Component {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n }\n\n get classNames(): string {\n return classList({\n PollPageHero: true,\n Hero: true,\n });\n }\n\n get wrapperClasses(): string {\n return classList({\n 'PollPageHero--wrapper': true,\n });\n }\n\n oncreate(vnode: Mithril.Vnode): void {\n super.oncreate(vnode);\n }\n\n get title() {\n return this.attrs.title || app.translator.trans('fof-polls.forum.polls_page.title');\n }\n\n get icon() {\n return this.attrs.icon || 'fas fa-poll';\n }\n\n view() {\n return (\n
\n
\n
\n
{this.items().toArray()}
\n
\n
\n
\n );\n }\n\n items() {\n const items = new ItemList();\n items.add('title',

{[icon(this.icon), ' ', this.title]}

, 50);\n\n return items;\n }\n}\n","import Page, { IPageAttrs } from 'flarum/common/components/Page';\nimport PollListState from '../states/PollListState';\nimport Poll from '../models/Poll';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport type Mithril from 'mithril';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport listItems from 'flarum/common/helpers/listItems';\nimport app from 'flarum/forum/app';\nimport SelectDropdown from 'flarum/common/components/SelectDropdown';\nimport IndexPageHero from './PollPageHero';\n\nexport abstract class AbstractPollPage extends Page {\n loading: boolean = false;\n poll: Poll | null | undefined = null;\n polls: Poll[] = [];\n\n view(): Mithril.Children {\n return
{this.pageContent().toArray()}
;\n }\n\n pageContent(): ItemList {\n const items = new ItemList();\n\n items.add('hero', this.hero(), 100);\n items.add('main',
{this.mainContent().toArray()}
, 10);\n\n return items;\n }\n\n mainContent(): ItemList {\n const items = new ItemList();\n\n items.add('sidebar', this.sidebar(), 100);\n items.add('content', this.content(), 10);\n\n return items;\n }\n\n content(): Mithril.Children {\n return
{this.contentItems().toArray()}
;\n }\n\n contentItems(): ItemList {\n const items = new ItemList();\n\n if (this.loading) {\n items.add('loading', );\n }\n\n return items;\n }\n\n hero(): Mithril.Children {\n return ;\n }\n\n sidebar(): Mithril.Children {\n return (\n \n );\n }\n\n sidebarItems(): ItemList {\n const items = IndexPage.prototype.sidebarItems();\n\n items.setContent(\n 'nav',\n \n {this.navItems().toArray()}\n \n );\n\n return items;\n }\n\n navItems(): ItemList {\n const items = IndexPage.prototype.navItems();\n\n if (app.initializers.has('flarum-tags')) {\n // remove the tags from the nav items\n items.remove('separator');\n items.remove('moreTags');\n\n // each tag is added using the key \"tag{id}\". We need to remove all of them\n for (const key in items.toObject()) {\n if (key.startsWith('tag') && key !== 'tags') {\n items.remove(key);\n }\n }\n }\n\n return items;\n }\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport PollModel from '../models/Poll';\nimport PollView from './PollView';\nimport { AbstractPollPage } from './AbstractPollPage';\nimport ItemList from 'flarum/common/utils/ItemList';\n\nexport default class PollViewPage extends AbstractPollPage {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n if (!app.forum.attribute('globalPollsEnabled')) {\n m.route.set('/');\n return;\n }\n\n const editId = m.route.param('id');\n this.poll = app.store.getById('poll', editId);\n\n if (!this.poll) {\n this.loading = true;\n\n app.store.find('fof/polls', editId).then((item) => {\n this.poll = item;\n this.loading = false;\n app.setTitle(this.poll.question());\n m.redraw();\n });\n }\n }\n\n contentItems(): ItemList {\n const items = super.contentItems();\n\n if (!this.loading) {\n items.add('poll', );\n }\n\n return items;\n }\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport type { PollListParams } from '../../states/PollListState';\nimport SubtreeRetainer from 'flarum/common/utils/SubtreeRetainer';\nimport classList from 'flarum/common/utils/classList';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport Link from 'flarum/common/components/Link';\nimport highlight from 'flarum/common/helpers/highlight';\nimport slidable from 'flarum/forum/utils/slidable';\nimport icon from 'flarum/common/helpers/icon';\nimport abbreviateNumber from 'flarum/common/utils/abbreviateNumber';\nimport Poll from '../../models/Poll';\nimport PollControls from '../../utils/PollControls';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport listItems from 'flarum/common/helpers/listItems';\nimport PollViewPage from '../PollViewPage';\n\nexport interface IPollListItemAttrs extends ComponentAttrs {\n poll: Poll;\n params: PollListParams;\n}\n\n/**\n * The `PollListItem` component shows a single poll in the\n * poll list.\n */\nexport default class PollListItem extends Component {\n /**\n * Ensures that the poll will not be redrawn\n * unless new data comes in.\n */\n subtree!: SubtreeRetainer;\n poll!: Poll;\n\n highlightRegExp?: RegExp;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.poll = this.attrs.poll;\n\n this.subtree = new SubtreeRetainer(\n () => this.poll.freshness,\n () => {\n const time = app.session.user && app.session.user.markedAllAsReadAt();\n return time && time.getTime();\n },\n () => this.active()\n );\n }\n\n elementAttrs() {\n return {\n className: classList('PollListItem', {\n active: this.active(),\n 'PollListItem--hidden': this.poll.isHidden(),\n Slidable: 'ontouchstart' in window,\n }),\n };\n }\n\n view() {\n const controls = PollControls.controls(this.poll, this).toArray();\n const attrs = this.elementAttrs();\n\n return (\n
\n {this.controlsView(controls)}\n {this.contentView()}\n {this.slidableUnderneathView()}\n
\n );\n }\n\n controlsView(controls: Mithril.ChildArray): Mithril.Children {\n return (\n !!controls.length && (\n \n {controls}\n \n )\n );\n }\n\n slidableUnderneathView(): Mithril.Children {\n const isUnread = this.poll.isUnread();\n\n return (\n \n {icon('fas fa-check')}\n \n );\n }\n\n contentView(): Mithril.Children {\n // const isUnread = this.poll.isUnread();\n // const isRead = this.poll.isRead();\n\n return (\n //
\n
{this.mainView()}
\n );\n }\n\n mainView(): Mithril.Children {\n return (\n \n

{highlight(this.poll.question(), this.highlightRegExp)}

\n {this.poll.subtitle() &&

{this.poll.subtitle()}

}\n
    {listItems(this.infoItems().toArray())}
\n \n );\n }\n\n // infoView() {\n // return (\n //
\n // {this.poll.subtitle() &&

{this.poll.subtitle()}

}\n //
    {listItems(this.infoItems().toArray())}
\n //
\n // );\n // }\n\n oncreate(vnode: Mithril.VnodeDOM) {\n super.oncreate(vnode);\n\n // If we're on a touch device, set up the discussion row to be slidable.\n // This allows the user to drag the row to either side of the screen to\n // reveal controls.\n if ('ontouchstart' in window) {\n const slidableInstance = slidable(this.element);\n\n this.$('.PollListItem-controls').on('hidden.bs.dropdown', () => slidableInstance.reset());\n }\n }\n\n onbeforeupdate(vnode: Mithril.VnodeDOM) {\n super.onbeforeupdate(vnode);\n\n return this.subtree.needsRebuild();\n }\n\n /**\n * Determine whether or not the discussion is currently being viewed.\n */\n active() {\n return app.current.matches(PollViewPage, { poll: this.poll });\n }\n\n /**\n * Mark the poll as read.\n */\n markAsRead() {\n if (this.poll.isUnread()) {\n this.poll.save({ lastVotedNumber: this.poll.voteCount() });\n m.redraw();\n }\n }\n\n infoItems(): ItemList {\n const items = new ItemList();\n const active = !this.poll.hasEnded();\n const activeView = this.poll.endDate()\n ? [\n icon('fas fa-clock'),\n ' ',\n active\n ? app.translator.trans('fof-polls.forum.days_remaining', { time: dayjs(this.poll.endDate()).fromNow() })\n : app.translator.trans('fof-polls.forum.poll_ended'),\n ]\n : [icon('fas fa-infinity'), ' ', app.translator.trans('fof-polls.forum.poll_never_ends')];\n\n items.add('active', {activeView});\n\n const voteCount = this.poll.voteCount();\n if (voteCount !== undefined) {\n items.add(\n 'voteCount',\n \n {icon('fas fa-poll fa-fw')}\n {[\n ' ',\n app.translator.trans('fof-polls.forum.polls_count', {\n count: abbreviateNumber(voteCount),\n }),\n ]}\n ,\n 70\n );\n }\n\n return items;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Placeholder'];","import app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport PollListItem from './PollListItem';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Placeholder from 'flarum/common/components/Placeholder';\nimport classList from 'flarum/common/utils/classList';\nimport PollListState from '../../states/PollListState';\n\nexport interface PollListAttrs extends ComponentAttrs {\n state: PollListState;\n}\n\n/**\n * The `PollList` component displays a list of polls.\n */\nexport default class PollList extends Component {\n view() {\n const state = this.attrs.state;\n const params = state.getParams();\n const isLoading = state.isInitialLoading() || state.isLoadingNext();\n\n let loading;\n\n if (isLoading) {\n loading = ;\n } else if (state.hasNext()) {\n loading = (\n \n );\n }\n\n if (state.isEmpty()) {\n const text = app.translator.trans('fof-polls.forum.polls_list.empty_text');\n return (\n
\n \n
\n );\n }\n\n return (\n
\n
    \n {state.getPages().map((pg) => {\n return pg.items.map((poll) => (\n
  • \n \n
  • \n ));\n })}\n
\n
{loading}
\n
\n );\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/states/PaginatedListState'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/EventEmitter'];","import app from 'flarum/forum/app';\nimport PaginatedListState, { Page, PaginatedListParams, PaginatedListRequestParams } from 'flarum/common/states/PaginatedListState';\nimport Poll from '../models/Poll';\nimport { ApiResponsePlural } from 'flarum/common/Store';\nimport EventEmitter from 'flarum/common/utils/EventEmitter';\n\nexport interface PollListParams extends PaginatedListParams {\n sort?: string;\n}\n\nconst globalEventEmitter = new EventEmitter();\n\nexport default class PollListState

extends PaginatedListState {\n protected extraPolls: Poll[] = [];\n protected eventEmitter: EventEmitter;\n\n constructor(params: P, page: number = 1) {\n super(params, page, 20);\n\n this.eventEmitter = globalEventEmitter.on('poll.deleted', this.deletePoll.bind(this));\n }\n\n get type(): string {\n return 'fof/polls';\n }\n\n requestParams(): PaginatedListRequestParams {\n const params = {\n include: this.params.include || ['options', 'votes'],\n filter: this.params.filter || {},\n sort: this.sortMap()[this.params.sort ?? ''],\n };\n\n if (this.params.q) {\n params.filter.q = this.params.q;\n }\n\n return params;\n }\n\n protected loadPage(page: number = 1): Promise> {\n const preloadedPolls = app.preloadedApiDocument();\n\n if (preloadedPolls) {\n this.initialLoading = false;\n\n return Promise.resolve(preloadedPolls);\n }\n\n return super.loadPage(page);\n }\n\n clear(): void {\n super.clear();\n\n this.extraPolls = [];\n }\n\n /**\n * Get a map of sort keys (which appear in the URL, and are used for\n * translation) to the API sort value that they represent.\n */\n sortMap() {\n const map: any = {};\n\n if (this.params.q) {\n map.relevance = '';\n }\n map.newest = '-createdAt';\n map.oldest = 'createdAt';\n\n return map;\n }\n\n /**\n * In the last request, has the user searched for a poll?\n */\n isSearchResults(): boolean {\n return !!this.params.q;\n }\n\n removePoll(poll: Poll): void {\n this.eventEmitter.emit('poll.deleted', poll);\n }\n\n deletePoll(poll: Poll): void {\n for (const page of this.pages) {\n const index = page.items.indexOf(poll);\n\n if (index !== -1) {\n page.items.splice(index, 1);\n break;\n }\n }\n\n const index = this.extraPolls.indexOf(poll);\n\n if (index !== -1) {\n this.extraPolls.splice(index);\n }\n\n m.redraw();\n }\n\n /**\n * Add a poll to the top of the list.\n */\n addPoll(poll: Poll): void {\n this.removePoll(poll);\n this.extraPolls.unshift(poll);\n\n m.redraw();\n }\n\n protected getAllItems(): Poll[] {\n return this.extraPolls.concat(super.getAllItems());\n }\n\n public getPages(): Page[] {\n const pages = super.getPages();\n\n if (this.extraPolls.length) {\n return [\n {\n number: -1,\n items: this.extraPolls,\n },\n ...pages,\n ];\n }\n\n return pages;\n }\n}\n","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport listItems from 'flarum/common/helpers/listItems';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport PollList from './Poll/PollList';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport extractText from 'flarum/common/utils/extractText';\nimport PollListState from '../states/PollListState';\nimport Button from 'flarum/common/components/Button';\nimport SelectDropdown from 'flarum/common/components/SelectDropdown';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport PollView from './PollView';\nimport { AbstractPollPage } from './AbstractPollPage';\n\nexport default class PollsPage extends AbstractPollPage {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n if (!app.forum.attribute('globalPollsEnabled')) {\n m.route.set('/');\n return;\n }\n\n this.state = new PollListState({\n sort: m.route.param('sort'),\n filter: m.route.param('filter'),\n });\n\n this.state.refresh();\n\n app.setTitle(extractText(app.translator.trans('fof-polls.forum.page.nav')));\n }\n\n view(): Mithril.Children {\n if (this.loading) {\n return ;\n }\n\n if (this.poll) {\n return (\n

\n
\n \n
\n
\n );\n }\n\n return (\n
\n {super.hero()}\n
\n
\n \n
\n
\n
    {listItems(this.viewItems().toArray())}
\n
    {listItems(this.actionItems().toArray())}
\n
\n \n
\n
\n
\n
\n );\n }\n\n sidebarItems(): ItemList {\n const items = new ItemList();\n const canStartPoll = app.forum.attribute('canStartGlobalPolls');\n\n items.add(\n 'newGlobalPoll',\n {\n this.newPollAction();\n }}\n disabled={!canStartPoll}\n >\n {app.translator.trans(`fof-polls.forum.poll.${canStartPoll ? 'start_poll_button' : 'cannot_start_poll_button'}`)}\n \n );\n\n items.add(\n 'nav',\n \n {this.navItems().toArray()}\n \n );\n\n return items;\n }\n\n actionItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'refresh',\n Button.component({\n title: app.translator.trans('fof-polls.forum.page.refresh_tooltip'),\n icon: 'fas fa-sync',\n className: 'Button Button--icon',\n onclick: () => {\n this.state.refresh();\n },\n })\n );\n\n return items;\n }\n\n viewItems() {\n return IndexPage.prototype.viewItems();\n }\n\n navItems() {\n return IndexPage.prototype.navItems();\n }\n\n /**\n * Change to create new poll page\n */\n newPollAction(): void {\n if (!app.session.user) {\n app.modal.show(LogInModal);\n return;\n }\n\n m.route.set(app.route('fof.polls.compose'));\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Separator'];","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Poll from '../models/Poll';\nimport Component from 'flarum/common/Component';\nimport ComposePollPage from '../components/ComposePollPage';\nimport PollsPage from '../components/PollsPage';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Separator from 'flarum/common/components/Separator';\nimport Button from 'flarum/common/components/Button';\n\n/**\n * The `UserControls` utility constructs a list of buttons for a user which\n * perform actions on it.\n */\nexport default {\n /**\n * Get a list of controls for a user.\n */\n controls(poll: Poll, context: Component): ItemList {\n const items = new ItemList();\n\n ['poll', 'moderation', 'destructive'].forEach((section) => {\n const controls = (this[section + 'Controls'](poll, context) as ItemList).toArray();\n if (controls.length) {\n controls.forEach((item) => items.add(item.itemName, item));\n items.add(section + 'Separator', );\n }\n });\n\n return items;\n },\n\n /**\n * Get controls for direct modifcation actions on polls (e.g. vote, view voters).\n */\n pollControls(poll: Poll, context: Component): ItemList {\n const items = new ItemList();\n\n return items;\n },\n\n /**\n * Get controls for a user pertaining to moderation (e.g. suspend, edit).\n */\n moderationControls(poll: Poll, context: Component): ItemList {\n const items = new ItemList();\n\n if (poll.canEdit()) {\n items.add(\n 'edit',\n \n );\n }\n\n return items;\n },\n\n /**\n * Get controls for a user which are destructive (e.g. delete).\n * @protected\n */\n destructiveControls(poll: Poll, context: Component): ItemList {\n const items = new ItemList();\n\n if (poll.canDelete()) {\n items.add(\n 'delete',\n \n );\n }\n\n return items;\n },\n\n /**\n * Delete the poll.\n */\n async deleteAction(poll: Poll): Promise {\n if (!confirm(app.translator.trans(`fof-polls.forum.poll_controls.delete_confirmation`) as string)) {\n return;\n }\n\n return poll\n .delete()\n .then(() => {\n this.showDeletionAlert(poll, 'success');\n if (app.current.matches(ComposePollPage, { id: poll.id() }) || app.current.matches(PollsPage, { id: poll.id() })) {\n app.history.back();\n } else {\n window.location.reload();\n }\n })\n .catch(() => this.showDeletionAlert(poll, 'error'));\n },\n\n /**\n * Show deletion alert of poll\n */\n showDeletionAlert(poll: Poll, type: string): void {\n const message = {\n success: `fof-polls.forum.poll_controls.delete_success_message`,\n error: `fof-polls.forum.poll_controls.delete_error_message`,\n }[type]!;\n\n app.alerts.show({ type }, app.translator.trans(message, { poll: poll }));\n },\n\n /**\n * Edit the poll.\n */\n editAction(poll: Poll): void {\n m.route.set(app.route('fof.polls.compose', { id: poll.id() }));\n },\n};\n","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","import app from 'flarum/forum/app';\nimport Button, { IButtonAttrs } from 'flarum/common/components/Button';\nimport classList from 'flarum/common/utils/classList';\nimport type Mithril from 'mithril';\nimport Poll from '../models/Poll';\nimport PollOption from '../models/PollOption';\n\nexport interface UploadPollImageButtonAttrs extends IButtonAttrs {\n className?: string;\n loading?: boolean;\n name: string;\n onclick: () => void;\n poll?: Poll | null;\n option?: PollOption | null;\n onUpload: (fileName: string | null | undefined) => void;\n}\n\nexport interface PollUploadObject {\n fileUrl: string;\n fileName: string;\n}\n\nexport default class UploadPollImageButton extends Button {\n loading: boolean = false;\n uploadedImageUrl: string | undefined | false = false;\n fileName: string | undefined = undefined;\n $input: JQuery | undefined;\n\n view(vnode: Mithril.Vnode) {\n this.attrs.loading = this.loading;\n this.attrs.className = classList(this.attrs.className, 'Button');\n\n const imageUrl = this.getImageUrl();\n\n if (imageUrl) {\n this.attrs.onclick = this.remove.bind(this);\n\n return (\n
\n

\n \"\"\n

\n

{super.view({ ...vnode, children: app.translator.trans('fof-polls.forum.upload_image.remove_button') })}

\n
\n );\n } else {\n this.attrs.onclick = this.upload.bind(this);\n }\n\n return super.view({ ...vnode, children: app.translator.trans('fof-polls.forum.upload_image.upload_button') });\n }\n\n /**\n * Prompt the user to upload an image.\n */\n upload() {\n if (this.loading) return;\n\n this.$input = $('');\n\n this.$input\n .appendTo('body')\n .hide()\n .trigger('click')\n .on('change', (e) => {\n const body = new FormData();\n body.append(this.attrs.name, $(e.target)[0].files[0]);\n\n this.loading = true;\n m.redraw();\n\n app\n .request({\n method: 'POST',\n url: this.resourceUrl(),\n serialize: (raw) => raw,\n body,\n })\n .then(this.success.bind(this), this.failure.bind(this));\n });\n }\n\n /**\n * Remove the image.\n */\n remove() {\n this.loading = true;\n m.redraw();\n\n let fileName = undefined;\n\n if (!this.attrs.poll?.exists && !this.attrs.option?.exists) {\n fileName = this.fileName;\n }\n\n app\n .request({\n method: 'DELETE',\n url: this.resourceUrl(fileName),\n })\n .then(this.success.bind(this), this.failure.bind(this));\n }\n\n resourceUrl(fileName: string | undefined = undefined) {\n let url = app.forum.attribute('apiUrl') + '/fof/polls/' + this.attrs.name;\n const poll = this.attrs.poll;\n const option = this.attrs.option;\n\n if (fileName) {\n url += '/name/' + fileName;\n } else {\n if (poll?.exists) url += '/' + poll?.id();\n if (option?.exists) url += '/' + option?.id();\n }\n\n return url;\n }\n\n getImageUrl() {\n if (this.uploadedImageUrl !== false) {\n return this.uploadedImageUrl;\n }\n\n return this.attrs.poll?.imageUrl() || this.attrs.option?.imageUrl();\n }\n\n /**\n * After a successful upload/removal, redraw the page.\n *\n * @param {PollUploadObject} response\n * @protected\n */\n success(response: PollUploadObject | null) {\n this.loading = false;\n this.uploadedImageUrl = response?.fileUrl;\n this.fileName = response?.fileName;\n\n this.attrs.onUpload?.(response?.fileName);\n m.redraw();\n this.$input?.remove();\n }\n\n /**\n * If upload/removal fails, stop loading.\n *\n * @param {object} response\n * @protected\n */\n failure(response: object) {\n this.loading = false;\n m.redraw();\n this.$input?.remove();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/RequestError'];","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Button from 'flarum/common/components/Button';\nimport Switch from 'flarum/common/components/Switch';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Stream from 'flarum/common/utils/Stream';\nimport extractText from 'flarum/common/utils/extractText';\nimport FormError from './form/FormError';\nimport PollFormState from '../states/PollFormState';\nimport PollControls from '../utils/PollControls';\nimport PollModel from '../models/Poll';\nimport PollOption from '../models/PollOption';\nimport UploadPollImageButton from './UploadPollImageButton';\nimport Poll from '../models/Poll';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport RequestError from 'flarum/common/utils/RequestError';\n\ninterface PollFormAttrs extends ComponentAttrs {\n poll: PollModel;\n onsubmit: (data: object, state: PollFormState) => Promise;\n}\n\nexport default class PollForm extends Component {\n protected options: PollOption[] = [];\n protected optionAnswers: Stream[] = [];\n protected optionImageUrls: Stream[] = [];\n protected question: Stream;\n protected subtitle: Stream;\n protected image: Stream;\n protected imageAlt: Stream;\n protected endDate: Stream;\n protected publicPoll: Stream;\n protected allowMultipleVotes: Stream;\n protected hideVotes: Stream;\n protected allowChangeVote: Stream;\n protected maxVotes: Stream;\n protected datepickerMinDate: string = '';\n\n oninit(vnode: Mithril.Vnode): void {\n super.oninit(vnode);\n this.state = new PollFormState(this.attrs.poll);\n\n // state handles poll initialization\n const poll = this.state.poll;\n\n this.options = (poll.tempOptions ?? poll.options()) as PollOption[];\n this.optionAnswers = this.options.map((o) => Stream(o.answer()));\n this.optionImageUrls = this.options.map((o) => Stream(o.imageUrl()));\n\n this.question = Stream(poll.question());\n this.subtitle = Stream(poll.subtitle());\n this.image = Stream(poll.image());\n this.imageAlt = Stream(poll.imageAlt());\n this.endDate = Stream(this.formatDate(poll.endDate()));\n this.publicPoll = Stream(poll.publicPoll());\n this.allowMultipleVotes = Stream(poll.allowMultipleVotes());\n this.hideVotes = Stream(poll.hideVotes());\n this.allowChangeVote = Stream(poll.allowChangeVote());\n this.maxVotes = Stream(poll.maxVotes() || 0);\n\n // Set minimum date for datepicker to current date\n this.datepickerMinDate = this.formatDate() as string;\n\n // Replace minimum of 'today' for poll end date only if the poll is not already closed\n if (this.endDate() && dayjs(poll.endDate).isAfter(dayjs())) {\n // We know that endDate is set, so we can safely cast the result to string\n this.datepickerMinDate = this.formatDate(poll.endDate()) as string;\n }\n }\n\n view(): Mithril.Children {\n return (\n
\n
{this.fields().toArray()}
\n
\n );\n }\n\n fields(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'question',\n
\n \n\n \n
,\n 100\n );\n\n items.add(\n 'subtitle',\n
\n \n\n \n
,\n 95\n );\n\n items.add(\n 'poll_image',\n
\n \n

{app.translator.trans('fof-polls.forum.modal.poll_image.help')}

\n \n \n
,\n 90\n );\n\n if (this.image()) {\n items.add(\n 'poll_image_alt',\n
\n \n\n \n\n

{app.translator.trans('fof-polls.forum.modal.poll_image.alt_help_text')}

\n
,\n 90\n );\n }\n\n items.add(\n 'answers',\n
\n \n\n {this.displayOptions().toArray()}\n\n \n
,\n 80\n );\n\n items.add(\n 'date',\n
\n \n\n
\n \n {Button.component({\n className: 'Button PollModal--button Button--icon',\n icon: 'fas fa-times',\n onclick: this.endDate.bind(this, null),\n })}\n
\n\n {this.endDate() && (\n

\n \n  \n {dayjs(this.endDate()).isBefore(dayjs())\n ? app.translator.trans('fof-polls.forum.poll_ended')\n : app.translator.trans('fof-polls.forum.days_remaining', { time: dayjs(this.endDate()).fromNow() })}\n

\n )}\n
,\n 40\n );\n\n items.add(\n 'public',\n
\n {Switch.component(\n {\n state: this.publicPoll() || false,\n onchange: this.publicPoll,\n },\n app.translator.trans('fof-polls.forum.modal.public_poll_label')\n )}\n
,\n 20\n );\n\n items.add(\n 'hide-votes',\n
\n \n {app.translator.trans('fof-polls.forum.modal.hide_votes_label')}\n \n
,\n 20\n );\n\n items.add(\n 'allow-change-vote',\n
\n \n {app.translator.trans('fof-polls.forum.modal.allow_change_vote_label')}\n \n
,\n 20\n );\n\n items.add(\n 'allow-multiple-votes',\n
\n {Switch.component(\n {\n state: this.allowMultipleVotes() || false,\n onchange: this.allowMultipleVotes,\n },\n app.translator.trans('fof-polls.forum.modal.allow_multiple_votes_label')\n )}\n
,\n 15\n );\n\n if (this.allowMultipleVotes()) {\n items.add(\n 'max-votes',\n
\n \n\n \n\n

{app.translator.trans('fof-polls.forum.modal.max_votes_help')}

\n
,\n 15\n );\n }\n\n items.add(\n 'submit',\n
\n \n {this.state.poll.exists && (\n \n {app.translator.trans('fof-polls.forum.modal.delete')}\n \n )}\n
,\n -10\n );\n\n return items;\n }\n\n displayOptions(): ItemList {\n const items = new ItemList();\n\n this.options.forEach((option, i) => {\n items.add(\n 'option-' + i,\n
\n
\n \n {app.forum.attribute('allowPollOptionImage') && (\n
\n \n

{app.translator.trans('fof-polls.forum.modal.poll_option_image.help')}

\n \n \n
\n )}\n
\n {i >= 2\n ? Button.component({\n type: 'button',\n className: 'Button PollModal--button Button--icon',\n icon: 'fas fa-minus',\n onclick: i >= 2 ? this.removeOption.bind(this, i) : '',\n })\n : ''}\n
\n );\n });\n\n return items;\n }\n\n addOption() {\n const max = Math.max(app.forum.attribute('pollMaxOptions'), 2);\n\n if (this.options.length < max) {\n this.options.push(app.store.createRecord('poll_options'));\n this.optionAnswers.push(Stream(''));\n this.optionImageUrls.push(Stream(''));\n } else {\n alert(extractText(app.translator.trans('fof-polls.forum.modal.max', { max })));\n }\n }\n\n removeOption(i: number): void {\n this.options.splice(i, 1);\n this.optionAnswers.splice(i, 1);\n this.optionImageUrls.splice(i, 1);\n }\n\n data(): object {\n if (this.question() === '') {\n throw new FormError(app.translator.trans('fof-polls.forum.modal.include_question'));\n }\n\n if (this.options.length < 2) {\n throw new FormError(app.translator.trans('fof-polls.forum.modal.min'));\n }\n\n const pollExists = this.state.poll.exists;\n const options = this.options.map((option, i) => {\n option.pushAttributes({\n answer: this.optionAnswers[i](),\n imageUrl: this.optionImageUrls[i](),\n });\n\n return pollExists ? option.data : option.data.attributes;\n });\n\n return {\n question: this.question(),\n subtitle: this.subtitle(),\n pollImage: this.image(),\n imageAlt: this.imageAlt(),\n endDate: this.dateToTimestamp(this.endDate()) ?? false,\n publicPoll: this.publicPoll(),\n hideVotes: this.hideVotes(),\n allowChangeVote: this.allowChangeVote(),\n allowMultipleVotes: this.allowMultipleVotes(),\n maxVotes: this.maxVotes(),\n options,\n };\n }\n\n async onsubmit(event: Event) {\n event.preventDefault();\n\n try {\n await this.attrs.onsubmit(this.data(), this.state);\n } catch (error) {\n if (error instanceof FormError) {\n app.alerts.show({ type: 'error' }, error.message);\n } else if (error instanceof RequestError) {\n console.error(error);\n app.alerts.show({ type: 'error' }, app.translator.trans('fof-polls.forum.modal.error'));\n }\n }\n }\n\n async delete(): Promise {\n this.state.loading = true;\n try {\n await PollControls.deleteAction(this.state.poll);\n this.state.deleting = true;\n } finally {\n this.state.loading = false;\n m.redraw();\n }\n }\n\n formatDate(date: Date | string | false | undefined | null = undefined, def: Date | false = false): string | false {\n const dayjsDate = dayjs(date);\n\n if (date === false || !dayjsDate.isValid()) return def !== false ? this.formatDate(def) : false;\n\n return dayjsDate.format('YYYY-MM-DDTHH:mm');\n }\n\n dateToTimestamp(date: Date | false): string | null {\n const dayjsDate = dayjs(date);\n\n if (!date || !dayjsDate.isValid()) return null;\n\n return dayjsDate.format();\n }\n\n pollImageUploadSuccess(fileName: string | null | undefined): void {\n this.image(fileName);\n }\n\n pollOptionImageUploadSuccess(index: number, fileName: string | null | undefined): void {\n this.optionImageUrls[index] = Stream(fileName);\n }\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';\nimport PollForm from './PollForm';\nimport PollModel from '../models/Poll';\nimport PollFormState from '../states/PollFormState';\n\ninterface CreatePollModalAttrs extends IInternalModalAttrs {\n poll: PollModel;\n onsubmit: (data: object) => Promise;\n}\n\nexport default class CreatePollModal extends Modal {\n title(): Mithril.Children {\n return app.translator.trans('fof-polls.forum.modal.add_title');\n }\n\n className(): string {\n return 'PollDiscussionModal Modal--medium';\n }\n\n content(): Mithril.Children {\n return [\n
\n \n
,\n ];\n }\n\n async onFormSubmit(data: object, state: PollFormState): Promise {\n this.hide();\n await this.attrs.onsubmit(data);\n }\n}\n","import app from 'flarum/forum/app';\n\nimport { extend } from 'flarum/common/extend';\nimport classList from 'flarum/common/utils/classList';\nimport DiscussionComposer from 'flarum/forum/components/DiscussionComposer';\nimport ReplyComposer from 'flarum/forum/components/ReplyComposer';\nimport CreatePollModal from './components/CreatePollModal';\nimport Poll from './models/Poll';\nimport PollOption from './models/PollOption';\nimport { ModelAttributes } from 'flarum/common/Model';\nimport PollModelAttributes from './models/PollModelAttributes';\n\nfunction toPoll(data: PollModelAttributes) {\n if (data) {\n const poll = app.store.createRecord('polls');\n\n poll.tempOptions = data.options.map((option: ModelAttributes) => {\n const pollOption = app.store.createRecord('poll_options');\n pollOption.pushAttributes(option);\n return pollOption;\n });\n poll.pushAttributes(data);\n\n return poll;\n }\n return data;\n}\n\nexport const addToComposer = (composer: ComponentClass) => {\n // @ts-ignore\n composer.prototype.addPoll = function () {\n app.modal.show(CreatePollModal, {\n poll: toPoll(this.composer.fields.poll),\n onsubmit: (poll: PollModelAttributes) => (this.composer.fields.poll = poll),\n });\n };\n\n // Add button to DiscussionComposer header\n extend(composer.prototype, 'headerItems', function (items) {\n const discussion = this.composer.body?.attrs?.discussion;\n\n // @ts-ignore\n const canStartPoll = discussion?.canStartPoll() ?? app.forum.canStartPolls();\n\n if (canStartPoll) {\n items.add(\n 'polls',\n \n \n {app.translator.trans(`fof-polls.forum.composer_discussion.${this.composer.fields.poll ? 'edit' : 'add'}_poll`)}\n \n ,\n 1\n );\n }\n });\n\n extend(composer.prototype, 'data', function (data) {\n if (this.composer.fields.poll) {\n data.poll = this.composer.fields.poll;\n }\n });\n};\n\nexport default () => {\n addToComposer(DiscussionComposer);\n addToComposer(ReplyComposer);\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/CommentPost'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionPage'];","import app from 'flarum/forum/app';\n\nimport { extend } from 'flarum/common/extend';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport PollView from './components/PollView';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport Poll from './models/Poll';\nimport Post from 'flarum/common/models/Post';\nimport PollOption from './models/PollOption';\n\ninterface PollPost extends Post {\n polls: () => Poll[];\n}\n\ninterface PusherPollDto {\n pollId: string;\n pollVoteCount: number;\n options: { [key: string]: number };\n}\n\nexport default () => {\n extend(CommentPost.prototype, 'content', function (content) {\n const post = this.attrs.post as PollPost;\n\n if ((!post.isHidden() || this.revealContent) && post.polls()) {\n for (const poll of post.polls()) {\n if (poll) {\n content.push();\n }\n }\n }\n });\n\n extend(CommentPost.prototype, 'oninit', function () {\n this.subtree.check(() => {\n const polls = (this.attrs.post as PollPost).polls();\n\n const checks = polls?.map?.(\n (poll) =>\n poll && [\n poll.data?.attributes,\n poll.options().map?.((option) => option?.data?.attributes),\n poll.myVotes().map?.((vote) => vote.option()?.id()),\n ]\n );\n\n return JSON.stringify(checks);\n });\n });\n\n extend(DiscussionPage.prototype, 'oncreate', function () {\n // @ts-ignore\n if (app.pusher) {\n // @ts-ignore\n app.pusher.then((binding) => {\n // We will listen for updates to all polls and options\n // Even if that model is not in the current discussion, it doesn't really matter\n binding.channels.main.bind('updatedPollOptions', (data: PusherPollDto) => {\n const poll = app.store.getById('polls', data['pollId']);\n\n if (poll) {\n poll.pushAttributes({\n voteCount: data['pollVoteCount'],\n });\n\n // Not redrawing here, as the option below should trigger the redraw already\n }\n\n const changedOptions = data['options'];\n\n for (const optionId in changedOptions) {\n const option = app.store.getById('poll_options', optionId);\n\n if (option && option.voteCount() !== undefined) {\n option.pushAttributes({\n voteCount: changedOptions[optionId],\n });\n }\n }\n\n m.redraw();\n });\n });\n }\n });\n\n extend(DiscussionPage.prototype, 'onremove', function () {\n // @ts-ignore\n if (app.pusher) {\n // @ts-ignore\n app.pusher.then((binding) => {\n binding.channels.main.unbind('updatedPollOptions');\n });\n }\n });\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/PostControls'];","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport CreatePollModal from './CreatePollModal';\nimport PollFormState from '../states/PollFormState';\n\nexport default class EditPollModal extends CreatePollModal {\n title(): Mithril.Children {\n return app.translator.trans('fof-polls.forum.modal.edit_title');\n }\n\n async onFormSubmit(data: object, state: PollFormState): Promise {\n await state.save(data);\n\n // Show success alert\n const alertId = app.alerts.show(\n {\n type: 'success',\n },\n app.translator.trans('fof-polls.forum.compose.success')\n );\n\n // Hide alert after 10 seconds\n setTimeout(() => app.alerts.dismiss(alertId), 10000);\n }\n}\n","import app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport ListVotersModal from './ListVotersModal';\nimport classList from 'flarum/common/utils/classList';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport icon from 'flarum/common/helpers/icon';\nimport EditPollModal from './EditPollModal';\nimport Poll from '../models/Poll';\nimport type Mithril from 'mithril';\nimport PollOption from '../models/PollOption';\nimport Post from 'flarum/common/models/Post';\nimport extractText from 'flarum/common/utils/extractText';\n\nexport interface PostPollAttrs extends ComponentAttrs {\n poll: Poll;\n post?: Post;\n}\n\nexport default class PostPoll extends Component {\n loadingOptions: boolean = false;\n useSubmitUI!: boolean;\n pendingSubmit: boolean = false;\n pendingOptions: any;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.useSubmitUI = !this.attrs.poll?.canChangeVote() && this.attrs.poll?.allowMultipleVotes();\n this.pendingOptions = null;\n }\n\n oncreate(vnode: Mithril.Vnode) {\n super.oncreate(vnode);\n\n this.preventClose = this.preventClose.bind(this);\n window.addEventListener('beforeunload', this.preventClose);\n }\n\n onremove(vnode: Mithril.Vnode) {\n super.onremove(vnode);\n\n window.removeEventListener('beforeunload', this.preventClose);\n }\n\n view() {\n const poll = this.attrs.poll;\n const options = poll.options() || [];\n let maxVotes = poll.allowMultipleVotes() ? poll.maxVotes() : 1;\n\n if (maxVotes === 0) maxVotes = options.length;\n\n const infoItems = this.infoItems(maxVotes);\n\n return (\n
\n
\n
\n

{poll.question()}

\n {poll.subtitle() &&

{poll.subtitle()}

}\n
\n\n
\n {poll.canSeeVoters() && (\n \n
\n
\n\n
\n
{options.map(this.viewOption.bind(this))}
\n\n
\n {!infoItems.isEmpty() &&
{infoItems.toArray()}
}\n\n {this.useSubmitUI && this.pendingSubmit && (\n \n )}\n
\n
\n
\n );\n }\n\n infoItems(maxVotes: number) {\n const items = new ItemList();\n const poll = this.attrs.poll;\n const hasVoted = poll.myVotes()?.length > 0;\n\n if (app.session.user && !poll.canVote() && !poll.hasEnded()) {\n items.add(\n 'no-permission',\n \n \n {app.translator.trans('fof-polls.forum.no_permission')}\n \n );\n }\n\n if (poll.endDate()) {\n items.add(\n 'end-date',\n \n \n {poll.hasEnded()\n ? app.translator.trans('fof-polls.forum.poll_ended')\n : app.translator.trans('fof-polls.forum.days_remaining', { time: dayjs(poll.endDate()).fromNow() })}\n \n );\n }\n\n if (poll.canVote()) {\n items.add(\n 'max-votes',\n \n \n {app.translator.trans('fof-polls.forum.max_votes_allowed', { max: maxVotes })}\n \n );\n\n if (!poll.canChangeVote()) {\n items.add(\n 'cannot-change-vote',\n \n \n {app.translator.trans('fof-polls.forum.poll.cannot_change_vote')}\n \n );\n }\n }\n\n return items;\n }\n\n viewOption(opt: PollOption) {\n const poll = this.attrs.poll;\n const hasVoted = poll.myVotes()?.length > 0;\n const totalVotes = poll.voteCount();\n\n const voted = this.pendingOptions ? this.pendingOptions.has(opt.id()) : poll.myVotes()?.some?.((vote) => vote.option() === opt);\n const votes = opt.voteCount();\n const percent = totalVotes > 0 ? Math.round((votes / totalVotes) * 100) : 0;\n\n // isNaN(null) is false, so we have to check type directly now that API always returns the field\n const canSeeVoteCount = typeof votes === 'number';\n const isDisabled = this.loadingOptions || (hasVoted && !poll.canChangeVote());\n const width = canSeeVoteCount ? percent : (Number(voted) / (poll.myVotes()?.length || 1)) * 100;\n\n const showCheckmark = !app.session.user || (!poll.hasEnded() && poll.canVote() && (!hasVoted || poll.canChangeVote()));\n\n const bar = (\n
\n {showCheckmark && (\n \n )}\n\n
\n {opt.answer()}\n {voted && !showCheckmark && icon('fas fa-check-circle', { className: 'PollAnswer-check' })}\n {canSeeVoteCount && {percent}%}\n
\n\n {opt.imageUrl() ? {opt.answer()} : null}\n
\n );\n\n return (\n \n {canSeeVoteCount ? (\n \n {bar}\n \n ) : (\n bar\n )}\n
\n );\n }\n\n changeVote(option: PollOption, evt: Event) {\n if (!app.session.user) {\n app.modal.show(LogInModal);\n evt.target.checked = false;\n return;\n }\n\n const optionIds = this.pendingOptions || new Set(this.attrs.poll.myVotes().map?.((v) => v.option().id()));\n const isUnvoting = optionIds.delete(option.id());\n const allowsMultiple = this.attrs.poll.allowMultipleVotes();\n\n if (!allowsMultiple) {\n optionIds.clear();\n }\n\n if (!isUnvoting) {\n optionIds.add(option.id());\n }\n\n if (this.useSubmitUI) {\n this.pendingOptions = optionIds.size ? optionIds : null;\n this.pendingSubmit = !!this.pendingOptions;\n return;\n }\n\n return this.submit(optionIds, null, () => (evt.target.checked = isUnvoting));\n }\n\n onsubmit() {\n return this.submit(this.pendingOptions, () => {\n this.pendingOptions = null;\n this.pendingSubmit = false;\n });\n }\n\n submit(optionIds, cb, onerror) {\n this.loadingOptions = true;\n m.redraw();\n\n return app\n .request({\n method: 'PATCH',\n url: `${app.forum.attribute('apiUrl')}/fof/polls/${this.attrs.poll.id()}/votes`,\n body: {\n data: {\n optionIds: Array.from(optionIds),\n },\n },\n })\n .then((res) => {\n app.store.pushPayload(res);\n cb?.();\n })\n .catch((err) => {\n onerror?.(err);\n })\n .finally(() => {\n this.loadingOptions = false;\n\n m.redraw();\n });\n }\n\n showVoters() {\n // Load all the votes only when opening the votes list\n app.modal.show(ListVotersModal, {\n poll: this.attrs.poll,\n post: this.attrs.post,\n });\n }\n\n deletePoll() {\n if (confirm(extractText(app.translator.trans('fof-polls.forum.moderation.delete_confirm')))) {\n this.attrs.poll.delete().then(() => {\n m.redraw.sync();\n });\n }\n }\n\n /**\n * Attempting to use the `tooltipVisible` attr on the Tooltip component set to 'false' when no vote count\n * caused the tooltip to break on click. This is a workaround to hide the tooltip when no vote count is available,\n * called on 'onremove' of the Tooltip component. It doesn't always work as intended either, but it does the job.\n */\n hideOptionTooltip(vnode: Mithril.Vnode) {\n vnode.attrs.tooltipVisible = false;\n vnode.state.updateVisibility();\n }\n\n /**\n * Alert before navigating away using browser's 'beforeunload' event\n */\n preventClose(e) {\n if (this.pendingOptions) {\n e.preventDefault();\n return true;\n }\n }\n}\n","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Poll from '../models/Poll';\nimport type Mithril from 'mithril';\nimport PollView from './PollView';\n\nexport interface PollShowcaseItemAttrs extends ComponentAttrs {\n poll: Poll;\n}\n\nexport default class PollShowcaseItem extends Component {\n poll!: Poll;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.poll = this.attrs.poll;\n }\n\n view() {\n return (\n
\n \n
\n );\n }\n}\n","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport PollListState from '../states/PollListState';\nimport type Mithril from 'mithril';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport PollShowcaseItem from './PollShowcaseItem';\nimport Placeholder from 'flarum/common/components/Placeholder';\nimport app from 'flarum/forum/app';\n\nexport interface PollListAttrs extends ComponentAttrs {\n state: PollListState;\n}\n\nexport default class PollShowcase extends Component {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.attrs.state.refresh();\n }\n\n view(): Mithril.Children {\n return (\n
\n
\n

{app.translator.trans('fof-polls.forum.showcase.active-polls')}

\n {this.showcaseItems().toArray()}\n {this.showcaseItems().toArray().length === 0 && }\n
\n
\n

{app.translator.trans('fof-polls.forum.showcase.ended-polls')}

\n {this.endedItems().toArray()}\n {this.endedItems().toArray().length === 0 && }\n
\n
\n );\n }\n\n showcaseItems(): ItemList {\n const items = new ItemList();\n\n this.attrs.state.getPages().map((page) => {\n page.items.map((poll) => {\n if (!poll.hasEnded()) {\n items.add('poll-active-' + poll.id(), );\n }\n });\n });\n\n return items;\n }\n\n endedItems(): ItemList {\n const items = new ItemList();\n\n this.attrs.state.getPages().map((page) => {\n page.items.map((poll) => {\n if (poll.hasEnded()) {\n items.add('poll-ended-' + poll.id(), );\n }\n });\n });\n\n return items;\n }\n}\n","import app from 'flarum/forum/app';\nimport { IPageAttrs } from 'flarum/common/components/Page';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Mithril from 'mithril';\nimport PollListState from '../states/PollListState';\nimport extractText from 'flarum/common/utils/extractText';\nimport Button from 'flarum/common/components/Button';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport { AbstractPollPage } from './AbstractPollPage';\nimport PollShowcase from './PollShowcase';\n\nexport default class PollsShowcasePage extends AbstractPollPage {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n if (!app.forum.attribute('globalPollsEnabled')) {\n m.route.set('/');\n return;\n }\n\n this.state = new PollListState({\n sort: m.route.param('sort'),\n filter: m.route.param('filter'),\n include: this.includeParams(),\n });\n\n this.state.refresh();\n\n app.setTitle(extractText(app.translator.trans('fof-polls.forum.page.nav')));\n }\n\n includeParams(): string[] {\n return ['options', 'votes', 'myVotes', 'myVotes.option'];\n }\n\n contentItems(): ItemList {\n const items = super.contentItems();\n\n if (!this.loading) {\n items.add('poll-showcase', );\n }\n\n return items;\n }\n\n sidebarItems(): ItemList {\n const items = super.sidebarItems();\n const canStartPoll = app.forum.attribute('canStartGlobalPolls');\n\n if (canStartPoll) {\n items.remove('newDiscussion');\n items.add(\n 'newGlobalPoll',\n {\n this.newPollAction();\n }}\n disabled={!canStartPoll}\n >\n {app.translator.trans(`fof-polls.forum.poll.${canStartPoll ? 'start_poll_button' : 'cannot_start_poll_button'}`)}\n ,\n 100\n );\n }\n\n return items;\n }\n\n newPollAction(): void {\n if (!app.session.user) {\n app.modal.show(LogInModal);\n return;\n }\n\n m.route.set(app.route('fof.polls.compose'));\n }\n}\n","import CreatePollModal from './CreatePollModal';\nimport PostPoll from './PostPoll';\nimport EditPollModal from './EditPollModal';\nimport ListVotersModal from './ListVotersModal';\nimport PollForm from './PollForm';\nimport ComposePollHero from './ComposePollHero';\nimport ComposePollPage from './ComposePollPage';\nimport PollsPage from './PollsPage';\nimport PollView from './PollView';\nimport PollViewPage from './PollViewPage';\nimport PollSubmitButton from './Poll/PollSubmitButton';\nimport PollOption from './Poll/PollOption';\nimport PollOptions from './Poll/PollOptions';\nimport PollsShowcasePage from './PollsShowcasePage';\nimport PollShowcase from './PollShowcase';\nimport PollShowcaseItem from './PollShowcaseItem';\nimport { AbstractPollPage } from './AbstractPollPage';\nimport PollTitle from './Poll/PollTitle';\nimport PollSubtitle from './Poll/PollSubtitle';\nimport PollImage from './Poll/PollImage';\n\nexport const components = {\n CreatePollModal,\n PostPoll,\n EditPollModal,\n ListVotersModal,\n PollForm,\n ComposePollHero,\n ComposePollPage,\n PollsPage,\n PollView,\n PollViewPage,\n PollSubmitButton,\n PollOption,\n PollOptions,\n PollsShowcasePage,\n PollShowcase,\n PollShowcaseItem,\n AbstractPollPage,\n PollTitle,\n PollSubtitle,\n PollImage,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/computed'];","import Model from 'flarum/common/Model';\nimport PollOption from './PollOption';\nimport PollVote from './PollVote';\nimport computed from 'flarum/common/utils/computed';\n\nexport default class Poll extends Model {\n public tempOptions: PollOption[] | undefined;\n\n question() {\n return Model.attribute('question').call(this);\n }\n\n subtitle() {\n return Model.attribute('subtitle').call(this);\n }\n\n image() {\n return Model.attribute('image').call(this);\n }\n\n imageUrl() {\n return Model.attribute('imageUrl').call(this);\n }\n\n imageAlt() {\n return Model.attribute('imageAlt').call(this);\n }\n\n hasEnded() {\n return Model.attribute('hasEnded').call(this);\n }\n\n endDate() {\n return Model.attribute('endDate', Model.transformDate).call(this);\n }\n\n publicPoll() {\n return Model.attribute('publicPoll').call(this);\n }\n\n hideVotes() {\n return Model.attribute('hideVotes').call(this);\n }\n\n allowChangeVote() {\n return Model.attribute('allowChangeVote').call(this);\n }\n\n allowMultipleVotes() {\n return Model.attribute('allowMultipleVotes').call(this);\n }\n\n maxVotes() {\n return Model.attribute('maxVotes').call(this);\n }\n\n voteCount() {\n return Model.attribute('voteCount').call(this);\n }\n\n canVote() {\n return Model.attribute('canVote').call(this);\n }\n\n canEdit() {\n return Model.attribute('canEdit').call(this);\n }\n\n canDelete() {\n return Model.attribute('canDelete').call(this);\n }\n\n canSeeVoters() {\n return Model.attribute('canSeeVoters').call(this);\n }\n\n canChangeVote() {\n return Model.attribute('canChangeVote').call(this);\n }\n\n options() {\n const options = Model.hasMany('options').call(this);\n return options ? (options as PollOption[]) : [];\n }\n\n votes() {\n return Model.hasMany('votes').call(this);\n }\n\n myVotes(): PollVote[] {\n const myVotes = Model.hasMany('myVotes').call(this);\n return myVotes ? (myVotes as PollVote[]) : [];\n }\n\n isGlobal() {\n return Model.attribute('isGlobal').call(this);\n }\n\n isHidden() {\n return computed('hiddenAt', (hiddenAt) => !!hiddenAt).call(this);\n }\n\n // TODO: These two don't make sense as of now\n isUnread() {\n return false;\n }\n\n apiEndpoint() {\n /** @ts-ignore */\n return `/fof/polls${this.exists ? `/${this.data.id}` : ''}`;\n }\n}\n","import Model from 'flarum/common/Model';\nimport Poll from './Poll';\nimport PollVote from './PollVote';\n\nexport default class PollOption extends Model {\n answer() {\n return Model.attribute('answer').call(this);\n }\n\n imageUrl() {\n return Model.attribute('imageUrl').call(this);\n }\n\n voteCount() {\n return Model.attribute('voteCount').call(this);\n }\n\n poll() {\n return Model.hasOne('polls').call(this);\n }\n\n votes() {\n return Model.hasMany('votes').call(this);\n }\n\n apiEndpoint() {\n /** @ts-ignore */\n return `/fof/polls/answers${this.exists ? `/${this.data.id}` : ''}`;\n }\n}\n","import Model from 'flarum/common/Model';\nimport Poll from './Poll';\nimport PollOption from './PollOption';\nimport User from 'flarum/common/models/User';\n\nexport default class PollVote extends Model {\n poll() {\n return Model.hasOne('poll').call(this);\n }\n\n option() {\n const result = Model.hasOne('option').call(this);\n return result === false ? null : result;\n }\n\n user() {\n return Model.hasOne('user').call(this);\n }\n\n pollId() {\n return Model.attribute('pollId').call(this);\n }\n\n optionId() {\n return Model.attribute('optionId').call(this);\n }\n\n apiEndpoint() {\n return `/fof/polls/${this.pollId()}/vote`;\n }\n}\n","import Poll from './Poll';\nimport PollOption from './PollOption';\nimport PollVote from './PollVote';\n\nexport const models = {\n Poll,\n PollOption,\n PollVote,\n};\n","import PollFormState from './PollFormState';\nimport PollListState from './PollListState';\nimport PollState from './PollState';\n\nexport const states = {\n PollFormState,\n PollListState,\n PollState,\n};\n","import PollControls from './PollControls';\n\nexport const utils = {\n PollControls,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extenders'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Post'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Forum'];","import Extend from 'flarum/common/extenders';\nimport Post from 'flarum/common/models/Post';\nimport Forum from 'flarum/common/models/Forum';\nimport Discussion from 'flarum/common/models/Discussion';\nimport Poll from './models/Poll';\nimport PollOption from './models/PollOption';\nimport PollVote from './models/PollVote';\nimport PollsPage from './components/PollsPage';\nimport ComposePollPage from './components/ComposePollPage';\nimport PollViewPage from './components/PollViewPage';\nimport PollsShowcasePage from './components/PollsShowcasePage';\n\nexport default [\n new Extend.Routes() //\n .add('fof.polls.showcase', '/polls', PollsShowcasePage)\n .add('fof.polls.list', '/polls/all', PollsPage)\n .add('fof.polls.view', '/polls/view/:id', PollViewPage)\n .add('fof.polls.compose', '/polls/composer', ComposePollPage),\n\n new Extend.Store() //\n .add('polls', Poll)\n .add('poll_options', PollOption)\n .add('poll_votes', PollVote),\n\n new Extend.Model(Post) //\n .hasMany('polls')\n .attribute('canStartPoll'),\n\n new Extend.Model(Forum) //\n .attribute('canStartPolls'),\n\n new Extend.Model(Discussion) //\n .attribute('hasPoll')\n .attribute('canStartPoll'),\n];\n","import app from 'flarum/forum/app';\n\nimport addDiscussionBadge from './addDiscussionBadge';\nimport addComposerItems from './addComposerItems';\nimport addPollsToPost from './addPollsToPost';\nimport addPostControls from './addPostControls';\nimport addNavItem from './addNavItem';\n\nexport * from './components';\nexport * from './models';\nexport * from './states';\nexport * from './utils';\n\napp.initializers.add('fof/polls', () => {\n addDiscussionBadge();\n addComposerItems();\n addPollsToPost();\n addPostControls();\n addNavItem();\n});\n\nexport { default as extend } from './extend';\n","import app from 'flarum/forum/app';\n\nimport { extend } from 'flarum/common/extend';\nimport PostControls from 'flarum/forum/utils/PostControls';\nimport CreatePollModal from './components/CreatePollModal';\nimport Button from 'flarum/common/components/Button';\nimport Post from 'flarum/common/models/Post';\nimport PollModelAttributes from './models/PollModelAttributes';\n\nexport default () => {\n const createPoll = (post: Post) =>\n app.modal.show(CreatePollModal, {\n onsubmit: (data: PollModelAttributes) =>\n app.store\n .createRecord('polls')\n .save(\n {\n ...data,\n relationships: {\n post,\n },\n },\n {\n data: {\n include: 'options,myVotes,myVotes.option',\n },\n }\n )\n .then((poll) => {\n // @ts-ignore\n post.rawRelationship('polls')?.push?.({ type: 'polls', id: poll.id() });\n\n return poll;\n }),\n });\n\n extend(PostControls, 'moderationControls', function (items, post) {\n // @ts-ignore\n if (!post.isHidden() && post.canStartPoll()) {\n items.add(\n 'addPoll',\n \n );\n }\n });\n};\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport LinkButton from 'flarum/common/components/LinkButton';\n\nexport default function addNavItem() {\n extend(IndexPage.prototype, 'navItems', (items) => {\n if (!app.forum.attribute('globalPollsEnabled')) {\n return;\n }\n\n items.add(\n 'fof-polls-showcase',\n LinkButton.component(\n {\n href: app.route('fof.polls.showcase'),\n icon: 'fas fa-poll',\n },\n app.translator.trans('fof-polls.forum.page.nav')\n ),\n 35\n );\n\n const showAllGlobalPolls = app.forum.attribute('canStartGlobalPolls');\n\n if (showAllGlobalPolls) {\n items.add(\n 'fof-polls-list',\n LinkButton.component(\n {\n href: app.route('fof.polls.list'),\n icon: 'fas fa-list',\n },\n app.translator.trans('fof-polls.forum.page.nav-all')\n ),\n 32\n );\n }\n });\n}\n"],"names":["_typeof","require","_regeneratorRuntime","module","exports","e","__esModule","t","r","Object","prototype","n","hasOwnProperty","o","defineProperty","value","i","Symbol","a","iterator","c","asyncIterator","u","toStringTag","define","enumerable","configurable","writable","wrap","Generator","create","Context","makeInvokeMethod","tryCatch","type","arg","call","h","l","f","s","y","GeneratorFunction","GeneratorFunctionPrototype","p","this","d","getPrototypeOf","v","values","g","defineIteratorMethods","forEach","_invoke","AsyncIterator","invoke","resolve","__await","then","callInvokeWithMethodAndArg","Error","done","method","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","TypeError","resultName","next","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","isNaN","length","displayName","isGeneratorFunction","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","keys","reverse","pop","prev","charAt","slice","stop","rval","handle","complete","finish","delegateYield","runtime","regeneratorRuntime","accidentalStrictMode","globalThis","Function","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","getter","definition","key","get","obj","prop","flarum","core","compat","asyncGeneratorStep","gen","reject","_next","_throw","info","error","_asyncToGenerator","fn","self","args","arguments","apply","err","_setPrototypeOf","bind","_inheritsLoose","subClass","superClass","_getPrototypeOf","_isNativeReflectConstruct","Boolean","valueOf","Reflect","construct","_wrapNativeSuper","Class","_cache","Map","toString","indexOf","isNativeFunction","has","set","Wrapper","isNativeReflectConstruct","FormError","_Error","props","PollFormState","poll","loading","deleting","expandedGroup","createNewPoll","app","createRecord","pushAttributes","question","endDate","publicPoll","allowMultipleVotes","hideVotes","allowChangeVote","maxVotes","tempOptions","_proto","isExpanded","groupKey","expand","m","redraw","save","_save","_callee","data","_context","attributes","options","_x","_delete2","_callee2","_context2","ComposePollHero","_Component","_this","_len","Array","_key","concat","oninit","vnode","attrs","view","className","trans","id","controlItems","toArray","items","ItemList","add","LinkButton","icon","itemClassName","href","exists","Component","ComposePollPage","_Page","_this$poll","_this$poll2","_this2","attribute","editId","route","param","getById","find","item","_this2$poll","bodyClass","LoadingIndicator","listItems","sidebarItems","PollForm","onsubmit","_onsubmit","state","isNew","alertAttrs","alertId","controls","Button","onclick","show","setTimeout","dismiss","_x2","SelectDropdown","buttonClassName","accessibleToggleLabel","navItems","IndexPage","Page","PollOption","option","hasVoted","totalVotes","votes","voted","canSeeVoteCount","answer","percent","Math","round","_this$poll$myVotes","overallVoteCount","voteCount","hasVotedFor","isDisabled","loadingOptions","canChangeVote","width","Number","myVotes","bar","style","showCheckMarks","checked","disabled","onchange","changeVote","optionDisplayItems","imageUrl","src","alt","classList","Tooltip","text","count","onremove","hideOptionTooltip","tooltipVisible","updateVisibility","PollOptions","pollOptions","createOptionView","PollImage","imageAlt","imageItems","_this$imageAlt","ListVotersModal","_Modal","include","title","content","map","optionContent","opt","filter","optionAnswer","voteContent","vote","user","Link","avatar","username","Modal","PollState","pendingSubmit","pendingOptions","useSubmitUI","showVoters","hasEnded","canVote","init","isShowResult","some","getMaxVotes","showButton","evt","target","LogInModal","optionIds","Set","isUnvoting","clear","size","submit","hasSelectedOptions","cb","onerror","_this3","url","body","from","res","pushPayload","PollSubmitButton","event","pollButtonSubmit","PollTitle","pollTitleItems","PollSubtitle","subtitle","pollSubtitleItems","PollView","preventClose","preventDefault","oncreate","window","addEventListener","removeEventListener","PollControls","canEdit","controlsView","createMainView","createPollHeader","createPollContent","createPollFooter","createFormItems","infoItems","isEmpty","questionSlug","slug","Dropdown","menuClassName","class","time","dayjs","fromNow","max","toPropertyKey","toPrimitive","String","_defineProperties","descriptor","_createClass","Constructor","protoProps","staticProps","PollPageHero","wrapperClasses","classNames","Hero","AbstractPollPage","polls","pageContent","hero","mainContent","sidebar","contentItems","IndexPageHero","setContent","remove","toObject","startsWith","PollViewPage","_AbstractPollPage","PollListItem","subtree","highlightRegExp","SubtreeRetainer","freshness","markedAllAsReadAt","getTime","active","elementAttrs","isHidden","Slidable","contentView","slidableUnderneathView","isUnread","markAsRead","mainView","highlight","slidableInstance","slidable","element","$","on","onbeforeupdate","needsRebuild","matches","lastVotedNumber","activeView","abbreviateNumber","PollList","params","getParams","isLoading","isInitialLoading","isLoadingNext","hasNext","loadNext","Placeholder","isSearchResults","getPages","pg","globalEventEmitter","EventEmitter","PollListState","_PaginatedListState","page","extraPolls","eventEmitter","deletePoll","ReferenceError","_assertThisInitialized","requestParams","_this$params$sort","sort","sortMap","q","loadPage","preloadedPolls","initialLoading","relevance","newest","oldest","removePoll","emit","_step","_iterator","_createForOfIteratorHelperLoose","pages","index","splice","addPoll","unshift","getAllItems","number","PaginatedListState","PollsPage","refresh","extractText","viewItems","actionItems","canStartPoll","newPollAction","context","section","itemName","Separator","pollControls","moderationControls","editAction","destructiveControls","canDelete","deleteAction","confirm","showDeletionAlert","back","location","reload","message","success","_extends","assign","source","UploadPollImageButton","_Button","uploadedImageUrl","fileName","$input","getImageUrl","children","upload","appendTo","hide","trigger","FormData","append","files","resourceUrl","serialize","raw","failure","_this$attrs$poll","_this$attrs$option","_this$attrs$poll2","_this$attrs$option2","response","_this$attrs$onUpload","_this$attrs","_this$$input","fileUrl","onUpload","_this$$input2","optionAnswers","optionImageUrls","image","datepickerMinDate","_poll$tempOptions","Stream","formatDate","isAfter","fields","bidi","pollImageUploadSuccess","required","displayOptions","addOption","min","isBefore","Switch","placeholder","pollOptionImageUploadSuccess","removeOption","alert","_this$dateToTimestamp","pollExists","pollImage","dateToTimestamp","t0","RequestError","console","date","def","dayjsDate","isValid","format","CreatePollModal","onFormSubmit","_onFormSubmit","toPoll","pollOption","addToComposer","composer","extend","_this$composer$body","_discussion$canStartP","discussion","canStartPolls","EditPollModal","_CreatePollModal","PostPoll","canSeeVoters","viewOption","_poll$myVotes","_poll$myVotes2","_poll$myVotes3","_poll$myVotes4","showCheckmark","_this$attrs$poll$myVo","_this$attrs$poll$myVo2","post","sync","PollShowcaseItem","PollShowcase","showcaseItems","endedItems","PollsShowcasePage","includeParams","components","Poll","_Model","Model","isGlobal","computed","hiddenAt","apiEndpoint","PollVote","result","pollId","optionId","models","states","utils","Extend","Post","hasMany","Forum","Discussion","createPoll","DiscussionList","badges","hasPoll","Badge","label","DiscussionComposer","ReplyComposer","CommentPost","revealContent","check","checks","_poll$data","_poll$options$map","_poll$options","_poll$myVotes$map","_option$data","_vote$option","JSON","stringify","DiscussionPage","binding","channels","main","changedOptions","unbind","relationships","_post$rawRelationship","rawRelationship","PostControls"],"sourceRoot":""} \ No newline at end of file