From 8bea804340b5d1d9d0791ed52ba3050e3c1daf7d Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Mon, 13 Nov 2023 11:36:52 +0000 Subject: [PATCH] Bundled output for commit 9424f5dccce1ad0020be191a5eb208c61f3c6454 Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] --- js/dist/admin.js.map | 2 +- js/dist/forum.js | 2 +- js/dist/forum.js.map | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/js/dist/admin.js.map b/js/dist/admin.js.map index 197870d..51cf1be 100755 --- a/js/dist/admin.js.map +++ b/js/dist/admin.js.map @@ -1 +1 @@ -{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,wBCL/C,SAASC,EAAgBb,EAAGc,GAKzC,OAJAD,EAAkBZ,OAAOc,eAAiBd,OAAOc,eAAeC,OAAS,SAAyBhB,EAAGc,GAEnG,OADAd,EAAEiB,UAAYH,EACPd,CACR,EACMa,EAAgBb,EAAGc,EAC3B,CCLc,SAASI,EAAeC,EAAUC,GAC/CD,EAASZ,UAAYN,OAAOoB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,cAAgBhC,EAAMgC,WAAa,IAErD,IAAMtC,EAAQsE,EAAKtE,QAInB,OAHAM,EAAM0H,MAAMC,gBAAkB3H,EAAM0H,MAAMhI,MAAQA,EAClDM,EAAMgC,WAAa,WAEZ2C,EAAE,OAAQ3E,EAAO,UAAMgC,UAAU,kBAAkBgC,EAAKvE,QAChE,GCNYmI,EAAa,CACxB7E,aAAAA,EACAnD,kBAAAA,GCDFE,IAAAA,aAAAA,IAAqB,oBAAoB,SAACA,GACxCA,EAAI+H,MAAMlI,OAAOyD,MAAQ/D,EAEzBS,EAAIgI,cAAJ,IACO,oBACJC,mBACC,CACExF,KAAM,mBACNyF,MAAOlI,EAAImI,WAAWC,MAAM,iDAC5BC,WAAY,wBAEd,SAEDJ,mBACC,CACExF,KAAM,mBACNyF,MAAOlI,EAAImI,WAAWC,MAAM,sDAC5BC,WAAY,yBACZC,YAAY,GAEd,QAEDL,mBACC,CACExF,KAAM,qBACNyF,MAAOlI,EAAImI,WAAWC,MAAM,uDAC5BC,WAAY,0BACZC,YAAY,GAEd,QAEDL,mBACC,CACExF,KAAM,gBACNyF,MAAOlI,EAAImI,WAAWC,MAAM,uDAC5BC,WAAY,mCACZC,YAAY,GAEd,QAEDL,mBACC,CACExF,KAAM,cACNyF,MAAOlI,EAAImI,WAAWC,MAAM,2DAC5BC,WAAY,mCAEd,QAEDJ,mBACC,CACExF,KAAM,cACNyF,MAAOlI,EAAImI,WAAWC,MAAM,6DAC5BC,WAAY,qCAEd,QAEDE,aAAatF,EACjB,G","sources":["webpack://@fof/gamification/webpack/bootstrap","webpack://@fof/gamification/webpack/runtime/compat get default export","webpack://@fof/gamification/webpack/runtime/define property getters","webpack://@fof/gamification/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/gamification/webpack/runtime/make namespace object","webpack://@fof/gamification/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/gamification/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/gamification/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/utils/mixin']\"","webpack://@fof/gamification/./src/common/models/Rank.js","webpack://@fof/gamification/./src/common/models/index.js","webpack://@fof/gamification/external root \"flarum.core.compat['admin/app']\"","webpack://@fof/gamification/external root \"flarum.core.compat['admin/components/ExtensionPage']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/gamification/external root \"flarum.core.compat['admin/utils/saveSettings']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/components/Switch']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/utils/withAttr']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@fof/gamification/external root \"flarum.core.compat['admin/components/UploadImageButton']\"","webpack://@fof/gamification/./src/admin/components/UploadImageButton.js","webpack://@fof/gamification/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/components/Select']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/components/Tooltip']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/utils/extractText']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/models/Group']\"","webpack://@fof/gamification/./src/admin/components/GroupSettings.tsx","webpack://@fof/gamification/./src/admin/components/SettingsPage.js","webpack://@fof/gamification/./src/common/helpers/index.js","webpack://@fof/gamification/./src/common/helpers/rankLabel.js","webpack://@fof/gamification/./src/admin/components/index.js","webpack://@fof/gamification/./src/admin/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","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/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/mixin'];","import Model from 'flarum/common/Model';\nimport mixin from 'flarum/common/utils/mixin';\n\nexport default class Rank extends mixin(Model, {\n points: Model.attribute('points'),\n name: Model.attribute('name'),\n color: Model.attribute('color'),\n}) {}\n","import Rank from './Rank';\n\nexport const models = {\n Rank,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/ExtensionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/utils/saveSettings'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/withAttr'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/UploadImageButton'];","import app from 'flarum/admin/app';\nimport FlarumUploadImageButton from 'flarum/admin/components/UploadImageButton';\n\nexport default class UploadImageButton extends FlarumUploadImageButton {\n resourceUrl() {\n return app.forum.attribute('apiUrl') + '/' + this.attrs.path;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Select'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extractText'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Group'];","import app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport Select from 'flarum/common/components/Select';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport extractText from 'flarum/common/utils/extractText';\nimport withAttr from 'flarum/common/utils/withAttr';\nimport Stream from 'flarum/common/utils/Stream';\nimport Group from 'flarum/common/models/Group';\n\ninterface SettingsEntry {\n groupId?: number;\n minPoints?: number;\n maxPoints?: number;\n}\n\ninterface GroupSettingsAttrs {\n value: string;\n onchange: (value: string) => void;\n}\n\nexport default class GroupSettings extends Component {\n newGroupId = Stream('');\n newMinPoints = Stream('');\n newMaxPoints = Stream('');\n\n view() {\n let entries: SettingsEntry[] = [];\n\n try {\n entries = JSON.parse(this.attrs.value);\n } catch (error) {\n // silence errors. Will reset to empty array below\n }\n\n if (!Array.isArray(entries)) {\n entries = [];\n }\n\n let groupOptions: { [id: string]: string } = {};\n\n app.store.all('groups').forEach((group) => {\n // Don't allow Member or Guest since those are virtual, and don't allow Admin as it's too dangerous and could strip admins of their roles\n if ([Group.ADMINISTRATOR_ID, Group.MEMBER_ID, Group.GUEST_ID].indexOf(group.id()!) !== -1) {\n return;\n }\n\n groupOptions[group.id()!] = group.nameSingular();\n });\n\n const addHandler = () => {\n const newEntry: SettingsEntry = {\n groupId: parseInt(this.newGroupId()),\n };\n\n if (this.newMinPoints()) {\n newEntry.minPoints = parseInt(this.newMinPoints());\n }\n\n if (this.newMaxPoints()) {\n newEntry.maxPoints = parseInt(this.newMaxPoints());\n }\n\n entries.push(newEntry);\n\n this.attrs.onchange(JSON.stringify(entries));\n\n this.newGroupId('');\n this.newMinPoints('');\n this.newMaxPoints('');\n };\n\n return (\n \n \n \n \n \n \n \n \n \n {entries.map((entry, entryIndex) => {\n const valueChangeHandler = (attribute: keyof SettingsEntry) => {\n return (value: string) => {\n if (value === '') {\n delete entry[attribute];\n } else {\n entry[attribute] = parseInt(value);\n }\n\n this.attrs.onchange(JSON.stringify(entries));\n };\n };\n\n const deleteHandler = () => {\n entries.splice(entryIndex, 1);\n\n this.attrs.onchange(JSON.stringify(entries));\n };\n\n return (\n \n \n \n \n \n \n );\n })}\n \n \n \n \n \n \n \n
{app.translator.trans('fof-gamification.admin.page.groups.column.group')}{app.translator.trans('fof-gamification.admin.page.groups.column.minPoints')}{app.translator.trans('fof-gamification.admin.page.groups.column.maxPoints')}
\n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n
\n );\n }\n}\n","import app from 'flarum/admin/app';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport Button from 'flarum/common/components/Button';\nimport saveSettings from 'flarum/admin/utils/saveSettings';\nimport Switch from 'flarum/common/components/Switch';\nimport withAttr from 'flarum/common/utils/withAttr';\nimport Stream from 'flarum/common/utils/Stream';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport UploadImageButton from './UploadImageButton';\nimport GroupSettings from './GroupSettings';\n\nexport default class SettingsPage extends ExtensionPage {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.fields = [\n 'convertedLikes',\n 'amountPerPost',\n 'amountPerDiscussion',\n 'postStartAmount',\n 'rankAmt',\n 'iconName',\n 'blockedUsers',\n 'iconNameAlt',\n 'autoAssignedGroups',\n ];\n\n this.switches = [\n 'autoUpvotePosts',\n 'customRankingImages',\n 'rateLimit',\n 'showVotesOnDiscussionPage',\n 'useAlternateLayout',\n 'altPostVotingUi',\n 'upVotesOnly',\n 'firstPostOnly',\n 'allowSelfVotes',\n ];\n\n this.ranks = app.store.all('ranks');\n\n this.values = {};\n\n this.settingsPrefix = 'fof-gamification';\n\n const settings = app.data.settings;\n\n this.fields.forEach((key) => (this.values[key] = Stream(settings[this.addPrefix(key)])));\n\n this.switches.forEach((key) => (this.values[key] = Stream(!!Number(settings[this.addPrefix(key)]))));\n\n this.newRank = {\n points: Stream(''),\n name: Stream(''),\n color: Stream(''),\n };\n }\n\n /**\n * @returns {*}\n */\n content() {\n return (\n
\n
\n
{this.settingsItems().toArray()}
\n
\n
\n );\n }\n\n updateName(rank, value) {\n rank.save({ name: value });\n }\n\n updatePoints(rank, value) {\n rank.save({ points: value });\n }\n\n updateColor(rank, value) {\n rank.save({ color: value });\n }\n\n deleteRank(rankToDelete) {\n rankToDelete.delete();\n this.ranks.some((rank, i) => {\n if (rank.data.id === rankToDelete.data.id) {\n this.ranks.splice(i, 1);\n return true;\n }\n });\n }\n\n addRank() {\n app.store\n .createRecord('ranks')\n .save({\n points: this.newRank.points(),\n name: this.newRank.name(),\n color: this.newRank.color(),\n })\n .then(() => {\n this.newRank.color('');\n this.newRank.name('');\n this.newRank.points('');\n\n m.redraw();\n });\n }\n\n /**\n *\n * @returns boolean\n */\n changed() {\n var switchesCheck = this.switches.some((key) => this.values[key]() !== (app.data.settings[this.addPrefix(key)] == '1'));\n var fieldsCheck = this.fields.some((key) => this.values[key]() !== app.data.settings[this.addPrefix(key)]);\n return fieldsCheck || switchesCheck;\n }\n\n prepareSubmissionData() {\n const settings = {};\n\n this.switches.forEach((key) => (settings[this.addPrefix(key)] = this.values[key]()));\n this.fields.forEach((key) => (settings[this.addPrefix(key)] = this.values[key]()));\n\n return settings;\n }\n\n /**\n * @param e\n */\n onsubmit(e) {\n e.preventDefault();\n\n if (this.loading) return;\n\n this.loading = true;\n\n app.alerts.dismiss(this.successAlert);\n\n saveSettings(this.prepareSubmissionData())\n .then(this.onsaved.bind(this))\n .then(() => window.location.reload())\n .catch(console.error)\n .then(() => {\n this.loading = false;\n });\n }\n\n /**\n * @returns string\n */\n addPrefix(key) {\n return this.settingsPrefix + '.' + key;\n }\n\n settingsItems() {\n const items = new ItemList();\n\n items.add(\n 'convertLikesToUpvotes',\n
\n
{app.translator.trans('fof-gamification.admin.page.convert.help')}
\n {this.values.convertedLikes() === undefined ? (\n {\n app\n .request({\n url: app.forum.attribute('apiUrl') + '/fof/gamification/convert',\n method: 'POST',\n })\n .then(this.values.convertedLikes('converting'));\n }}\n >\n {app.translator.trans('fof-gamification.admin.page.convert.button')}\n \n ) : this.values.convertedLikes() === 'converting' ? (\n \n ) : (\n \n )}\n
,\n 100\n );\n\n items.add(\n 'ranks',\n
\n {app.translator.trans('fof-gamification.admin.page.ranks.title')}\n \n
{app.translator.trans('fof-gamification.admin.page.ranks.help.help')}
\n
\n {this.ranks.map((rank) => (\n
\n \n \n \n
\n ))}\n
\n
\n \n \n \n\n \n
\n \n \n
,\n 90\n );\n\n items.add(\n 'voteSettings',\n <>\n {app.translator.trans('fof-gamification.admin.page.votes.title')}\n {this.voteItems().toArray()}\n ,\n 80\n );\n\n items.add(\n 'rankingsPage',\n <>\n {app.translator.trans('fof-gamification.admin.page.rankings.title')}\n {this.rankingsItems().toArray()}\n ,\n 70\n );\n\n items.add(\n 'groups',\n
\n {app.translator.trans('fof-gamification.admin.page.groups.title')}\n
{app.translator.trans('fof-gamification.admin.page.groups.help')}
\n \n
,\n 60\n );\n\n items.add(\n 'submit',\n ,\n 0\n );\n\n return items;\n }\n\n voteItems() {\n const items = new ItemList();\n\n items.add(\n 'icon',\n <>\n \n
{app.translator.trans('fof-gamification.admin.page.votes.icon_help')}
\n \n ,\n 100\n );\n\n items.add(\n 'altIcon',\n <>\n \n
{app.translator.trans('fof-gamification.admin.page.votes.icon_help')}
\n \n ,\n 90\n );\n\n items.add(\n 'autoUpvote',\n \n {app.translator.trans('fof-gamification.admin.page.votes.auto_upvote')}\n ,\n 80\n );\n\n items.add(\n 'rateLimit',\n \n {app.translator.trans('fof-gamification.admin.page.votes.rate_limit')}\n ,\n 70\n );\n\n items.add(\n 'opVotesOnDiscussionList',\n \n {app.translator.trans('fof-gamification.admin.page.votes.discussion_page')}\n ,\n 60\n );\n\n items.add(\n 'altDiscussionListLayout',\n \n {app.translator.trans('fof-gamification.admin.page.votes.alternate_layout')}\n ,\n 50\n );\n\n items.add(\n 'altPostLayout',\n \n {app.translator.trans('fof-gamification.admin.page.votes.alternate_post_layout')}\n ,\n 40\n );\n\n items.add(\n 'upvotesOnly',\n \n {app.translator.trans('fof-gamification.admin.page.votes.upvotes_only')}\n ,\n 30\n );\n\n items.add(\n 'firstPostOnly',\n \n {app.translator.trans('fof-gamification.admin.page.votes.first_post_only')}\n ,\n 20\n );\n\n items.add(\n 'allowSelfVotes',\n \n {app.translator.trans('fof-gamification.admin.page.votes.allow_self_votes')}\n ,\n 10\n );\n\n return items;\n }\n\n rankingsItems() {\n const items = new ItemList();\n\n items.add(\n 'customImages',\n \n {app.translator.trans('fof-gamification.admin.page.rankings.enable')}\n ,\n 100\n );\n\n items.add(\n 'ignoredUsers',\n <>\n \n \n ,\n 90\n );\n\n items.add(\n 'customImages',\n <>\n
{app.translator.trans('fof-gamification.admin.page.rankings.blocked.help')}
\n {[1, 2, 3].map((num) => (\n <>\n \n \n
\n \n ))}\n ,\n 80\n );\n\n return items;\n }\n}\n","import rankLabel from './rankLabel';\n\nexport const helpers = {\n rankLabel,\n};\n","export default function rankLabel(rank, attrs = {}) {\n attrs.style = attrs.style || {};\n attrs.className = 'rankLabel ' + (attrs.className || '');\n\n const color = rank.color();\n attrs.style.backgroundColor = attrs.style.color = color;\n attrs.className += ' colored';\n\n return m('span', attrs, {rank.name()});\n}\n","import SettingsPage from './SettingsPage';\nimport UploadImageButton from './UploadImageButton';\n\nexport const components = {\n SettingsPage,\n UploadImageButton,\n};\n","import app from 'flarum/admin/app';\nimport SettingsPage from './components/SettingsPage';\nimport Rank from '../common/models/Rank';\n\napp.initializers.add('fof-gamification', (app) => {\n app.store.models.ranks = Rank;\n\n app.extensionData\n .for('fof-gamification')\n .registerPermission(\n {\n icon: 'fas fa-thumbs-up',\n label: app.translator.trans('fof-gamification.admin.permissions.vote_label'),\n permission: 'discussion.votePosts',\n },\n 'reply'\n )\n .registerPermission(\n {\n icon: 'fas fa-thumbs-up',\n label: app.translator.trans('fof-gamification.admin.permissions.see_votes_label'),\n permission: 'discussion.canSeeVotes',\n allowGuest: true,\n },\n 'view'\n )\n .registerPermission(\n {\n icon: 'fas fa-info-circle',\n label: app.translator.trans('fof-gamification.admin.permissions.see_voters_label'),\n permission: 'discussion.canSeeVoters',\n allowGuest: true,\n },\n 'view'\n )\n .registerPermission(\n {\n icon: 'fas fa-trophy',\n label: app.translator.trans('fof-gamification.admin.permissions.see_ranking_page'),\n permission: 'fof.gamification.viewRankingPage',\n allowGuest: true,\n },\n 'view'\n )\n .registerPermission(\n {\n icon: 'fas fa-bell',\n label: app.translator.trans('fof-gamification.admin.permissions.upvote_notifications'),\n permission: 'discussion.upvote_notifications',\n },\n 'view'\n )\n .registerPermission(\n {\n icon: 'fas fa-bell',\n label: app.translator.trans('fof-gamification.admin.permissions.downvote_notifications'),\n permission: 'discussion.downvote_notifications',\n },\n 'view'\n )\n .registerPage(SettingsPage);\n});\n\nexport * from '../common/helpers';\nexport * from './components';\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","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","_inheritsLoose","subClass","superClass","create","constructor","flarum","core","compat","Rank","mixin","Model","points","name","color","models","UploadImageButton","resourceUrl","app","this","attrs","path","FlarumUploadImageButton","GroupSettings","newGroupId","Stream","newMinPoints","newMaxPoints","view","entries","JSON","parse","error","Array","isArray","groupOptions","forEach","group","Group","indexOf","id","nameSingular","map","entry","entryIndex","valueChangeHandler","attribute","parseInt","onchange","stringify","options","groupId","className","type","minPoints","withAttr","maxPoints","text","extractText","icon","onclick","splice","bidi","newEntry","push","disabled","Component","SettingsPage","oninit","vnode","fields","switches","ranks","values","settingsPrefix","settings","addPrefix","Number","newRank","content","onsubmit","settingsItems","toArray","updateName","rank","save","updatePoints","updateColor","deleteRank","rankToDelete","some","i","data","addRank","then","m","redraw","changed","switchesCheck","prepareSubmissionData","e","preventDefault","loading","successAlert","saveSettings","onsaved","window","location","reload","console","items","ItemList","add","undefined","convertedLikes","url","method","number","placeholder","oninput","rankAmt","min","voteItems","rankingsItems","autoAssignedGroups","iconName","iconNameAlt","state","autoUpvotePosts","rateLimit","showVotesOnDiscussionPage","useAlternateLayout","altPostVotingUi","upVotesOnly","firstPostOnly","allowSelfVotes","customRankingImages","blockedUsers","num","ExtensionPage","helpers","rankLabel","style","backgroundColor","components","store","extensionData","registerPermission","label","translator","trans","permission","allowGuest","registerPage"],"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,EA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AAWxH,MAAM,uDAC5ByH,WAAY,0BACZC,YAAY,GAEd,QAEDJ,mBACC,CACElG,KAAM,gBACNmG,MAAO1J,EAAI2J,WAAWxH,MAAM,uDAC5ByH,WAAY,mCACZC,YAAY,GAEd,QAEDJ,mBACC,CACElG,KAAM,cACNmG,MAAO1J,EAAI2J,WAAWxH,MAAM,2DAC5ByH,WAAY,mCAEd,QAEDH,mBACC,CACElG,KAAM,cACNmG,MAAO1J,EAAI2J,WAAWxH,MAAM,6DAC5ByH,WAAY,qCAEd,QAEDE,aAAa/F,EAClB,G","sources":["webpack://@fof/gamification/webpack/bootstrap","webpack://@fof/gamification/webpack/runtime/compat get default export","webpack://@fof/gamification/webpack/runtime/define property getters","webpack://@fof/gamification/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/gamification/webpack/runtime/make namespace object","webpack://@fof/gamification/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/gamification/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/gamification/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/utils/mixin']\"","webpack://@fof/gamification/./src/common/models/Rank.js","webpack://@fof/gamification/./src/common/models/index.js","webpack://@fof/gamification/external root \"flarum.core.compat['admin/app']\"","webpack://@fof/gamification/external root \"flarum.core.compat['admin/components/ExtensionPage']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/gamification/external root \"flarum.core.compat['admin/utils/saveSettings']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/components/Switch']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/utils/withAttr']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@fof/gamification/external root \"flarum.core.compat['admin/components/UploadImageButton']\"","webpack://@fof/gamification/./src/admin/components/UploadImageButton.js","webpack://@fof/gamification/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/components/Select']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/components/Tooltip']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/utils/extractText']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/models/Group']\"","webpack://@fof/gamification/./src/admin/components/GroupSettings.tsx","webpack://@fof/gamification/./src/admin/components/SettingsPage.js","webpack://@fof/gamification/./src/common/helpers/index.js","webpack://@fof/gamification/./src/common/helpers/rankLabel.js","webpack://@fof/gamification/./src/admin/components/index.js","webpack://@fof/gamification/./src/admin/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","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/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/mixin'];","import Model from 'flarum/common/Model';\nimport mixin from 'flarum/common/utils/mixin';\n\nexport default class Rank extends mixin(Model, {\n points: Model.attribute('points'),\n name: Model.attribute('name'),\n color: Model.attribute('color'),\n}) {}\n","import Rank from './Rank';\n\nexport const models = {\n Rank,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/ExtensionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/utils/saveSettings'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/withAttr'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/UploadImageButton'];","import app from 'flarum/admin/app';\nimport FlarumUploadImageButton from 'flarum/admin/components/UploadImageButton';\n\nexport default class UploadImageButton extends FlarumUploadImageButton {\n resourceUrl() {\n return app.forum.attribute('apiUrl') + '/' + this.attrs.path;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Select'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extractText'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Group'];","import app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport Select from 'flarum/common/components/Select';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport extractText from 'flarum/common/utils/extractText';\nimport withAttr from 'flarum/common/utils/withAttr';\nimport Stream from 'flarum/common/utils/Stream';\nimport Group from 'flarum/common/models/Group';\n\ninterface SettingsEntry {\n groupId?: number;\n minPoints?: number;\n maxPoints?: number;\n}\n\ninterface GroupSettingsAttrs {\n value: string;\n onchange: (value: string) => void;\n}\n\nexport default class GroupSettings extends Component {\n newGroupId = Stream('');\n newMinPoints = Stream('');\n newMaxPoints = Stream('');\n\n view() {\n let entries: SettingsEntry[] = [];\n\n try {\n entries = JSON.parse(this.attrs.value);\n } catch (error) {\n // silence errors. Will reset to empty array below\n }\n\n if (!Array.isArray(entries)) {\n entries = [];\n }\n\n let groupOptions: { [id: string]: string } = {};\n\n app.store.all('groups').forEach((group) => {\n // Don't allow Member or Guest since those are virtual, and don't allow Admin as it's too dangerous and could strip admins of their roles\n if ([Group.ADMINISTRATOR_ID, Group.MEMBER_ID, Group.GUEST_ID].indexOf(group.id()!) !== -1) {\n return;\n }\n\n groupOptions[group.id()!] = group.nameSingular();\n });\n\n const addHandler = () => {\n const newEntry: SettingsEntry = {\n groupId: parseInt(this.newGroupId()),\n };\n\n if (this.newMinPoints()) {\n newEntry.minPoints = parseInt(this.newMinPoints());\n }\n\n if (this.newMaxPoints()) {\n newEntry.maxPoints = parseInt(this.newMaxPoints());\n }\n\n entries.push(newEntry);\n\n this.attrs.onchange(JSON.stringify(entries));\n\n this.newGroupId('');\n this.newMinPoints('');\n this.newMaxPoints('');\n };\n\n return (\n \n \n \n \n \n \n \n \n \n {entries.map((entry, entryIndex) => {\n const valueChangeHandler = (attribute: keyof SettingsEntry) => {\n return (value: string) => {\n if (value === '') {\n delete entry[attribute];\n } else {\n entry[attribute] = parseInt(value);\n }\n\n this.attrs.onchange(JSON.stringify(entries));\n };\n };\n\n const deleteHandler = () => {\n entries.splice(entryIndex, 1);\n\n this.attrs.onchange(JSON.stringify(entries));\n };\n\n return (\n \n \n \n \n \n \n );\n })}\n \n \n \n \n \n \n \n
{app.translator.trans('fof-gamification.admin.page.groups.column.group')}{app.translator.trans('fof-gamification.admin.page.groups.column.minPoints')}{app.translator.trans('fof-gamification.admin.page.groups.column.maxPoints')}
\n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n
\n );\n }\n}\n","import app from 'flarum/admin/app';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport Button from 'flarum/common/components/Button';\nimport saveSettings from 'flarum/admin/utils/saveSettings';\nimport Switch from 'flarum/common/components/Switch';\nimport withAttr from 'flarum/common/utils/withAttr';\nimport Stream from 'flarum/common/utils/Stream';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport UploadImageButton from './UploadImageButton';\nimport GroupSettings from './GroupSettings';\n\nexport default class SettingsPage extends ExtensionPage {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.fields = [\n 'convertedLikes',\n 'amountPerPost',\n 'amountPerDiscussion',\n 'postStartAmount',\n 'rankAmt',\n 'iconName',\n 'blockedUsers',\n 'iconNameAlt',\n 'autoAssignedGroups',\n ];\n\n this.switches = [\n 'autoUpvotePosts',\n 'customRankingImages',\n 'rateLimit',\n 'showVotesOnDiscussionPage',\n 'useAlternateLayout',\n 'altPostVotingUi',\n 'upVotesOnly',\n 'firstPostOnly',\n 'allowSelfVotes',\n ];\n\n this.ranks = app.store.all('ranks');\n\n this.values = {};\n\n this.settingsPrefix = 'fof-gamification';\n\n const settings = app.data.settings;\n\n this.fields.forEach((key) => (this.values[key] = Stream(settings[this.addPrefix(key)])));\n\n this.switches.forEach((key) => (this.values[key] = Stream(!!Number(settings[this.addPrefix(key)]))));\n\n this.newRank = {\n points: Stream(''),\n name: Stream(''),\n color: Stream(''),\n };\n }\n\n /**\n * @returns {*}\n */\n content() {\n return (\n
\n
\n
{this.settingsItems().toArray()}
\n
\n
\n );\n }\n\n updateName(rank, value) {\n rank.save({ name: value });\n }\n\n updatePoints(rank, value) {\n rank.save({ points: value });\n }\n\n updateColor(rank, value) {\n rank.save({ color: value });\n }\n\n deleteRank(rankToDelete) {\n rankToDelete.delete();\n this.ranks.some((rank, i) => {\n if (rank.data.id === rankToDelete.data.id) {\n this.ranks.splice(i, 1);\n return true;\n }\n });\n }\n\n addRank() {\n app.store\n .createRecord('ranks')\n .save({\n points: this.newRank.points(),\n name: this.newRank.name(),\n color: this.newRank.color(),\n })\n .then(() => {\n this.newRank.color('');\n this.newRank.name('');\n this.newRank.points('');\n\n m.redraw();\n });\n }\n\n /**\n *\n * @returns boolean\n */\n changed() {\n var switchesCheck = this.switches.some((key) => this.values[key]() !== (app.data.settings[this.addPrefix(key)] == '1'));\n var fieldsCheck = this.fields.some((key) => this.values[key]() !== app.data.settings[this.addPrefix(key)]);\n return fieldsCheck || switchesCheck;\n }\n\n prepareSubmissionData() {\n const settings = {};\n\n this.switches.forEach((key) => (settings[this.addPrefix(key)] = this.values[key]()));\n this.fields.forEach((key) => (settings[this.addPrefix(key)] = this.values[key]()));\n\n return settings;\n }\n\n /**\n * @param e\n */\n onsubmit(e) {\n e.preventDefault();\n\n if (this.loading) return;\n\n this.loading = true;\n\n app.alerts.dismiss(this.successAlert);\n\n saveSettings(this.prepareSubmissionData())\n .then(this.onsaved.bind(this))\n .then(() => window.location.reload())\n .catch(console.error)\n .then(() => {\n this.loading = false;\n });\n }\n\n /**\n * @returns string\n */\n addPrefix(key) {\n return this.settingsPrefix + '.' + key;\n }\n\n settingsItems() {\n const items = new ItemList();\n\n items.add(\n 'convertLikesToUpvotes',\n
\n
{app.translator.trans('fof-gamification.admin.page.convert.help')}
\n {this.values.convertedLikes() === undefined ? (\n {\n app\n .request({\n url: app.forum.attribute('apiUrl') + '/fof/gamification/convert',\n method: 'POST',\n })\n .then(this.values.convertedLikes('converting'));\n }}\n >\n {app.translator.trans('fof-gamification.admin.page.convert.button')}\n \n ) : this.values.convertedLikes() === 'converting' ? (\n \n ) : (\n \n )}\n
,\n 100\n );\n\n items.add(\n 'ranks',\n
\n {app.translator.trans('fof-gamification.admin.page.ranks.title')}\n \n
{app.translator.trans('fof-gamification.admin.page.ranks.help.help')}
\n
\n {this.ranks.map((rank) => (\n
\n \n \n \n
\n ))}\n
\n
\n \n \n \n\n \n
\n \n \n
,\n 90\n );\n\n items.add(\n 'voteSettings',\n <>\n {app.translator.trans('fof-gamification.admin.page.votes.title')}\n {this.voteItems().toArray()}\n ,\n 80\n );\n\n items.add(\n 'rankingsPage',\n <>\n {app.translator.trans('fof-gamification.admin.page.rankings.title')}\n {this.rankingsItems().toArray()}\n ,\n 70\n );\n\n items.add(\n 'groups',\n
\n {app.translator.trans('fof-gamification.admin.page.groups.title')}\n
{app.translator.trans('fof-gamification.admin.page.groups.help')}
\n \n
,\n 60\n );\n\n items.add(\n 'submit',\n ,\n 0\n );\n\n return items;\n }\n\n voteItems() {\n const items = new ItemList();\n\n items.add(\n 'icon',\n <>\n \n
{app.translator.trans('fof-gamification.admin.page.votes.icon_help')}
\n \n ,\n 100\n );\n\n items.add(\n 'altIcon',\n <>\n \n
{app.translator.trans('fof-gamification.admin.page.votes.icon_help')}
\n \n ,\n 90\n );\n\n items.add(\n 'autoUpvote',\n \n {app.translator.trans('fof-gamification.admin.page.votes.auto_upvote')}\n ,\n 80\n );\n\n items.add(\n 'rateLimit',\n \n {app.translator.trans('fof-gamification.admin.page.votes.rate_limit')}\n ,\n 70\n );\n\n items.add(\n 'opVotesOnDiscussionList',\n \n {app.translator.trans('fof-gamification.admin.page.votes.discussion_page')}\n ,\n 60\n );\n\n items.add(\n 'altDiscussionListLayout',\n \n {app.translator.trans('fof-gamification.admin.page.votes.alternate_layout')}\n ,\n 50\n );\n\n items.add(\n 'altPostLayout',\n \n {app.translator.trans('fof-gamification.admin.page.votes.alternate_post_layout')}\n ,\n 40\n );\n\n items.add(\n 'upvotesOnly',\n \n {app.translator.trans('fof-gamification.admin.page.votes.upvotes_only')}\n ,\n 30\n );\n\n items.add(\n 'firstPostOnly',\n \n {app.translator.trans('fof-gamification.admin.page.votes.first_post_only')}\n ,\n 20\n );\n\n items.add(\n 'allowSelfVotes',\n \n {app.translator.trans('fof-gamification.admin.page.votes.allow_self_votes')}\n ,\n 10\n );\n\n return items;\n }\n\n rankingsItems() {\n const items = new ItemList();\n\n items.add(\n 'customImages',\n \n {app.translator.trans('fof-gamification.admin.page.rankings.enable')}\n ,\n 100\n );\n\n items.add(\n 'ignoredUsers',\n <>\n \n \n ,\n 90\n );\n\n items.add(\n 'customImages',\n <>\n
{app.translator.trans('fof-gamification.admin.page.rankings.blocked.help')}
\n {[1, 2, 3].map((num) => (\n <>\n \n \n
\n \n ))}\n ,\n 80\n );\n\n return items;\n }\n}\n","import rankLabel from './rankLabel';\n\nexport const helpers = {\n rankLabel,\n};\n","export default function rankLabel(rank, attrs = {}) {\n attrs.style = attrs.style || {};\n attrs.className = 'rankLabel ' + (attrs.className || '');\n\n const color = rank.color();\n attrs.style.backgroundColor = attrs.style.color = color;\n attrs.className += ' colored';\n\n return m('span', attrs, {rank.name()});\n}\n","import SettingsPage from './SettingsPage';\nimport UploadImageButton from './UploadImageButton';\n\nexport const components = {\n SettingsPage,\n UploadImageButton,\n};\n","import app from 'flarum/admin/app';\nimport SettingsPage from './components/SettingsPage';\nimport Rank from '../common/models/Rank';\n\napp.initializers.add('fof-gamification', (app) => {\n app.store.models.ranks = Rank;\n\n app.extensionData\n .for('fof-gamification')\n .registerPermission(\n {\n icon: 'fas fa-thumbs-up',\n label: app.translator.trans('fof-gamification.admin.permissions.vote_label'),\n permission: 'discussion.votePosts',\n },\n 'reply'\n )\n .registerPermission(\n {\n icon: 'fas fa-thumbs-up',\n label: app.translator.trans('fof-gamification.admin.permissions.see_votes_label'),\n permission: 'discussion.canSeeVotes',\n allowGuest: true,\n },\n 'view'\n )\n .registerPermission(\n {\n icon: 'fas fa-info-circle',\n label: app.translator.trans('fof-gamification.admin.permissions.see_voters_label'),\n permission: 'discussion.canSeeVoters',\n allowGuest: true,\n },\n 'view'\n )\n .registerPermission(\n {\n icon: 'fas fa-trophy',\n label: app.translator.trans('fof-gamification.admin.permissions.see_ranking_page'),\n permission: 'fof.gamification.viewRankingPage',\n allowGuest: true,\n },\n 'view'\n )\n .registerPermission(\n {\n icon: 'fas fa-bell',\n label: app.translator.trans('fof-gamification.admin.permissions.upvote_notifications'),\n permission: 'discussion.upvote_notifications',\n },\n 'view'\n )\n .registerPermission(\n {\n icon: 'fas fa-bell',\n label: app.translator.trans('fof-gamification.admin.permissions.downvote_notifications'),\n permission: 'discussion.downvote_notifications',\n },\n 'view'\n )\n .registerPage(SettingsPage);\n});\n\nexport * from '../common/helpers';\nexport * from './components';\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","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","_inheritsLoose","subClass","superClass","create","constructor","flarum","core","compat","Rank","_mixin","apply","arguments","mixin","Model","points","name","color","models","UploadImageButton","_FlarumUploadImageBut","resourceUrl","app","attribute","this","attrs","path","FlarumUploadImageButton","GroupSettings","_Component","_this","_len","length","args","Array","_key","concat","newGroupId","Stream","newMinPoints","newMaxPoints","view","_this2","entries","JSON","parse","error","isArray","groupOptions","all","forEach","group","Group","indexOf","id","nameSingular","m","trans","map","entry","entryIndex","valueChangeHandler","parseInt","onchange","stringify","Select","options","groupId","className","type","minPoints","withAttr","maxPoints","Tooltip","text","extractText","Button","icon","onclick","splice","bidi","newEntry","push","disabled","Component","SettingsPage","_ExtensionPage","_proto","oninit","vnode","fields","switches","ranks","values","settingsPrefix","settings","addPrefix","Number","newRank","content","onsubmit","settingsItems","toArray","updateName","rank","save","updatePoints","updateColor","deleteRank","rankToDelete","some","i","data","addRank","_this3","createRecord","then","redraw","changed","_this4","switchesCheck","prepareSubmissionData","_this5","e","_this6","preventDefault","loading","dismiss","successAlert","saveSettings","onsaved","window","location","reload","console","_this7","items","ItemList","add","undefined","convertedLikes","url","method","number","placeholder","oninput","rankAmt","min","'['","voteItems","rankingsItems","autoAssignedGroups","iconName","iconNameAlt","Switch","state","autoUpvotePosts","rateLimit","showVotesOnDiscussionPage","useAlternateLayout","altPostVotingUi","upVotesOnly","firstPostOnly","allowSelfVotes","customRankingImages","blockedUsers","num","ExtensionPage","helpers","rankLabel","style","backgroundColor","components","store","extensionData","registerPermission","label","translator","permission","allowGuest","registerPage"],"sourceRoot":""} \ No newline at end of file diff --git a/js/dist/forum.js b/js/dist/forum.js index 358ae91..ebfb456 100755 --- a/js/dist/forum.js +++ b/js/dist/forum.js @@ -1,3 +1,3 @@ /*! For license information please see forum.js.LICENSE.txt */ -(()=>{var t={987:(t,o,e)=>{var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,i=/^0o[0-7]+$/i,s=parseInt,c="object"==typeof e.g&&e.g&&e.g.Object===Object&&e.g,u="object"==typeof self&&self&&self.Object===Object&&self,l=c||u||Function("return this")(),f=Object.prototype.toString,m=Math.max,p=Math.min,d=function(){return l.Date.now()};function v(t){var o=typeof t;return!!t&&("object"==o||"function"==o)}function h(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==f.call(t)}(t))return NaN;if(v(t)){var o="function"==typeof t.valueOf?t.valueOf():t;t=v(o)?o+"":o}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(n,"");var e=a.test(t);return e||i.test(t)?s(t.slice(2),e?2:8):r.test(t)?NaN:+t}t.exports=function(t,o,e){var n,r,a,i,s,c,u=0,l=!1,f=!1,y=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function g(o){var e=n,a=r;return n=r=void 0,u=o,i=t.apply(a,e)}function b(t){return u=t,s=setTimeout(N,o),l?g(t):i}function w(t){var e=t-c;return void 0===c||e>=o||e<0||f&&t-u>=a}function N(){var t=d();if(w(t))return x(t);s=setTimeout(N,function(t){var e=o-(t-c);return f?p(e,a-(t-u)):e}(t))}function x(t){return s=void 0,y&&n?g(t):(n=r=void 0,i)}function L(){var t=d(),e=w(t);if(n=arguments,r=this,c=t,e){if(void 0===s)return b(c);if(f)return s=setTimeout(N,o),g(c)}return void 0===s&&(s=setTimeout(N,o)),i}return o=h(o)||0,v(e)&&(l=!!e.leading,a=(f="maxWait"in e)?m(h(e.maxWait)||0,o):a,y="trailing"in e?!!e.trailing:y),L.cancel=function(){void 0!==s&&clearTimeout(s),u=0,n=c=r=s=void 0},L.flush=function(){return void 0===s?i:x(d())},L}},648:(t,o,e)=>{var n=e(288).default;function r(){"use strict";t.exports=r=function(){return o},t.exports.__esModule=!0,t.exports.default=t.exports;var o={},e=Object.prototype,a=e.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,o,e){return Object.defineProperty(t,o,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[o]}try{l({},"")}catch(t){l=function(t,o,e){return t[o]=e}}function f(t,o,e,n){var r=o&&o.prototype instanceof d?o:d,a=Object.create(r.prototype),i=new P(n||[]);return a._invoke=function(t,o,e){var n="suspendedStart";return function(r,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===r)throw a;return{value:void 0,done:!0}}for(e.method=r,e.arg=a;;){var i=e.delegate;if(i){var s=L(i,e);if(s){if(s===p)continue;return s}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if("suspendedStart"===n)throw n="completed",e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);n="executing";var c=m(t,o,e);if("normal"===c.type){if(n=e.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:e.done}}"throw"===c.type&&(n="completed",e.method="throw",e.arg=c.arg)}}}(t,e,i),a}function m(t,o,e){try{return{type:"normal",arg:t.call(o,e)}}catch(t){return{type:"throw",arg:t}}}o.wrap=f;var p={};function d(){}function v(){}function h(){}var y={};l(y,s,(function(){return this}));var g=Object.getPrototypeOf,b=g&&g(g(_([])));b&&b!==e&&a.call(b,s)&&(y=b);var w=h.prototype=d.prototype=Object.create(y);function N(t){["next","throw","return"].forEach((function(o){l(t,o,(function(t){return this._invoke(o,t)}))}))}function x(t,o){function e(r,i,s,c){var u=m(t[r],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?o.resolve(f.__await).then((function(t){e("next",t,s,c)}),(function(t){e("throw",t,s,c)})):o.resolve(f).then((function(t){l.value=t,s(l)}),(function(t){return e("throw",t,s,c)}))}c(u.arg)}var r;this._invoke=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 L(t,o){var e=t.iterator[o.method];if(void 0===e){if(o.delegate=null,"throw"===o.method){if(t.iterator.return&&(o.method="return",o.arg=void 0,L(t,o),"throw"===o.method))return p;o.method="throw",o.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var n=m(e,t.iterator,o.arg);if("throw"===n.type)return o.method="throw",o.arg=n.arg,o.delegate=null,p;var r=n.arg;return r?r.done?(o[t.resultName]=r.value,o.next=t.nextLoc,"return"!==o.method&&(o.method="next",o.arg=void 0),o.delegate=null,p):r:(o.method="throw",o.arg=new TypeError("iterator result is not an object"),o.delegate=null,p)}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 V(t){var o=t.completion||{};o.type="normal",delete o.arg,t.completion=o}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function _(t){if(t){var o=t[s];if(o)return o.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var e=-1,n=function o(){for(;++e=0;--n){var r=this.tryEntries[n],i=r.completion;if("root"===r.tryLoc)return e("end");if(r.tryLoc<=this.prev){var s=a.call(r,"catchLoc"),c=a.call(r,"finallyLoc");if(s&&c){if(this.prev=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev=0;--o){var e=this.tryEntries[o];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),V(e),p}},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;V(e)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,o,e){return this.delegate={iterator:_(t),resultName:o,nextLoc:e},"next"===this.method&&(this.arg=void 0),p}},o}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},288: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},357:(t,o,e)=>{var n=e(648)();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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),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";function t(o,e){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,o){return t.__proto__=o,t},t(o,e)}function o(o,e){o.prototype=Object.create(e.prototype),o.prototype.constructor=o,t(o,e)}e.r(n),e.d(n,{components:()=>Dt,helpers:()=>Ut,models:()=>c});const r=flarum.core.compat["common/Model"];var a=e.n(r);const i=flarum.core.compat["common/utils/mixin"];var s=function(t){function e(){return t.apply(this,arguments)||this}return o(e,t),e}(e.n(i)()(a(),{points:a().attribute("points"),name:a().attribute("name"),color:a().attribute("color")})),c={Rank:s};const u=flarum.core.compat["forum/app"];var l=e.n(u);const f=flarum.core.compat["common/models/Discussion"];var p=e.n(f);const d=flarum.core.compat["common/models/Post"];var v=e.n(d);const h=flarum.core.compat["common/models/User"];var y=e.n(h);const g=flarum.core.compat["common/helpers/avatar"];var b=e.n(g);const w=flarum.core.compat["common/components/Page"];var N=e.n(w);const x=flarum.core.compat["forum/components/IndexPage"];var L=e.n(x);const k=flarum.core.compat["common/components/Button"];var V=e.n(k);const P=flarum.core.compat["common/components/LoadingIndicator"];var _=e.n(P);const F=flarum.core.compat["common/helpers/listItems"];var O=e.n(F);const j=flarum.core.compat["common/helpers/username"];var I=e.n(j);const S=flarum.core.compat["common/helpers/icon"];var E=e.n(S);const G=function(t,o){void 0===o&&(o=!1);var e=l().data["fof-gamification."+t];return o?!!parseInt(e):e},R=flarum.core.compat["common/components/Link"];var B=e.n(R),D=function(t){function e(){return t.apply(this,arguments)||this}o(e,t);var n=e.prototype;return n.oninit=function(o){t.prototype.oninit.call(this,o),l().forum.attribute("canViewRankingPage")||m.route.set("/"),this.loading=!0,this.users=[],this.refresh()},n.view=function(){var t,o=this;return t=this.loading?_().component():V().component({className:"Button",onclick:this.loadMore.bind(this)},l().translator.trans("core.forum.discussion_list.load_more_button")),m("div",{className:"IndexPage"},L().prototype.hero(),m("div",{className:"container"},m("div",{className:"sideNavContainer"},m("nav",{className:"IndexPage-nav sideNav"},m("ul",null,O()(L().prototype.sidebarItems().toArray()))),m("div",{className:"IndexPage-results sideNavOffset"},m("table",{class:"rankings"},m("tr",null,m("th",{className:"rankings-mobile"},l().translator.trans("fof-gamification.forum.ranking.rank")),m("th",null,l().translator.trans("fof-gamification.forum.ranking.name")),m("th",null,l().translator.trans("fof-gamification.forum.ranking.amount"))),this.users.map((function(t,e){return++e,[m("tr",{className:"ranking-"+e},e<4?G("customRankingImages",!0)?m("img",{className:"rankings-mobile rankings-image",src:l().forum.attribute("baseUrl")+l().forum.attribute("fof-gamification.topimage"+e+"Url")}):m("td",{className:"rankings-mobile rankings-"+e},E()("fas fa-trophy")):m("td",{className:"rankings-4 rankings-mobile"},o.addOrdinalSuffix(e)),m("td",null,m("div",{className:"PostUser"},m("h3",{className:"rankings-info"},m(B(),{href:l().route.user(t),force:!0},e<4?b()(t,{className:"info-avatar rankings-"+e+"-avatar"}):""," ",I()(t))))),e<4?m("td",{className:"rankings-"+e},t.points()):m("td",{className:"rankings-4"},t.points()))]}))),m("div",{className:"rankings-loadmore"}," ",t)))))},n.refresh=function(t){var o=this;return void 0===t&&(t=!0),t&&(this.loading=!0,this.users=[]),this.loadResults().then((function(t){o.users=[],o.parseResults(t)}),(function(){o.loading=!1,m.redraw()}))},n.addOrdinalSuffix=function(t){if("en"===l().data.locale){var o=t%10,e=t%100;return 1===o&&11!==e?t+"st":2===o&&12!==e?t+"nd":3===o&&13!==e?t+"rd":t+"th"}return t},n.loadResults=function(t){var o={};return o.page={offset:t,limit:"10"},l().store.find("rankings",o)},n.loadMore=function(){this.loading=!0,this.loadResults(this.users.length).then(this.parseResults.bind(this))},n.parseResults=function(t){return[].push.apply(this.users,t),this.loading=!1,this.users.sort((function(t,o){return parseFloat(o.points())-parseFloat(t.points())})),m.redraw(),t},e}(N());const M=flarum.core.compat["common/extend"],U=flarum.core.compat["forum/states/DiscussionListState"];var T=e.n(U);const A=flarum.core.compat["common/components/LinkButton"];var C=e.n(A);const H=flarum.core.compat["forum/components/CommentPost"];var $=e.n(H);const z=flarum.core.compat["common/utils/classList"];var W=e.n(z);const Y=flarum.core.compat["forum/utils/PostControls"];var q=e.n(Y);const J=flarum.core.compat["common/components/Modal"];var K=function(t){function e(){return t.apply(this,arguments)||this}o(e,t);var n=e.prototype;return n.className=function(){return"VotesModal Modal--small"},n.title=function(){return l().translator.trans("fof-gamification.forum.modal.title")},n.oninit=function(o){t.prototype.oninit.call(this,o),this.loading=!this.attrs.post.upvotes()||!this.attrs.post.downvotes(),this.loading&&this.load()},n.content=function(){var t=this;return this.loading?m("div",{className:"Modal-body"},m(_(),null)):m("div",{className:"Modal-body"},m("ul",{className:"VotesModal-list"},["upvotes","downvotes"].map((function(o){var e=t.attrs.post[o]();if(e&&e.length)return m("div",null,m("legend",null,l().translator.trans("fof-gamification.forum.modal."+o+"_label")),e.map((function(t){return m("li",null,m(B(),{href:l().route.user(t)},b()(t)," ",I()(t)))})))}))))},n.load=function(){return l().store.find("posts",this.attrs.post.id(),{include:"upvotes,downvotes"}).then(this.loaded.bind(this))},e}(e.n(J)());const Q=flarum.core.compat["forum/utils/DiscussionControls"];var X=e.n(Q);const Z=function(t,o,e,n,r){if(void 0===r&&(r=t.discussion()),l().session.user){if(!r||r.canVote()||t.canVote())return o&&e&&(o=!1,e=!1),n&&n(!0),m.redraw(),t.save([o,e,"vote"]).then((function(){return null}),(function(){return null})).then((function(){n&&n(!1),r&&r.pushAttributes({votes:t.votes()}),m.redraw()}))}else X().replyAction.call(r,!0)},tt=flarum.core.compat["forum/components/DiscussionListItem"];var ot=e.n(tt);const et=flarum.core.compat["common/utils/abbreviateNumber"];var nt=e.n(et);const rt=flarum.core.compat["forum/components/PostUser"];var at=e.n(rt);const it=flarum.core.compat["forum/components/UserCard"];var st=e.n(it);function ct(t,o){void 0===o&&(o={}),o.style=o.style||{},o.className="rankLabel "+(o.className||"");var e=t.color();return o.style.backgroundColor=o.style.color=e,o.className+=" colored",m("span",o,m("span",{className:"rankLabel-text"},t.name()))}function ut(){var t=function(t){return function(o){return o&&o.attrs&&o.attrs.className&&String(o.attrs.className).split(" ").includes(t)}},o=function o(e,n){var r=[];if(e&&e.children&&Array.isArray(e.children)){var a=e.children.find(t(n));a&&r.push(a),e.children.forEach((function(t){r.push.apply(r,o(t,n))}))}return r};(0,M.extend)(st().prototype,"infoItems",(function(t){var o=this.attrs.user;t.add("points",m("div",null,E()("fas fa-medal"),l().translator.trans("fof-gamification.forum.user.card.points",{count:o.points()})),50)})),(0,M.extend)(st().prototype,"view",(function(e){var n=this.attrs.user,r=o(e,"UserCard-profile")[0],a=Number(G("rankAmt"));if(r){var i=r.children.find(t("UserCard-badges"));return n.ranks()&&(i?n.ranks().reverse().map((function(t,o){if(!a||o0?"fas fa-"+t+"-up":"fas fa-"+t+"-down"},n.href=function(){return l().route.post(this.attrs.notification.subject())},n.content=function(){var t=this.attrs.notification.fromUser();return parseInt(this.attrs.notification.content())>0?l().translator.trans("fof-gamification.forum.notification.upvote",{user:t}):l().translator.trans("fof-gamification.forum.notification.downvote",{user:t})},n.excerpt=function(){return this.attrs.notification.subject().contentPlain()},e}(e.n(bt)());const Nt=flarum.core.compat["forum/components/NotificationGrid"];var xt=e.n(Nt);function Lt(t,o,e,n,r,a,i){try{var s=t[a](i),c=s.value}catch(t){return void e(t)}s.done?o(c):Promise.resolve(c).then(n,r)}var kt=e(357),Vt=e.n(kt);const Pt=flarum.core.compat["common/Component"];var _t=e.n(Pt);const Ft=flarum.core.compat["common/components/Tooltip"];var Ot=e.n(Ft);const jt=flarum.core.compat["common/utils/SubtreeRetainer"];var It=e.n(jt),St=function(t){function e(){for(var o,e=arguments.length,n=new Array(e),r=0;r15?m("span",{className:"FoFGamification-voters-item FoFGamification-voters-item--plus"},m("span",{className:"Avatar"},"+"+(t.length-15))):null)))},n.load=function(){var t,o=(t=Vt().mark((function t(){return Vt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,l().store.find("posts",this.attrs.post.id(),{include:"upvotes"});case 2:this.loading=!1,m.redraw();case 4:case"end":return t.stop()}}),t,this)})),function(){var o=this,e=arguments;return new Promise((function(n,r){var a=t.apply(o,e);function i(t){Lt(a,n,r,i,s,"next",t)}function s(t){Lt(a,n,r,i,s,"throw",t)}i(void 0)}))});return function(){return o.apply(this,arguments)}}(),e}(_t());const Et=flarum.core.compat["forum/components/UserPage"];var Gt=e.n(Et);const Rt=flarum.core.compat["forum/components/PostsUserPage"];var Bt=function(t){function e(){return t.apply(this,arguments)||this}return o(e,t),e.prototype.loadResults=function(t){return l().store.find("posts",{filter:{type:"comment",voted:this.user.id()},page:{offset:t,limit:this.loadLimit},sort:"-createdAt"})},e}(e.n(Rt)()),Dt={RankingsPage:D,VoteNotification:wt,VotesModal:K,Voters:St};function Mt(){return Mt=Object.assign?Object.assign.bind():function(t){for(var o=1;o{var t={987:(t,o,e)=>{var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,i=/^0o[0-7]+$/i,s=parseInt,c="object"==typeof e.g&&e.g&&e.g.Object===Object&&e.g,u="object"==typeof self&&self&&self.Object===Object&&self,l=c||u||Function("return this")(),f=Object.prototype.toString,m=Math.max,p=Math.min,d=function(){return l.Date.now()};function v(t){var o=typeof t;return!!t&&("object"==o||"function"==o)}function h(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==f.call(t)}(t))return NaN;if(v(t)){var o="function"==typeof t.valueOf?t.valueOf():t;t=v(o)?o+"":o}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(n,"");var e=a.test(t);return e||i.test(t)?s(t.slice(2),e?2:8):r.test(t)?NaN:+t}t.exports=function(t,o,e){var n,r,a,i,s,c,u=0,l=!1,f=!1,y=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function g(o){var e=n,a=r;return n=r=void 0,u=o,i=t.apply(a,e)}function b(t){var e=t-c;return void 0===c||e>=o||e<0||f&&t-u>=a}function w(){var t=d();if(b(t))return N(t);s=setTimeout(w,function(t){var e=o-(t-c);return f?p(e,a-(t-u)):e}(t))}function N(t){return s=void 0,y&&n?g(t):(n=r=void 0,i)}function x(){var t=d(),e=b(t);if(n=arguments,r=this,c=t,e){if(void 0===s)return function(t){return u=t,s=setTimeout(w,o),l?g(t):i}(c);if(f)return s=setTimeout(w,o),g(c)}return void 0===s&&(s=setTimeout(w,o)),i}return o=h(o)||0,v(e)&&(l=!!e.leading,a=(f="maxWait"in e)?m(h(e.maxWait)||0,o):a,y="trailing"in e?!!e.trailing:y),x.cancel=function(){void 0!==s&&clearTimeout(s),u=0,n=c=r=s=void 0},x.flush=function(){return void 0===s?i:N(d())},x}},648:(t,o,e)=>{var n=e(288).default;function r(){"use strict";t.exports=r=function(){return o},t.exports.__esModule=!0,t.exports.default=t.exports;var o={},e=Object.prototype,a=e.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,o,e){return Object.defineProperty(t,o,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[o]}try{l({},"")}catch(t){l=function(t,o,e){return t[o]=e}}function f(t,o,e,n){var r=o&&o.prototype instanceof d?o:d,a=Object.create(r.prototype),i=new P(n||[]);return a._invoke=function(t,o,e){var n="suspendedStart";return function(r,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===r)throw a;return{value:void 0,done:!0}}for(e.method=r,e.arg=a;;){var i=e.delegate;if(i){var s=L(i,e);if(s){if(s===p)continue;return s}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if("suspendedStart"===n)throw n="completed",e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);n="executing";var c=m(t,o,e);if("normal"===c.type){if(n=e.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:e.done}}"throw"===c.type&&(n="completed",e.method="throw",e.arg=c.arg)}}}(t,e,i),a}function m(t,o,e){try{return{type:"normal",arg:t.call(o,e)}}catch(t){return{type:"throw",arg:t}}}o.wrap=f;var p={};function d(){}function v(){}function h(){}var y={};l(y,s,(function(){return this}));var g=Object.getPrototypeOf,b=g&&g(g(_([])));b&&b!==e&&a.call(b,s)&&(y=b);var w=h.prototype=d.prototype=Object.create(y);function N(t){["next","throw","return"].forEach((function(o){l(t,o,(function(t){return this._invoke(o,t)}))}))}function x(t,o){function e(r,i,s,c){var u=m(t[r],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?o.resolve(f.__await).then((function(t){e("next",t,s,c)}),(function(t){e("throw",t,s,c)})):o.resolve(f).then((function(t){l.value=t,s(l)}),(function(t){return e("throw",t,s,c)}))}c(u.arg)}var r;this._invoke=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 L(t,o){var e=t.iterator[o.method];if(void 0===e){if(o.delegate=null,"throw"===o.method){if(t.iterator.return&&(o.method="return",o.arg=void 0,L(t,o),"throw"===o.method))return p;o.method="throw",o.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var n=m(e,t.iterator,o.arg);if("throw"===n.type)return o.method="throw",o.arg=n.arg,o.delegate=null,p;var r=n.arg;return r?r.done?(o[t.resultName]=r.value,o.next=t.nextLoc,"return"!==o.method&&(o.method="next",o.arg=void 0),o.delegate=null,p):r:(o.method="throw",o.arg=new TypeError("iterator result is not an object"),o.delegate=null,p)}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 V(t){var o=t.completion||{};o.type="normal",delete o.arg,t.completion=o}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function _(t){if(t){var o=t[s];if(o)return o.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var e=-1,n=function o(){for(;++e=0;--n){var r=this.tryEntries[n],i=r.completion;if("root"===r.tryLoc)return e("end");if(r.tryLoc<=this.prev){var s=a.call(r,"catchLoc"),c=a.call(r,"finallyLoc");if(s&&c){if(this.prev=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev=0;--o){var e=this.tryEntries[o];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),V(e),p}},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;V(e)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,o,e){return this.delegate={iterator:_(t),resultName:o,nextLoc:e},"next"===this.method&&(this.arg=void 0),p}},o}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},288: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},357:(t,o,e)=>{var n=e(648)();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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),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";function t(o,e){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,o){return t.__proto__=o,t},t(o,e)}function o(o,e){o.prototype=Object.create(e.prototype),o.prototype.constructor=o,t(o,e)}e.r(n),e.d(n,{components:()=>Dt,helpers:()=>Ut,models:()=>c});const r=flarum.core.compat["common/Model"];var a=e.n(r);const i=flarum.core.compat["common/utils/mixin"];var s=function(t){function e(){return t.apply(this,arguments)||this}return o(e,t),e}(e.n(i)()(a(),{points:a().attribute("points"),name:a().attribute("name"),color:a().attribute("color")})),c={Rank:s};const u=flarum.core.compat["forum/app"];var l=e.n(u);const f=flarum.core.compat["common/models/Discussion"];var p=e.n(f);const d=flarum.core.compat["common/models/Post"];var v=e.n(d);const h=flarum.core.compat["common/models/User"];var y=e.n(h);const g=flarum.core.compat["common/helpers/avatar"];var b=e.n(g);const w=flarum.core.compat["common/components/Page"];var N=e.n(w);const x=flarum.core.compat["forum/components/IndexPage"];var L=e.n(x);const k=flarum.core.compat["common/components/Button"];var V=e.n(k);const P=flarum.core.compat["common/components/LoadingIndicator"];var _=e.n(P);const F=flarum.core.compat["common/helpers/listItems"];var O=e.n(F);const j=flarum.core.compat["common/helpers/username"];var I=e.n(j);const S=flarum.core.compat["common/helpers/icon"];var E=e.n(S);const G=function(t,o){void 0===o&&(o=!1);var e=l().data["fof-gamification."+t];return o?!!parseInt(e):e},R=flarum.core.compat["common/components/Link"];var B=e.n(R),D=function(t){function e(){return t.apply(this,arguments)||this}o(e,t);var n=e.prototype;return n.oninit=function(o){t.prototype.oninit.call(this,o),l().forum.attribute("canViewRankingPage")||m.route.set("/"),this.loading=!0,this.users=[],this.refresh()},n.view=function(){var t,o=this;return t=this.loading?_().component():V().component({className:"Button",onclick:this.loadMore.bind(this)},l().translator.trans("core.forum.discussion_list.load_more_button")),m("div",{className:"IndexPage"},L().prototype.hero(),m("div",{className:"container"},m("div",{className:"sideNavContainer"},m("nav",{className:"IndexPage-nav sideNav"},m("ul",null,O()(L().prototype.sidebarItems().toArray()))),m("div",{className:"IndexPage-results sideNavOffset"},m("table",{class:"rankings"},m("tr",null,m("th",{className:"rankings-mobile"},l().translator.trans("fof-gamification.forum.ranking.rank")),m("th",null,l().translator.trans("fof-gamification.forum.ranking.name")),m("th",null,l().translator.trans("fof-gamification.forum.ranking.amount"))),this.users.map((function(t,e){return++e,[m("tr",{className:"ranking-"+e},e<4?G("customRankingImages",!0)?m("img",{className:"rankings-mobile rankings-image",src:l().forum.attribute("baseUrl")+l().forum.attribute("fof-gamification.topimage"+e+"Url")}):m("td",{className:"rankings-mobile rankings-"+e},E()("fas fa-trophy")):m("td",{className:"rankings-4 rankings-mobile"},o.addOrdinalSuffix(e)),m("td",null,m("div",{className:"PostUser"},m("h3",{className:"rankings-info"},m(B(),{href:l().route.user(t),force:!0},e<4?b()(t,{className:"info-avatar rankings-"+e+"-avatar"}):""," ",I()(t))))),e<4?m("td",{className:"rankings-"+e},t.points()):m("td",{className:"rankings-4"},t.points()))]}))),m("div",{className:"rankings-loadmore"}," ",t)))))},n.refresh=function(t){var o=this;return void 0===t&&(t=!0),t&&(this.loading=!0,this.users=[]),this.loadResults().then((function(t){o.users=[],o.parseResults(t)}),(function(){o.loading=!1,m.redraw()}))},n.addOrdinalSuffix=function(t){if("en"===l().data.locale){var o=t%10,e=t%100;return 1===o&&11!==e?t+"st":2===o&&12!==e?t+"nd":3===o&&13!==e?t+"rd":t+"th"}return t},n.loadResults=function(t){var o={};return o.page={offset:t,limit:"10"},l().store.find("rankings",o)},n.loadMore=function(){this.loading=!0,this.loadResults(this.users.length).then(this.parseResults.bind(this))},n.parseResults=function(t){return[].push.apply(this.users,t),this.loading=!1,this.users.sort((function(t,o){return parseFloat(o.points())-parseFloat(t.points())})),m.redraw(),t},e}(N());const M=flarum.core.compat["common/extend"],U=flarum.core.compat["forum/states/DiscussionListState"];var T=e.n(U);const A=flarum.core.compat["common/components/LinkButton"];var C=e.n(A);const H=flarum.core.compat["forum/components/CommentPost"];var $=e.n(H);const z=flarum.core.compat["common/utils/classList"];var W=e.n(z);const Y=flarum.core.compat["forum/utils/PostControls"];var q=e.n(Y);const J=flarum.core.compat["common/components/Modal"];var K=function(t){function e(){return t.apply(this,arguments)||this}o(e,t);var n=e.prototype;return n.className=function(){return"VotesModal Modal--small"},n.title=function(){return l().translator.trans("fof-gamification.forum.modal.title")},n.oninit=function(o){t.prototype.oninit.call(this,o),this.loading=!this.attrs.post.upvotes()||!this.attrs.post.downvotes(),this.loading&&this.load()},n.content=function(){var t=this;return this.loading?m("div",{className:"Modal-body"},m(_(),null)):m("div",{className:"Modal-body"},m("ul",{className:"VotesModal-list"},["upvotes","downvotes"].map((function(o){var e=t.attrs.post[o]();if(e&&e.length)return m("div",null,m("legend",null,l().translator.trans("fof-gamification.forum.modal."+o+"_label")),e.map((function(t){return m("li",null,m(B(),{href:l().route.user(t)},b()(t)," ",I()(t)))})))}))))},n.load=function(){return l().store.find("posts",this.attrs.post.id(),{include:"upvotes,downvotes"}).then(this.loaded.bind(this))},e}(e.n(J)());const Q=flarum.core.compat["forum/utils/DiscussionControls"];var X=e.n(Q);const Z=function(t,o,e,n,r){if(void 0===r&&(r=t.discussion()),l().session.user){if(!r||r.canVote()||t.canVote())return o&&e&&(o=!1,e=!1),n&&n(!0),m.redraw(),t.save([o,e,"vote"]).then((function(){return null}),(function(){return null})).then((function(){n&&n(!1),r&&r.pushAttributes({votes:t.votes()}),m.redraw()}))}else X().replyAction.call(r,!0)},tt=flarum.core.compat["forum/components/DiscussionListItem"];var ot=e.n(tt);const et=flarum.core.compat["common/utils/abbreviateNumber"];var nt=e.n(et);const rt=flarum.core.compat["forum/components/PostUser"];var at=e.n(rt);const it=flarum.core.compat["forum/components/UserCard"];var st=e.n(it);function ct(t,o){void 0===o&&(o={}),o.style=o.style||{},o.className="rankLabel "+(o.className||"");var e=t.color();return o.style.backgroundColor=o.style.color=e,o.className+=" colored",m("span",o,m("span",{className:"rankLabel-text"},t.name()))}function ut(){var t=function(t){return function(o){return o&&o.attrs&&o.attrs.className&&String(o.attrs.className).split(" ").includes(t)}},o=function o(e,n){var r=[];if(e&&e.children&&Array.isArray(e.children)){var a=e.children.find(t(n));a&&r.push(a),e.children.forEach((function(t){r.push.apply(r,o(t,n))}))}return r};(0,M.extend)(st().prototype,"infoItems",(function(t){var o=this.attrs.user;t.add("points",m("div",null,E()("fas fa-medal"),l().translator.trans("fof-gamification.forum.user.card.points",{count:o.points()})),50)})),(0,M.extend)(st().prototype,"view",(function(e){var n=this.attrs.user,r=o(e,"UserCard-profile")[0],a=Number(G("rankAmt"));if(r){var i=r.children.find(t("UserCard-badges"));return n.ranks()&&(i?n.ranks().reverse().map((function(t,o){if(!a||o0?"fas fa-"+t+"-up":"fas fa-"+t+"-down"},n.href=function(){return l().route.post(this.attrs.notification.subject())},n.content=function(){var t=this.attrs.notification.fromUser();return parseInt(this.attrs.notification.content())>0?l().translator.trans("fof-gamification.forum.notification.upvote",{user:t}):l().translator.trans("fof-gamification.forum.notification.downvote",{user:t})},n.excerpt=function(){return this.attrs.notification.subject().contentPlain()},e}(e.n(bt)());const Nt=flarum.core.compat["forum/components/NotificationGrid"];var xt=e.n(Nt);function Lt(t,o,e,n,r,a,i){try{var s=t[a](i),c=s.value}catch(t){return void e(t)}s.done?o(c):Promise.resolve(c).then(n,r)}var kt=e(357),Vt=e.n(kt);const Pt=flarum.core.compat["common/Component"];var _t=e.n(Pt);const Ft=flarum.core.compat["common/components/Tooltip"];var Ot=e.n(Ft);const jt=flarum.core.compat["common/utils/SubtreeRetainer"];var It=e.n(jt),St=function(t){function e(){for(var o,e=arguments.length,n=new Array(e),r=0;r15?m("span",{className:"FoFGamification-voters-item FoFGamification-voters-item--plus"},m("span",{className:"Avatar"},"+"+(t.length-15))):null)))},n.load=function(){var t,o=(t=Vt().mark((function t(){return Vt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,l().store.find("posts",this.attrs.post.id(),{include:"upvotes"});case 2:this.loading=!1,m.redraw();case 4:case"end":return t.stop()}}),t,this)})),function(){var o=this,e=arguments;return new Promise((function(n,r){var a=t.apply(o,e);function i(t){Lt(a,n,r,i,s,"next",t)}function s(t){Lt(a,n,r,i,s,"throw",t)}i(void 0)}))});return function(){return o.apply(this,arguments)}}(),e}(_t());const Et=flarum.core.compat["forum/components/UserPage"];var Gt=e.n(Et);const Rt=flarum.core.compat["forum/components/PostsUserPage"];var Bt=function(t){function e(){return t.apply(this,arguments)||this}return o(e,t),e.prototype.loadResults=function(t){return l().store.find("posts",{filter:{type:"comment",voted:this.user.id()},page:{offset:t,limit:this.loadLimit},sort:"-createdAt"})},e}(e.n(Rt)()),Dt={RankingsPage:D,VoteNotification:wt,VotesModal:K,Voters:St};function Mt(){return Mt=Object.assign?Object.assign.bind():function(t){for(var o=1;o\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = debounce;\n","var _typeof = require(\"./typeof.js\")[\"default\"];\n\nfunction _regeneratorRuntime() {\n \"use strict\";\n /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */\n\n module.exports = _regeneratorRuntime = function _regeneratorRuntime() {\n return exports;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n var exports = {},\n Op = Object.prototype,\n hasOwn = Op.hasOwnProperty,\n $Symbol = \"function\" == typeof Symbol ? Symbol : {},\n iteratorSymbol = $Symbol.iterator || \"@@iterator\",\n asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\",\n toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n return Object.defineProperty(obj, key, {\n value: value,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), obj[key];\n }\n\n try {\n define({}, \"\");\n } catch (err) {\n define = function define(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,\n generator = Object.create(protoGenerator.prototype),\n context = new Context(tryLocsList || []);\n return generator._invoke = function (innerFn, self, context) {\n var state = \"suspendedStart\";\n return function (method, arg) {\n if (\"executing\" === state) throw new Error(\"Generator is already running\");\n\n if (\"completed\" === state) {\n if (\"throw\" === method) throw arg;\n return doneResult();\n }\n\n for (context.method = method, context.arg = arg;;) {\n var delegate = context.delegate;\n\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) {\n if (\"suspendedStart\" === state) throw state = \"completed\", context.arg;\n context.dispatchException(context.arg);\n } else \"return\" === context.method && context.abrupt(\"return\", context.arg);\n state = \"executing\";\n var record = tryCatch(innerFn, self, context);\n\n if (\"normal\" === record.type) {\n if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue;\n return {\n value: record.arg,\n done: context.done\n };\n }\n\n \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg);\n }\n };\n }(innerFn, self, context), generator;\n }\n\n function tryCatch(fn, obj, arg) {\n try {\n return {\n type: \"normal\",\n arg: fn.call(obj, arg)\n };\n } catch (err) {\n return {\n type: \"throw\",\n arg: err\n };\n }\n }\n\n exports.wrap = wrap;\n var ContinueSentinel = {};\n\n function Generator() {}\n\n function GeneratorFunction() {}\n\n function GeneratorFunctionPrototype() {}\n\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n var getProto = Object.getPrototypeOf,\n NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);\n var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);\n\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n define(prototype, method, function (arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n\n if (\"throw\" !== record.type) {\n var result = record.arg,\n value = result.value;\n return value && \"object\" == _typeof(value) && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) {\n invoke(\"next\", value, resolve, reject);\n }, function (err) {\n invoke(\"throw\", err, resolve, reject);\n }) : PromiseImpl.resolve(value).then(function (unwrapped) {\n result.value = unwrapped, resolve(result);\n }, function (error) {\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n\n reject(record.arg);\n }\n\n var previousPromise;\n\n this._invoke = function (method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function (resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n };\n }\n\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n\n if (undefined === method) {\n if (context.delegate = null, \"throw\" === context.method) {\n if (delegate.iterator[\"return\"] && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method)) return ContinueSentinel;\n context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel;\n var info = record.arg;\n return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel);\n }\n\n function pushTryEntry(locs) {\n var entry = {\n tryLoc: locs[0]\n };\n 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\", delete record.arg, entry.completion = record;\n }\n\n function Context(tryLocsList) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);\n }\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) return iteratorMethod.call(iterable);\n if (\"function\" == typeof iterable.next) return iterable;\n\n if (!isNaN(iterable.length)) {\n var i = -1,\n next = function next() {\n for (; ++i < iterable.length;) {\n if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;\n }\n\n return next.value = undefined, next.done = !0, next;\n };\n\n return next.next = next;\n }\n }\n\n return {\n next: doneResult\n };\n }\n\n function doneResult() {\n return {\n value: undefined,\n done: !0\n };\n }\n\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, \"constructor\", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) {\n var ctor = \"function\" == typeof genFun && genFun.constructor;\n return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name));\n }, exports.mark = function (genFun) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun;\n }, exports.awrap = function (arg) {\n return {\n __await: arg\n };\n }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n void 0 === PromiseImpl && (PromiseImpl = Promise);\n var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);\n return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {\n return result.done ? result.value : iter.next();\n });\n }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () {\n return this;\n }), define(Gp, \"toString\", function () {\n return \"[object Generator]\";\n }), exports.keys = function (object) {\n var keys = [];\n\n for (var key in object) {\n keys.push(key);\n }\n\n return keys.reverse(), function next() {\n for (; keys.length;) {\n var key = keys.pop();\n if (key in object) return next.value = key, next.done = !1, next;\n }\n\n return next.done = !0, next;\n };\n }, exports.values = values, Context.prototype = {\n constructor: Context,\n reset: function reset(skipTempReset) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) {\n \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);\n }\n },\n stop: function stop() {\n this.done = !0;\n var rootRecord = this.tryEntries[0].completion;\n if (\"throw\" === rootRecord.type) throw rootRecord.arg;\n return this.rval;\n },\n dispatchException: function dispatchException(exception) {\n if (this.done) throw exception;\n var context = this;\n\n function handle(loc, caught) {\n return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i],\n record = entry.completion;\n if (\"root\" === entry.tryLoc) return handle(\"end\");\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\"),\n hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);\n if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);\n } else {\n if (!hasFinally) throw new Error(\"try statement without catch or finally\");\n if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n\n if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);\n var record = finallyEntry ? finallyEntry.completion : {};\n return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);\n },\n complete: function complete(record, afterLoc) {\n if (\"throw\" === record.type) throw record.arg;\n return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;\n },\n finish: function finish(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;\n }\n },\n \"catch\": function _catch(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n\n if (\"throw\" === record.type) {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n\n return thrown;\n }\n }\n\n throw new Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(iterable, resultName, nextLoc) {\n return this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel;\n }\n }, exports;\n}\n\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(obj);\n}\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__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\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 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/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/mixin'];","import Model from 'flarum/common/Model';\nimport mixin from 'flarum/common/utils/mixin';\n\nexport default class Rank extends mixin(Model, {\n points: Model.attribute('points'),\n name: Model.attribute('name'),\n color: Model.attribute('color'),\n}) {}\n","import Rank from './Rank';\n\nexport const models = {\n Rank,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Discussion'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Post'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/avatar'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Page'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/IndexPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/listItems'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/username'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","import app from 'flarum/forum/app';\n\nexport default (key, isBool = false) => {\n const val = app.data[`fof-gamification.${key}`];\n\n if (isBool) {\n return !!parseInt(val);\n }\n\n return val;\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Link'];","import app from 'flarum/forum/app';\nimport avatar from 'flarum/common/helpers/avatar';\nimport Page from 'flarum/common/components/Page';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport listItems from 'flarum/common/helpers/listItems';\nimport username from 'flarum/common/helpers/username';\nimport icon from 'flarum/common/helpers/icon';\nimport setting from '../helpers/setting';\nimport Link from 'flarum/common/components/Link';\n\n/**\n * This page re-uses Flarum's IndexPage CSS classes\n */\nexport default class RankingsPage extends Page {\n oninit(vnode) {\n super.oninit(vnode);\n\n if (!app.forum.attribute('canViewRankingPage')) {\n m.route.set('/');\n }\n\n this.loading = true;\n this.users = [];\n this.refresh();\n }\n\n view() {\n let loading;\n\n if (this.loading) {\n loading = LoadingIndicator.component();\n } else {\n loading = Button.component(\n {\n className: 'Button',\n onclick: this.loadMore.bind(this),\n },\n app.translator.trans('core.forum.discussion_list.load_more_button')\n );\n }\n\n return (\n
\n {IndexPage.prototype.hero()}\n
\n
\n \n
\n \n \n \n \n \n \n {this.users.map((user, i) => {\n ++i;\n return [\n \n {i < 4 ? (\n setting('customRankingImages', true) ? (\n \n ) : (\n \n )\n ) : (\n \n )}\n \n {i < 4 ? : }\n ,\n ];\n })}\n
{app.translator.trans('fof-gamification.forum.ranking.rank')}{app.translator.trans('fof-gamification.forum.ranking.name')}{app.translator.trans('fof-gamification.forum.ranking.amount')}
{icon('fas fa-trophy')}{this.addOrdinalSuffix(i)}\n
\n

\n \n {i < 4 ? avatar(user, { className: 'info-avatar rankings-' + i + '-avatar' }) : ''} {username(user)}\n \n

\n
\n
{user.points()}{user.points()}
\n
{loading}
\n
\n
\n
\n
\n );\n }\n\n refresh(clear = true) {\n if (clear) {\n this.loading = true;\n this.users = [];\n }\n\n return this.loadResults().then(\n (results) => {\n this.users = [];\n this.parseResults(results);\n },\n () => {\n this.loading = false;\n m.redraw();\n }\n );\n }\n\n addOrdinalSuffix(i) {\n if (app.data.locale === 'en') {\n const j = i % 10;\n const k = i % 100;\n\n if (j === 1 && k !== 11) {\n return i + 'st';\n } else if (j === 2 && k !== 12) {\n return i + 'nd';\n } else if (j === 3 && k !== 13) {\n return i + 'rd';\n }\n return i + 'th';\n } else {\n return i;\n }\n }\n\n loadResults(offset) {\n const params = {};\n params.page = {\n offset: offset,\n limit: '10',\n };\n\n return app.store.find('rankings', params);\n }\n\n loadMore() {\n this.loading = true;\n\n this.loadResults(this.users.length).then(this.parseResults.bind(this));\n }\n\n parseResults(results) {\n [].push.apply(this.users, results);\n\n this.loading = false;\n\n this.users.sort(function (a, b) {\n return parseFloat(b.points()) - parseFloat(a.points());\n });\n\n m.redraw();\n\n return results;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/states/DiscussionListState'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/CommentPost'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/classList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/PostControls'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","import app from 'flarum/forum/app';\nimport Modal from 'flarum/common/components/Modal';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport avatar from 'flarum/common/helpers/avatar';\nimport username from 'flarum/common/helpers/username';\nimport Link from 'flarum/common/components/Link';\n\nexport default class VotesModal extends Modal {\n className() {\n return 'VotesModal Modal--small';\n }\n\n title() {\n return app.translator.trans('fof-gamification.forum.modal.title');\n }\n\n oninit(vnode) {\n super.oninit(vnode);\n\n this.loading = !this.attrs.post.upvotes() || !this.attrs.post.downvotes();\n\n if (this.loading) {\n this.load();\n }\n }\n\n content() {\n if (this.loading) {\n return (\n
\n \n
\n );\n }\n\n return (\n
\n
    \n {['upvotes', 'downvotes'].map((type) => {\n const voters = this.attrs.post[type]();\n\n if (!voters || !voters.length) return;\n\n return (\n
    \n {app.translator.trans(`fof-gamification.forum.modal.${type}_label`)}\n {voters.map((user) => (\n
  • \n \n {avatar(user)} {username(user)}\n \n
  • \n ))}\n
    \n );\n })}\n
\n
\n );\n }\n\n load() {\n return app.store\n .find('posts', this.attrs.post.id(), {\n include: 'upvotes,downvotes',\n })\n .then(this.loaded.bind(this));\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/DiscussionControls'];","import app from 'flarum/forum/app';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\n\nexport default (post, upvoted, downvoted, load, discussion = post.discussion()) => {\n if (!app.session.user) {\n // We use this instead of showing LogInModal so that extensions can override it\n DiscussionControls.replyAction.call(discussion, true);\n return;\n } else if (discussion && !discussion.canVote() && !post.canVote()) {\n return;\n }\n\n if (upvoted && downvoted) {\n upvoted = false;\n downvoted = false;\n }\n\n if (load) load(true);\n\n m.redraw();\n\n return post\n .save([upvoted, downvoted, 'vote'])\n .then(\n () => null,\n () => null\n )\n .then(() => {\n if (load) load(false);\n\n if (discussion) {\n discussion.pushAttributes({\n votes: post.votes(),\n });\n }\n\n m.redraw();\n });\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionListItem'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/abbreviateNumber'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/PostUser'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/UserCard'];","export default function rankLabel(rank, attrs = {}) {\n attrs.style = attrs.style || {};\n attrs.className = 'rankLabel ' + (attrs.className || '');\n\n const color = rank.color();\n attrs.style.backgroundColor = attrs.style.color = color;\n attrs.className += ' colored';\n\n return m('span', attrs, {rank.name()});\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport PostUser from 'flarum/forum/components/PostUser';\nimport UserCard from 'flarum/forum/components/UserCard';\nimport rankLabel from '../common/helpers/rankLabel';\nimport setting from './helpers/setting';\nimport icon from 'flarum/common/helpers/icon';\n\nexport default function () {\n const matchClass = (className) => {\n return (node) => node && node.attrs && node.attrs.className && String(node.attrs.className).split(' ').includes(className);\n };\n\n const matchTag = (tagName) => {\n return (node) => node && node.tag && node.tag === tagName;\n };\n\n const findMatchClass = function (node, className) {\n const arr = [];\n\n if (node && node.children && Array.isArray(node.children)) {\n const nodeInChildren = node.children.find(matchClass(className));\n\n if (nodeInChildren) {\n arr.push(nodeInChildren);\n }\n\n node.children.forEach(function (currentValue) {\n arr.push(...findMatchClass(currentValue, className));\n });\n }\n\n return arr;\n };\n\n extend(UserCard.prototype, 'infoItems', function (items) {\n const user = this.attrs.user;\n\n items.add(\n 'points',\n
\n {icon('fas fa-medal')}\n {app.translator.trans('fof-gamification.forum.user.card.points', {\n count: user.points(),\n })}\n
,\n 50\n );\n });\n\n extend(UserCard.prototype, 'view', function (vnode) {\n const user = this.attrs.user;\n const profile_node = findMatchClass(vnode, 'UserCard-profile')[0];\n const amt = Number(setting('rankAmt'));\n\n if (!profile_node) return;\n\n let badges_node = profile_node.children.find(matchClass('UserCard-badges'));\n if (user.ranks()) {\n if (!badges_node) {\n profile_node.children.splice(\n 1,\n 0,\n
    \n {user\n .ranks()\n .reverse()\n .map((rank, i) => {\n if (!amt || i < amt) {\n return
  • {rankLabel(rank)}
  • ;\n }\n })}\n
\n );\n } else {\n user\n .ranks()\n .reverse()\n .map((rank, i) => {\n if (!amt || i < amt) {\n return
  • {rankLabel(rank)}
  • ;\n }\n })\n .forEach((rank) => {\n if (!rank) {\n return;\n }\n badges_node.children.push(rank);\n });\n }\n }\n\n return vnode;\n });\n\n extend(PostUser.prototype, 'view', function (vnode) {\n const post = this.attrs.post;\n const user = post.user();\n\n if (!user) {\n return vnode;\n }\n\n const header_node = vnode.children.find(matchTag('h3'));\n const amt = Number(setting('rankAmt')) ?? user.ranks().length;\n\n header_node.children = header_node.children\n .concat(\n user\n .ranks()\n .reverse()\n .splice(0, amt)\n .map((rank) => {\n return {rankLabel(rank)};\n })\n )\n .filter(function (el) {\n return el.tag !== undefined;\n });\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionPage'];","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\n\nimport debounce from 'lodash.debounce';\n\nconst fetch = (postId) => app.store.find('posts', postId).then(() => m.redraw());\nconst debounced = [];\nconst update = (postId) => {\n let func = debounced[postId];\n\n if (func) return func(postId);\n\n func = debounced[postId] = debounce(fetch, 1500);\n\n return func(postId);\n};\n\nexport default () => {\n extend(DiscussionPage.prototype, 'oncreate', function () {\n if (app.pusher) {\n app.pusher.then((channels) => {\n channels.pusher.bind('newVote', (data) => {\n const post = app.store.getById('posts', data.post_id);\n const userId = data.user_id;\n\n if (!post || post.votes() === data.votes || userId == app.session.user.id()) return;\n\n update(post.id());\n });\n });\n }\n });\n\n extend(DiscussionPage.prototype, 'onremove', function () {\n if (app.pusher) {\n app.pusher.then((channels) => {\n channels.pusher.unbind('newVote');\n });\n }\n });\n};\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\n\nimport DiscussionListItem from 'flarum/forum/components/DiscussionListItem';\nimport abbreviateNumber from 'flarum/common/utils/abbreviateNumber';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\n\nimport saveVote from './helpers/saveVote';\nimport setting from './helpers/setting';\n\nconst get = (discussion, key) => {\n const post = discussion.firstPost();\n\n if (post && post[key]() !== undefined) {\n return post[key]();\n }\n\n return discussion[key]();\n};\n\nexport default function addAlternateLayout() {\n extend(DiscussionListItem.prototype, 'oninit', function () {\n const discussion = this.attrs.discussion;\n\n if (!discussion.seeVotes()) {\n return;\n }\n\n this.subtree.check(() => this.voteLoading);\n });\n\n extend(DiscussionListItem.prototype, 'view', function (vdom) {\n const discussion = this.attrs.discussion;\n\n if (!discussion.seeVotes()) {\n return;\n }\n\n if (!vdom || !vdom.children) return;\n\n const content = vdom.children.find((v) => v && v.attrs && v.attrs.className && v.attrs.className.includes('DiscussionListItem-content'));\n const post = discussion.firstPost();\n\n const hasUpvoted = get(discussion, 'hasUpvoted');\n const hasDownvoted = get(discussion, 'hasDownvoted');\n // We set canVote to true for guest users so that they can access the login by clicking the button\n const canVote = !app.session.user || get(discussion, 'canVote');\n\n const upvotesOnly = setting('upVotesOnly', true);\n const altIcon = setting('iconNameAlt') || 'arrow';\n\n const onclick = (upvoted, downvoted) => saveVote(post, upvoted, downvoted, (val) => (this.voteLoading = val));\n\n content.children.unshift(\n
    \n onclick(!hasUpvoted, false)}\n aria-label={app.translator.trans('fof-gamification.forum.post.upvote_button')}\n />\n\n {abbreviateNumber(get(discussion, 'votes') || 0)}\n\n {!upvotesOnly && (\n onclick(false, !hasDownvoted)}\n aria-label={app.translator.trans('fof-gamification.forum.post.downvote_button')}\n />\n )}\n\n {this.voteLoading && }\n
    \n );\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/states/DiscussionListState'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/Notification'];","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nimport setting from '../helpers/setting';\n\nexport default class UpvotedNotification extends Notification {\n icon() {\n const icon = setting('iconName') || 'thumbs';\n\n if (this.attrs.notification.content() > 0) {\n return `fas fa-${icon}-up`;\n } else {\n return `fas fa-${icon}-down`;\n }\n }\n\n href() {\n return app.route.post(this.attrs.notification.subject());\n }\n\n content() {\n const user = this.attrs.notification.fromUser();\n const content = parseInt(this.attrs.notification.content());\n\n if (content > 0) {\n return app.translator.trans('fof-gamification.forum.notification.upvote', { user });\n } else {\n return app.translator.trans('fof-gamification.forum.notification.downvote', { user });\n }\n }\n\n excerpt() {\n return this.attrs.notification.subject().contentPlain();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/NotificationGrid'];","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/SubtreeRetainer'];","import app from 'flarum/forum/app';\n\nimport Component from 'flarum/common/Component';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Link from 'flarum/common/components/Link';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport avatar from 'flarum/common/helpers/avatar';\nimport icon from 'flarum/common/helpers/icon';\nimport SubtreeRetainer from 'flarum/common/utils/SubtreeRetainer';\n\nimport type Mithril from 'mithril';\n\nexport default class Voters extends Component {\n subtreeRetainer!: SubtreeRetainer;\n lastRenderVotes: number = -1;\n loading: boolean = false;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.loading = !this.attrs.post.upvotes();\n\n if (this.loading) {\n this.load();\n }\n\n this.subtreeRetainer = new SubtreeRetainer(\n () => this.loading,\n () => this.attrs.post.votes(),\n () => this.attrs.post?.upvotes?.()?.length\n );\n }\n\n onbeforeupdate(vnode: Mithril.Vnode) {\n super.onbeforeupdate(vnode);\n\n return this.subtreeRetainer.needsRebuild();\n }\n\n onupdate(vnode: Mithril.Vnode) {\n if (this.lastRenderVotes !== this.attrs.post.votes()) {\n this.loading = true;\n setTimeout(() => m.redraw(), 0);\n this.lastRenderVotes = this.attrs.post.votes();\n this.load();\n }\n }\n\n view() {\n // if (this.loading) {\n if (this.attrs.post.votes() === false || this.attrs.post.upvotes() === false) {\n return (\n
    \n
    \n
    \n \n {icon('fas fa-users')}\n {app.translator.trans('fof-gamification.forum.voters.label')}\n \n {app.translator.trans('fof-gamification.forum.voters.label')}\n \n \n
    \n\n \n
    \n
    \n );\n }\n\n const max = 15;\n const voters = this.attrs.post.upvotes();\n\n return (\n
    \n
    \n
    \n \n {icon('fas fa-users')}\n {app.translator.trans('fof-gamification.forum.voters.label')}\n \n {voters.length === 0\n ? app.translator.trans('fof-gamification.forum.voters.label_none')\n : app.translator.trans('fof-gamification.forum.voters.label')}\n \n \n
    \n
    \n {voters.length === 0 ? app.translator.trans('fof-gamification.forum.voters.none') : null}\n
    \n
    \n {voters.slice(0, max).map((user: any) => (\n \n {avatar(user)}\n \n ))}\n {voters.length > max ? (\n \n {`+${voters.length - max}`}\n \n ) : null}\n
    \n
    \n
    \n );\n }\n\n async load() {\n await app.store.find('posts', this.attrs.post.id(), {\n include: 'upvotes',\n });\n\n this.loading = false;\n\n m.redraw();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/UserPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/PostsUserPage'];","import app from 'flarum/forum/app';\nimport PostsUserPage from 'flarum/forum/components/PostsUserPage';\n\n/**\n * The `VotesUserPage` component shows posts which user voted on.\n */\nexport default class VotesUserPage extends PostsUserPage {\n /**\n * Load a new page of the user's activity feed.\n *\n * @param offset The position to start getting results from.\n * @protected\n */\n loadResults(offset: number) {\n return app.store.find('posts', {\n filter: {\n type: 'comment',\n voted: this.user.id(),\n },\n page: { offset, limit: this.loadLimit },\n sort: '-createdAt',\n });\n }\n}\n","import RankingsPage from './RankingsPage';\nimport VoteNotification from './VoteNotification';\nimport VotesModal from './VotesModal';\nimport Voters from './Voters';\n\nexport const components = {\n RankingsPage,\n VoteNotification,\n VotesModal,\n Voters,\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\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n return _extends.apply(this, arguments);\n}","import rankLabel from './rankLabel';\n\nexport const helpers = {\n rankLabel,\n};\n","import saveVote from './saveVote';\nimport setting from './setting';\n\nimport { helpers as commonHelpers } from '../../common/helpers';\n\nexport const helpers = {\n saveVote,\n setting,\n ...commonHelpers,\n};\n","import app from 'flarum/forum/app';\nimport Model from 'flarum/common/Model';\nimport Discussion from 'flarum/common/models/Discussion';\nimport Post from 'flarum/common/models/Post';\nimport User from 'flarum/common/models/User';\n\nimport Rank from '../common/models/Rank';\n\nimport RankingsPage from './components/RankingsPage';\n\nimport addHotnessSort from './addHotnessSort';\nimport addVoteButtons from './addVoteButtons';\nimport addUpvotesToDiscussion from './addUpvotesToDiscussion';\nimport addUserInfo from './addUserInfo';\nimport addPusher from './addPusher';\nimport addAlternateLayout from './addAlternateLayout';\n\nimport setting from './helpers/setting';\nimport addVotesSort from './addVotesSort';\nimport useAlternatePostVoteLayout from './useAlternatePostVoteLayout';\nimport addNotifications from './addNotifications';\nimport addVotersToDiscussionPageSideBar from './addVotersToDiscussionPageSideBar';\nimport addUpvoteTabToUserProfile from './addUpvoteTabToUserProfile';\n\napp.initializers.add('fof-gamification', () => {\n Discussion.prototype.votes = Model.attribute('votes');\n Discussion.prototype.hasUpvoted = Model.attribute('hasUpvoted');\n Discussion.prototype.hasDownvoted = Model.attribute('hasDownvoted');\n Discussion.prototype.canVote = Model.attribute('canVote');\n Discussion.prototype.seeVotes = Model.attribute('seeVotes');\n\n User.prototype.points = Model.attribute('points');\n User.prototype.ranks = Model.hasMany('ranks');\n User.prototype.canHaveVotingNotifications = Model.attribute('canHaveVotingNotifications');\n\n Post.prototype.upvotes = Model.hasMany('upvotes');\n Post.prototype.downvotes = Model.hasMany('downvotes');\n\n Post.prototype.votes = Model.attribute('votes');\n Post.prototype.canVote = Model.attribute('canVote');\n Post.prototype.canSeeVotes = Model.attribute('canSeeVotes');\n Post.prototype.hasUpvoted = Model.attribute('hasUpvoted');\n Post.prototype.hasDownvoted = Model.attribute('hasDownvoted');\n Post.prototype.seeVoters = Model.attribute('seeVoters');\n\n app.store.models.ranks = Rank;\n\n app.routes.rankings = { path: '/rankings', component: RankingsPage };\n\n addVoteButtons();\n addHotnessSort();\n addVotesSort();\n addUserInfo();\n addUpvotesToDiscussion();\n addPusher();\n addNotifications();\n addVotersToDiscussionPageSideBar();\n addUpvoteTabToUserProfile();\n\n if (setting('useAlternateLayout', true)) {\n addAlternateLayout();\n }\n\n if (setting('altPostVotingUi', true)) {\n useAlternatePostVoteLayout();\n }\n});\n\nexport * from './components';\nexport * from './helpers';\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Button from 'flarum/common/components/Button';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport classList from 'flarum/common/utils/classList';\nimport PostControls from 'flarum/forum/utils/PostControls';\n\nimport VotesModal from './components/VotesModal';\nimport setting from './helpers/setting';\nimport saveVote from './helpers/saveVote';\n\nexport default function () {\n extend(PostControls, 'moderationControls', function (items, post) {\n if (post.seeVoters()) {\n items.add('viewVotes', [\n m(\n Button,\n {\n icon: 'fas fa-thumbs-up',\n onclick: () => {\n app.modal.show(VotesModal, { post });\n },\n },\n app.translator.trans('fof-gamification.forum.mod_item')\n ),\n ]);\n }\n });\n\n extend(CommentPost.prototype, 'actionItems', function (items) {\n const post = this.attrs.post;\n\n //if (!post.canVote()) return;\n\n const hasDownvoted = post.hasDownvoted();\n const hasUpvoted = post.hasUpvoted();\n\n const icon = setting('iconName') || 'thumbs';\n const upVotesOnly = setting('upVotesOnly', true);\n\n const canSeeVotes = post.canSeeVotes();\n\n // We set canVote to true for guest users so that they can access the login by clicking the button\n const canVote = !app.session.user || post.canVote();\n\n const onclick = (upvoted, downvoted) => saveVote(post, upvoted, downvoted, (val) => (this.voteLoading = val));\n\n items.add(\n 'votes',\n
    \n {Button.component({\n icon: this.voteLoading ? undefined : `fas fa-fw fa-${icon}-up`,\n className: classList('Post-vote Post-upvote', hasUpvoted && 'Post-vote--active'),\n loading: this.voteLoading,\n disabled: this.voteLoading || !canVote || !canSeeVotes,\n onclick: () => onclick(!hasUpvoted, false),\n 'aria-label': app.translator.trans('fof-gamification.forum.post.upvote_button'),\n })}\n\n \n\n {!upVotesOnly &&\n Button.component({\n icon: this.voteLoading ? undefined : `fas fa-fw fa-${icon}-down`,\n className: classList('Post-vote Post-downvote', hasDownvoted && 'Post-vote--active'),\n loading: this.voteLoading,\n disabled: !canVote || !canSeeVotes,\n onclick: () => onclick(false, !hasDownvoted),\n 'aria-label': app.translator.trans('fof-gamification.forum.post.downvote_button'),\n })}\n
    ,\n 10\n );\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport LinkButton from 'flarum/common/components/LinkButton';\n\nexport default function () {\n extend(IndexPage.prototype, 'navItems', function (items) {\n if (!app.forum.attribute('canViewRankingPage')) {\n return;\n }\n\n items.add(\n 'rankings',\n LinkButton.component(\n {\n href: app.route('rankings'),\n icon: 'fas fa-trophy',\n },\n app.translator.trans('fof-gamification.forum.nav.name')\n ),\n 80\n );\n });\n\n extend(DiscussionListState.prototype, 'sortMap', function (map) {\n map.hot = '-hotness';\n });\n}\n","import { extend } from 'flarum/common/extend';\nimport DiscussionListState from 'flarum/common/states/DiscussionListState';\n\nexport default function () {\n extend(DiscussionListState.prototype, 'sortMap', function (map) {\n map.votes = '-votes';\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport DiscussionListItem from 'flarum/forum/components/DiscussionListItem';\nimport abbreviateNumber from 'flarum/common/utils/abbreviateNumber';\nimport icon from 'flarum/common/helpers/icon';\nimport setting from './helpers/setting';\n\nexport default function () {\n if (!setting('showVotesOnDiscussionPage', true) || setting('useAlternateLayout', true)) {\n return;\n }\n\n extend(DiscussionListItem.prototype, 'elementAttrs', function (attrs) {\n if (!this.attrs.discussion.seeVotes()) {\n return;\n }\n\n attrs.className += ' DiscussionListItem--withVotes';\n });\n\n extend(DiscussionListItem.prototype, 'infoItems', function (items) {\n const discussion = this.attrs.discussion;\n\n if (!discussion.seeVotes()) {\n return;\n }\n\n items.add(\n 'discussion-votes',\n \n {icon('far fa-thumbs-up')}\n {abbreviateNumber(this.attrs.discussion.votes())}\n ,\n 20\n );\n });\n}\n","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport VoteNotification from './components/VoteNotification';\nimport NotificationGrid from 'flarum/forum/components/NotificationGrid';\nimport ItemList from 'flarum/common/utils/ItemList';\n\nexport default function addNotifications() {\n app.notificationComponents.vote = VoteNotification;\n\n extend(NotificationGrid.prototype, 'notificationTypes', function (items: ItemList<{ name: string; icon: string; label: any }>) {\n const user = app.session?.user;\n\n if (!user?.canHaveVotingNotifications?.()) return;\n\n items.add('vote', {\n name: 'vote',\n icon: 'fas fa-thumbs-up',\n label: app.translator.trans('fof-gamification.forum.notification.prefrences.vote'),\n });\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport Voters from './components/Voters';\nimport type ItemList from 'flarum/common/utils/ItemList';\n\nimport type Mithril from 'mithril';\n\n/**\n * Adds our custom {@link Voters} component to the discussion sidebar.\n */\nexport default function addVotersToDiscussionPageSideBar() {\n extend(DiscussionPage.prototype, 'sidebarItems', function (this: DiscussionPage, items: ItemList) {\n const discussion = this.discussion;\n const posts = discussion!.posts() || [];\n const firstPost = posts?.[0];\n\n if (firstPost?.canSeeVotes?.() && firstPost?.seeVoters?.() && !!app.forum.attribute('fof-gamification-op-votes-only')) {\n items.add('op-voters', , 90);\n }\n });\n}\n","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport UserPage from 'flarum/forum/components/UserPage';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport VotesUserPage from './components/VotesUserPage';\nimport setting from './helpers/setting';\n\nexport default function addUpvoteTabToUserProfile() {\n app.routes['user.votes'] = { path: '/u/:username/votes', component: VotesUserPage };\n extend(UserPage.prototype, 'navItems', function (items) {\n const user = this.user;\n const icon = setting('iconName') || 'thumbs';\n items.add(\n 'votes',\n \n {app.translator.trans('fof-gamification.forum.user.votes_link')}\n ,\n 85\n );\n });\n}\n","import app from 'flarum/forum/app';\n\nimport { extend } from 'flarum/common/extend';\n\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport Button from 'flarum/common/components/Button';\nimport abbreviateNumber from 'flarum/common/utils/abbreviateNumber';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport type ItemList from 'flarum/common/utils/ItemList';\n\nimport setting from './helpers/setting';\nimport saveVote from './helpers/saveVote';\n\nexport default function useAlternatePostVoteLayout() {\n extend(CommentPost.prototype, 'actionItems', function (this: CommentPost, items: ItemList) {\n if (this.attrs.post.isHidden()) return;\n\n items.remove('votes');\n });\n\n extend(CommentPost.prototype, 'classes', function (this: CommentPost, classes: string[]) {\n if (this.attrs.post.isHidden()) return;\n\n const upvotesOnly = setting('upVotesOnly', true);\n\n classes.push('votesAlternativeLayout');\n\n if (upvotesOnly) {\n classes.push('votesUpvotesOnly');\n }\n });\n\n extend(CommentPost.prototype, 'headerItems', function (this: CommentPost, items: ItemList) {\n const post = this.attrs.post;\n\n if (post.isHidden()) return;\n if (!post.canSeeVotes()) return;\n\n const hasDownvoted = post.hasDownvoted();\n const hasUpvoted = post.hasUpvoted();\n\n const icon = setting('iconName') || 'thumbs';\n const upvotesOnly = setting('upVotesOnly', true);\n\n const canSeeVotes = post.canSeeVotes();\n\n // We set canVote to true for guest users so that they can access the login by clicking the button\n const canVote = !app.session.user || post.canVote();\n\n const onclick = (upvoted, downvoted) =>\n saveVote(post, upvoted, downvoted, (val) => {\n this.voteLoading = val;\n });\n\n items.add(\n 'votes',\n
    \n onclick(!hasUpvoted, false)}\n aria-label={app.translator.trans('fof-gamification.forum.post.upvote_button')}\n />\n\n {abbreviateNumber(post.votes() || 0)}\n\n {!upvotesOnly && (\n onclick(false, !hasDownvoted)}\n aria-label={app.translator.trans('fof-gamification.forum.post.downvote_button')}\n />\n )}\n\n {this.voteLoading && }\n
    ,\n 10000\n );\n });\n}\n"],"names":["reTrim","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","parseInt","freeGlobal","global","Object","freeSelf","self","root","Function","objectToString","prototype","toString","nativeMax","Math","max","nativeMin","min","now","Date","isObject","value","type","toNumber","isObjectLike","call","isSymbol","other","valueOf","replace","isBinary","test","slice","module","exports","func","wait","options","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","TypeError","invokeFunc","time","args","thisArg","undefined","apply","leadingEdge","setTimeout","timerExpired","shouldInvoke","timeSinceLastCall","trailingEdge","remainingWait","debounced","isInvoking","arguments","this","cancel","clearTimeout","flush","_typeof","require","_regeneratorRuntime","__esModule","Op","hasOwn","hasOwnProperty","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","obj","key","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","tryLocsList","protoGenerator","Generator","generator","create","context","Context","_invoke","state","method","arg","Error","done","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","fn","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","PromiseImpl","invoke","resolve","reject","__await","then","unwrapped","error","previousPromise","callInvokeWithMethodAndArg","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","doneResult","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","object","reverse","pop","skipTempReset","prev","charAt","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","runtime","regeneratorRuntime","accidentalStrictMode","globalThis","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","n","getter","d","a","definition","o","get","g","e","window","prop","r","_setPrototypeOf","p","bind","_inheritsLoose","subClass","superClass","flarum","core","compat","Rank","mixin","Model","points","color","models","isBool","val","app","RankingsPage","oninit","vnode","m","route","set","loading","users","refresh","view","LoadingIndicator","Button","className","onclick","loadMore","IndexPage","listItems","toArray","class","map","user","setting","src","icon","addOrdinalSuffix","href","force","avatar","username","clear","loadResults","results","parseResults","redraw","j","k","offset","params","page","limit","sort","b","parseFloat","Page","VotesModal","title","attrs","post","upvotes","downvotes","load","content","voters","id","include","loaded","Modal","upvoted","downvoted","discussion","canVote","save","pushAttributes","votes","DiscussionControls","rankLabel","rank","style","backgroundColor","matchClass","node","String","split","includes","findMatchClass","arr","children","Array","isArray","nodeInChildren","find","currentValue","extend","UserCard","items","add","count","profile_node","amt","Number","badges_node","ranks","splice","PostUser","header_node","tag","concat","filter","el","fetch","postId","firstPost","UpvotedNotification","notification","subject","fromUser","excerpt","contentPlain","Notification","asyncGeneratorStep","gen","_next","_throw","Voters","subtreeRetainer","lastRenderVotes","SubtreeRetainer","onbeforeupdate","needsRebuild","onupdate","display","slug","text","Component","VotesUserPage","voted","loadLimit","PostsUserPage","components","VoteNotification","_extends","assign","target","source","helpers","saveVote","Discussion","User","Post","path","component","PostControls","seeVoters","CommentPost","hasDownvoted","hasUpvoted","upVotesOnly","canSeeVotes","voteLoading","classList","disabled","LinkButton","DiscussionListState","hot","addUserInfo","DiscussionListItem","seeVotes","abbreviateNumber","DiscussionPage","channels","pusher","data","post_id","userId","user_id","debounce","unbind","NotificationGrid","canHaveVotingNotifications","label","posts","UserPage","subtree","check","vdom","v","upvotesOnly","altIcon","unshift","size","isHidden","remove","classes"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.js","mappings":";2BAUA,IASIA,EAAS,aAGTC,EAAa,qBAGbC,EAAa,aAGbC,EAAY,cAGZC,EAAeC,SAGfC,EAA8B,iBAAVC,EAAAA,GAAsBA,EAAAA,GAAUA,EAAAA,EAAOC,SAAWA,QAAUD,EAAAA,EAGhFE,EAA0B,iBAARC,MAAoBA,MAAQA,KAAKF,SAAWA,QAAUE,KAGxEC,EAAOL,GAAcG,GAAYG,SAAS,cAATA,GAUjCC,EAPcL,OAAOM,UAOQC,SAG7BC,EAAYC,KAAKC,IACjBC,EAAYF,KAAKG,IAkBjBC,EAAM,WACR,OAAOV,EAAKW,KAAKD,KACnB,EA2MA,SAASE,EAASC,GAChB,IAAIC,SAAcD,EAClB,QAASA,IAAkB,UAARC,GAA4B,YAARA,EACzC,CA2EA,SAASC,EAASF,GAChB,GAAoB,iBAATA,EACT,OAAOA,EAET,GAhCF,SAAkBA,GAChB,MAAuB,iBAATA,GAtBhB,SAAsBA,GACpB,QAASA,GAAyB,iBAATA,CAC3B,CAqBKG,CAAaH,IAzTF,mBAyTYX,EAAee,KAAKJ,EAChD,CA6BMK,CAASL,GACX,OA3VM,IA6VR,GAAID,EAASC,GAAQ,CACnB,IAAIM,EAAgC,mBAAjBN,EAAMO,QAAwBP,EAAMO,UAAYP,EACnEA,EAAQD,EAASO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AACS,IAAM,CACLC,UAAU,yEACVc,KAAI,gBAAkBA,EAAI,QAC1B,cAAamI,EACbgB,UAAWzG,GAAWpP,KAAK2V,YAC3B9J,QAAS,kBAAMA,GAAQ,GAAQgJ,EAAa,EAC5C,aAAYlK,IAAAA,WAAeoB,MAAM,iDAIpC/L,KAAK2V,aAAezK,EAACQ,IAAgB,CAAC4H,QAAQ,SAASqE,KAAK,WAE/D,IA7C6B,CA+CjC,IRjBF","sources":["webpack://@fof/gamification/./node_modules/lodash.debounce/index.js","webpack://@fof/gamification/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js","webpack://@fof/gamification/./node_modules/@babel/runtime/helpers/typeof.js","webpack://@fof/gamification/./node_modules/@babel/runtime/regenerator/index.js","webpack://@fof/gamification/webpack/bootstrap","webpack://@fof/gamification/webpack/runtime/compat get default export","webpack://@fof/gamification/webpack/runtime/define property getters","webpack://@fof/gamification/webpack/runtime/global","webpack://@fof/gamification/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/gamification/webpack/runtime/make namespace object","webpack://@fof/gamification/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/gamification/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/gamification/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/utils/mixin']\"","webpack://@fof/gamification/./src/common/models/Rank.js","webpack://@fof/gamification/./src/common/models/index.js","webpack://@fof/gamification/external root \"flarum.core.compat['forum/app']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/models/Discussion']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/models/Post']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/models/User']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/helpers/avatar']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/components/Page']\"","webpack://@fof/gamification/external root \"flarum.core.compat['forum/components/IndexPage']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/helpers/listItems']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/helpers/username']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/gamification/./src/forum/helpers/setting.js","webpack://@fof/gamification/external root \"flarum.core.compat['common/components/Link']\"","webpack://@fof/gamification/./src/forum/components/RankingsPage.js","webpack://@fof/gamification/external root \"flarum.core.compat['common/extend']\"","webpack://@fof/gamification/external root \"flarum.core.compat['forum/states/DiscussionListState']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/components/LinkButton']\"","webpack://@fof/gamification/external root \"flarum.core.compat['forum/components/CommentPost']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/utils/classList']\"","webpack://@fof/gamification/external root \"flarum.core.compat['forum/utils/PostControls']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@fof/gamification/./src/forum/components/VotesModal.js","webpack://@fof/gamification/external root \"flarum.core.compat['forum/utils/DiscussionControls']\"","webpack://@fof/gamification/./src/forum/helpers/saveVote.js","webpack://@fof/gamification/external root \"flarum.core.compat['forum/components/DiscussionListItem']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/utils/abbreviateNumber']\"","webpack://@fof/gamification/external root \"flarum.core.compat['forum/components/PostUser']\"","webpack://@fof/gamification/external root \"flarum.core.compat['forum/components/UserCard']\"","webpack://@fof/gamification/./src/common/helpers/rankLabel.js","webpack://@fof/gamification/./src/forum/addUserInfo.js","webpack://@fof/gamification/external root \"flarum.core.compat['forum/components/DiscussionPage']\"","webpack://@fof/gamification/./src/forum/addPusher.js","webpack://@fof/gamification/./src/forum/addAlternateLayout.js","webpack://@fof/gamification/external root \"flarum.core.compat['common/states/DiscussionListState']\"","webpack://@fof/gamification/external root \"flarum.core.compat['forum/components/Notification']\"","webpack://@fof/gamification/./src/forum/components/VoteNotification.js","webpack://@fof/gamification/external root \"flarum.core.compat['forum/components/NotificationGrid']\"","webpack://@fof/gamification/./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","webpack://@fof/gamification/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/components/Tooltip']\"","webpack://@fof/gamification/external root \"flarum.core.compat['common/utils/SubtreeRetainer']\"","webpack://@fof/gamification/./src/forum/components/Voters.tsx","webpack://@fof/gamification/external root \"flarum.core.compat['forum/components/UserPage']\"","webpack://@fof/gamification/external root \"flarum.core.compat['forum/components/PostsUserPage']\"","webpack://@fof/gamification/./src/forum/components/VotesUserPage.ts","webpack://@fof/gamification/./src/forum/components/index.js","webpack://@fof/gamification/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@fof/gamification/./src/common/helpers/index.js","webpack://@fof/gamification/./src/forum/helpers/index.js","webpack://@fof/gamification/./src/forum/index.js","webpack://@fof/gamification/./src/forum/addVoteButtons.js","webpack://@fof/gamification/./src/forum/addHotnessSort.js","webpack://@fof/gamification/./src/forum/addVotesSort.js","webpack://@fof/gamification/./src/forum/addUpvotesToDiscussion.js","webpack://@fof/gamification/./src/forum/addNotifications.ts","webpack://@fof/gamification/./src/forum/addVotersToDiscussionPageSideBar.tsx","webpack://@fof/gamification/./src/forum/addUpvoteTabToUserProfile.js","webpack://@fof/gamification/./src/forum/useAlternatePostVoteLayout.tsx"],"sourcesContent":["/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = debounce;\n","var _typeof = require(\"./typeof.js\")[\"default\"];\n\nfunction _regeneratorRuntime() {\n \"use strict\";\n /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */\n\n module.exports = _regeneratorRuntime = function _regeneratorRuntime() {\n return exports;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n var exports = {},\n Op = Object.prototype,\n hasOwn = Op.hasOwnProperty,\n $Symbol = \"function\" == typeof Symbol ? Symbol : {},\n iteratorSymbol = $Symbol.iterator || \"@@iterator\",\n asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\",\n toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n return Object.defineProperty(obj, key, {\n value: value,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), obj[key];\n }\n\n try {\n define({}, \"\");\n } catch (err) {\n define = function define(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,\n generator = Object.create(protoGenerator.prototype),\n context = new Context(tryLocsList || []);\n return generator._invoke = function (innerFn, self, context) {\n var state = \"suspendedStart\";\n return function (method, arg) {\n if (\"executing\" === state) throw new Error(\"Generator is already running\");\n\n if (\"completed\" === state) {\n if (\"throw\" === method) throw arg;\n return doneResult();\n }\n\n for (context.method = method, context.arg = arg;;) {\n var delegate = context.delegate;\n\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) {\n if (\"suspendedStart\" === state) throw state = \"completed\", context.arg;\n context.dispatchException(context.arg);\n } else \"return\" === context.method && context.abrupt(\"return\", context.arg);\n state = \"executing\";\n var record = tryCatch(innerFn, self, context);\n\n if (\"normal\" === record.type) {\n if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue;\n return {\n value: record.arg,\n done: context.done\n };\n }\n\n \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg);\n }\n };\n }(innerFn, self, context), generator;\n }\n\n function tryCatch(fn, obj, arg) {\n try {\n return {\n type: \"normal\",\n arg: fn.call(obj, arg)\n };\n } catch (err) {\n return {\n type: \"throw\",\n arg: err\n };\n }\n }\n\n exports.wrap = wrap;\n var ContinueSentinel = {};\n\n function Generator() {}\n\n function GeneratorFunction() {}\n\n function GeneratorFunctionPrototype() {}\n\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n var getProto = Object.getPrototypeOf,\n NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);\n var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);\n\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n define(prototype, method, function (arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n\n if (\"throw\" !== record.type) {\n var result = record.arg,\n value = result.value;\n return value && \"object\" == _typeof(value) && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) {\n invoke(\"next\", value, resolve, reject);\n }, function (err) {\n invoke(\"throw\", err, resolve, reject);\n }) : PromiseImpl.resolve(value).then(function (unwrapped) {\n result.value = unwrapped, resolve(result);\n }, function (error) {\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n\n reject(record.arg);\n }\n\n var previousPromise;\n\n this._invoke = function (method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function (resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n };\n }\n\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n\n if (undefined === method) {\n if (context.delegate = null, \"throw\" === context.method) {\n if (delegate.iterator[\"return\"] && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method)) return ContinueSentinel;\n context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel;\n var info = record.arg;\n return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel);\n }\n\n function pushTryEntry(locs) {\n var entry = {\n tryLoc: locs[0]\n };\n 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\", delete record.arg, entry.completion = record;\n }\n\n function Context(tryLocsList) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);\n }\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) return iteratorMethod.call(iterable);\n if (\"function\" == typeof iterable.next) return iterable;\n\n if (!isNaN(iterable.length)) {\n var i = -1,\n next = function next() {\n for (; ++i < iterable.length;) {\n if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;\n }\n\n return next.value = undefined, next.done = !0, next;\n };\n\n return next.next = next;\n }\n }\n\n return {\n next: doneResult\n };\n }\n\n function doneResult() {\n return {\n value: undefined,\n done: !0\n };\n }\n\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, \"constructor\", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) {\n var ctor = \"function\" == typeof genFun && genFun.constructor;\n return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name));\n }, exports.mark = function (genFun) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun;\n }, exports.awrap = function (arg) {\n return {\n __await: arg\n };\n }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n void 0 === PromiseImpl && (PromiseImpl = Promise);\n var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);\n return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {\n return result.done ? result.value : iter.next();\n });\n }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () {\n return this;\n }), define(Gp, \"toString\", function () {\n return \"[object Generator]\";\n }), exports.keys = function (object) {\n var keys = [];\n\n for (var key in object) {\n keys.push(key);\n }\n\n return keys.reverse(), function next() {\n for (; keys.length;) {\n var key = keys.pop();\n if (key in object) return next.value = key, next.done = !1, next;\n }\n\n return next.done = !0, next;\n };\n }, exports.values = values, Context.prototype = {\n constructor: Context,\n reset: function reset(skipTempReset) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) {\n \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);\n }\n },\n stop: function stop() {\n this.done = !0;\n var rootRecord = this.tryEntries[0].completion;\n if (\"throw\" === rootRecord.type) throw rootRecord.arg;\n return this.rval;\n },\n dispatchException: function dispatchException(exception) {\n if (this.done) throw exception;\n var context = this;\n\n function handle(loc, caught) {\n return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i],\n record = entry.completion;\n if (\"root\" === entry.tryLoc) return handle(\"end\");\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\"),\n hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);\n if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);\n } else {\n if (!hasFinally) throw new Error(\"try statement without catch or finally\");\n if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n\n if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);\n var record = finallyEntry ? finallyEntry.completion : {};\n return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);\n },\n complete: function complete(record, afterLoc) {\n if (\"throw\" === record.type) throw record.arg;\n return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;\n },\n finish: function finish(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;\n }\n },\n \"catch\": function _catch(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n\n if (\"throw\" === record.type) {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n\n return thrown;\n }\n }\n\n throw new Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(iterable, resultName, nextLoc) {\n return this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel;\n }\n }, exports;\n}\n\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(obj);\n}\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__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\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 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/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/mixin'];","import Model from 'flarum/common/Model';\nimport mixin from 'flarum/common/utils/mixin';\n\nexport default class Rank extends mixin(Model, {\n points: Model.attribute('points'),\n name: Model.attribute('name'),\n color: Model.attribute('color'),\n}) {}\n","import Rank from './Rank';\n\nexport const models = {\n Rank,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Discussion'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Post'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/avatar'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Page'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/IndexPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/listItems'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/username'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","import app from 'flarum/forum/app';\n\nexport default (key, isBool = false) => {\n const val = app.data[`fof-gamification.${key}`];\n\n if (isBool) {\n return !!parseInt(val);\n }\n\n return val;\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Link'];","import app from 'flarum/forum/app';\nimport avatar from 'flarum/common/helpers/avatar';\nimport Page from 'flarum/common/components/Page';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport listItems from 'flarum/common/helpers/listItems';\nimport username from 'flarum/common/helpers/username';\nimport icon from 'flarum/common/helpers/icon';\nimport setting from '../helpers/setting';\nimport Link from 'flarum/common/components/Link';\n\n/**\n * This page re-uses Flarum's IndexPage CSS classes\n */\nexport default class RankingsPage extends Page {\n oninit(vnode) {\n super.oninit(vnode);\n\n if (!app.forum.attribute('canViewRankingPage')) {\n m.route.set('/');\n }\n\n this.loading = true;\n this.users = [];\n this.refresh();\n }\n\n view() {\n let loading;\n\n if (this.loading) {\n loading = LoadingIndicator.component();\n } else {\n loading = Button.component(\n {\n className: 'Button',\n onclick: this.loadMore.bind(this),\n },\n app.translator.trans('core.forum.discussion_list.load_more_button')\n );\n }\n\n return (\n
    \n {IndexPage.prototype.hero()}\n
    \n
    \n \n
    \n \n \n \n \n \n \n {this.users.map((user, i) => {\n ++i;\n return [\n \n {i < 4 ? (\n setting('customRankingImages', true) ? (\n \n ) : (\n \n )\n ) : (\n \n )}\n \n {i < 4 ? : }\n ,\n ];\n })}\n
    {app.translator.trans('fof-gamification.forum.ranking.rank')}{app.translator.trans('fof-gamification.forum.ranking.name')}{app.translator.trans('fof-gamification.forum.ranking.amount')}
    {icon('fas fa-trophy')}{this.addOrdinalSuffix(i)}\n
    \n

    \n \n {i < 4 ? avatar(user, { className: 'info-avatar rankings-' + i + '-avatar' }) : ''} {username(user)}\n \n

    \n
    \n
    {user.points()}{user.points()}
    \n
    {loading}
    \n
    \n
    \n
    \n
    \n );\n }\n\n refresh(clear = true) {\n if (clear) {\n this.loading = true;\n this.users = [];\n }\n\n return this.loadResults().then(\n (results) => {\n this.users = [];\n this.parseResults(results);\n },\n () => {\n this.loading = false;\n m.redraw();\n }\n );\n }\n\n addOrdinalSuffix(i) {\n if (app.data.locale === 'en') {\n const j = i % 10;\n const k = i % 100;\n\n if (j === 1 && k !== 11) {\n return i + 'st';\n } else if (j === 2 && k !== 12) {\n return i + 'nd';\n } else if (j === 3 && k !== 13) {\n return i + 'rd';\n }\n return i + 'th';\n } else {\n return i;\n }\n }\n\n loadResults(offset) {\n const params = {};\n params.page = {\n offset: offset,\n limit: '10',\n };\n\n return app.store.find('rankings', params);\n }\n\n loadMore() {\n this.loading = true;\n\n this.loadResults(this.users.length).then(this.parseResults.bind(this));\n }\n\n parseResults(results) {\n [].push.apply(this.users, results);\n\n this.loading = false;\n\n this.users.sort(function (a, b) {\n return parseFloat(b.points()) - parseFloat(a.points());\n });\n\n m.redraw();\n\n return results;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/states/DiscussionListState'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/CommentPost'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/classList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/PostControls'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","import app from 'flarum/forum/app';\nimport Modal from 'flarum/common/components/Modal';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport avatar from 'flarum/common/helpers/avatar';\nimport username from 'flarum/common/helpers/username';\nimport Link from 'flarum/common/components/Link';\n\nexport default class VotesModal extends Modal {\n className() {\n return 'VotesModal Modal--small';\n }\n\n title() {\n return app.translator.trans('fof-gamification.forum.modal.title');\n }\n\n oninit(vnode) {\n super.oninit(vnode);\n\n this.loading = !this.attrs.post.upvotes() || !this.attrs.post.downvotes();\n\n if (this.loading) {\n this.load();\n }\n }\n\n content() {\n if (this.loading) {\n return (\n
    \n \n
    \n );\n }\n\n return (\n
    \n
      \n {['upvotes', 'downvotes'].map((type) => {\n const voters = this.attrs.post[type]();\n\n if (!voters || !voters.length) return;\n\n return (\n
      \n {app.translator.trans(`fof-gamification.forum.modal.${type}_label`)}\n {voters.map((user) => (\n
    • \n \n {avatar(user)} {username(user)}\n \n
    • \n ))}\n
      \n );\n })}\n
    \n
    \n );\n }\n\n load() {\n return app.store\n .find('posts', this.attrs.post.id(), {\n include: 'upvotes,downvotes',\n })\n .then(this.loaded.bind(this));\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/DiscussionControls'];","import app from 'flarum/forum/app';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\n\nexport default (post, upvoted, downvoted, load, discussion = post.discussion()) => {\n if (!app.session.user) {\n // We use this instead of showing LogInModal so that extensions can override it\n DiscussionControls.replyAction.call(discussion, true);\n return;\n } else if (discussion && !discussion.canVote() && !post.canVote()) {\n return;\n }\n\n if (upvoted && downvoted) {\n upvoted = false;\n downvoted = false;\n }\n\n if (load) load(true);\n\n m.redraw();\n\n return post\n .save([upvoted, downvoted, 'vote'])\n .then(\n () => null,\n () => null\n )\n .then(() => {\n if (load) load(false);\n\n if (discussion) {\n discussion.pushAttributes({\n votes: post.votes(),\n });\n }\n\n m.redraw();\n });\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionListItem'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/abbreviateNumber'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/PostUser'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/UserCard'];","export default function rankLabel(rank, attrs = {}) {\n attrs.style = attrs.style || {};\n attrs.className = 'rankLabel ' + (attrs.className || '');\n\n const color = rank.color();\n attrs.style.backgroundColor = attrs.style.color = color;\n attrs.className += ' colored';\n\n return m('span', attrs, {rank.name()});\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport PostUser from 'flarum/forum/components/PostUser';\nimport UserCard from 'flarum/forum/components/UserCard';\nimport rankLabel from '../common/helpers/rankLabel';\nimport setting from './helpers/setting';\nimport icon from 'flarum/common/helpers/icon';\n\nexport default function () {\n const matchClass = (className) => {\n return (node) => node && node.attrs && node.attrs.className && String(node.attrs.className).split(' ').includes(className);\n };\n\n const matchTag = (tagName) => {\n return (node) => node && node.tag && node.tag === tagName;\n };\n\n const findMatchClass = function (node, className) {\n const arr = [];\n\n if (node && node.children && Array.isArray(node.children)) {\n const nodeInChildren = node.children.find(matchClass(className));\n\n if (nodeInChildren) {\n arr.push(nodeInChildren);\n }\n\n node.children.forEach(function (currentValue) {\n arr.push(...findMatchClass(currentValue, className));\n });\n }\n\n return arr;\n };\n\n extend(UserCard.prototype, 'infoItems', function (items) {\n const user = this.attrs.user;\n\n items.add(\n 'points',\n
    \n {icon('fas fa-medal')}\n {app.translator.trans('fof-gamification.forum.user.card.points', {\n count: user.points(),\n })}\n
    ,\n 50\n );\n });\n\n extend(UserCard.prototype, 'view', function (vnode) {\n const user = this.attrs.user;\n const profile_node = findMatchClass(vnode, 'UserCard-profile')[0];\n const amt = Number(setting('rankAmt'));\n\n if (!profile_node) return;\n\n let badges_node = profile_node.children.find(matchClass('UserCard-badges'));\n if (user.ranks()) {\n if (!badges_node) {\n profile_node.children.splice(\n 1,\n 0,\n
      \n {user\n .ranks()\n .reverse()\n .map((rank, i) => {\n if (!amt || i < amt) {\n return
    • {rankLabel(rank)}
    • ;\n }\n })}\n
    \n );\n } else {\n user\n .ranks()\n .reverse()\n .map((rank, i) => {\n if (!amt || i < amt) {\n return
  • {rankLabel(rank)}
  • ;\n }\n })\n .forEach((rank) => {\n if (!rank) {\n return;\n }\n badges_node.children.push(rank);\n });\n }\n }\n\n return vnode;\n });\n\n extend(PostUser.prototype, 'view', function (vnode) {\n const post = this.attrs.post;\n const user = post.user();\n\n if (!user) {\n return vnode;\n }\n\n const header_node = vnode.children.find(matchTag('h3'));\n const amt = Number(setting('rankAmt')) ?? user.ranks().length;\n\n header_node.children = header_node.children\n .concat(\n user\n .ranks()\n .reverse()\n .splice(0, amt)\n .map((rank) => {\n return {rankLabel(rank)};\n })\n )\n .filter(function (el) {\n return el.tag !== undefined;\n });\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionPage'];","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\n\nimport debounce from 'lodash.debounce';\n\nconst fetch = (postId) => app.store.find('posts', postId).then(() => m.redraw());\nconst debounced = [];\nconst update = (postId) => {\n let func = debounced[postId];\n\n if (func) return func(postId);\n\n func = debounced[postId] = debounce(fetch, 1500);\n\n return func(postId);\n};\n\nexport default () => {\n extend(DiscussionPage.prototype, 'oncreate', function () {\n if (app.pusher) {\n app.pusher.then((channels) => {\n channels.pusher.bind('newVote', (data) => {\n const post = app.store.getById('posts', data.post_id);\n const userId = data.user_id;\n\n if (!post || post.votes() === data.votes || userId == app.session.user.id()) return;\n\n update(post.id());\n });\n });\n }\n });\n\n extend(DiscussionPage.prototype, 'onremove', function () {\n if (app.pusher) {\n app.pusher.then((channels) => {\n channels.pusher.unbind('newVote');\n });\n }\n });\n};\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\n\nimport DiscussionListItem from 'flarum/forum/components/DiscussionListItem';\nimport abbreviateNumber from 'flarum/common/utils/abbreviateNumber';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\n\nimport saveVote from './helpers/saveVote';\nimport setting from './helpers/setting';\n\nconst get = (discussion, key) => {\n const post = discussion.firstPost();\n\n if (post && post[key]() !== undefined) {\n return post[key]();\n }\n\n return discussion[key]();\n};\n\nexport default function addAlternateLayout() {\n extend(DiscussionListItem.prototype, 'oninit', function () {\n const discussion = this.attrs.discussion;\n\n if (!discussion.seeVotes()) {\n return;\n }\n\n this.subtree.check(() => this.voteLoading);\n });\n\n extend(DiscussionListItem.prototype, 'view', function (vdom) {\n const discussion = this.attrs.discussion;\n\n if (!discussion.seeVotes()) {\n return;\n }\n\n if (!vdom || !vdom.children) return;\n\n const content = vdom.children.find((v) => v && v.attrs && v.attrs.className && v.attrs.className.includes('DiscussionListItem-content'));\n const post = discussion.firstPost();\n\n const hasUpvoted = get(discussion, 'hasUpvoted');\n const hasDownvoted = get(discussion, 'hasDownvoted');\n // We set canVote to true for guest users so that they can access the login by clicking the button\n const canVote = !app.session.user || get(discussion, 'canVote');\n\n const upvotesOnly = setting('upVotesOnly', true);\n const altIcon = setting('iconNameAlt') || 'arrow';\n\n const onclick = (upvoted, downvoted) => saveVote(post, upvoted, downvoted, (val) => (this.voteLoading = val));\n\n content.children.unshift(\n
    \n onclick(!hasUpvoted, false)}\n aria-label={app.translator.trans('fof-gamification.forum.post.upvote_button')}\n />\n\n {abbreviateNumber(get(discussion, 'votes') || 0)}\n\n {!upvotesOnly && (\n onclick(false, !hasDownvoted)}\n aria-label={app.translator.trans('fof-gamification.forum.post.downvote_button')}\n />\n )}\n\n {this.voteLoading && }\n
    \n );\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/states/DiscussionListState'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/Notification'];","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nimport setting from '../helpers/setting';\n\nexport default class UpvotedNotification extends Notification {\n icon() {\n const icon = setting('iconName') || 'thumbs';\n\n if (this.attrs.notification.content() > 0) {\n return `fas fa-${icon}-up`;\n } else {\n return `fas fa-${icon}-down`;\n }\n }\n\n href() {\n return app.route.post(this.attrs.notification.subject());\n }\n\n content() {\n const user = this.attrs.notification.fromUser();\n const content = parseInt(this.attrs.notification.content());\n\n if (content > 0) {\n return app.translator.trans('fof-gamification.forum.notification.upvote', { user });\n } else {\n return app.translator.trans('fof-gamification.forum.notification.downvote', { user });\n }\n }\n\n excerpt() {\n return this.attrs.notification.subject().contentPlain();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/NotificationGrid'];","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/SubtreeRetainer'];","import app from 'flarum/forum/app';\n\nimport Component from 'flarum/common/Component';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Link from 'flarum/common/components/Link';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport avatar from 'flarum/common/helpers/avatar';\nimport icon from 'flarum/common/helpers/icon';\nimport SubtreeRetainer from 'flarum/common/utils/SubtreeRetainer';\n\nimport type Mithril from 'mithril';\n\nexport default class Voters extends Component {\n subtreeRetainer!: SubtreeRetainer;\n lastRenderVotes: number = -1;\n loading: boolean = false;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.loading = !this.attrs.post.upvotes();\n\n if (this.loading) {\n this.load();\n }\n\n this.subtreeRetainer = new SubtreeRetainer(\n () => this.loading,\n () => this.attrs.post.votes(),\n () => this.attrs.post?.upvotes?.()?.length\n );\n }\n\n onbeforeupdate(vnode: Mithril.Vnode) {\n super.onbeforeupdate(vnode);\n\n return this.subtreeRetainer.needsRebuild();\n }\n\n onupdate(vnode: Mithril.Vnode) {\n if (this.lastRenderVotes !== this.attrs.post.votes()) {\n this.loading = true;\n setTimeout(() => m.redraw(), 0);\n this.lastRenderVotes = this.attrs.post.votes();\n this.load();\n }\n }\n\n view() {\n // if (this.loading) {\n if (this.attrs.post.votes() === false || this.attrs.post.upvotes() === false) {\n return (\n
    \n
    \n
    \n \n {icon('fas fa-users')}\n {app.translator.trans('fof-gamification.forum.voters.label')}\n \n {app.translator.trans('fof-gamification.forum.voters.label')}\n \n \n
    \n\n \n
    \n
    \n );\n }\n\n const max = 15;\n const voters = this.attrs.post.upvotes();\n\n return (\n
    \n
    \n
    \n \n {icon('fas fa-users')}\n {app.translator.trans('fof-gamification.forum.voters.label')}\n \n {voters.length === 0\n ? app.translator.trans('fof-gamification.forum.voters.label_none')\n : app.translator.trans('fof-gamification.forum.voters.label')}\n \n \n
    \n
    \n {voters.length === 0 ? app.translator.trans('fof-gamification.forum.voters.none') : null}\n
    \n
    \n {voters.slice(0, max).map((user: any) => (\n \n {avatar(user)}\n \n ))}\n {voters.length > max ? (\n \n {`+${voters.length - max}`}\n \n ) : null}\n
    \n
    \n
    \n );\n }\n\n async load() {\n await app.store.find('posts', this.attrs.post.id(), {\n include: 'upvotes',\n });\n\n this.loading = false;\n\n m.redraw();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/UserPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/PostsUserPage'];","import app from 'flarum/forum/app';\nimport PostsUserPage from 'flarum/forum/components/PostsUserPage';\n\n/**\n * The `VotesUserPage` component shows posts which user voted on.\n */\nexport default class VotesUserPage extends PostsUserPage {\n /**\n * Load a new page of the user's activity feed.\n *\n * @param offset The position to start getting results from.\n * @protected\n */\n loadResults(offset: number) {\n return app.store.find('posts', {\n filter: {\n type: 'comment',\n voted: this.user.id(),\n },\n page: { offset, limit: this.loadLimit },\n sort: '-createdAt',\n });\n }\n}\n","import RankingsPage from './RankingsPage';\nimport VoteNotification from './VoteNotification';\nimport VotesModal from './VotesModal';\nimport Voters from './Voters';\n\nexport const components = {\n RankingsPage,\n VoteNotification,\n VotesModal,\n Voters,\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\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n return _extends.apply(this, arguments);\n}","import rankLabel from './rankLabel';\n\nexport const helpers = {\n rankLabel,\n};\n","import saveVote from './saveVote';\nimport setting from './setting';\n\nimport { helpers as commonHelpers } from '../../common/helpers';\n\nexport const helpers = {\n saveVote,\n setting,\n ...commonHelpers,\n};\n","import app from 'flarum/forum/app';\nimport Model from 'flarum/common/Model';\nimport Discussion from 'flarum/common/models/Discussion';\nimport Post from 'flarum/common/models/Post';\nimport User from 'flarum/common/models/User';\n\nimport Rank from '../common/models/Rank';\n\nimport RankingsPage from './components/RankingsPage';\n\nimport addHotnessSort from './addHotnessSort';\nimport addVoteButtons from './addVoteButtons';\nimport addUpvotesToDiscussion from './addUpvotesToDiscussion';\nimport addUserInfo from './addUserInfo';\nimport addPusher from './addPusher';\nimport addAlternateLayout from './addAlternateLayout';\n\nimport setting from './helpers/setting';\nimport addVotesSort from './addVotesSort';\nimport useAlternatePostVoteLayout from './useAlternatePostVoteLayout';\nimport addNotifications from './addNotifications';\nimport addVotersToDiscussionPageSideBar from './addVotersToDiscussionPageSideBar';\nimport addUpvoteTabToUserProfile from './addUpvoteTabToUserProfile';\n\napp.initializers.add('fof-gamification', () => {\n Discussion.prototype.votes = Model.attribute('votes');\n Discussion.prototype.hasUpvoted = Model.attribute('hasUpvoted');\n Discussion.prototype.hasDownvoted = Model.attribute('hasDownvoted');\n Discussion.prototype.canVote = Model.attribute('canVote');\n Discussion.prototype.seeVotes = Model.attribute('seeVotes');\n\n User.prototype.points = Model.attribute('points');\n User.prototype.ranks = Model.hasMany('ranks');\n User.prototype.canHaveVotingNotifications = Model.attribute('canHaveVotingNotifications');\n\n Post.prototype.upvotes = Model.hasMany('upvotes');\n Post.prototype.downvotes = Model.hasMany('downvotes');\n\n Post.prototype.votes = Model.attribute('votes');\n Post.prototype.canVote = Model.attribute('canVote');\n Post.prototype.canSeeVotes = Model.attribute('canSeeVotes');\n Post.prototype.hasUpvoted = Model.attribute('hasUpvoted');\n Post.prototype.hasDownvoted = Model.attribute('hasDownvoted');\n Post.prototype.seeVoters = Model.attribute('seeVoters');\n\n app.store.models.ranks = Rank;\n\n app.routes.rankings = { path: '/rankings', component: RankingsPage };\n\n addVoteButtons();\n addHotnessSort();\n addVotesSort();\n addUserInfo();\n addUpvotesToDiscussion();\n addPusher();\n addNotifications();\n addVotersToDiscussionPageSideBar();\n addUpvoteTabToUserProfile();\n\n if (setting('useAlternateLayout', true)) {\n addAlternateLayout();\n }\n\n if (setting('altPostVotingUi', true)) {\n useAlternatePostVoteLayout();\n }\n});\n\nexport * from './components';\nexport * from './helpers';\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Button from 'flarum/common/components/Button';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport classList from 'flarum/common/utils/classList';\nimport PostControls from 'flarum/forum/utils/PostControls';\n\nimport VotesModal from './components/VotesModal';\nimport setting from './helpers/setting';\nimport saveVote from './helpers/saveVote';\n\nexport default function () {\n extend(PostControls, 'moderationControls', function (items, post) {\n if (post.seeVoters()) {\n items.add('viewVotes', [\n m(\n Button,\n {\n icon: 'fas fa-thumbs-up',\n onclick: () => {\n app.modal.show(VotesModal, { post });\n },\n },\n app.translator.trans('fof-gamification.forum.mod_item')\n ),\n ]);\n }\n });\n\n extend(CommentPost.prototype, 'actionItems', function (items) {\n const post = this.attrs.post;\n\n //if (!post.canVote()) return;\n\n const hasDownvoted = post.hasDownvoted();\n const hasUpvoted = post.hasUpvoted();\n\n const icon = setting('iconName') || 'thumbs';\n const upVotesOnly = setting('upVotesOnly', true);\n\n const canSeeVotes = post.canSeeVotes();\n\n // We set canVote to true for guest users so that they can access the login by clicking the button\n const canVote = !app.session.user || post.canVote();\n\n const onclick = (upvoted, downvoted) => saveVote(post, upvoted, downvoted, (val) => (this.voteLoading = val));\n\n items.add(\n 'votes',\n
    \n {Button.component({\n icon: this.voteLoading ? undefined : `fas fa-fw fa-${icon}-up`,\n className: classList('Post-vote Post-upvote', hasUpvoted && 'Post-vote--active'),\n loading: this.voteLoading,\n disabled: this.voteLoading || !canVote || !canSeeVotes,\n onclick: () => onclick(!hasUpvoted, false),\n 'aria-label': app.translator.trans('fof-gamification.forum.post.upvote_button'),\n })}\n\n \n\n {!upVotesOnly &&\n Button.component({\n icon: this.voteLoading ? undefined : `fas fa-fw fa-${icon}-down`,\n className: classList('Post-vote Post-downvote', hasDownvoted && 'Post-vote--active'),\n loading: this.voteLoading,\n disabled: !canVote || !canSeeVotes,\n onclick: () => onclick(false, !hasDownvoted),\n 'aria-label': app.translator.trans('fof-gamification.forum.post.downvote_button'),\n })}\n
    ,\n 10\n );\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport LinkButton from 'flarum/common/components/LinkButton';\n\nexport default function () {\n extend(IndexPage.prototype, 'navItems', function (items) {\n if (!app.forum.attribute('canViewRankingPage')) {\n return;\n }\n\n items.add(\n 'rankings',\n LinkButton.component(\n {\n href: app.route('rankings'),\n icon: 'fas fa-trophy',\n },\n app.translator.trans('fof-gamification.forum.nav.name')\n ),\n 80\n );\n });\n\n extend(DiscussionListState.prototype, 'sortMap', function (map) {\n map.hot = '-hotness';\n });\n}\n","import { extend } from 'flarum/common/extend';\nimport DiscussionListState from 'flarum/common/states/DiscussionListState';\n\nexport default function () {\n extend(DiscussionListState.prototype, 'sortMap', function (map) {\n map.votes = '-votes';\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport DiscussionListItem from 'flarum/forum/components/DiscussionListItem';\nimport abbreviateNumber from 'flarum/common/utils/abbreviateNumber';\nimport icon from 'flarum/common/helpers/icon';\nimport setting from './helpers/setting';\n\nexport default function () {\n if (!setting('showVotesOnDiscussionPage', true) || setting('useAlternateLayout', true)) {\n return;\n }\n\n extend(DiscussionListItem.prototype, 'elementAttrs', function (attrs) {\n if (!this.attrs.discussion.seeVotes()) {\n return;\n }\n\n attrs.className += ' DiscussionListItem--withVotes';\n });\n\n extend(DiscussionListItem.prototype, 'infoItems', function (items) {\n const discussion = this.attrs.discussion;\n\n if (!discussion.seeVotes()) {\n return;\n }\n\n items.add(\n 'discussion-votes',\n \n {icon('far fa-thumbs-up')}\n {abbreviateNumber(this.attrs.discussion.votes())}\n ,\n 20\n );\n });\n}\n","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport VoteNotification from './components/VoteNotification';\nimport NotificationGrid from 'flarum/forum/components/NotificationGrid';\nimport ItemList from 'flarum/common/utils/ItemList';\n\nexport default function addNotifications() {\n app.notificationComponents.vote = VoteNotification;\n\n extend(NotificationGrid.prototype, 'notificationTypes', function (items: ItemList<{ name: string; icon: string; label: any }>) {\n const user = app.session?.user;\n\n if (!user?.canHaveVotingNotifications?.()) return;\n\n items.add('vote', {\n name: 'vote',\n icon: 'fas fa-thumbs-up',\n label: app.translator.trans('fof-gamification.forum.notification.prefrences.vote'),\n });\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport Voters from './components/Voters';\nimport type ItemList from 'flarum/common/utils/ItemList';\n\nimport type Mithril from 'mithril';\n\n/**\n * Adds our custom {@link Voters} component to the discussion sidebar.\n */\nexport default function addVotersToDiscussionPageSideBar() {\n extend(DiscussionPage.prototype, 'sidebarItems', function (this: DiscussionPage, items: ItemList) {\n const discussion = this.discussion;\n const posts = discussion!.posts() || [];\n const firstPost = posts?.[0];\n\n if (firstPost?.canSeeVotes?.() && firstPost?.seeVoters?.() && !!app.forum.attribute('fof-gamification-op-votes-only')) {\n items.add('op-voters', , 90);\n }\n });\n}\n","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport UserPage from 'flarum/forum/components/UserPage';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport VotesUserPage from './components/VotesUserPage';\nimport setting from './helpers/setting';\n\nexport default function addUpvoteTabToUserProfile() {\n app.routes['user.votes'] = { path: '/u/:username/votes', component: VotesUserPage };\n extend(UserPage.prototype, 'navItems', function (items) {\n const user = this.user;\n const icon = setting('iconName') || 'thumbs';\n items.add(\n 'votes',\n \n {app.translator.trans('fof-gamification.forum.user.votes_link')}\n ,\n 85\n );\n });\n}\n","import app from 'flarum/forum/app';\n\nimport { extend } from 'flarum/common/extend';\n\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport Button from 'flarum/common/components/Button';\nimport abbreviateNumber from 'flarum/common/utils/abbreviateNumber';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport type ItemList from 'flarum/common/utils/ItemList';\n\nimport setting from './helpers/setting';\nimport saveVote from './helpers/saveVote';\n\nexport default function useAlternatePostVoteLayout() {\n extend(CommentPost.prototype, 'actionItems', function (this: CommentPost, items: ItemList) {\n if (this.attrs.post.isHidden()) return;\n\n items.remove('votes');\n });\n\n extend(CommentPost.prototype, 'classes', function (this: CommentPost, classes: string[]) {\n if (this.attrs.post.isHidden()) return;\n\n const upvotesOnly = setting('upVotesOnly', true);\n\n classes.push('votesAlternativeLayout');\n\n if (upvotesOnly) {\n classes.push('votesUpvotesOnly');\n }\n });\n\n extend(CommentPost.prototype, 'headerItems', function (this: CommentPost, items: ItemList) {\n const post = this.attrs.post;\n\n if (post.isHidden()) return;\n if (!post.canSeeVotes()) return;\n\n const hasDownvoted = post.hasDownvoted();\n const hasUpvoted = post.hasUpvoted();\n\n const icon = setting('iconName') || 'thumbs';\n const upvotesOnly = setting('upVotesOnly', true);\n\n const canSeeVotes = post.canSeeVotes();\n\n // We set canVote to true for guest users so that they can access the login by clicking the button\n const canVote = !app.session.user || post.canVote();\n\n const onclick = (upvoted, downvoted) =>\n saveVote(post, upvoted, downvoted, (val) => {\n this.voteLoading = val;\n });\n\n items.add(\n 'votes',\n
    \n onclick(!hasUpvoted, false)}\n aria-label={app.translator.trans('fof-gamification.forum.post.upvote_button')}\n />\n\n {abbreviateNumber(post.votes() || 0)}\n\n {!upvotesOnly && (\n onclick(false, !hasDownvoted)}\n aria-label={app.translator.trans('fof-gamification.forum.post.downvote_button')}\n />\n )}\n\n {this.voteLoading && }\n
    ,\n 10000\n );\n });\n}\n"],"names":["reTrim","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","parseInt","freeGlobal","global","Object","freeSelf","self","root","Function","objectToString","prototype","toString","nativeMax","Math","max","nativeMin","min","now","Date","isObject","value","type","toNumber","isObjectLike","call","isSymbol","other","valueOf","replace","isBinary","test","slice","module","exports","func","wait","options","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","TypeError","invokeFunc","time","args","thisArg","undefined","apply","shouldInvoke","timeSinceLastCall","timerExpired","trailingEdge","setTimeout","remainingWait","debounced","isInvoking","arguments","this","leadingEdge","cancel","clearTimeout","flush","_typeof","require","_regeneratorRuntime","__esModule","Op","hasOwn","hasOwnProperty","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","obj","key","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","tryLocsList","protoGenerator","Generator","generator","create","context","Context","_invoke","state","method","arg","Error","done","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","fn","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","PromiseImpl","invoke","resolve","reject","__await","then","unwrapped","error","previousPromise","callInvokeWithMethodAndArg","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","doneResult","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","object","reverse","pop","skipTempReset","prev","charAt","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","runtime","regeneratorRuntime","accidentalStrictMode","globalThis","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","n","getter","d","a","definition","o","get","g","e","window","prop","r","_setPrototypeOf","p","bind","_inheritsLoose","subClass","superClass","flarum","core","compat","Rank","_mixin","mixin","Model","points","color","models","isBool","val","app","RankingsPage","_Page","_proto","oninit","vnode","attribute","m","route","set","loading","users","refresh","view","_this","LoadingIndicator","Button","className","onclick","loadMore","trans","IndexPage","hero","listItems","sidebarItems","toArray","class","map","user","setting","src","icon","addOrdinalSuffix","Link","href","force","avatar","username","clear","_this2","loadResults","results","parseResults","redraw","locale","j","k","offset","params","page","limit","find","sort","b","parseFloat","Page","VotesModal","_Modal","title","attrs","post","upvotes","downvotes","load","content","voters","id","include","loaded","Modal","upvoted","downvoted","discussion","canVote","save","pushAttributes","votes","DiscussionControls","rankLabel","rank","style","backgroundColor","matchClass","node","String","split","includes","findMatchClass","arr","children","Array","isArray","nodeInChildren","currentValue","extend","UserCard","items","add","count","profile_node","amt","Number","badges_node","ranks","splice","PostUser","_Number","header_node","tag","concat","filter","el","fetch","postId","firstPost","UpvotedNotification","_Notification","notification","subject","fromUser","excerpt","contentPlain","Notification","asyncGeneratorStep","gen","_next","_throw","Voters","_Component","_len","_key","subtreeRetainer","lastRenderVotes","SubtreeRetainer","_this2$attrs$post","_this2$attrs$post$upv","onbeforeupdate","needsRebuild","onupdate","display","slug","Tooltip","text","_load","_callee","_context","Component","VotesUserPage","_PostsUserPage","voted","loadLimit","PostsUserPage","components","VoteNotification","_extends","assign","target","source","helpers","saveVote","Discussion","hasUpvoted","hasDownvoted","seeVotes","User","canHaveVotingNotifications","Post","canSeeVotes","seeVoters","rankings","path","component","PostControls","show","CommentPost","upVotesOnly","voteLoading","classList","disabled","LinkButton","DiscussionListState","hot","addUserInfo","DiscussionListItem","abbreviateNumber","DiscussionPage","channels","pusher","data","getById","post_id","userId","user_id","debounce","unbind","vote","NotificationGrid","_app$session","label","posts","UserPage","subtree","check","vdom","v","upvotesOnly","altIcon","unshift","size","isHidden","remove","classes"],"sourceRoot":""} \ No newline at end of file