From 594100acf52ad74a33cbd30e5ca2220196790821 Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Wed, 2 Oct 2024 07:10:53 +0000 Subject: [PATCH] Bundled output for commit 449ba48ba3d78b22a3122361e38a9d03b64b080e 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 3242362..9fe4f84 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),o.d(t,{extend:()=>V});const n=flarum.core.compat["common/extend"],s=flarum.core.compat["forum/app"];var r=o.n(s);flarum.core.compat["common/Model"];const i=flarum.core.compat["common/models/Discussion"];var a=o.n(i);const e=flarum.core.compat["forum/components/NotificationGrid"];var c=o.n(e);const l=flarum.core.compat["common/components/Badge"];var u=o.n(l);const f=flarum.core.compat["common/components/Button"];var p=o.n(f);const b=flarum.core.compat["forum/components/DiscussionPage"];var d=o.n(b);const _=flarum.core.compat["forum/utils/DiscussionControls"];var g=o.n(_);function w(o,t){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,t){return o.__proto__=t,o},w(o,t)}function y(o,t){o.prototype=Object.create(t.prototype),o.prototype.constructor=o,w(o,t)}const v=flarum.core.compat["common/components/Dropdown"];var h=o.n(v);const x=flarum.core.compat["common/components/Tooltip"];var S=o.n(x);const P=flarum.core.compat["common/helpers/icon"];var N=o.n(P);const M=flarum.core.compat["common/utils/extractText"];var O=o.n(M);const k=flarum.core.compat["common/utils/classList"];var B=o.n(k);const j=flarum.core.compat["common/Component"];var D=function(o){function t(){return o.apply(this,arguments)||this}return y(t,o),t.prototype.view=function(){return m("button",{className:"SubscriptionMenuItem hasIcon",onclick:this.attrs.onclick},this.attrs.active&&N()("fas fa-check",{className:"Button-icon"}),m("span",{className:"SubscriptionMenuItem-label"},N()(this.attrs.icon,{className:"Button-icon"}),m("strong",null,this.attrs.label),m("span",{className:"SubscriptionMenuItem-description"},this.attrs.description)))},t}(o.n(j)()),I=function(o){function t(){return o.apply(this,arguments)||this}y(t,o);var n=t.prototype;return n.oninit=function(t){o.prototype.oninit.call(this,t),this.options=[{subscription:null,icon:"far fa-star",label:r().translator.trans("flarum-subscriptions.forum.sub_controls.not_following_button"),description:r().translator.trans("flarum-subscriptions.forum.sub_controls.not_following_text")},{subscription:"follow",icon:"fas fa-star",label:r().translator.trans("flarum-subscriptions.forum.sub_controls.following_button"),description:r().translator.trans("flarum-subscriptions.forum.sub_controls.following_text")},{subscription:"ignore",icon:"far fa-eye-slash",label:r().translator.trans("flarum-subscriptions.forum.sub_controls.ignoring_button"),description:r().translator.trans("flarum-subscriptions.forum.sub_controls.ignoring_text")}]},n.view=function(){var o=this,t=this.attrs.discussion,n=t.subscription(),s=r().translator.trans("flarum-subscriptions.forum.sub_controls.follow_button"),i="far fa-star",a="SubscriptionMenu-button--"+n;switch(n){case"follow":s=r().translator.trans("flarum-subscriptions.forum.sub_controls.following_button"),i="fas fa-star";break;case"ignore":s=r().translator.trans("flarum-subscriptions.forum.sub_controls.ignoring_button"),i="far fa-eye-slash"}var e=r().session.user.preferences(),c=e.notify_newPost_email,l=e.notify_newPost_alert,u=O()(r().translator.trans(c?"flarum-subscriptions.forum.sub_controls.notify_email_tooltip":"flarum-subscriptions.forum.sub_controls.notify_alert_tooltip")),f=(c||l)&&null===n,b=m(p(),{className:B()("Button","SubscriptionMenu-button",a),icon:i,onclick:this.saveSubscription.bind(this,t,-1!==["follow","ignore"].indexOf(n)?null:"follow")},s);return m("div",{className:"Dropdown ButtonGroup SubscriptionMenu"},f?m(S(),{text:u,position:"bottom"},b):b,m("button",{className:B()("Dropdown-toggle Button Button--icon",a),"data-toggle":"dropdown"},N()("fas fa-caret-down",{className:"Button-icon"})),m("ul",{className:"Dropdown-menu dropdown-menu Dropdown-menu--right"},this.options.map((function(s){return m("li",null,m(D,Object.assign({},s,{onclick:o.saveSubscription.bind(o,t,s.subscription),active:n===s.subscription})))}))))},n.saveSubscription=function(o,t){o.save({subscription:t}),this.$(".SubscriptionMenu-button").tooltip("hide")},t}(h());const A=flarum.core.compat["common/components/LinkButton"];var R=o.n(A);const T=flarum.core.compat["forum/components/IndexPage"];var L=o.n(T);const C=flarum.core.compat["forum/states/DiscussionListState"];var q=o.n(C);const F=flarum.core.compat["forum/states/GlobalSearchState"];var G=o.n(F);const z=flarum.core.compat["forum/components/SettingsPage"];var U=o.n(z);const $=flarum.core.compat["common/components/Switch"];var E=o.n($);const H=flarum.core.compat["forum/components/Notification"];var J=function(o){function t(){return o.apply(this,arguments)||this}y(t,o);var n=t.prototype;return n.icon=function(){return"fas fa-star"},n.href=function(){var o=this.attrs.notification,t=o.subject(),n=o.content()||{};return r().route.discussion(t,n.postNumber)},n.content=function(){return r().translator.trans("flarum-subscriptions.forum.notifications.new_post_text",{user:this.attrs.notification.fromUser()})},t}(o.n(H)());const K=flarum.core.compat["common/extenders"];var Q=o.n(K);const V=[(new(Q().Routes)).add("following","/following",L()),new(Q().Model)(a()).attribute("subscription")];r().initializers.add("subscriptions",(function(){r().notificationComponents.newPost=J,(0,n.extend)(a().prototype,"badges",(function(o){var t;switch(this.subscription()){case"follow":t=m(u(),{label:r().translator.trans("flarum-subscriptions.forum.badge.following_tooltip"),icon:"fas fa-star",type:"following"});break;case"ignore":t=m(u(),{label:r().translator.trans("flarum-subscriptions.forum.badge.ignoring_tooltip"),icon:"far fa-eye-slash",type:"ignoring"})}t&&o.add("subscription",t)})),(0,n.extend)(g(),"userControls",(function(o,t,n){if(r().session.user&&!(n instanceof d())){var s={none:{label:r().translator.trans("flarum-subscriptions.forum.discussion_controls.follow_button"),icon:"fas fa-star",save:"follow"},follow:{label:r().translator.trans("flarum-subscriptions.forum.discussion_controls.unfollow_button"),icon:"far fa-star",save:null},ignore:{label:r().translator.trans("flarum-subscriptions.forum.discussion_controls.unignore_button"),icon:"fas fa-eye",save:null}},i=t.subscription()||"none";o.add("subscription",m(p(),{icon:s[i].icon,onclick:t.save.bind(t,{subscription:s[i].save})},s[i].label))}})),(0,n.extend)(d().prototype,"sidebarItems",(function(o){if(r().session.user){var t=this.discussion;o.add("subscription",m(I,{discussion:t}),80)}})),(0,n.extend)(L().prototype,"navItems",(function(o){if(r().session.user){var t=r().search.stickyParams();o.add("following",m(R(),{href:r().route("following",t),icon:"fas fa-star"},r().translator.trans("flarum-subscriptions.forum.index.following_link")),50)}})),(0,n.extend)(L().prototype,"setTitle",(function(){"following"===r().current.get("routeName")&&r().setTitle(r().translator.trans("flarum-subscriptions.forum.following.meta_title_text"))})),(0,n.extend)(G().prototype,"params",(function(o){o.onFollowing="following"===r().current.get("routeName")})),(0,n.extend)(q().prototype,"requestParams",(function(o){this.params.onFollowing&&(o.filter||(o.filter={}),o.filter.q?o.filter.q+=" is:following":o.filter.subscription="following")})),(0,n.extend)(U().prototype,"notificationsItems",(function(o){var t,n=this;o.add("followAfterReply",m(E(),{state:this.user.preferences().followAfterReply,onchange:function(o){n.followAfterReplyLoading=!0,n.user.savePreferences({followAfterReply:o}).then((function(){n.followAfterReplyLoading=!1,m.redraw()}))},loading:this.followAfterReplyLoading},r().translator.trans("flarum-subscriptions.forum.settings.follow_after_reply_label"))),o.add("notifyForAllPosts",m(E(),{id:"flarum_subscriptions__notify_for_all_posts",state:!(null==(t=this.user.preferences())||!t["flarum-subscriptions.notify_for_all_posts"]),onchange:function(o){n.user.savePreferences({"flarum-subscriptions.notify_for_all_posts":o})}},r().translator.trans("flarum-subscriptions.forum.settings.notify_for_all_posts_label")))})),(0,n.extend)(c().prototype,"notificationTypes",(function(o){o.add("newPost",{name:"newPost",icon:"fas fa-star",label:r().translator.trans("flarum-subscriptions.forum.settings.notify_new_post_label")})}))}))})(),module.exports=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),o.d(t,{extend:()=>V});const n=flarum.core.compat["common/extend"],s=flarum.core.compat["forum/app"];var r=o.n(s);flarum.core.compat["common/Model"];const i=flarum.core.compat["common/models/Discussion"];var a=o.n(i);const e=flarum.core.compat["forum/components/NotificationGrid"];var c=o.n(e);const l=flarum.core.compat["common/components/Badge"];var u=o.n(l);const f=flarum.core.compat["common/components/Button"];var p=o.n(f);const b=flarum.core.compat["forum/components/DiscussionPage"];var d=o.n(b);const _=flarum.core.compat["forum/utils/DiscussionControls"];var g=o.n(_);function w(o,t){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,t){return o.__proto__=t,o},w(o,t)}function y(o,t){o.prototype=Object.create(t.prototype),o.prototype.constructor=o,w(o,t)}const v=flarum.core.compat["common/components/Dropdown"];var h=o.n(v);const x=flarum.core.compat["common/components/Tooltip"];var S=o.n(x);const P=flarum.core.compat["common/helpers/icon"];var N=o.n(P);const M=flarum.core.compat["common/utils/extractText"];var O=o.n(M);const k=flarum.core.compat["common/utils/classList"];var j=o.n(k);const B=flarum.core.compat["common/Component"];var D=function(o){function t(){return o.apply(this,arguments)||this}return y(t,o),t.prototype.view=function(){return m("button",{className:"SubscriptionMenuItem hasIcon",onclick:this.attrs.onclick},this.attrs.active&&N()("fas fa-check",{className:"Button-icon"}),m("span",{className:"SubscriptionMenuItem-label"},N()(this.attrs.icon,{className:"Button-icon"}),m("strong",null,this.attrs.label),m("span",{className:"SubscriptionMenuItem-description"},this.attrs.description)))},t}(o.n(B)()),I=function(o){function t(){return o.apply(this,arguments)||this}y(t,o);var n=t.prototype;return n.oninit=function(t){o.prototype.oninit.call(this,t),this.options=[{subscription:null,icon:"far fa-star",label:r().translator.trans("flarum-subscriptions.forum.sub_controls.not_following_button"),description:r().translator.trans("flarum-subscriptions.forum.sub_controls.not_following_text")},{subscription:"follow",icon:"fas fa-star",label:r().translator.trans("flarum-subscriptions.forum.sub_controls.following_button"),description:r().translator.trans("flarum-subscriptions.forum.sub_controls.following_text")},{subscription:"ignore",icon:"far fa-eye-slash",label:r().translator.trans("flarum-subscriptions.forum.sub_controls.ignoring_button"),description:r().translator.trans("flarum-subscriptions.forum.sub_controls.ignoring_text")}]},n.view=function(){var o=this,t=this.attrs.discussion,n=t.subscription(),s=r().translator.trans("flarum-subscriptions.forum.sub_controls.follow_button"),i="far fa-star",a="SubscriptionMenu-button--"+n;switch(n){case"follow":s=r().translator.trans("flarum-subscriptions.forum.sub_controls.following_button"),i="fas fa-star";break;case"ignore":s=r().translator.trans("flarum-subscriptions.forum.sub_controls.ignoring_button"),i="far fa-eye-slash"}var e=r().session.user.preferences(),c=e.notify_newPost_email,l=e.notify_newPost_alert,u=O()(r().translator.trans(c?"flarum-subscriptions.forum.sub_controls.notify_email_tooltip":"flarum-subscriptions.forum.sub_controls.notify_alert_tooltip")),f=(c||l)&&null===n,b=m(p(),{className:j()("Button","SubscriptionMenu-button",a),icon:i,onclick:this.saveSubscription.bind(this,t,-1!==["follow","ignore"].indexOf(n)?null:"follow")},s);return m("div",{className:"Dropdown ButtonGroup SubscriptionMenu"},f?m(S(),{text:u,position:"bottom"},b):b,m("button",{className:j()("Dropdown-toggle Button Button--icon",a),"data-toggle":"dropdown"},N()("fas fa-caret-down",{className:"Button-icon"})),m("ul",{className:"Dropdown-menu dropdown-menu Dropdown-menu--right"},this.options.map((function(s){return m("li",null,m(D,Object.assign({},s,{onclick:o.saveSubscription.bind(o,t,s.subscription),active:n===s.subscription})))}))))},n.saveSubscription=function(o,t){o.save({subscription:t}),this.$(".SubscriptionMenu-button").tooltip("hide")},t}(h());const A=flarum.core.compat["common/components/LinkButton"];var R=o.n(A);const T=flarum.core.compat["forum/components/IndexPage"];var L=o.n(T);const C=flarum.core.compat["forum/states/DiscussionListState"];var q=o.n(C);const F=flarum.core.compat["forum/states/GlobalSearchState"];var G=o.n(F);const z=flarum.core.compat["forum/components/SettingsPage"];var U=o.n(z);const $=flarum.core.compat["common/components/Switch"];var E=o.n($);const H=flarum.core.compat["forum/components/Notification"];var J=function(o){function t(){return o.apply(this,arguments)||this}y(t,o);var n=t.prototype;return n.icon=function(){return"fas fa-star"},n.href=function(){var o=this.attrs.notification,t=o.subject(),n=o.content()||{};return r().route.discussion(t,n.postNumber)},n.content=function(){return r().translator.trans("flarum-subscriptions.forum.notifications.new_post_text",{user:this.attrs.notification.fromUser()})},t}(o.n(H)());const K=flarum.core.compat["common/extenders"];var Q=o.n(K);const V=[(new(Q().Routes)).add("following","/following",L()),new(Q().Model)(a()).attribute("subscription")],W={"subscriptions/components/NewPostNotification":J,"subscriptions/components/SubscriptionMenu":I,"subscriptions/components/SubscriptionMenuItem":D},X=flarum.core;r().initializers.add("subscriptions",(function(){r().notificationComponents.newPost=J,(0,n.extend)(a().prototype,"badges",(function(o){var t;switch(this.subscription()){case"follow":t=m(u(),{label:r().translator.trans("flarum-subscriptions.forum.badge.following_tooltip"),icon:"fas fa-star",type:"following"});break;case"ignore":t=m(u(),{label:r().translator.trans("flarum-subscriptions.forum.badge.ignoring_tooltip"),icon:"far fa-eye-slash",type:"ignoring"})}t&&o.add("subscription",t)})),(0,n.extend)(g(),"userControls",(function(o,t,n){if(r().session.user&&!(n instanceof d())){var s={none:{label:r().translator.trans("flarum-subscriptions.forum.discussion_controls.follow_button"),icon:"fas fa-star",save:"follow"},follow:{label:r().translator.trans("flarum-subscriptions.forum.discussion_controls.unfollow_button"),icon:"far fa-star",save:null},ignore:{label:r().translator.trans("flarum-subscriptions.forum.discussion_controls.unignore_button"),icon:"fas fa-eye",save:null}},i=t.subscription()||"none";o.add("subscription",m(p(),{icon:s[i].icon,onclick:t.save.bind(t,{subscription:s[i].save})},s[i].label))}})),(0,n.extend)(d().prototype,"sidebarItems",(function(o){if(r().session.user){var t=this.discussion;o.add("subscription",m(I,{discussion:t}),80)}})),(0,n.extend)(L().prototype,"navItems",(function(o){if(r().session.user){var t=r().search.stickyParams();o.add("following",m(R(),{href:r().route("following",t),icon:"fas fa-star"},r().translator.trans("flarum-subscriptions.forum.index.following_link")),50)}})),(0,n.extend)(L().prototype,"setTitle",(function(){"following"===r().current.get("routeName")&&r().setTitle(r().translator.trans("flarum-subscriptions.forum.following.meta_title_text"))})),(0,n.extend)(G().prototype,"params",(function(o){o.onFollowing="following"===r().current.get("routeName")})),(0,n.extend)(q().prototype,"requestParams",(function(o){this.params.onFollowing&&(o.filter||(o.filter={}),o.filter.q?o.filter.q+=" is:following":o.filter.subscription="following")})),(0,n.extend)(U().prototype,"notificationsItems",(function(o){var t,n=this;o.add("followAfterReply",m(E(),{state:this.user.preferences().followAfterReply,onchange:function(o){n.followAfterReplyLoading=!0,n.user.savePreferences({followAfterReply:o}).then((function(){n.followAfterReplyLoading=!1,m.redraw()}))},loading:this.followAfterReplyLoading},r().translator.trans("flarum-subscriptions.forum.settings.follow_after_reply_label"))),o.add("notifyForAllPosts",m(E(),{id:"flarum_subscriptions__notify_for_all_posts",state:!(null==(t=this.user.preferences())||!t["flarum-subscriptions.notify_for_all_posts"]),onchange:function(o){n.user.savePreferences({"flarum-subscriptions.notify_for_all_posts":o})}},r().translator.trans("flarum-subscriptions.forum.settings.notify_for_all_posts_label")))})),(0,n.extend)(c().prototype,"notificationTypes",(function(o){o.add("newPost",{name:"newPost",icon:"fas fa-star",label:r().translator.trans("flarum-subscriptions.forum.settings.notify_new_post_label")})}))})),Object.assign(X.compat,W)})(),module.exports=t})(); //# sourceMappingURL=forum.js.map \ No newline at end of file diff --git a/js/dist/forum.js.map b/js/dist/forum.js.map index 9198dc2..0a9bb4f 100644 --- a/js/dist/forum.js.map +++ b/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"file":"forum.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,qDCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,iBCAlD,EAA+BF,OAAOC,KAAKC,OAAO,a,aCAnBF,OAAOC,KAAKC,OAAO,gBAAxD,MCAM,EAA+BF,OAAOC,KAAKC,OAAO,4B,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,qC,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,2B,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,4B,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,mC,aCAxD,MAAM,EAA+BF,OAA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subscriptions/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/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/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/components/IndexPage']\"","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/external root \"flarum.core.compat['common/extenders']\"","webpack://@flarum/subscriptions/./src/forum/extend.ts","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/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 _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 \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/components/IndexPage'];","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","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extenders'];","import Extend from 'flarum/common/extenders';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport Discussion from 'flarum/common/models/Discussion';\n\nexport default [\n new Extend.Routes() //\n .add('following', '/following', IndexPage),\n\n new Extend.Model(Discussion) //\n .attribute('subscription'),\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 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\nexport { default as extend } from './extend';\n\napp.initializers.add('subscriptions', function () {\n app.notificationComponents.newPost = NewPostNotification;\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 = ;\n break;\n\n case 'ignore':\n badge = ;\n break;\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 \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', , 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 \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 {\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","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","_inheritsLoose","subClass","superClass","create","constructor","SubscriptionMenuItem","view","className","onclick","this","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","save","$","tooltip","Dropdown","NewPostNotification","href","notification","subject","content","postNumber","user","fromUser","Notification","Extend","add","IndexPage","Discussion","attribute","extend","badges","badge","type","DiscussionControls","items","context","DiscussionPage","states","none","follow","ignore","params","GlobalSearchState","onFollowing","DiscussionListState","filter","q","SettingsPage","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,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,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qB,kEAI1ByC,EAAMT,IACJ,oBACA,EAAC,IAAM,CACLgC,GAAG,6CACHT,QAAiC,OAAzB,EAACnE,KAAKwC,KAAMvB,iBAAX,EAA2B,8CACpCoD,SAAU,SAACQ,GACT,EAAKrC,KAAM+B,gBAAgB,CAAE,4CAA6CM,GAC5E,GAECjE,IAAAA,WAAAA,MAAqB,mEAG5B,KJdAoC,EAAAA,EAAAA,QAAO8B,IAAAA,UAA4B,qBAAqB,SAAUzB,GAChEA,EAAMT,IAAI,UAAW,CACnBmC,KAAM,UACN5E,KAAM,cACNC,MAAOQ,IAAAA,WAAAA,MAAqB,8DAEhC,GACF,IAMAzC,OAAO6G,OAAO/F,EAAAA,OAAQgG,E","sources":["webpack://@flarum/subscriptions/webpack/bootstrap","webpack://@flarum/subscriptions/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/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/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/components/IndexPage']\"","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/external root \"flarum.core.compat['common/extenders']\"","webpack://@flarum/subscriptions/./src/forum/extend.ts","webpack://@flarum/subscriptions/./src/forum/compat.ts","webpack://@flarum/subscriptions/external assign \"flarum.core\"","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/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 _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 \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/components/IndexPage'];","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","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extenders'];","import Extend from 'flarum/common/extenders';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport Discussion from 'flarum/common/models/Discussion';\n\nexport default [\n new Extend.Routes() //\n .add('following', '/following', IndexPage),\n\n new Extend.Model(Discussion) //\n .attribute('subscription'),\n];\n","import NewPostNotification from './components/NewPostNotification';\nimport SubscriptionMenu from './components/SubscriptionMenu';\nimport SubscriptionMenuItem from './components/SubscriptionMenuItem';\n\nexport default {\n 'subscriptions/components/NewPostNotification': NewPostNotification,\n 'subscriptions/components/SubscriptionMenu': SubscriptionMenu,\n 'subscriptions/components/SubscriptionMenuItem': SubscriptionMenuItem,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core;","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 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\nexport { default as extend } from './extend';\n\napp.initializers.add('subscriptions', function () {\n app.notificationComponents.newPost = NewPostNotification;\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\n// Expose compat API\nimport subscriptionsCompat from './compat';\nimport { compat } from '@flarum/core/forum';\n\nObject.assign(compat, subscriptionsCompat);\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 = ;\n break;\n\n case 'ignore':\n badge = ;\n break;\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 \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', , 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 \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 {\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","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","_inheritsLoose","subClass","superClass","create","constructor","SubscriptionMenuItem","view","className","onclick","this","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","save","$","tooltip","Dropdown","NewPostNotification","href","notification","subject","content","postNumber","user","fromUser","Notification","Extend","add","IndexPage","Discussion","attribute","extend","badges","badge","type","DiscussionControls","items","context","DiscussionPage","states","none","follow","ignore","params","GlobalSearchState","onFollowing","DiscussionListState","filter","q","SettingsPage","state","followAfterReply","onchange","followAfterReplyLoading","savePreferences","then","m","redraw","loading","id","val","NotificationGrid","name","assign","subscriptionsCompat"],"sourceRoot":""} \ No newline at end of file