From 541fb175384f174a92c6444fd59310825c856567 Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Thu, 10 Nov 2022 23:30:18 +0000 Subject: [PATCH] Bundled output for commit 259db92b9a8da063116e38c4034fe6c1bef42cbf Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] --- js/dist/forum.js | 2 +- js/dist/forum.js.map | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/dist/forum.js b/js/dist/forum.js index f3fd8ae..09e05fe 100644 --- a/js/dist/forum.js +++ b/js/dist/forum.js @@ -1,2 +1,2 @@ -(()=>{var o={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return o.d(n,{a:n}),n},d:(t,n)=>{for(var s in n)o.o(n,s)&&!o.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:n[s]})},o:(o,t)=>Object.prototype.hasOwnProperty.call(o,t),r:o=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})}},t={};(()=>{"use strict";o.r(t);const n=flarum.core.compat["common/extend"],s=flarum.core.compat["forum/app"];var r=o.n(s);const i=flarum.core.compat["common/Model"];var a=o.n(i);const e=flarum.core.compat["common/models/Discussion"];var c=o.n(e);const l=flarum.core.compat["forum/components/IndexPage"];var u=o.n(l);const f=flarum.core.compat["forum/components/NotificationGrid"];var p=o.n(f);const b=flarum.core.compat["common/components/Badge"];var d=o.n(b);const _=flarum.core.compat["common/components/Button"];var g=o.n(_);const w=flarum.core.compat["forum/components/DiscussionPage"];var y=o.n(w);const v=flarum.core.compat["forum/utils/DiscussionControls"];var h=o.n(v);function x(){return x=Object.assign||function(o){for(var t=1;t{var o={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return o.d(n,{a:n}),n},d:(t,n)=>{for(var s in n)o.o(n,s)&&!o.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:n[s]})},o:(o,t)=>Object.prototype.hasOwnProperty.call(o,t),r:o=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})}},t={};(()=>{"use strict";o.r(t);const n=flarum.core.compat["common/extend"],s=flarum.core.compat["forum/app"];var r=o.n(s);const i=flarum.core.compat["common/Model"];var a=o.n(i);const e=flarum.core.compat["common/models/Discussion"];var c=o.n(e);const l=flarum.core.compat["forum/components/IndexPage"];var u=o.n(l);const f=flarum.core.compat["forum/components/NotificationGrid"];var p=o.n(f);const b=flarum.core.compat["common/components/Badge"];var d=o.n(b);const _=flarum.core.compat["common/components/Button"];var g=o.n(_);const w=flarum.core.compat["forum/components/DiscussionPage"];var y=o.n(w);const v=flarum.core.compat["forum/utils/DiscussionControls"];var h=o.n(v);function x(){return x=Object.assign?Object.assign.bind():function(o){for(var t=1;t {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Discussion'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/IndexPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/NotificationGrid'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Badge'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/DiscussionControls'];","export default function _extends() {\n _extends = Object.assign || 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\n return _extends.apply(this, arguments);\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Dropdown'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extractText'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/classList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","import Component from 'flarum/common/Component';\nimport icon from 'flarum/common/helpers/icon';\n\nexport default class SubscriptionMenuItem extends Component {\n view() {\n return (\n \n );\n }\n}\n","import app from 'flarum/forum/app';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport Button from 'flarum/common/components/Button';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport icon from 'flarum/common/helpers/icon';\nimport extractText from 'flarum/common/utils/extractText';\nimport classList from 'flarum/common/utils/classList';\n\nimport SubscriptionMenuItem from './SubscriptionMenuItem';\n\nexport default class SubscriptionMenu extends Dropdown {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.options = [\n {\n subscription: null,\n icon: 'far fa-star',\n label: app.translator.trans('flarum-subscriptions.forum.sub_controls.not_following_button'),\n description: app.translator.trans('flarum-subscriptions.forum.sub_controls.not_following_text'),\n },\n {\n subscription: 'follow',\n icon: 'fas fa-star',\n label: app.translator.trans('flarum-subscriptions.forum.sub_controls.following_button'),\n description: app.translator.trans('flarum-subscriptions.forum.sub_controls.following_text'),\n },\n {\n subscription: 'ignore',\n icon: 'far fa-eye-slash',\n label: app.translator.trans('flarum-subscriptions.forum.sub_controls.ignoring_button'),\n description: app.translator.trans('flarum-subscriptions.forum.sub_controls.ignoring_text'),\n },\n ];\n }\n\n view() {\n const discussion = this.attrs.discussion;\n const subscription = discussion.subscription();\n\n let buttonLabel = app.translator.trans('flarum-subscriptions.forum.sub_controls.follow_button');\n let buttonIcon = 'far fa-star';\n const buttonClass = 'SubscriptionMenu-button--' + subscription;\n\n switch (subscription) {\n case 'follow':\n buttonLabel = app.translator.trans('flarum-subscriptions.forum.sub_controls.following_button');\n buttonIcon = 'fas fa-star';\n break;\n\n case 'ignore':\n buttonLabel = app.translator.trans('flarum-subscriptions.forum.sub_controls.ignoring_button');\n buttonIcon = 'far fa-eye-slash';\n break;\n\n default:\n // no default\n }\n\n const preferences = app.session.user.preferences();\n const notifyEmail = preferences['notify_newPost_email'];\n const notifyAlert = preferences['notify_newPost_alert'];\n const tooltipText = extractText(\n app.translator.trans(\n notifyEmail ? 'flarum-subscriptions.forum.sub_controls.notify_email_tooltip' : 'flarum-subscriptions.forum.sub_controls.notify_alert_tooltip'\n )\n );\n\n const shouldShowTooltip = (notifyEmail || notifyAlert) && subscription === null;\n\n const button = (\n \n {buttonLabel}\n \n );\n\n return (\n
\n {shouldShowTooltip ? (\n \n {button}\n \n ) : (\n button\n )}\n\n \n\n
    \n {this.options.map((attrs) => (\n
  • \n {SubscriptionMenuItem.component({\n ...attrs,\n onclick: this.saveSubscription.bind(this, discussion, attrs.subscription),\n active: subscription === attrs.subscription,\n })}\n
  • \n ))}\n
\n
\n );\n }\n\n saveSubscription(discussion, subscription) {\n discussion.save({ subscription });\n\n this.$('.SubscriptionMenu-button').tooltip('hide');\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/states/DiscussionListState'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/states/GlobalSearchState'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/SettingsPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/Notification'];","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\n\nexport default class NewPostNotification extends Notification {\n icon() {\n return 'fas fa-star';\n }\n\n href() {\n const notification = this.attrs.notification;\n const discussion = notification.subject();\n const content = notification.content() || {};\n\n return app.route.discussion(discussion, content.postNumber);\n }\n\n content() {\n return app.translator.trans('flarum-subscriptions.forum.notifications.new_post_text', { user: this.attrs.notification.fromUser() });\n }\n}\n","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport Model from 'flarum/common/Model';\nimport Discussion from 'flarum/common/models/Discussion';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport NotificationGrid from 'flarum/forum/components/NotificationGrid';\n\nimport addSubscriptionBadge from './addSubscriptionBadge';\nimport addSubscriptionControls from './addSubscriptionControls';\nimport addSubscriptionFilter from './addSubscriptionFilter';\nimport addSubscriptionSettings from './addSubscriptionSettings';\n\nimport NewPostNotification from './components/NewPostNotification';\n\napp.initializers.add('subscriptions', function () {\n app.routes.following = { path: '/following', component: IndexPage };\n app.notificationComponents.newPost = NewPostNotification;\n\n Discussion.prototype.subscription = Model.attribute('subscription');\n\n addSubscriptionBadge();\n addSubscriptionControls();\n addSubscriptionFilter();\n addSubscriptionSettings();\n\n extend(NotificationGrid.prototype, 'notificationTypes', function (items) {\n items.add('newPost', {\n name: 'newPost',\n icon: 'fas fa-star',\n label: app.translator.trans('flarum-subscriptions.forum.settings.notify_new_post_label'),\n });\n });\n});\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Discussion from 'flarum/common/models/Discussion';\nimport Badge from 'flarum/common/components/Badge';\n\nexport default function addSubscriptionBadge() {\n extend(Discussion.prototype, 'badges', function (badges) {\n let badge;\n\n switch (this.subscription()) {\n case 'follow':\n badge = Badge.component({\n label: app.translator.trans('flarum-subscriptions.forum.badge.following_tooltip'),\n icon: 'fas fa-star',\n type: 'following',\n });\n break;\n\n case 'ignore':\n badge = Badge.component({\n label: app.translator.trans('flarum-subscriptions.forum.badge.ignoring_tooltip'),\n icon: 'far fa-eye-slash',\n type: 'ignoring',\n });\n break;\n\n default:\n // no default\n }\n\n if (badge) {\n badges.add('subscription', badge);\n }\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Button from 'flarum/common/components/Button';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\n\nimport SubscriptionMenu from './components/SubscriptionMenu';\n\nexport default function addSubscriptionControls() {\n extend(DiscussionControls, 'userControls', function (items, discussion, context) {\n if (app.session.user && !(context instanceof DiscussionPage)) {\n const states = {\n none: { label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.follow_button'), icon: 'fas fa-star', save: 'follow' },\n follow: { label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.unfollow_button'), icon: 'far fa-star', save: null },\n ignore: { label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.unignore_button'), icon: 'fas fa-eye', save: null },\n };\n\n const subscription = discussion.subscription() || 'none';\n\n items.add(\n 'subscription',\n Button.component(\n {\n icon: states[subscription].icon,\n onclick: discussion.save.bind(discussion, { subscription: states[subscription].save }),\n },\n states[subscription].label\n )\n );\n }\n });\n\n extend(DiscussionPage.prototype, 'sidebarItems', function (items) {\n if (app.session.user) {\n const discussion = this.discussion;\n\n items.add('subscription', SubscriptionMenu.component({ discussion }), 80);\n }\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport GlobalSearchState from 'flarum/forum/states/GlobalSearchState';\n\nexport default function addSubscriptionFilter() {\n extend(IndexPage.prototype, 'navItems', function (items) {\n if (app.session.user) {\n const params = app.search.stickyParams();\n\n items.add(\n 'following',\n LinkButton.component(\n {\n href: app.route('following', params),\n icon: 'fas fa-star',\n },\n app.translator.trans('flarum-subscriptions.forum.index.following_link')\n ),\n 50\n );\n }\n });\n\n extend(IndexPage.prototype, 'setTitle', function () {\n if (app.current.get('routeName') === 'following') {\n app.setTitle(app.translator.trans('flarum-subscriptions.forum.following.meta_title_text'));\n }\n });\n\n extend(GlobalSearchState.prototype, 'params', function (params) {\n // We can't set `q` here directly, as that would make the search bar\n // think that text has been entered, and display the \"clear\" button.\n params.onFollowing = app.current.get('routeName') === 'following';\n });\n\n extend(DiscussionListState.prototype, 'requestParams', function (params) {\n if (this.params.onFollowing) {\n params.filter ||= {};\n\n if (params.filter.q) {\n params.filter.q += ' is:following';\n } else {\n params.filter.subscription = 'following';\n }\n }\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport SettingsPage from 'flarum/forum/components/SettingsPage';\nimport Switch from 'flarum/common/components/Switch';\n\nexport default function () {\n extend(SettingsPage.prototype, 'notificationsItems', function (this: SettingsPage, items) {\n items.add(\n 'followAfterReply',\n Switch.component(\n {\n state: this.user.preferences().followAfterReply,\n onchange: (value) => {\n this.followAfterReplyLoading = true;\n\n this.user.savePreferences({ followAfterReply: value }).then(() => {\n this.followAfterReplyLoading = false;\n m.redraw();\n });\n },\n loading: this.followAfterReplyLoading,\n },\n app.translator.trans('flarum-subscriptions.forum.settings.follow_after_reply_label')\n )\n );\n\n items.add(\n 'notifyForAllPosts',\n {\n this.user!.savePreferences({ 'flarum-subscriptions.notify_for_all_posts': val });\n }}\n >\n {app.translator.trans('flarum-subscriptions.forum.settings.notify_for_all_posts_label')}\n \n );\n });\n}\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_extends","assign","target","i","arguments","length","source","apply","this","_setPrototypeOf","p","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","create","constructor","SubscriptionMenuItem","view","className","onclick","attrs","active","icon","label","description","Component","SubscriptionMenu","oninit","vnode","options","subscription","app","discussion","buttonLabel","buttonIcon","buttonClass","preferences","notifyEmail","notifyAlert","tooltipText","extractText","shouldShowTooltip","button","classList","saveSubscription","bind","indexOf","text","position","map","component","save","$","tooltip","Dropdown","NewPostNotification","href","notification","subject","content","postNumber","user","fromUser","Notification","path","IndexPage","Discussion","Model","extend","badges","badge","Badge","type","add","DiscussionControls","items","context","DiscussionPage","states","none","follow","ignore","Button","params","LinkButton","GlobalSearchState","onFollowing","DiscussionListState","filter","q","SettingsPage","Switch","state","followAfterReply","onchange","followAfterReplyLoading","savePreferences","then","m","redraw","loading","id","val","NotificationGrid","name"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,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riptions/webpack/runtime/compat get default export","webpack://@flarum/subscriptions/webpack/runtime/define property getters","webpack://@flarum/subscriptions/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/subscriptions/webpack/runtime/make namespace object","webpack://@flarum/subscriptions/external root \"flarum.core.compat['common/extend']\"","webpack://@flarum/subscriptions/external root \"flarum.core.compat['forum/app']\"","webpack://@flarum/subscriptions/external root \"flarum.core.compat['common/Model']\"","webpack://@flarum/subscriptions/external root \"flarum.core.compat['common/models/Discussion']\"","webpack://@flarum/subscriptions/external root \"flarum.core.compat['forum/components/IndexPage']\"","webpack://@flarum/subscriptions/external root \"flarum.core.compat['forum/components/NotificationGrid']\"","webpack://@flarum/subscriptions/external root \"flarum.core.compat['common/components/Badge']\"","webpack://@flarum/subscriptions/external root \"flarum.core.compat['common/components/Button']\"","webpack://@flarum/subscriptions/external root \"flarum.core.compat['forum/components/DiscussionPage']\"","webpack://@flarum/subscriptions/external root \"flarum.core.compat['forum/utils/DiscussionControls']\"","webpack://@flarum/subscriptions/../../../node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@flarum/subscriptions/../../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@flarum/subscriptions/../../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/subscriptions/external root \"flarum.core.compat['common/components/Dropdown']\"","webpack://@flarum/subscriptions/external root \"flarum.core.compat['common/components/Tooltip']\"","webpack://@flarum/subscriptions/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@flarum/subscriptions/external root \"flarum.core.compat['common/utils/extractText']\"","webpack://@flarum/subscriptions/external root \"flarum.core.compat['common/utils/classList']\"","webpack://@flarum/subscriptions/external root \"flarum.core.compat['common/Component']\"","webpack://@flarum/subscriptions/./src/forum/components/SubscriptionMenuItem.js","webpack://@flarum/subscriptions/./src/forum/components/SubscriptionMenu.js","webpack://@flarum/subscriptions/external root \"flarum.core.compat['common/components/LinkButton']\"","webpack://@flarum/subscriptions/external root \"flarum.core.compat['forum/states/DiscussionListState']\"","webpack://@flarum/subscriptions/external root \"flarum.core.compat['forum/states/GlobalSearchState']\"","webpack://@flarum/subscriptions/external root \"flarum.core.compat['forum/components/SettingsPage']\"","webpack://@flarum/subscriptions/external root \"flarum.core.compat['common/components/Switch']\"","webpack://@flarum/subscriptions/external root \"flarum.core.compat['forum/components/Notification']\"","webpack://@flarum/subscriptions/./src/forum/components/NewPostNotification.js","webpack://@flarum/subscriptions/./src/forum/index.js","webpack://@flarum/subscriptions/./src/forum/addSubscriptionBadge.js","webpack://@flarum/subscriptions/./src/forum/addSubscriptionControls.js","webpack://@flarum/subscriptions/./src/forum/addSubscriptionFilter.js","webpack://@flarum/subscriptions/./src/forum/addSubscriptionSettings.tsx"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Discussion'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/IndexPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/NotificationGrid'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Badge'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/DiscussionControls'];","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Dropdown'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extractText'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/classList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","import Component from 'flarum/common/Component';\nimport icon from 'flarum/common/helpers/icon';\n\nexport default class SubscriptionMenuItem extends Component {\n view() {\n return (\n \n );\n }\n}\n","import app from 'flarum/forum/app';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport Button from 'flarum/common/components/Button';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport icon from 'flarum/common/helpers/icon';\nimport extractText from 'flarum/common/utils/extractText';\nimport classList from 'flarum/common/utils/classList';\n\nimport SubscriptionMenuItem from './SubscriptionMenuItem';\n\nexport default class SubscriptionMenu extends Dropdown {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.options = [\n {\n subscription: null,\n icon: 'far fa-star',\n label: app.translator.trans('flarum-subscriptions.forum.sub_controls.not_following_button'),\n description: app.translator.trans('flarum-subscriptions.forum.sub_controls.not_following_text'),\n },\n {\n subscription: 'follow',\n icon: 'fas fa-star',\n label: app.translator.trans('flarum-subscriptions.forum.sub_controls.following_button'),\n description: app.translator.trans('flarum-subscriptions.forum.sub_controls.following_text'),\n },\n {\n subscription: 'ignore',\n icon: 'far fa-eye-slash',\n label: app.translator.trans('flarum-subscriptions.forum.sub_controls.ignoring_button'),\n description: app.translator.trans('flarum-subscriptions.forum.sub_controls.ignoring_text'),\n },\n ];\n }\n\n view() {\n const discussion = this.attrs.discussion;\n const subscription = discussion.subscription();\n\n let buttonLabel = app.translator.trans('flarum-subscriptions.forum.sub_controls.follow_button');\n let buttonIcon = 'far fa-star';\n const buttonClass = 'SubscriptionMenu-button--' + subscription;\n\n switch (subscription) {\n case 'follow':\n buttonLabel = app.translator.trans('flarum-subscriptions.forum.sub_controls.following_button');\n buttonIcon = 'fas fa-star';\n break;\n\n case 'ignore':\n buttonLabel = app.translator.trans('flarum-subscriptions.forum.sub_controls.ignoring_button');\n buttonIcon = 'far fa-eye-slash';\n break;\n\n default:\n // no default\n }\n\n const preferences = app.session.user.preferences();\n const notifyEmail = preferences['notify_newPost_email'];\n const notifyAlert = preferences['notify_newPost_alert'];\n const tooltipText = extractText(\n app.translator.trans(\n notifyEmail ? 'flarum-subscriptions.forum.sub_controls.notify_email_tooltip' : 'flarum-subscriptions.forum.sub_controls.notify_alert_tooltip'\n )\n );\n\n const shouldShowTooltip = (notifyEmail || notifyAlert) && subscription === null;\n\n const button = (\n \n {buttonLabel}\n \n );\n\n return (\n
\n {shouldShowTooltip ? (\n \n {button}\n \n ) : (\n button\n )}\n\n \n\n
    \n {this.options.map((attrs) => (\n
  • \n {SubscriptionMenuItem.component({\n ...attrs,\n onclick: this.saveSubscription.bind(this, discussion, attrs.subscription),\n active: subscription === attrs.subscription,\n })}\n
  • \n ))}\n
\n
\n );\n }\n\n saveSubscription(discussion, subscription) {\n discussion.save({ subscription });\n\n this.$('.SubscriptionMenu-button').tooltip('hide');\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/states/DiscussionListState'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/states/GlobalSearchState'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/SettingsPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/Notification'];","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\n\nexport default class NewPostNotification extends Notification {\n icon() {\n return 'fas fa-star';\n }\n\n href() {\n const notification = this.attrs.notification;\n const discussion = notification.subject();\n const content = notification.content() || {};\n\n return app.route.discussion(discussion, content.postNumber);\n }\n\n content() {\n return app.translator.trans('flarum-subscriptions.forum.notifications.new_post_text', { user: this.attrs.notification.fromUser() });\n }\n}\n","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport Model from 'flarum/common/Model';\nimport Discussion from 'flarum/common/models/Discussion';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport NotificationGrid from 'flarum/forum/components/NotificationGrid';\n\nimport addSubscriptionBadge from './addSubscriptionBadge';\nimport addSubscriptionControls from './addSubscriptionControls';\nimport addSubscriptionFilter from './addSubscriptionFilter';\nimport addSubscriptionSettings from './addSubscriptionSettings';\n\nimport NewPostNotification from './components/NewPostNotification';\n\napp.initializers.add('subscriptions', function () {\n app.routes.following = { path: '/following', component: IndexPage };\n app.notificationComponents.newPost = NewPostNotification;\n\n Discussion.prototype.subscription = Model.attribute('subscription');\n\n addSubscriptionBadge();\n addSubscriptionControls();\n addSubscriptionFilter();\n addSubscriptionSettings();\n\n extend(NotificationGrid.prototype, 'notificationTypes', function (items) {\n items.add('newPost', {\n name: 'newPost',\n icon: 'fas fa-star',\n label: app.translator.trans('flarum-subscriptions.forum.settings.notify_new_post_label'),\n });\n });\n});\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Discussion from 'flarum/common/models/Discussion';\nimport Badge from 'flarum/common/components/Badge';\n\nexport default function addSubscriptionBadge() {\n extend(Discussion.prototype, 'badges', function (badges) {\n let badge;\n\n switch (this.subscription()) {\n case 'follow':\n badge = Badge.component({\n label: app.translator.trans('flarum-subscriptions.forum.badge.following_tooltip'),\n icon: 'fas fa-star',\n type: 'following',\n });\n break;\n\n case 'ignore':\n badge = Badge.component({\n label: app.translator.trans('flarum-subscriptions.forum.badge.ignoring_tooltip'),\n icon: 'far fa-eye-slash',\n type: 'ignoring',\n });\n break;\n\n default:\n // no default\n }\n\n if (badge) {\n badges.add('subscription', badge);\n }\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Button from 'flarum/common/components/Button';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\n\nimport SubscriptionMenu from './components/SubscriptionMenu';\n\nexport default function addSubscriptionControls() {\n extend(DiscussionControls, 'userControls', function (items, discussion, context) {\n if (app.session.user && !(context instanceof DiscussionPage)) {\n const states = {\n none: { label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.follow_button'), icon: 'fas fa-star', save: 'follow' },\n follow: { label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.unfollow_button'), icon: 'far fa-star', save: null },\n ignore: { label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.unignore_button'), icon: 'fas fa-eye', save: null },\n };\n\n const subscription = discussion.subscription() || 'none';\n\n items.add(\n 'subscription',\n Button.component(\n {\n icon: states[subscription].icon,\n onclick: discussion.save.bind(discussion, { subscription: states[subscription].save }),\n },\n states[subscription].label\n )\n );\n }\n });\n\n extend(DiscussionPage.prototype, 'sidebarItems', function (items) {\n if (app.session.user) {\n const discussion = this.discussion;\n\n items.add('subscription', SubscriptionMenu.component({ discussion }), 80);\n }\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport GlobalSearchState from 'flarum/forum/states/GlobalSearchState';\n\nexport default function addSubscriptionFilter() {\n extend(IndexPage.prototype, 'navItems', function (items) {\n if (app.session.user) {\n const params = app.search.stickyParams();\n\n items.add(\n 'following',\n LinkButton.component(\n {\n href: app.route('following', params),\n icon: 'fas fa-star',\n },\n app.translator.trans('flarum-subscriptions.forum.index.following_link')\n ),\n 50\n );\n }\n });\n\n extend(IndexPage.prototype, 'setTitle', function () {\n if (app.current.get('routeName') === 'following') {\n app.setTitle(app.translator.trans('flarum-subscriptions.forum.following.meta_title_text'));\n }\n });\n\n extend(GlobalSearchState.prototype, 'params', function (params) {\n // We can't set `q` here directly, as that would make the search bar\n // think that text has been entered, and display the \"clear\" button.\n params.onFollowing = app.current.get('routeName') === 'following';\n });\n\n extend(DiscussionListState.prototype, 'requestParams', function (params) {\n if (this.params.onFollowing) {\n params.filter ||= {};\n\n if (params.filter.q) {\n params.filter.q += ' is:following';\n } else {\n params.filter.subscription = 'following';\n }\n }\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport SettingsPage from 'flarum/forum/components/SettingsPage';\nimport Switch from 'flarum/common/components/Switch';\n\nexport default function () {\n extend(SettingsPage.prototype, 'notificationsItems', function (this: SettingsPage, items) {\n items.add(\n 'followAfterReply',\n Switch.component(\n {\n state: this.user.preferences().followAfterReply,\n onchange: (value) => {\n this.followAfterReplyLoading = true;\n\n this.user.savePreferences({ followAfterReply: value }).then(() => {\n this.followAfterReplyLoading = false;\n m.redraw();\n });\n },\n loading: this.followAfterReplyLoading,\n },\n app.translator.trans('flarum-subscriptions.forum.settings.follow_after_reply_label')\n )\n );\n\n items.add(\n 'notifyForAllPosts',\n {\n this.user!.savePreferences({ 'flarum-subscriptions.notify_for_all_posts': val });\n }}\n >\n {app.translator.trans('flarum-subscriptions.forum.settings.notify_for_all_posts_label')}\n \n );\n });\n}\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_extends","assign","bind","target","i","arguments","length","source","apply","this","_setPrototypeOf","p","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","create","constructor","SubscriptionMenuItem","view","className","onclick","attrs","active","icon","label","description","Component","SubscriptionMenu","oninit","vnode","options","subscription","app","discussion","buttonLabel","buttonIcon","buttonClass","preferences","notifyEmail","notifyAlert","tooltipText","extractText","shouldShowTooltip","button","classList","saveSubscription","indexOf","text","position","map","component","save","$","tooltip","Dropdown","NewPostNotification","href","notification","subject","content","postNumber","user","fromUser","Notification","path","IndexPage","Discussion","Model","extend","badges","badge","Badge","type","add","DiscussionControls","items","context","DiscussionPage","states","none","follow","ignore","Button","params","LinkButton","GlobalSearchState","onFollowing","DiscussionListState","filter","q","SettingsPage","Switch","state","followAfterReply","onchange","followAfterReplyLoading","savePreferences","then","m","redraw","loading","id","val","NotificationGrid","name"],"sourceRoot":""} \ No newline at end of file