text: module.exports=function(t){var e={};function r(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,o){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(o,i,function(e){return t[e]}.bind(null,i));return o},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=17)}([function(t,e){t.exports=flarum.core.compat.Model},function(t,e){t.exports=flarum.core.compat["models/Discussion"]},function(t,e){t.exports=flarum.core.compat["tags/models/Tag"]},function(t,e,r){"use strict";r.d(e,"a",(function(){return l}));var o=r(0),i=r.n(o),n=r(1),s=r.n(n),a=r(2),c=r.n(a);function l(){s.a.prototype.articleSeriesOrder=i.a.attribute("articleSeriesOrder"),s.a.prototype.articleSeries=i.a.hasOne("articleSeries"),c.a.prototype.isArticleSeries=i.a.attribute("isArticleSeries"),c.a.prototype.articles=i.a.hasMany("articles")}},function(t,e){t.exports=flarum.core.compat["common/extend"]},function(t,e){t.exports=flarum.core.compat["common/components/Button"]},,,function(t,e){t.exports=flarum.core.compat["components/Link"]},function(t,e){t.exports=flarum.core.compat["common/utils/Stream"]},function(t,e){t.exports=flarum.core.compat["v17development/blog/components/BlogItemSidebar"]},function(t,e){t.exports=flarum.core.compat["common/Component"]},function(t,e){t.exports=flarum.core.compat["forum/utils/DiscussionControls"]},function(t,e){t.exports=flarum.core.compat["common/components/Modal"]},function(t,e){t.exports=flarum.core.compat["common/components/Select"]},,,function(t,e,r){"use strict";r.r(e);var o=r(3),i=r(4),n=r(10),s=r.n(n);function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,a(t,e)}var l=r(11),u=r.n(l),p=r(8),d=r.n(p),f=function(t){function e(){return t.apply(this,arguments)||this}c(e,t);var r=e.prototype;return r.view=function(){if(null==this.attrs.discussion)return"";var t=this.attrs.discussion.articleSeries();if(!t)return"";var e=t.articles();return m("div",{className:"BlogArticleList BlogSideWidget"},m("h3",null,app.translator.trans("askvortsov-article-series.forum.article_list.title",{series:m(d.a,{href:app.route("blogCategory",{slug:t.slug()})},t.name())})),e&&e.sort((function(t,e){return t.articleSeriesOrder()-e.articleSeriesOrder()})).map(this.articleItem))},r.articleItem=function(t,e){return console.log(m.route.param("id"),t.slug()),m(d.a,{href:app.route("blogArticle",{id:t.slug()}),className:"BlogSideWidget-item BlogSideWidget-item-"+t.id()},e+1,". ",m.route.param("id")===t.slug()?m("strong",null,t.title()):t.title())},e}(u.a);var v=r(5),g=r.n(v),b=r(12),h=r.n(b),y=r(13),S=r.n(y),_=r(14),O=r.n(_),x=r(9),N=r.n(x),j=function(t){function e(){return t.apply(this,arguments)||this}c(e,t);var r=e.prototype;return r.oninit=function(e){t.prototype.oninit.call(this,e);var r=this.attrs.discussion.articleSeries();this.articleSeriesId=N()(r?r.id():"NULL"),this.articleSeriesOrder=N()(this.attrs.discussion.articleSeriesOrder()||0)},r.className=function(){return"ArticleSeriesModal Modal--small"},r.title=function(){return app.translator.trans("askvortsov-article-series.forum.article_series_modal.title")},r.content=function(){var t=this.attrs.discussion.tags().filter((function(t){return t.isArticleSeries()})).reduce((function(t,e){return t[e.id()]=e.name(),t}),{});return t.NULL="None",m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("div",{className:"Form-group"},m("label",null,app.translator.trans("askvortsov-article-series.forum.article_series_modal.tag_id_label")),m(O.a,{value:this.articleSeriesId(),onchange:this.articleSeriesId,options:t})),m("div",{className:"Form-group"},m("label",null,app.translator.trans("askvortsov-article-series.forum.article_series_modal.order_label")),m("input",{className:"FormControl",bidi:this.articleSeriesOrder,type:"number"})),m("div",{className:"Form-group"},g.a.component({className:"Button Button--primary Button--block",type:"submit",loading:this.loading},app.translator.trans("askvortsov-article-series.forum.article_series_modal.submit_button")))))},r.onsubmit=function(t){var e=this;t.preventDefault(),this.loading=!0,this.attrs.discussion.save({articleSeriesId:parseInt(this.articleSeriesId())||null,articleSeriesOrder:this.articleSeriesOrder()}).finally((function(){e.loading=!1,m.redraw()}))},e}(S.a);app.initializers.add("askvortsov/flarum-article-series",(function(){Object(o.a)(),Object(i.extend)(s.a.prototype,"items",(function(t){var e=t.get("author");t.remove("author"),t.add("author",e,"phone"===app.screen()?5:20),t.add("article-list",m(f,{discussion:this.attrs.article}),10)})),Object(i.extend)(h.a,"userControls",(function(t,e){t.add("article-series-settings",m(g.a,{icon:"fas fa-book",onclick:function(){return app.modal.show(j,{discussion:e})}},app.translator.trans("askvortsov-article-series.forum.discussion_controls.article_series_button")))}))}))}]);
  //# sourceMappingURL=forum.js.map