module.exports=function(t){var o={};function e(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,e),r.l=!0,r.exports}return e.m=t,e.c=o,e.d=function(t,o,n){e.o(t,o)||Object.defineProperty(t,o,{enumerable:!0,get:n})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,o){if(1&o&&(t=e(t)),8&o)return t;if(4&o&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&o&&"string"!=typeof t)for(var r in t)e.d(n,r,function(o){return t[o]}.bind(null,r));return n},e.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(o,"a",o),o},e.o=function(t,o){return Object.prototype.hasOwnProperty.call(t,o)},e.p="",e(e.s=11)}([function(t,o){t.exports=flarum.core.compat.extend},function(t,o){t.exports=flarum.core.compat.app},function(t,o){t.exports=flarum.core.compat["components/Button"]},function(t,o){t.exports=flarum.core.compat.Model},function(t,o){t.exports=flarum.core.compat["models/Discussion"]},function(t,o){t.exports=flarum.core.compat["utils/DiscussionControls"]},function(t,o){t.exports=flarum.core.compat["components/DiscussionList"]},function(t,o){t.exports=flarum.core.compat["components/DiscussionListItem"]},function(t,o){t.exports=flarum.core.compat["utils/abbreviateNumber"]},function(t,o){t.exports=flarum.core.compat["components/Modal"]},,function(t,o,e){"use strict";e.r(o);var n=e(1),r=e.n(n),s=e(0),i=e(6),u=e.n(i),a=e(3),c=e.n(a),p=e(4),l=e.n(p),f=e(7),d=e.n(f),v=e(8),b=e.n(v),w=e(2),h=e.n(w),y=e(5),_=e.n(y);var x=e(9),g=function(t){var o,e;function n(){return t.apply(this,arguments)||this}e=t,(o=n).prototype=Object.create(e.prototype),o.prototype.constructor=o,o.__proto__=e;var r=n.prototype;return r.init=function(){t.prototype.init.call(this),this.discussion=this.props.discussion,this.currentViewsCount=this.props.discussion.views(),this.newViewsCount=m.prop(this.currentViewsCount)},r.content=function(){return m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("div",{className:"Form-group"},m("label",null,app.translator.trans("flarum_discussion_views.forum.modal_resetviews.label")),m("input",{className:"FormControl",type:"number",min:"0",bidi:this.newViewsCount})),m("div",{className:"Form-group"},h.a.component({className:"Button Button--primary Button--block",type:"submit",loading:this.loading,children:app.translator.trans("flarum_discussion_views.forum.modal_resetviews.submit")}))))},r.title=function(){return app.translator.trans("flarum_discussion_views.forum.modal_resetviews.title")},r.className=function(){return"Modal--small"},r.onsubmit=function(t){var o=this;t.preventDefault(),this.loading=!0;var e=parseInt(this.newViewsCount()),n=this.currentViewsCount;e>=0&&e!==n&&this.props.discussion.save({views:e}).then(function(){m.redraw()}).catch(function(t){o.loading=!1,console.log(t)}),this.hide()},n}(e.n(x).a);r.a.initializers.add("michaelbelgium-discussion-views",function(){Object(s.extend)(u.a.prototype,"sortMap",function(t){t.popular="-view_count",t.unpopular="view_count"}),l.a.prototype.views=c.a.attribute("views"),l.a.prototype.canReset=c.a.attribute("canReset"),Object(s.extend)(d.a.prototype,"infoItems",function(t){var o=this.props.discussion;t.add("discussion-views",b()(o.views()))}),Object(s.extend)(_.a,"moderationControls",function(t,o){o.canReset()&&t.add("reset",h.a.component({children:app.translator.trans("flarum_discussion_views.forum.discussion_controls.resetviews_button"),icon:"far fa-eye",onclick:this.resetViewsAction.bind(o)}))}),_.a.resetViewsAction=function(){return app.modal.show(new g({discussion:this}))}})}]);
//# sourceMappingURL=forum.js.map