diff --git a/extensions/tags/js/dist/forum.js b/extensions/tags/js/dist/forum.js index db5af41fe..64331150b 100644 --- a/extensions/tags/js/dist/forum.js +++ b/extensions/tags/js/dist/forum.js @@ -1,3 +1,3 @@ /*! For license information please see forum.js.LICENSE.txt */ -(()=>{var t={810:()=>{},990:(t,e,n)=>{"use strict";n.d(e,{l:()=>Ft});const r=flarum.core.compat["forum/app"];var a=n.n(r);function o(t,e,n,r,a,o,s){try{var i=t[o](s),c=i.value}catch(t){return void n(t)}i.done?e(c):Promise.resolve(c).then(r,a)}var s=n(507),i=n.n(s);const c=flarum.core.compat["common/app"];var l=n.n(c),u=function(){function t(){this.loadedIncludes=new Set}return t.prototype.load=function(){var t,e=(t=i().mark((function t(e){var n,r=this;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0===e&&(e=[]),0!==(n=e.filter((function(t){return!r.loadedIncludes.has(t)}))).length){t.next=4;break}return t.abrupt("return",Promise.resolve(l().store.all("tags")));case 4:return t.abrupt("return",l().store.find("tags",{include:n.join(",")}).then((function(t){return n.forEach((function(t){return r.loadedIncludes.add(t)})),t})));case 5:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(r,a){var s=t.apply(e,n);function i(t){o(s,r,a,i,c,"next",t)}function c(t){o(s,r,a,i,c,"throw",t)}i(void 0)}))});return function(t){return e.apply(this,arguments)}}(),t}();const d=flarum.core.compat["common/extend"],f=flarum.core.compat["forum/components/IndexPage"];var p=n.n(f);const h=flarum.core.compat["common/components/Separator"];var g=n.n(h);const v=flarum.core.compat["common/components/LinkButton"];var y=n.n(v);function b(t,e){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},b(t,e)}function T(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,b(t,e)}const x=flarum.core.compat["common/components/Link"];var w=n.n(x);const _=flarum.core.compat["common/utils/classList"];var N=n.n(_);function L(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var r=t&&t.icon(),a=n.useColor,o=void 0===a||a;return e.className=N()([e.className,"icon",r?t.icon():"TagIcon"]),t&&o?(e.style=e.style||{},e.style["--color"]=t.color(),r&&(e.style.color=t.color())):t||(e.className+=" untagged"),r?m("i",e):m("span",e)}var S=function(t){function e(){return t.apply(this,arguments)||this}return T(e,t),e.prototype.view=function(t){var e=this.attrs.model,n=(this.constructor.isActive(this.attrs),e&&e.description()),r=N()(["TagLinkButton","hasIcon",this.attrs.className,e.isChild()&&"child"]);return m(w(),{className:r,href:this.attrs.route,style:e?{"--color":e.color()}:"",title:n||""},L(e,{className:"Button-icon"}),m("span",{className:"Button-label"},e?e.name():app.translator.trans("flarum-tags.forum.index.untagged_link")))},e.initAttrs=function(e){t.initAttrs.call(this,e);var n=e.model;e.params.tags=n?n.slug():"untagged",e.route=app.route("tag",e.params)},e}(y());const P=flarum.core.compat["common/components/Page"];var I=n.n(P);const C=flarum.core.compat["common/components/LoadingIndicator"];var k=n.n(C);const D=flarum.core.compat["common/helpers/listItems"];var E=n.n(D);const O=flarum.core.compat["common/helpers/humanTime"];var A=n.n(O);const M=flarum.core.compat["common/helpers/textContrastClass"];var R=n.n(M);const j=flarum.core.compat["common/utils/extract"];var q=n.n(j);function B(t,e){void 0===e&&(e={}),e.style=e.style||{},e.className="TagLabel "+(e.className||"");var n=q()(e,"link"),r=t?t.name():app.translator.trans("flarum-tags.lib.deleted_tag_text");if(t){var a=t.color();a&&(e.style["--tag-bg"]=a,e.className=N()(e.className,"colored",R()(a))),n&&(e.title=t.description()||"",e.href=app.route("tag",{tags:t.slug()})),t.isChild()&&(e.className+=" TagLabel--child")}else e.className+=" untagged";return m(n?w():"span",e,m("span",{className:"TagLabel-text"},t&&t.icon()&&L(t,{},{useColor:!1})," ",r))}function H(t){return t.slice(0).sort((function(t,e){var n=t.position(),r=e.position();if(null===n&&null===r)return e.discussionCount()-t.discussionCount();if(null===r)return-1;if(null===n)return 1;var a=t.parent(),o=e.parent();return a===o?n-r:a&&o?a.position()-o.position():a?a===e?1:a.position()-r:o?o===t?-1:n-o.position():0}))}var F=function(t){function e(){return t.apply(this,arguments)||this}T(e,t);var n=e.prototype;return n.oninit=function(e){var n=this;t.prototype.oninit.call(this,e),app.history.push("tags",app.translator.trans("flarum-tags.forum.header.back_to_tags_tooltip")),this.tags=[];var r=app.preloadedApiDocument();r?this.tags=H(r.filter((function(t){return!t.isChild()}))):(this.loading=!0,app.tagList.load(["children","lastPostedDiscussion","parent"]).then((function(){n.tags=H(app.store.all("tags").filter((function(t){return!t.isChild()}))),n.loading=!1,m.redraw()})))},n.view=function(){if(this.loading)return m(k(),null);var t=this.tags.filter((function(t){return null!==t.position()})),e=this.tags.filter((function(t){return null===t.position()}));return m("div",{className:"TagsPage"},p().prototype.hero(),m("div",{className:"container"},m("nav",{className:"TagsPage-nav IndexPage-nav sideNav"},m("ul",null,E()(p().prototype.sidebarItems().toArray()))),m("div",{className:"TagsPage-content sideNavOffset"},m("ul",{className:"TagTiles"},t.map((function(t){var e=t.lastPostedDiscussion(),n=H(t.children()||[]);return m("li",{className:N()("TagTile",{colored:t.color()},R()(t.color())),style:{"--tag-bg":t.color()}},m(w(),{className:"TagTile-info",href:app.route.tag(t)},t.icon()&&L(t,{},{useColor:!1}),m("h3",{className:"TagTile-name"},t.name()),m("p",{className:"TagTile-description"},t.description()),n?m("div",{className:"TagTile-children"},n.map((function(t){return[m(w(),{href:app.route.tag(t)},t.name())," "]}))):""),e?m(w(),{className:"TagTile-lastPostedDiscussion",href:app.route.discussion(e,e.lastPostNumber())},m("span",{className:"TagTile-lastPostedDiscussion-title"},e.title()),A()(e.lastPostedAt())):m("span",{className:"TagTile-lastPostedDiscussion"}))}))),e.length?m("div",{className:"TagCloud"},e.map((function(t){return[B(t,{link:!0})," "]}))):"")))},n.oncreate=function(e){t.prototype.oncreate.call(this,e),app.setTitle(app.translator.trans("flarum-tags.forum.all_tags.meta_title_text")),app.setTitleCount(0)},e}(I());function G(){(0,d.extend)(p().prototype,"navItems",(function(t){if(t.add("tags",m(y(),{icon:"fas fa-th-large",href:app.route("tags")},app.translator.trans("flarum-tags.forum.index.tags_link")),-10),!app.current.matches(F)){t.add("separator",g().component(),-12);var e=app.search.stickyParams(),n=app.store.all("tags"),r=this.currentTag(),a=function(n){var a=r===n;!a&&r&&(a=r.parent()===n),t.add("tag"+n.id(),S.component({model:n,params:e,active:a},null==n?void 0:n.name()),-14)};H(n).filter((function(t){return null!==t.position()&&(!t.isChild()||r&&(t.parent()===r||t.parent()===r.parent()))})).forEach(a);var o=n.filter((function(t){return null===t.position()})).sort((function(t,e){return e.discussionCount()-t.discussionCount()}));o.splice(0,3).forEach(a),o.length&&t.add("moreTags",m(y(),{href:app.route("tags")},app.translator.trans("flarum-tags.forum.index.more_link")),-16)}}))}const K=flarum.core.compat["forum/states/DiscussionListState"];var $=n.n(K);const U=flarum.core.compat["forum/states/GlobalSearchState"];var Y=n.n(U);const z=flarum.core.compat["common/Component"];var J=n.n(z),Q=function(t){function e(){return t.apply(this,arguments)||this}return T(e,t),e.prototype.view=function(){var t=this.attrs.model,e=t.color();return m("header",{className:N()("Hero","TagHero",{"TagHero--colored":e},R()(e)),style:e?{"--hero-bg":e}:""},m("div",{className:"container"},m("div",{className:"containerNarrow"},m("h1",{className:"Hero-title"},t.icon()&&L(t,{},{useColor:!1})," ",t.name()),m("div",{className:"Hero-subtitle"},t.description()))))},e}(J()),V=function(t){return a().store.all("tags").find((function(e){return 0===e.slug().localeCompare(t,void 0,{sensitivity:"base"})}))};function W(){p().prototype.currentTag=function(){var t=this;if(this.currentActiveTag)return this.currentActiveTag;var e=a().search.params().tags,n=null;if(e&&(n=V(e)),e&&!n||n&&!n.isChild()&&!n.children()){if(this.currentTagLoading)return;this.currentTagLoading=!0,a().store.find("tags",e,{include:"children,children.parent,parent,state"}).then((function(){t.currentActiveTag=V(e),m.redraw()})).finally((function(){t.currentTagLoading=!1}))}return n?(this.currentActiveTag=n,this.currentActiveTag):void 0},(0,d.override)(p().prototype,"hero",(function(t){var e=this.currentTag();return e?m(Q,{model:e}):t()})),(0,d.extend)(p().prototype,"view",(function(t){var e=this.currentTag();e&&(t.attrs.className+=" IndexPage--tag"+e.id())})),(0,d.extend)(p().prototype,"setTitle",(function(){var t=this.currentTag();t&&a().setTitle(t.name())})),(0,d.extend)(p().prototype,"sidebarItems",(function(t){var e=this.currentTag();if(e){var n=e.color(),r=e.canStartDiscussion()||!a().session.user,o=t.get("newDiscussion");n&&(o.attrs.className=N()([o.attrs.className,"Button--tagColored",R()(n)]),o.attrs.style={"--color":n}),o.attrs.disabled=!r,o.children=a().translator.trans(r?"core.forum.index.start_discussion_button":"core.forum.index.cannot_start_discussion_button")}})),(0,d.extend)(Y().prototype,"params",(function(t){t.tags=m.route.param("tags")})),(0,d.extend)($().prototype,"requestParams",(function(t){var e;if("string"==typeof t.include?t.include=[t.include]:null==(e=t.include)||e.push("tags","tags.parent"),this.params.tags){var n,r=null!=(n=t.filter)?n:{};r.tag=this.params.tags;var a=r.q;a&&(r.q=a+" tag:"+this.params.tags),t.filter=r}}))}const X=flarum.core.compat["forum/components/DiscussionListItem"];var Z=n.n(X);const tt=flarum.core.compat["forum/components/DiscussionHero"];var et=n.n(tt);function nt(t,e){void 0===e&&(e={});var n=[],r=q()(e,"link");return e.className="TagsLabel "+(e.className||""),t?H(t).forEach((function(e){(e||1===t.length)&&n.push(B(e,{link:r}))})):n.push(B()),m("span",e,n)}function rt(){(0,d.extend)(Z().prototype,"infoItems",(function(t){var e=this.attrs.discussion.tags();e&&e.length&&t.add("tags",nt(e),10)})),(0,d.extend)(et().prototype,"view",(function(t){var e=H(this.attrs.discussion.tags());if(e&&e.length){var n=e[0].color();n&&(t.attrs.style={"--hero-bg":n},t.attrs.className=N()(t.attrs.className,"DiscussionHero--colored",R()(n)))}})),(0,d.extend)(et().prototype,"items",(function(t){var e=this.attrs.discussion.tags();e&&e.length&&t.add("tags",nt(e,{link:!0}),5)}))}const at=flarum.core.compat["forum/utils/DiscussionControls"];var ot=n.n(at);const st=flarum.core.compat["common/components/Button"];var it=n.n(st);const ct=flarum.core.compat["forum/components/DiscussionPage"];var lt=n.n(ct);const ut=flarum.core.compat["common/utils/extractText"];var mt=n.n(ut);function dt(t){var e=app.store.all("tags");return t?e.filter((function(e){return e.canAddToDiscussion()||-1!==t.tags().indexOf(e)})):e.filter((function(t){return t.canStartDiscussion()}))}const ft=flarum.core.compat["common/helpers/highlight"];var pt=n.n(ft);const ht=flarum.core.compat["common/utils/KeyboardNavigatable"];var gt=n.n(ht);const vt=flarum.core.compat["common/components/Modal"];var yt=n.n(vt);const bt=flarum.core.compat["common/utils/Stream"];var Tt=n.n(bt),xt=["className","isToggled"],wt=function(t){function e(){return t.apply(this,arguments)||this}return T(e,t),e.prototype.view=function(t){var e=this.attrs,n=e.className,r=e.isToggled,a=function(t,e){if(null==t)return{};var n,r,a={},o=Object.keys(t);for(r=0;r=0||(a[n]=t[n]);return a}(e,xt),o=r?"far fa-check-circle":"far fa-circle";return m(it(),Object.assign({},a,{icon:o,className:N()([n,r&&"Button--toggled"])}),t.children)},e}(J()),_t=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),a=0;at.max.primary)throw new Error("The minimum number of primary tags allowed cannot be more than the maximum number of primary tags allowed.");if(t.min.secondary>t.max.secondary)throw new Error("The minimum number of secondary tags allowed cannot be more than the maximum number of secondary tags allowed.");if(t.min.total>t.max.primary+t.max.secondary)throw new Error("The minimum number of tags allowed cannot be more than the maximum number of primary and secondary tags allowed together.");if(t.max.totalt.max.total)throw new Error("The minimum number of tags allowed cannot be more than the maximum number of tags allowed.")}(e.limits)};var n=e.prototype;return n.oninit=function(e){var n=this;t.prototype.oninit.call(this,e),this.navigator.onUp((function(){return n.setIndex(n.getCurrentNumericIndex()-1,!0)})).onDown((function(){return n.setIndex(n.getCurrentNumericIndex()+1,!0)})).onSelect(this.select.bind(this)).onRemove((function(){return n.selected.splice(n.selected.length-1,1)})),l().tagList.load(["parent"]).then((function(t){n.loading=!1,n.attrs.selectableTags&&(t=n.attrs.selectableTags(t)),n.tags=H(t),n.attrs.selectedTags&&n.attrs.selectedTags.map(n.addTag.bind(n)),n.indexTag=t[0],m.redraw()}))},n.className=function(){return N()("TagSelectionModal",this.attrs.className)},n.title=function(){return this.attrs.title},n.content=function(){var t=this;if(this.loading||!this.tags)return m(k(),null);var e=this.filter().toLowerCase(),n=this.primaryCount(),r=this.secondaryCount(),a=this.getFilteredTags(),o=Math.max(mt()(this.getInstruction(n,r)).length,this.filter().length);return[m("div",{className:"Modal-body"},m("div",{className:"TagSelectionModal-form"},m("div",{className:"TagSelectionModal-form-input"},m("div",{className:"TagsInput FormControl "+(this.focused?"focus":""),onclick:function(){return t.$(".TagsInput input").focus()}},m("span",{className:"TagsInput-selected"},this.selected.map((function(e){return m("span",{className:"TagsInput-tag",onclick:function(){t.removeTag(e),t.onready()}},B(e))}))),m("input",{className:"FormControl",placeholder:mt()(this.getInstruction(n,r)),bidi:this.filter,style:{width:o+"ch"},onkeydown:this.navigator.navigate.bind(this.navigator),onfocus:function(){return t.focused=!0},onblur:function(){return t.focused=!1}}))),m("div",{className:"TagSelectionModal-form-submit App-primaryControl"},m(it(),{type:"submit",className:"Button Button--primary",disabled:!this.meetsRequirements(n,r),icon:"fas fa-check"},l().translator.trans("flarum-tags.lib.tag_selection_modal.submit_button"))))),m("div",{className:"Modal-footer"},m("ul",{className:"TagSelectionModal-list SelectTagList"},a.map((function(n){return m("li",{"data-index":n.id(),className:N()({pinned:null!==n.position(),child:!!n.parent(),colored:!!n.color(),selected:t.selected.includes(n),active:t.indexTag===n}),style:{color:n.color()},onmouseover:function(){return t.indexTag=n},onclick:t.toggleTag.bind(t,n)},L(n),m("span",{className:"SelectTagListItem-name"},pt()(n.name(),e)),n.description()?m("span",{className:"SelectTagListItem-description"},n.description()):"")}))),this.attrs.limits.allowBypassing&&m("div",{className:"TagSelectionModal-controls"},m(wt,{className:"Button",onclick:function(){return t.bypassReqs=!t.bypassReqs},isToggled:this.bypassReqs},l().translator.trans("flarum-tags.lib.tag_selection_modal.bypass_requirements"))))]},n.getFilteredTags=function(){var t=this,e=this.filter().toLowerCase(),n=this.primaryCount(),r=this.secondaryCount(),a=this.tags;return this.attrs.requireParentTag&&(a=a.filter((function(e){var n=e.parent();return null!==n&&(!1===n||t.selected.includes(n))}))),this.bypassReqs||(this.selected.length>=this.attrs.limits.max.total?a=a.filter((function(e){return t.selected.includes(e)})):(n>=this.attrs.limits.max.primary&&(a=a.filter((function(e){return!e.isPrimary()||t.selected.includes(e)}))),r>=this.attrs.limits.max.secondary&&(a=a.filter((function(e){return e.isPrimary()||t.selected.includes(e)}))))),e&&(a=a.filter((function(t){return t.name().substring(0,e.length).toLowerCase()===e}))),this.indexTag&&a.includes(this.indexTag)||(this.indexTag=a[0]),a},n.primaryCount=function(){return this.selected.filter((function(t){return t.isPrimary()})).length},n.secondaryCount=function(){return this.selected.filter((function(t){return!t.isPrimary()})).length},n.meetsRequirements=function(t,e){return!!(this.bypassReqs||this.attrs.allowResetting&&0===this.selected.length)||!(this.selected.length=this.attrs.limits.min.primary&&e>=this.attrs.limits.min.secondary},n.addTag=function(t){if(t&&this.attrs.canSelect(t)){if(this.attrs.onSelect&&this.attrs.onSelect(t,this.selected),this.attrs.requireParentTag){var e=t.parent();e&&!this.selected.includes(e)&&this.selected.push(e)}this.selected.includes(t)||this.selected.push(t)}},n.removeTag=function(t){var e=this.selected.indexOf(t);-1!==e&&(this.selected.splice(e,1),this.attrs.requireParentTag&&this.selected.filter((function(e){return e.parent()===t})).forEach(this.removeTag.bind(this)),this.attrs.onDeselect&&this.attrs.onDeselect(t,this.selected))},n.toggleTag=function(t){this.tags&&(this.selected.includes(t)?this.removeTag(t):this.addTag(t),this.filter()&&(this.filter(""),this.indexTag=this.tags[0]),this.onready())},n.getInstruction=function(t,e){if(this.bypassReqs)return"";if(t li")},n.getCurrentNumericIndex=function(){return this.indexTag?this.selectableItems().index(this.getItem(this.indexTag)):-1},n.getItem=function(t){return this.selectableItems().filter('[data-index="'+t.id()+'"]')},n.setIndex=function(t,e){var n=this.selectableItems(),r=n.parent();t<0?t=n.length-1:t>=n.length&&(t=0);var a=n.eq(t);if(this.indexTag=l().store.getById("tags",a.attr("data-index")),m.redraw(),e&&this.indexTag){var o,s=r.scrollTop(),i=r.offset().top,c=i+r.outerHeight(),u=a.offset().top,d=u+a.outerHeight();uc&&(o=s-c+d+parseInt(r.css("padding-bottom"),10)),void 0!==o&&r.stop(!0).animate({scrollTop:o},100)}},e}(yt()),Nt=function(t){function e(){return t.apply(this,arguments)||this}return T(e,t),e.initAttrs=function(e){var n;t.initAttrs.call(this,e);var r=e.discussion?a().translator.trans("flarum-tags.forum.choose_tags.edit_title",{title:m("em",null,e.discussion.title())}):a().translator.trans("flarum-tags.forum.choose_tags.title");e.className=N()(e.className,"TagDiscussionModal"),e.title=mt()(r),e.allowResetting=!!a().forum.attribute("canBypassTagCounts"),e.limits={allowBypassing:e.allowResetting,max:{primary:a().forum.attribute("minPrimaryTags"),secondary:a().forum.attribute("maxSecondaryTags")},min:{primary:a().forum.attribute("maxPrimaryTags"),secondary:a().forum.attribute("minSecondaryTags")}},e.requireParentTag=!0,e.selectableTags=function(){return dt(e.discussion)},null!=e.selectedTags||(e.selectedTags=(null==(n=e.discussion)?void 0:n.tags())||[]),e.canSelect=function(t){return t.canStartDiscussion()};var o=e.onsubmit||null;e.onsubmit=function(t){var n=e.discussion;n&&n.save({relationships:{tags:t}}).then((function(){a().current.matches(lt())&&a().current.get("stream").update(),m.redraw()})),o&&o(t)}},e}(_t);function Lt(){(0,d.extend)(ot(),"moderationControls",(function(t,e){e.canTag()&&t.add("tags",m(it(),{icon:"fas fa-tag",onclick:function(){return app.modal.show(Nt,{discussion:e})}},app.translator.trans("flarum-tags.forum.discussion_controls.edit_tags_button")))}))}const St=flarum.core.compat["forum/components/DiscussionComposer"];var Pt=n.n(St);function It(){(0,d.extend)(p().prototype,"newDiscussionAction",(function(t){var e=this.currentTag();if(e){var n=e.parent(),r=n?[n,e]:[e];t.then((function(t){return t.fields.tags=r}))}else app.composer.fields.tags=[]})),(0,d.extend)(Pt().prototype,"oninit",(function(){app.tagList.load(["parent"]).then((function(){return m.redraw()}))})),Pt().prototype.chooseTags=function(){var t=this;dt().length&&app.modal.show(Nt,{selectedTags:(this.composer.fields.tags||[]).slice(0),onsubmit:function(e){t.composer.fields.tags=e,t.$("textarea").focus()}})},(0,d.extend)(Pt().prototype,"headerItems",(function(t){var e=this.composer.fields.tags||[],n=dt();t.add("tags",m("a",{className:N()(["DiscussionComposer-changeTags",!n.length&&"disabled"]),onclick:this.chooseTags.bind(this)},e.length?nt(e):m("span",{className:"TagLabel untagged"},app.translator.trans("flarum-tags.forum.composer_discussion.choose_tags_link"))),10)})),(0,d.override)(Pt().prototype,"onsubmit",(function(t){var e=this,n=this.composer.fields.tags||[],r=n.filter((function(t){return null!==t.position()&&!t.isChild()})),a=n.filter((function(t){return null===t.position()})),o=dt(),s=parseInt(app.forum.attribute("minPrimaryTags")),i=parseInt(app.forum.attribute("minSecondaryTags")),c=parseInt(app.forum.attribute("maxPrimaryTags")),l=parseInt(app.forum.attribute("maxSecondaryTags"));(!n.length&&0!==c&&0!==l||r.length{var r=n(75).default;function a(){"use strict";t.exports=a=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var e={},n=Object.prototype,o=n.hasOwnProperty,s=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},c=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function m(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{m({},"")}catch(t){m=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var a=e&&e.prototype instanceof h?e:h,o=Object.create(a.prototype),i=new I(r||[]);return s(o,"_invoke",{value:N(t,n,i)}),o}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var p={};function h(){}function g(){}function v(){}var y={};m(y,c,(function(){return this}));var b=Object.getPrototypeOf,T=b&&b(b(C([])));T&&T!==n&&o.call(T,c)&&(y=T);var x=v.prototype=h.prototype=Object.create(y);function w(t){["next","throw","return"].forEach((function(e){m(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function n(a,s,i,c){var l=f(t[a],t,s);if("throw"!==l.type){var u=l.arg,m=u.value;return m&&"object"==r(m)&&o.call(m,"__await")?e.resolve(m.__await).then((function(t){n("next",t,i,c)}),(function(t){n("throw",t,i,c)})):e.resolve(m).then((function(t){u.value=t,i(u)}),(function(t){return n("throw",t,i,c)}))}c(l.arg)}var a;s(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,a){n(t,r,e,a)}))}return a=a?a.then(o,o):o()}})}function N(t,e,n){var r="suspendedStart";return function(a,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw o;return{value:void 0,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var i=L(s,n);if(i){if(i===p)continue;return i}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=f(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function L(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,L(t,e),"throw"===e.method))return p;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var r=f(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,p;var a=r.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function C(t){if(t){var e=t[c];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n=0;--r){var a=this.tryEntries[r],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var i=o.call(a,"catchLoc"),c=o.call(a,"finallyLoc");if(i&&c){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),P(n),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;P(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:C(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports},75:t=>{function e(n){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},507:(t,e,n)=>{var r=n(440)();t.exports=r;try{regeneratorRuntime=r}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},e={};function n(r){var a=e[r];if(void 0!==a)return a.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{extend:()=>a.l});var t=n(810),e={};for(const n in t)"default"!==n&&(e[n]=()=>t[n]);n.d(r,e);var a=n(990)})(),module.exports=r})(); +(()=>{var t={810:()=>{},990:(t,e,n)=>{"use strict";n.d(e,{l:()=>Ft});const r=flarum.core.compat["forum/app"];var a=n.n(r);function o(t,e,n,r,a,o,s){try{var i=t[o](s),c=i.value}catch(t){return void n(t)}i.done?e(c):Promise.resolve(c).then(r,a)}var s=n(507),i=n.n(s);const c=flarum.core.compat["common/app"];var l=n.n(c),u=function(){function t(){this.loadedIncludes=new Set}return t.prototype.load=function(){var t,e=(t=i().mark((function t(e){var n,r=this;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0===e&&(e=[]),0!==(n=e.filter((function(t){return!r.loadedIncludes.has(t)}))).length){t.next=4;break}return t.abrupt("return",Promise.resolve(l().store.all("tags")));case 4:return t.abrupt("return",l().store.find("tags",{include:n.join(",")}).then((function(t){return n.forEach((function(t){return r.loadedIncludes.add(t)})),t})));case 5:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(r,a){var s=t.apply(e,n);function i(t){o(s,r,a,i,c,"next",t)}function c(t){o(s,r,a,i,c,"throw",t)}i(void 0)}))});return function(t){return e.apply(this,arguments)}}(),t}();const d=flarum.core.compat["common/extend"],f=flarum.core.compat["forum/components/IndexPage"];var p=n.n(f);const h=flarum.core.compat["common/components/Separator"];var g=n.n(h);const v=flarum.core.compat["common/components/LinkButton"];var y=n.n(v);function b(t,e){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},b(t,e)}function T(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,b(t,e)}const x=flarum.core.compat["common/components/Link"];var w=n.n(x);const _=flarum.core.compat["common/utils/classList"];var N=n.n(_);function L(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var r=t&&t.icon(),a=n.useColor,o=void 0===a||a;return e.className=N()([e.className,"icon",r?t.icon():"TagIcon"]),t&&o?(e.style=e.style||{},e.style["--color"]=t.color(),r&&(e.style.color=t.color())):t||(e.className+=" untagged"),r?m("i",e):m("span",e)}var S=function(t){function e(){return t.apply(this,arguments)||this}return T(e,t),e.prototype.view=function(t){var e=this.attrs.model,n=(this.constructor.isActive(this.attrs),e&&e.description()),r=N()(["TagLinkButton","hasIcon",this.attrs.className,e.isChild()&&"child"]);return m(w(),{className:r,href:this.attrs.route,style:e?{"--color":e.color()}:"",title:n||""},L(e,{className:"Button-icon"}),m("span",{className:"Button-label"},e?e.name():app.translator.trans("flarum-tags.forum.index.untagged_link")))},e.initAttrs=function(e){t.initAttrs.call(this,e);var n=e.model;e.params.tags=n?n.slug():"untagged",e.route=app.route("tag",e.params)},e}(y());const P=flarum.core.compat["common/components/Page"];var I=n.n(P);const C=flarum.core.compat["common/components/LoadingIndicator"];var k=n.n(C);const D=flarum.core.compat["common/helpers/listItems"];var E=n.n(D);const O=flarum.core.compat["common/helpers/humanTime"];var A=n.n(O);const M=flarum.core.compat["common/helpers/textContrastClass"];var R=n.n(M);const j=flarum.core.compat["common/utils/extract"];var q=n.n(j);function B(t,e){void 0===e&&(e={}),e.style=e.style||{},e.className="TagLabel "+(e.className||"");var n=q()(e,"link"),r=t?t.name():app.translator.trans("flarum-tags.lib.deleted_tag_text");if(t){var a=t.color();a&&(e.style["--tag-bg"]=a,e.className=N()(e.className,"colored",R()(a))),n&&(e.title=t.description()||"",e.href=app.route("tag",{tags:t.slug()})),t.isChild()&&(e.className+=" TagLabel--child")}else e.className+=" untagged";return m(n?w():"span",e,m("span",{className:"TagLabel-text"},t&&t.icon()&&L(t,{},{useColor:!1})," ",r))}function H(t){return t.slice(0).sort((function(t,e){var n=t.position(),r=e.position();if(null===n&&null===r)return e.discussionCount()-t.discussionCount();if(null===r)return-1;if(null===n)return 1;var a=t.parent(),o=e.parent();return a===o?n-r:a&&o?a.position()-o.position():a?a===e?1:a.position()-r:o?o===t?-1:n-o.position():0}))}var F=function(t){function e(){return t.apply(this,arguments)||this}T(e,t);var n=e.prototype;return n.oninit=function(e){var n=this;t.prototype.oninit.call(this,e),app.history.push("tags",app.translator.trans("flarum-tags.forum.header.back_to_tags_tooltip")),this.tags=[];var r=app.preloadedApiDocument();r?this.tags=H(r.filter((function(t){return!t.isChild()}))):(this.loading=!0,app.tagList.load(["children","lastPostedDiscussion","parent"]).then((function(){n.tags=H(app.store.all("tags").filter((function(t){return!t.isChild()}))),n.loading=!1,m.redraw()})))},n.view=function(){if(this.loading)return m(k(),null);var t=this.tags.filter((function(t){return null!==t.position()})),e=this.tags.filter((function(t){return null===t.position()}));return m("div",{className:"TagsPage"},p().prototype.hero(),m("div",{className:"container"},m("nav",{className:"TagsPage-nav IndexPage-nav sideNav"},m("ul",null,E()(p().prototype.sidebarItems().toArray()))),m("div",{className:"TagsPage-content sideNavOffset"},m("ul",{className:"TagTiles"},t.map((function(t){var e=t.lastPostedDiscussion(),n=H(t.children()||[]);return m("li",{className:N()("TagTile",{colored:t.color()},R()(t.color())),style:{"--tag-bg":t.color()}},m(w(),{className:"TagTile-info",href:app.route.tag(t)},t.icon()&&L(t,{},{useColor:!1}),m("h3",{className:"TagTile-name"},t.name()),m("p",{className:"TagTile-description"},t.description()),n?m("div",{className:"TagTile-children"},n.map((function(t){return[m(w(),{href:app.route.tag(t)},t.name())," "]}))):""),e?m(w(),{className:"TagTile-lastPostedDiscussion",href:app.route.discussion(e,e.lastPostNumber())},m("span",{className:"TagTile-lastPostedDiscussion-title"},e.title()),A()(e.lastPostedAt())):m("span",{className:"TagTile-lastPostedDiscussion"}))}))),e.length?m("div",{className:"TagCloud"},e.map((function(t){return[B(t,{link:!0})," "]}))):"")))},n.oncreate=function(e){t.prototype.oncreate.call(this,e),app.setTitle(app.translator.trans("flarum-tags.forum.all_tags.meta_title_text")),app.setTitleCount(0)},e}(I());function G(){(0,d.extend)(p().prototype,"navItems",(function(t){if(t.add("tags",m(y(),{icon:"fas fa-th-large",href:app.route("tags")},app.translator.trans("flarum-tags.forum.index.tags_link")),-10),!app.current.matches(F)){t.add("separator",g().component(),-12);var e=app.search.stickyParams(),n=app.store.all("tags"),r=this.currentTag(),a=function(n){var a=r===n;!a&&r&&(a=r.parent()===n),t.add("tag"+n.id(),S.component({model:n,params:e,active:a},null==n?void 0:n.name()),-14)};H(n).filter((function(t){return null!==t.position()&&(!t.isChild()||r&&(t.parent()===r||t.parent()===r.parent()))})).forEach(a);var o=n.filter((function(t){return null===t.position()})).sort((function(t,e){return e.discussionCount()-t.discussionCount()}));o.splice(0,3).forEach(a),o.length&&t.add("moreTags",m(y(),{href:app.route("tags")},app.translator.trans("flarum-tags.forum.index.more_link")),-16)}}))}const K=flarum.core.compat["forum/states/DiscussionListState"];var $=n.n(K);const U=flarum.core.compat["forum/states/GlobalSearchState"];var Y=n.n(U);const z=flarum.core.compat["common/Component"];var J=n.n(z),Q=function(t){function e(){return t.apply(this,arguments)||this}return T(e,t),e.prototype.view=function(){var t,e=this.attrs.model,n=e.color();return m("header",{className:N()("Hero","TagHero",(t={"TagHero--colored":n},t[R()(n)]=n,t)),style:n?{"--hero-bg":n}:""},m("div",{className:"container"},m("div",{className:"containerNarrow"},m("h1",{className:"Hero-title"},e.icon()&&L(e,{},{useColor:!1})," ",e.name()),m("div",{className:"Hero-subtitle"},e.description()))))},e}(J()),V=function(t){return a().store.all("tags").find((function(e){return 0===e.slug().localeCompare(t,void 0,{sensitivity:"base"})}))};function W(){p().prototype.currentTag=function(){var t=this;if(this.currentActiveTag)return this.currentActiveTag;var e=a().search.params().tags,n=null;if(e&&(n=V(e)),e&&!n||n&&!n.isChild()&&!n.children()){if(this.currentTagLoading)return;this.currentTagLoading=!0,a().store.find("tags",e,{include:"children,children.parent,parent,state"}).then((function(){t.currentActiveTag=V(e),m.redraw()})).finally((function(){t.currentTagLoading=!1}))}return n?(this.currentActiveTag=n,this.currentActiveTag):void 0},(0,d.override)(p().prototype,"hero",(function(t){var e=this.currentTag();return e?m(Q,{model:e}):t()})),(0,d.extend)(p().prototype,"view",(function(t){var e=this.currentTag();e&&(t.attrs.className+=" IndexPage--tag"+e.id())})),(0,d.extend)(p().prototype,"setTitle",(function(){var t=this.currentTag();t&&a().setTitle(t.name())})),(0,d.extend)(p().prototype,"sidebarItems",(function(t){var e=this.currentTag();if(e){var n=e.color(),r=e.canStartDiscussion()||!a().session.user,o=t.get("newDiscussion");n&&(o.attrs.className=N()([o.attrs.className,"Button--tagColored",R()(n)]),o.attrs.style={"--color":n}),o.attrs.disabled=!r,o.children=a().translator.trans(r?"core.forum.index.start_discussion_button":"core.forum.index.cannot_start_discussion_button")}})),(0,d.extend)(Y().prototype,"params",(function(t){t.tags=m.route.param("tags")})),(0,d.extend)($().prototype,"requestParams",(function(t){var e;if("string"==typeof t.include?t.include=[t.include]:null==(e=t.include)||e.push("tags","tags.parent"),this.params.tags){var n,r=null!=(n=t.filter)?n:{};r.tag=this.params.tags;var a=r.q;a&&(r.q=a+" tag:"+this.params.tags),t.filter=r}}))}const X=flarum.core.compat["forum/components/DiscussionListItem"];var Z=n.n(X);const tt=flarum.core.compat["forum/components/DiscussionHero"];var et=n.n(tt);function nt(t,e){void 0===e&&(e={});var n=[],r=q()(e,"link");return e.className="TagsLabel "+(e.className||""),t?H(t).forEach((function(e){(e||1===t.length)&&n.push(B(e,{link:r}))})):n.push(B()),m("span",e,n)}function rt(){(0,d.extend)(Z().prototype,"infoItems",(function(t){var e=this.attrs.discussion.tags();e&&e.length&&t.add("tags",nt(e),10)})),(0,d.extend)(et().prototype,"view",(function(t){var e=H(this.attrs.discussion.tags());if(e&&e.length){var n=e[0].color();n&&(t.attrs.style={"--hero-bg":n},t.attrs.className=N()(t.attrs.className,"DiscussionHero--colored",R()(n)))}})),(0,d.extend)(et().prototype,"items",(function(t){var e=this.attrs.discussion.tags();e&&e.length&&t.add("tags",nt(e,{link:!0}),5)}))}const at=flarum.core.compat["forum/utils/DiscussionControls"];var ot=n.n(at);const st=flarum.core.compat["common/components/Button"];var it=n.n(st);const ct=flarum.core.compat["forum/components/DiscussionPage"];var lt=n.n(ct);const ut=flarum.core.compat["common/utils/extractText"];var mt=n.n(ut);function dt(t){var e=app.store.all("tags");return t?e.filter((function(e){return e.canAddToDiscussion()||-1!==t.tags().indexOf(e)})):e.filter((function(t){return t.canStartDiscussion()}))}const ft=flarum.core.compat["common/helpers/highlight"];var pt=n.n(ft);const ht=flarum.core.compat["common/utils/KeyboardNavigatable"];var gt=n.n(ht);const vt=flarum.core.compat["common/components/Modal"];var yt=n.n(vt);const bt=flarum.core.compat["common/utils/Stream"];var Tt=n.n(bt),xt=["className","isToggled"],wt=function(t){function e(){return t.apply(this,arguments)||this}return T(e,t),e.prototype.view=function(t){var e=this.attrs,n=e.className,r=e.isToggled,a=function(t,e){if(null==t)return{};var n,r,a={},o=Object.keys(t);for(r=0;r=0||(a[n]=t[n]);return a}(e,xt),o=r?"far fa-check-circle":"far fa-circle";return m(it(),Object.assign({},a,{icon:o,className:N()([n,r&&"Button--toggled"])}),t.children)},e}(J()),_t=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),a=0;at.max.primary)throw new Error("The minimum number of primary tags allowed cannot be more than the maximum number of primary tags allowed.");if(t.min.secondary>t.max.secondary)throw new Error("The minimum number of secondary tags allowed cannot be more than the maximum number of secondary tags allowed.");if(t.min.total>t.max.primary+t.max.secondary)throw new Error("The minimum number of tags allowed cannot be more than the maximum number of primary and secondary tags allowed together.");if(t.max.totalt.max.total)throw new Error("The minimum number of tags allowed cannot be more than the maximum number of tags allowed.")}(e.limits)};var n=e.prototype;return n.oninit=function(e){var n=this;t.prototype.oninit.call(this,e),this.navigator.onUp((function(){return n.setIndex(n.getCurrentNumericIndex()-1,!0)})).onDown((function(){return n.setIndex(n.getCurrentNumericIndex()+1,!0)})).onSelect(this.select.bind(this)).onRemove((function(){return n.selected.splice(n.selected.length-1,1)})),l().tagList.load(["parent"]).then((function(t){n.loading=!1,n.attrs.selectableTags&&(t=n.attrs.selectableTags(t)),n.tags=H(t),n.attrs.selectedTags&&n.attrs.selectedTags.map(n.addTag.bind(n)),n.indexTag=t[0],m.redraw()}))},n.className=function(){return N()("TagSelectionModal",this.attrs.className)},n.title=function(){return this.attrs.title},n.content=function(){var t=this;if(this.loading||!this.tags)return m(k(),null);var e=this.filter().toLowerCase(),n=this.primaryCount(),r=this.secondaryCount(),a=this.getFilteredTags(),o=Math.max(mt()(this.getInstruction(n,r)).length,this.filter().length);return[m("div",{className:"Modal-body"},m("div",{className:"TagSelectionModal-form"},m("div",{className:"TagSelectionModal-form-input"},m("div",{className:"TagsInput FormControl "+(this.focused?"focus":""),onclick:function(){return t.$(".TagsInput input").focus()}},m("span",{className:"TagsInput-selected"},this.selected.map((function(e){return m("span",{className:"TagsInput-tag",onclick:function(){t.removeTag(e),t.onready()}},B(e))}))),m("input",{className:"FormControl",placeholder:mt()(this.getInstruction(n,r)),bidi:this.filter,style:{width:o+"ch"},onkeydown:this.navigator.navigate.bind(this.navigator),onfocus:function(){return t.focused=!0},onblur:function(){return t.focused=!1}}))),m("div",{className:"TagSelectionModal-form-submit App-primaryControl"},m(it(),{type:"submit",className:"Button Button--primary",disabled:!this.meetsRequirements(n,r),icon:"fas fa-check"},l().translator.trans("flarum-tags.lib.tag_selection_modal.submit_button"))))),m("div",{className:"Modal-footer"},m("ul",{className:"TagSelectionModal-list SelectTagList"},a.map((function(n){return m("li",{"data-index":n.id(),className:N()({pinned:null!==n.position(),child:!!n.parent(),colored:!!n.color(),selected:t.selected.includes(n),active:t.indexTag===n}),style:{color:n.color()},onmouseover:function(){return t.indexTag=n},onclick:t.toggleTag.bind(t,n)},L(n),m("span",{className:"SelectTagListItem-name"},pt()(n.name(),e)),n.description()?m("span",{className:"SelectTagListItem-description"},n.description()):"")}))),this.attrs.limits.allowBypassing&&m("div",{className:"TagSelectionModal-controls"},m(wt,{className:"Button",onclick:function(){return t.bypassReqs=!t.bypassReqs},isToggled:this.bypassReqs},l().translator.trans("flarum-tags.lib.tag_selection_modal.bypass_requirements"))))]},n.getFilteredTags=function(){var t=this,e=this.filter().toLowerCase(),n=this.primaryCount(),r=this.secondaryCount(),a=this.tags;return this.attrs.requireParentTag&&(a=a.filter((function(e){var n=e.parent();return null!==n&&(!1===n||t.selected.includes(n))}))),this.bypassReqs||(this.selected.length>=this.attrs.limits.max.total?a=a.filter((function(e){return t.selected.includes(e)})):(n>=this.attrs.limits.max.primary&&(a=a.filter((function(e){return!e.isPrimary()||t.selected.includes(e)}))),r>=this.attrs.limits.max.secondary&&(a=a.filter((function(e){return e.isPrimary()||t.selected.includes(e)}))))),e&&(a=a.filter((function(t){return t.name().substring(0,e.length).toLowerCase()===e}))),this.indexTag&&a.includes(this.indexTag)||(this.indexTag=a[0]),a},n.primaryCount=function(){return this.selected.filter((function(t){return t.isPrimary()})).length},n.secondaryCount=function(){return this.selected.filter((function(t){return!t.isPrimary()})).length},n.meetsRequirements=function(t,e){return!!(this.bypassReqs||this.attrs.allowResetting&&0===this.selected.length)||!(this.selected.length=this.attrs.limits.min.primary&&e>=this.attrs.limits.min.secondary},n.addTag=function(t){if(t&&this.attrs.canSelect(t)){if(this.attrs.onSelect&&this.attrs.onSelect(t,this.selected),this.attrs.requireParentTag){var e=t.parent();e&&!this.selected.includes(e)&&this.selected.push(e)}this.selected.includes(t)||this.selected.push(t)}},n.removeTag=function(t){var e=this.selected.indexOf(t);-1!==e&&(this.selected.splice(e,1),this.attrs.requireParentTag&&this.selected.filter((function(e){return e.parent()===t})).forEach(this.removeTag.bind(this)),this.attrs.onDeselect&&this.attrs.onDeselect(t,this.selected))},n.toggleTag=function(t){this.tags&&(this.selected.includes(t)?this.removeTag(t):this.addTag(t),this.filter()&&(this.filter(""),this.indexTag=this.tags[0]),this.onready())},n.getInstruction=function(t,e){if(this.bypassReqs)return"";if(t li")},n.getCurrentNumericIndex=function(){return this.indexTag?this.selectableItems().index(this.getItem(this.indexTag)):-1},n.getItem=function(t){return this.selectableItems().filter('[data-index="'+t.id()+'"]')},n.setIndex=function(t,e){var n=this.selectableItems(),r=n.parent();t<0?t=n.length-1:t>=n.length&&(t=0);var a=n.eq(t);if(this.indexTag=l().store.getById("tags",a.attr("data-index")),m.redraw(),e&&this.indexTag){var o,s=r.scrollTop(),i=r.offset().top,c=i+r.outerHeight(),u=a.offset().top,d=u+a.outerHeight();uc&&(o=s-c+d+parseInt(r.css("padding-bottom"),10)),void 0!==o&&r.stop(!0).animate({scrollTop:o},100)}},e}(yt()),Nt=function(t){function e(){return t.apply(this,arguments)||this}return T(e,t),e.initAttrs=function(e){var n;t.initAttrs.call(this,e);var r=e.discussion?a().translator.trans("flarum-tags.forum.choose_tags.edit_title",{title:m("em",null,e.discussion.title())}):a().translator.trans("flarum-tags.forum.choose_tags.title");e.className=N()(e.className,"TagDiscussionModal"),e.title=mt()(r),e.allowResetting=!!a().forum.attribute("canBypassTagCounts"),e.limits={allowBypassing:e.allowResetting,max:{primary:a().forum.attribute("minPrimaryTags"),secondary:a().forum.attribute("maxSecondaryTags")},min:{primary:a().forum.attribute("maxPrimaryTags"),secondary:a().forum.attribute("minSecondaryTags")}},e.requireParentTag=!0,e.selectableTags=function(){return dt(e.discussion)},null!=e.selectedTags||(e.selectedTags=(null==(n=e.discussion)?void 0:n.tags())||[]),e.canSelect=function(t){return t.canStartDiscussion()};var o=e.onsubmit||null;e.onsubmit=function(t){var n=e.discussion;n&&n.save({relationships:{tags:t}}).then((function(){a().current.matches(lt())&&a().current.get("stream").update(),m.redraw()})),o&&o(t)}},e}(_t);function Lt(){(0,d.extend)(ot(),"moderationControls",(function(t,e){e.canTag()&&t.add("tags",m(it(),{icon:"fas fa-tag",onclick:function(){return app.modal.show(Nt,{discussion:e})}},app.translator.trans("flarum-tags.forum.discussion_controls.edit_tags_button")))}))}const St=flarum.core.compat["forum/components/DiscussionComposer"];var Pt=n.n(St);function It(){(0,d.extend)(p().prototype,"newDiscussionAction",(function(t){var e=this.currentTag();if(e){var n=e.parent(),r=n?[n,e]:[e];t.then((function(t){return t.fields.tags=r}))}else app.composer.fields.tags=[]})),(0,d.extend)(Pt().prototype,"oninit",(function(){app.tagList.load(["parent"]).then((function(){return m.redraw()}))})),Pt().prototype.chooseTags=function(){var t=this;dt().length&&app.modal.show(Nt,{selectedTags:(this.composer.fields.tags||[]).slice(0),onsubmit:function(e){t.composer.fields.tags=e,t.$("textarea").focus()}})},(0,d.extend)(Pt().prototype,"headerItems",(function(t){var e=this.composer.fields.tags||[],n=dt();t.add("tags",m("a",{className:N()(["DiscussionComposer-changeTags",!n.length&&"disabled"]),onclick:this.chooseTags.bind(this)},e.length?nt(e):m("span",{className:"TagLabel untagged"},app.translator.trans("flarum-tags.forum.composer_discussion.choose_tags_link"))),10)})),(0,d.override)(Pt().prototype,"onsubmit",(function(t){var e=this,n=this.composer.fields.tags||[],r=n.filter((function(t){return null!==t.position()&&!t.isChild()})),a=n.filter((function(t){return null===t.position()})),o=dt(),s=parseInt(app.forum.attribute("minPrimaryTags")),i=parseInt(app.forum.attribute("minSecondaryTags")),c=parseInt(app.forum.attribute("maxPrimaryTags")),l=parseInt(app.forum.attribute("maxSecondaryTags"));(!n.length&&0!==c&&0!==l||r.length{var r=n(75).default;function a(){"use strict";t.exports=a=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var e={},n=Object.prototype,o=n.hasOwnProperty,s=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},c=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function m(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{m({},"")}catch(t){m=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var a=e&&e.prototype instanceof h?e:h,o=Object.create(a.prototype),i=new I(r||[]);return s(o,"_invoke",{value:N(t,n,i)}),o}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var p={};function h(){}function g(){}function v(){}var y={};m(y,c,(function(){return this}));var b=Object.getPrototypeOf,T=b&&b(b(C([])));T&&T!==n&&o.call(T,c)&&(y=T);var x=v.prototype=h.prototype=Object.create(y);function w(t){["next","throw","return"].forEach((function(e){m(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function n(a,s,i,c){var l=f(t[a],t,s);if("throw"!==l.type){var u=l.arg,m=u.value;return m&&"object"==r(m)&&o.call(m,"__await")?e.resolve(m.__await).then((function(t){n("next",t,i,c)}),(function(t){n("throw",t,i,c)})):e.resolve(m).then((function(t){u.value=t,i(u)}),(function(t){return n("throw",t,i,c)}))}c(l.arg)}var a;s(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,a){n(t,r,e,a)}))}return a=a?a.then(o,o):o()}})}function N(t,e,n){var r="suspendedStart";return function(a,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw o;return{value:void 0,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var i=L(s,n);if(i){if(i===p)continue;return i}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=f(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function L(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,L(t,e),"throw"===e.method))return p;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var r=f(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,p;var a=r.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function C(t){if(t){var e=t[c];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n=0;--r){var a=this.tryEntries[r],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var i=o.call(a,"catchLoc"),c=o.call(a,"finallyLoc");if(i&&c){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),P(n),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;P(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:C(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports},75:t=>{function e(n){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},507:(t,e,n)=>{var r=n(440)();t.exports=r;try{regeneratorRuntime=r}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},e={};function n(r){var a=e[r];if(void 0!==a)return a.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{extend:()=>a.l});var t=n(810),e={};for(const n in t)"default"!==n&&(e[n]=()=>t[n]);n.d(r,e);var a=n(990)})(),module.exports=r})(); //# sourceMappingURL=forum.js.map \ No newline at end of file diff --git a/extensions/tags/js/dist/forum.js.map b/extensions/tags/js/dist/forum.js.map index 2d3808497..cc78f2276 100644 --- a/extensions/tags/js/dist/forum.js.map +++ b/extensions/tags/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"file":"forum.js","mappings":";qEAAA,MAAM,EAA+BA,OAAOC,KAAKC,OAAO,0BCAxD,SAASC,EAAmBC,EAAKC,EAASC,EAAQC,EAAOC,EAAQC,EAAKC,GACpE,IACE,IAAIC,EAAOP,EAAIK,GAAKC,GAChBE,EAAQD,EAAKC,KAInB,CAHE,MAAOC,GAEP,YADAP,EAAOO,EAET,CACIF,EAAKG,KACPT,EAAQO,GAERG,QAAQV,QAAQO,GAAOI,KAAKT,EAAOC,EAEvC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O,WAE7D+B,OAAOyS,eAAeL,EAAS,aAAc,CAAEnU,OAAO,GAAO","sources":["webpack://@flarum/tags/external root \"flarum.core.compat['forum/app']\"","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","webpack://@flarum/tags/external root \"flarum.core.compat['common/app']\"","webpack://@flarum/tags/./src/common/states/TagListState.ts","webpack://@flarum/tags/external root \"flarum.core.compat['common/extend']\"","webpack://@flarum/tags/external root \"flarum.core.compat['forum/components/IndexPage']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/components/Separator']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/components/LinkButton']\"","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/tags/external root \"flarum.core.compat['common/components/Link']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/utils/classList']\"","webpack://@flarum/tags/./src/common/helpers/tagIcon.js","webpack://@flarum/tags/./src/forum/components/TagLinkButton.js","webpack://@flarum/tags/external root \"flarum.core.compat['common/components/Page']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/helpers/listItems']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/helpers/humanTime']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/helpers/textContrastClass']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/utils/extract']\"","webpack://@flarum/tags/./src/common/helpers/tagLabel.js","webpack://@flarum/tags/./src/common/utils/sortTags.tsx","webpack://@flarum/tags/./src/forum/components/TagsPage.js","webpack://@flarum/tags/./src/forum/addTagList.js","webpack://@flarum/tags/external root \"flarum.core.compat['forum/states/DiscussionListState']\"","webpack://@flarum/tags/external root \"flarum.core.compat['forum/states/GlobalSearchState']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/Component']\"","webpack://@flarum/tags/./src/forum/components/TagHero.js","webpack://@flarum/tags/./src/forum/addTagFilter.tsx","webpack://@flarum/tags/external root \"flarum.core.compat['forum/components/DiscussionListItem']\"","webpack://@flarum/tags/external root \"flarum.core.compat['forum/components/DiscussionHero']\"","webpack://@flarum/tags/./src/common/helpers/tagsLabel.js","webpack://@flarum/tags/./src/forum/addTagLabels.js","webpack://@flarum/tags/external root \"flarum.core.compat['forum/utils/DiscussionControls']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/components/Button']\"","webpack://@flarum/tags/external root \"flarum.core.compat['forum/components/DiscussionPage']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/utils/extractText']\"","webpack://@flarum/tags/./src/forum/utils/getSelectableTags.js","webpack://@flarum/tags/external root \"flarum.core.compat['common/helpers/highlight']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/utils/KeyboardNavigatable']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@flarum/tags/./src/forum/components/ToggleButton.js","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","webpack://@flarum/tags/./src/common/components/TagSelectionModal.tsx","webpack://@flarum/tags/./src/forum/components/TagDiscussionModal.tsx","webpack://@flarum/tags/./src/forum/addTagControl.js","webpack://@flarum/tags/external root \"flarum.core.compat['forum/components/DiscussionComposer']\"","webpack://@flarum/tags/./src/forum/addTagComposer.js","webpack://@flarum/tags/external root \"flarum.core.compat['common/extenders']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/models/Discussion']\"","webpack://@flarum/tags/external root \"flarum.core.compat['forum/components/EventPost']\"","webpack://@flarum/tags/./src/forum/components/DiscussionTaggedPost.js","webpack://@flarum/tags/external root \"flarum.core.compat['common/utils/computed']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/Model']\"","webpack://@flarum/tags/./src/common/models/Tag.ts","webpack://@flarum/tags/./src/common/extend.ts","webpack://@flarum/tags/./src/forum/extend.ts","webpack://@flarum/tags/./src/common/compat.js","webpack://@flarum/tags/./src/forum/compat.js","webpack://@flarum/tags/external assign \"flarum.core\"","webpack://@flarum/tags/./src/forum/index.ts","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/regeneratorRuntime.js","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/typeof.js","webpack://@flarum/tags/../../../node_modules/@babel/runtime/regenerator/index.js","webpack://@flarum/tags/webpack/bootstrap","webpack://@flarum/tags/webpack/runtime/compat get default export","webpack://@flarum/tags/webpack/runtime/define property getters","webpack://@flarum/tags/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/tags/webpack/runtime/make namespace object"],"sourcesContent":["const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n _next(undefined);\n });\n };\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/app'];","import app from 'flarum/common/app';\nimport type Tag from '../../common/models/Tag';\n\nexport default class TagListState {\n loadedIncludes = new Set();\n\n async load(includes: string[] = []): Promise {\n const unloadedIncludes = includes.filter((include) => !this.loadedIncludes.has(include));\n\n if (unloadedIncludes.length === 0) {\n return Promise.resolve(app.store.all('tags'));\n }\n\n return app.store.find('tags', { include: unloadedIncludes.join(',') }).then((val) => {\n unloadedIncludes.forEach((include) => this.loadedIncludes.add(include));\n return val;\n });\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/IndexPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Separator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","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/Link'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/classList'];","import classList from 'flarum/common/utils/classList';\n\nexport default function tagIcon(tag, attrs = {}, settings = {}) {\n const hasIcon = tag && tag.icon();\n const { useColor = true } = settings;\n\n attrs.className = classList([attrs.className, 'icon', hasIcon ? tag.icon() : 'TagIcon']);\n\n if (tag && useColor) {\n attrs.style = attrs.style || {};\n attrs.style['--color'] = tag.color();\n\n if (hasIcon) {\n attrs.style.color = tag.color();\n }\n } else if (!tag) {\n attrs.className += ' untagged';\n }\n\n return hasIcon ? : ;\n}\n","import Link from 'flarum/common/components/Link';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport classList from 'flarum/common/utils/classList';\nimport tagIcon from '../../common/helpers/tagIcon';\n\nexport default class TagLinkButton extends LinkButton {\n view(vnode) {\n const tag = this.attrs.model;\n const active = this.constructor.isActive(this.attrs);\n const description = tag && tag.description();\n const className = classList(['TagLinkButton', 'hasIcon', this.attrs.className, tag.isChild() && 'child']);\n\n return (\n \n {tagIcon(tag, { className: 'Button-icon' })}\n {tag ? tag.name() : app.translator.trans('flarum-tags.forum.index.untagged_link')}\n \n );\n }\n\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n\n const tag = attrs.model;\n\n attrs.params.tags = tag ? tag.slug() : 'untagged';\n attrs.route = app.route('tag', attrs.params);\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Page'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/listItems'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/humanTime'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/textContrastClass'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extract'];","import extract from 'flarum/common/utils/extract';\nimport Link from 'flarum/common/components/Link';\nimport classList from 'flarum/common/utils/classList';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport tagIcon from './tagIcon';\n\nexport default function tagLabel(tag, attrs = {}) {\n attrs.style = attrs.style || {};\n attrs.className = 'TagLabel ' + (attrs.className || '');\n\n const link = extract(attrs, 'link');\n const tagText = tag ? tag.name() : app.translator.trans('flarum-tags.lib.deleted_tag_text');\n\n if (tag) {\n const color = tag.color();\n if (color) {\n attrs.style['--tag-bg'] = color;\n attrs.className = classList(attrs.className, 'colored', textContrastClass(color));\n }\n\n if (link) {\n attrs.title = tag.description() || '';\n attrs.href = app.route('tag', { tags: tag.slug() });\n }\n\n if (tag.isChild()) {\n attrs.className += ' TagLabel--child';\n }\n } else {\n attrs.className += ' untagged';\n }\n\n return m(\n link ? Link : 'span',\n attrs,\n \n {tag && tag.icon() && tagIcon(tag, {}, { useColor: false })} {tagText}\n \n );\n}\n","import Tag from '../models/Tag';\n\nexport default function sortTags(tags: Tag[]) {\n return tags.slice(0).sort((a, b) => {\n const aPos = a.position();\n const bPos = b.position();\n\n // If they're both secondary tags, sort them by their discussions count,\n // descending.\n if (aPos === null && bPos === null) return b.discussionCount() - a.discussionCount();\n\n // If just one is a secondary tag, then the primary tag should\n // come first.\n if (bPos === null) return -1;\n if (aPos === null) return 1;\n\n // If we've made it this far, we know they're both primary tags. So we'll\n // need to see if they have parents.\n const aParent = a.parent();\n const bParent = b.parent();\n\n // If they both have the same parent, then their positions are local,\n // so we can compare them directly.\n if (aParent === bParent) return aPos - bPos;\n // If they are both child tags, then we will compare the positions of their\n // parents.\n else if (aParent && bParent) return aParent.position()! - bParent.position()!;\n // If we are comparing a child tag with its parent, then we let the parent\n // come first. If we are comparing an unrelated parent/child, then we\n // compare both of the parents.\n else if (aParent) return aParent === b ? 1 : aParent.position()! - bPos;\n else if (bParent) return bParent === a ? -1 : aPos - bParent.position()!;\n\n return 0;\n });\n}\n","import Page from 'flarum/common/components/Page';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport Link from 'flarum/common/components/Link';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport listItems from 'flarum/common/helpers/listItems';\nimport humanTime from 'flarum/common/helpers/humanTime';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport classList from 'flarum/common/utils/classList';\n\nimport tagIcon from '../../common/helpers/tagIcon';\nimport tagLabel from '../../common/helpers/tagLabel';\nimport sortTags from '../../common/utils/sortTags';\n\nexport default class TagsPage extends Page {\n oninit(vnode) {\n super.oninit(vnode);\n\n app.history.push('tags', app.translator.trans('flarum-tags.forum.header.back_to_tags_tooltip'));\n\n this.tags = [];\n\n const preloaded = app.preloadedApiDocument();\n\n if (preloaded) {\n this.tags = sortTags(preloaded.filter((tag) => !tag.isChild()));\n return;\n }\n\n this.loading = true;\n\n app.tagList.load(['children', 'lastPostedDiscussion', 'parent']).then(() => {\n this.tags = sortTags(app.store.all('tags').filter((tag) => !tag.isChild()));\n\n this.loading = false;\n\n m.redraw();\n });\n }\n\n view() {\n if (this.loading) {\n return ;\n }\n\n const pinned = this.tags.filter((tag) => tag.position() !== null);\n const cloud = this.tags.filter((tag) => tag.position() === null);\n\n return (\n
\n {IndexPage.prototype.hero()}\n
\n \n\n
\n
    \n {pinned.map((tag) => {\n const lastPostedDiscussion = tag.lastPostedDiscussion();\n const children = sortTags(tag.children() || []);\n\n return (\n
  • \n \n {tag.icon() && tagIcon(tag, {}, { useColor: false })}\n

    {tag.name()}

    \n

    {tag.description()}

    \n {children ? (\n
    \n {children.map((child) => [{child.name()}, ' '])}\n
    \n ) : (\n ''\n )}\n \n {lastPostedDiscussion ? (\n \n {lastPostedDiscussion.title()}\n {humanTime(lastPostedDiscussion.lastPostedAt())}\n \n ) : (\n \n )}\n
  • \n );\n })}\n
\n\n {cloud.length ?
{cloud.map((tag) => [tagLabel(tag, { link: true }), ' '])}
: ''}\n
\n
\n
\n );\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n app.setTitle(app.translator.trans('flarum-tags.forum.all_tags.meta_title_text'));\n app.setTitleCount(0);\n }\n}\n","import { extend } from 'flarum/common/extend';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport Separator from 'flarum/common/components/Separator';\nimport LinkButton from 'flarum/common/components/LinkButton';\n\nimport TagLinkButton from './components/TagLinkButton';\nimport TagsPage from './components/TagsPage';\nimport sortTags from '../common/utils/sortTags';\n\nexport default function () {\n // Add a link to the tags page, as well as a list of all the tags,\n // to the index page's sidebar.\n extend(IndexPage.prototype, 'navItems', function (items) {\n items.add(\n 'tags',\n \n {app.translator.trans('flarum-tags.forum.index.tags_link')}\n ,\n -10\n );\n\n if (app.current.matches(TagsPage)) return;\n\n items.add('separator', Separator.component(), -12);\n\n const params = app.search.stickyParams();\n const tags = app.store.all('tags');\n const currentTag = this.currentTag();\n\n const addTag = (tag) => {\n let active = currentTag === tag;\n\n if (!active && currentTag) {\n active = currentTag.parent() === tag;\n }\n\n // tag.name() is passed here as children even though it isn't used directly\n // because when we need to get the active child in SelectDropdown, we need to\n // use its children to populate the dropdown. The problem here is that `view`\n // on TagLinkButton is only called AFTER SelectDropdown, so no children are available\n // for SelectDropdown to use at the time.\n items.add('tag' + tag.id(), TagLinkButton.component({ model: tag, params, active }, tag?.name()), -14);\n };\n\n sortTags(tags)\n .filter(\n (tag) => tag.position() !== null && (!tag.isChild() || (currentTag && (tag.parent() === currentTag || tag.parent() === currentTag.parent())))\n )\n .forEach(addTag);\n\n const more = tags.filter((tag) => tag.position() === null).sort((a, b) => b.discussionCount() - a.discussionCount());\n\n more.splice(0, 3).forEach(addTag);\n\n if (more.length) {\n items.add('moreTags', {app.translator.trans('flarum-tags.forum.index.more_link')}, -16);\n }\n });\n}\n","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['common/Component'];","import Component from 'flarum/common/Component';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport tagIcon from '../../common/helpers/tagIcon';\nimport classList from 'flarum/common/utils/classList';\n\nexport default class TagHero extends Component {\n view() {\n const tag = this.attrs.model;\n const color = tag.color();\n\n return (\n \n
\n
\n

\n {tag.icon() && tagIcon(tag, {}, { useColor: false })} {tag.name()}\n

\n
{tag.description()}
\n
\n
\n \n );\n }\n}\n","import app from 'flarum/forum/app';\nimport type Mithril from 'mithril';\nimport { extend, override } from 'flarum/common/extend';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport GlobalSearchState from 'flarum/forum/states/GlobalSearchState';\nimport classList from 'flarum/common/utils/classList';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\n\nimport TagHero from './components/TagHero';\nimport Tag from '../common/models/Tag';\nimport { ComponentAttrs } from 'flarum/common/Component';\n\nconst findTag = (slug: string) => app.store.all('tags').find((tag) => tag.slug().localeCompare(slug, undefined, { sensitivity: 'base' }) === 0);\n\nexport default function () {\n IndexPage.prototype.currentTag = function () {\n if (this.currentActiveTag) {\n return this.currentActiveTag;\n }\n\n const slug = app.search.params().tags;\n let tag = null;\n\n if (slug) {\n tag = findTag(slug);\n }\n\n if ((slug && !tag) || (tag && !tag.isChild() && !tag.children())) {\n if (this.currentTagLoading) {\n return;\n }\n\n this.currentTagLoading = true;\n\n // Unlike the backend, no need to fetch parent.children because if we're on\n // a child tag page, then either:\n // - We loaded in that child tag (and its siblings) in the API document\n // - We first navigated to the current tag's parent, which would have loaded in the current tag's siblings.\n app.store\n .find('tags', slug, { include: 'children,children.parent,parent,state' })\n .then(() => {\n this.currentActiveTag = findTag(slug);\n\n m.redraw();\n })\n .finally(() => {\n this.currentTagLoading = false;\n });\n }\n\n if (tag) {\n this.currentActiveTag = tag;\n return this.currentActiveTag;\n }\n\n return;\n };\n\n // If currently viewing a tag, insert a tag hero at the top of the view.\n override(IndexPage.prototype, 'hero', function (original) {\n const tag = this.currentTag();\n\n if (tag) return ;\n\n return original();\n });\n\n extend(IndexPage.prototype, 'view', function (vdom: Mithril.Vnode) {\n const tag = this.currentTag();\n\n if (tag) vdom.attrs.className += ' IndexPage--tag' + tag.id();\n });\n\n extend(IndexPage.prototype, 'setTitle', function () {\n const tag = this.currentTag();\n\n if (tag) {\n app.setTitle(tag.name());\n }\n });\n\n // If currently viewing a tag, restyle the 'new discussion' button to use\n // the tag's color, and disable if the user isn't allowed to edit.\n extend(IndexPage.prototype, 'sidebarItems', function (items) {\n const tag = this.currentTag();\n\n if (tag) {\n const color = tag.color();\n const canStartDiscussion = tag.canStartDiscussion() || !app.session.user;\n const newDiscussion = items.get('newDiscussion') as Mithril.Vnode;\n\n if (color) {\n newDiscussion.attrs.className = classList([newDiscussion.attrs.className, 'Button--tagColored', textContrastClass(color)]);\n newDiscussion.attrs.style = { '--color': color };\n }\n\n newDiscussion.attrs.disabled = !canStartDiscussion;\n newDiscussion.children = app.translator.trans(\n canStartDiscussion ? 'core.forum.index.start_discussion_button' : 'core.forum.index.cannot_start_discussion_button'\n );\n }\n });\n\n // Add a parameter for the global search state to pass on to the\n // DiscussionListState that will let us filter discussions by tag.\n extend(GlobalSearchState.prototype, 'params', function (params) {\n params.tags = m.route.param('tags');\n });\n\n // Translate that parameter into a gambit appended to the search query.\n extend(DiscussionListState.prototype, 'requestParams', function (this: DiscussionListState, params) {\n if (typeof params.include === 'string') {\n params.include = [params.include];\n } else {\n params.include?.push('tags', 'tags.parent');\n }\n\n if (this.params.tags) {\n const filter = params.filter ?? {};\n filter.tag = this.params.tags;\n // TODO: replace this with a more robust system.\n const q = filter.q;\n if (q) {\n filter.q = `${q} tag:${this.params.tags}`;\n }\n params.filter = filter;\n }\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionListItem'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionHero'];","import extract from 'flarum/common/utils/extract';\nimport tagLabel from './tagLabel';\nimport sortTags from '../utils/sortTags';\n\nexport default function tagsLabel(tags, attrs = {}) {\n const children = [];\n const link = extract(attrs, 'link');\n\n attrs.className = 'TagsLabel ' + (attrs.className || '');\n\n if (tags) {\n sortTags(tags).forEach((tag) => {\n if (tag || tags.length === 1) {\n children.push(tagLabel(tag, { link }));\n }\n });\n } else {\n children.push(tagLabel());\n }\n\n return {children};\n}\n","import { extend } from 'flarum/common/extend';\nimport DiscussionListItem from 'flarum/forum/components/DiscussionListItem';\nimport DiscussionHero from 'flarum/forum/components/DiscussionHero';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport classList from 'flarum/common/utils/classList';\n\nimport tagsLabel from '../common/helpers/tagsLabel';\nimport sortTags from '../common/utils/sortTags';\n\nexport default function () {\n // Add tag labels to each discussion in the discussion list.\n extend(DiscussionListItem.prototype, 'infoItems', function (items) {\n const tags = this.attrs.discussion.tags();\n\n if (tags && tags.length) {\n items.add('tags', tagsLabel(tags), 10);\n }\n });\n\n // Restyle a discussion's hero to use its first tag's color.\n extend(DiscussionHero.prototype, 'view', function (view) {\n const tags = sortTags(this.attrs.discussion.tags());\n\n if (tags && tags.length) {\n const color = tags[0].color();\n if (color) {\n view.attrs.style = { '--hero-bg': color };\n view.attrs.className = classList(view.attrs.className, 'DiscussionHero--colored', textContrastClass(color));\n }\n }\n });\n\n // Add a list of a discussion's tags to the discussion hero, displayed\n // before the title. Put the title on its own line.\n extend(DiscussionHero.prototype, 'items', function (items) {\n const tags = this.attrs.discussion.tags();\n\n if (tags && tags.length) {\n items.add('tags', tagsLabel(tags, { link: true }), 5);\n }\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/DiscussionControls'];","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['common/utils/extractText'];","export default function getSelectableTags(discussion) {\n let tags = app.store.all('tags');\n\n if (discussion) {\n tags = tags.filter((tag) => tag.canAddToDiscussion() || discussion.tags().indexOf(tag) !== -1);\n } else {\n tags = tags.filter((tag) => tag.canStartDiscussion());\n }\n\n return tags;\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/highlight'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/KeyboardNavigatable'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","import Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport classList from 'flarum/common/utils/classList';\n\n/**\n * @TODO move to core\n */\nexport default class ToggleButton extends Component {\n view(vnode) {\n const { className, isToggled, ...attrs } = this.attrs;\n const icon = isToggled ? 'far fa-check-circle' : 'far fa-circle';\n\n return (\n \n );\n }\n}\n","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}","import app from 'flarum/common/app';\nimport Button from 'flarum/common/components/Button';\nimport classList from 'flarum/common/utils/classList';\nimport extractText from 'flarum/common/utils/extractText';\nimport highlight from 'flarum/common/helpers/highlight';\nimport KeyboardNavigatable from 'flarum/common/utils/KeyboardNavigatable';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Modal from 'flarum/common/components/Modal';\nimport Stream from 'flarum/common/utils/Stream';\n\nimport sortTags from '../utils/sortTags';\nimport tagLabel from '../helpers/tagLabel';\nimport tagIcon from '../helpers/tagIcon';\nimport ToggleButton from '../../forum/components/ToggleButton';\n\nimport type Tag from '../models/Tag';\nimport type { IInternalModalAttrs } from 'flarum/common/components/Modal';\nimport type Mithril from 'mithril';\n\nexport interface ITagSelectionModalLimits {\n /** Whether to allow bypassing the limits set here. This will show a toggle button to bypass limits. */\n allowBypassing?: boolean;\n /** Maximum number of primary/secondary tags allowed. */\n max?: {\n total?: number;\n primary?: number;\n secondary?: number;\n };\n /** Minimum number of primary/secondary tags to be selected. */\n min?: {\n total?: number;\n primary?: number;\n secondary?: number;\n };\n}\n\nexport interface ITagSelectionModalAttrs extends IInternalModalAttrs {\n /** Custom modal className to use. */\n className?: string;\n /** Modal title, defaults to 'Choose Tags'. */\n title?: string;\n /** Initial tag selection value. */\n selectedTags?: Tag[];\n /** Limits set based on minimum and maximum number of primary/secondary tags that can be selected. */\n limits?: ITagSelectionModalLimits;\n /** Whether to allow resetting the value. Defaults to true. */\n allowResetting?: boolean;\n /** Whether to require the parent tag of a selected tag to be selected as well. */\n requireParentTag?: boolean;\n /** Filter tags that can be selected. */\n selectableTags?: (tags: Tag[]) => Tag[];\n /** Whether a tag can be selected. */\n canSelect: (tag: Tag) => boolean;\n /** Callback for when a tag is selected. */\n onSelect?: (tag: Tag, selected: Tag[]) => void;\n /** Callback for when a tag is deselected. */\n onDeselect?: (tag: Tag, selected: Tag[]) => void;\n /** Callback for when the selection is submitted. */\n onsubmit?: (selected: Tag[]) => void;\n}\n\nexport type ITagSelectionModalState = undefined;\n\nexport default class TagSelectionModal<\n CustomAttrs extends ITagSelectionModalAttrs = ITagSelectionModalAttrs,\n CustomState extends ITagSelectionModalState = ITagSelectionModalState\n> extends Modal {\n protected loading = true;\n protected tags!: Tag[];\n protected selected: Tag[] = [];\n protected bypassReqs: boolean = false;\n\n protected filter = Stream('');\n protected focused = false;\n protected navigator = new KeyboardNavigatable();\n protected indexTag?: Tag;\n\n static initAttrs(attrs: ITagSelectionModalAttrs) {\n super.initAttrs(attrs);\n\n // Default values for optional attributes.\n attrs.title ||= extractText(app.translator.trans('flarum-tags.lib.tag_selection_modal.title'));\n attrs.canSelect ||= () => true;\n attrs.allowResetting ??= true;\n attrs.limits = {\n min: {\n total: attrs.limits?.min?.total ?? -Infinity,\n primary: attrs.limits?.min?.primary ?? -Infinity,\n secondary: attrs.limits?.min?.secondary ?? -Infinity,\n },\n max: {\n total: attrs.limits?.max?.total ?? Infinity,\n primary: attrs.limits?.max?.primary ?? Infinity,\n secondary: attrs.limits?.max?.secondary ?? Infinity,\n },\n };\n\n // Prevent illogical limits from being provided.\n catchInvalidLimits(attrs.limits);\n }\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.navigator\n .onUp(() => this.setIndex(this.getCurrentNumericIndex() - 1, true))\n .onDown(() => this.setIndex(this.getCurrentNumericIndex() + 1, true))\n .onSelect(this.select.bind(this))\n .onRemove(() => this.selected.splice(this.selected.length - 1, 1));\n\n app.tagList.load(['parent']).then((tags) => {\n this.loading = false;\n\n if (this.attrs.selectableTags) {\n tags = this.attrs.selectableTags(tags);\n }\n\n this.tags = sortTags(tags);\n\n if (this.attrs.selectedTags) {\n this.attrs.selectedTags.map(this.addTag.bind(this));\n }\n\n this.indexTag = tags[0];\n\n m.redraw();\n });\n }\n\n className() {\n return classList('TagSelectionModal', this.attrs.className);\n }\n\n title() {\n return this.attrs.title;\n }\n\n content() {\n if (this.loading || !this.tags) {\n return ;\n }\n\n const filter = this.filter().toLowerCase();\n const primaryCount = this.primaryCount();\n const secondaryCount = this.secondaryCount();\n const tags = this.getFilteredTags();\n\n const inputWidth = Math.max(extractText(this.getInstruction(primaryCount, secondaryCount)).length, this.filter().length);\n\n return [\n
\n
\n
\n
this.$('.TagsInput input').focus()}>\n \n {this.selected.map((tag) => (\n {\n this.removeTag(tag);\n this.onready();\n }}\n >\n {tagLabel(tag)}\n \n ))}\n \n (this.focused = true)}\n onblur={() => (this.focused = false)}\n />\n
\n
\n
\n \n {app.translator.trans('flarum-tags.lib.tag_selection_modal.submit_button')}\n \n
\n
\n
,\n\n
\n
    \n {tags.map((tag) => (\n (this.indexTag = tag)}\n onclick={this.toggleTag.bind(this, tag)}\n >\n {tagIcon(tag)}\n {highlight(tag.name(), filter)}\n {tag.description() ? {tag.description()} : ''}\n \n ))}\n
\n {this.attrs.limits!.allowBypassing && (\n
\n (this.bypassReqs = !this.bypassReqs)} isToggled={this.bypassReqs}>\n {app.translator.trans('flarum-tags.lib.tag_selection_modal.bypass_requirements')}\n \n
\n )}\n
,\n ];\n }\n\n /**\n * Filters the available tags on every state change.\n */\n private getFilteredTags(): Tag[] {\n const filter = this.filter().toLowerCase();\n const primaryCount = this.primaryCount();\n const secondaryCount = this.secondaryCount();\n let tags = this.tags;\n\n if (this.attrs.requireParentTag) {\n // Filter out all child tags whose parents have not been selected. This\n // makes it impossible to select a child if its parent hasn't been selected.\n tags = tags.filter((tag) => {\n const parent = tag.parent();\n return parent !== null && (parent === false || this.selected.includes(parent));\n });\n }\n\n if (!this.bypassReqs) {\n // If we reached the total maximum number of tags, we can't select anymore.\n if (this.selected.length >= this.attrs.limits!.max!.total!) {\n tags = tags.filter((tag) => this.selected.includes(tag));\n }\n // If the number of selected primary/secondary tags is at the maximum, then\n // we'll filter out all other tags of that type.\n else {\n if (primaryCount >= this.attrs.limits!.max!.primary!) {\n tags = tags.filter((tag) => !tag.isPrimary() || this.selected.includes(tag));\n }\n if (secondaryCount >= this.attrs.limits!.max!.secondary!) {\n tags = tags.filter((tag) => tag.isPrimary() || this.selected.includes(tag));\n }\n }\n }\n\n // If the user has entered text in the filter input, then filter by tags\n // whose name matches what they've entered.\n if (filter) {\n tags = tags.filter((tag) => tag.name().substring(0, filter.length).toLowerCase() === filter);\n }\n\n if (!this.indexTag || !tags.includes(this.indexTag)) this.indexTag = tags[0];\n\n return tags;\n }\n\n /**\n * Counts the number of selected primary tags.\n */\n protected primaryCount(): number {\n return this.selected.filter((tag) => tag.isPrimary()).length;\n }\n\n /**\n * Counts the number of selected secondary tags.\n */\n protected secondaryCount(): number {\n return this.selected.filter((tag) => !tag.isPrimary()).length;\n }\n\n /**\n * Validates the number of selected primary/secondary tags against the set min max limits.\n */\n protected meetsRequirements(primaryCount: number, secondaryCount: number) {\n if (this.bypassReqs || (this.attrs.allowResetting && this.selected.length === 0)) {\n return true;\n }\n\n if (this.selected.length < this.attrs.limits!.min!.total!) {\n return false;\n }\n\n return primaryCount >= this.attrs.limits!.min!.primary! && secondaryCount >= this.attrs.limits!.min!.secondary!;\n }\n\n /**\n * Add the given tag to the list of selected tags.\n */\n protected addTag(tag: Tag | undefined) {\n if (!tag || !this.attrs.canSelect(tag)) return;\n\n if (this.attrs.onSelect) {\n this.attrs.onSelect(tag, this.selected);\n }\n\n // If this tag has a parent, we'll also need to add the parent tag to the\n // selected list if it's not already in there.\n if (this.attrs.requireParentTag) {\n const parent = tag.parent();\n if (parent && !this.selected.includes(parent)) {\n this.selected.push(parent);\n }\n }\n\n if (!this.selected.includes(tag)) {\n this.selected.push(tag);\n }\n }\n\n /**\n * Remove the given tag from the list of selected tags.\n */\n protected removeTag(tag: Tag) {\n const index = this.selected.indexOf(tag);\n\n if (index !== -1) {\n this.selected.splice(index, 1);\n\n // Look through the list of selected tags for any tags which have the tag\n // we just removed as their parent. We'll need to remove them too.\n if (this.attrs.requireParentTag) {\n this.selected.filter((t) => t.parent() === tag).forEach(this.removeTag.bind(this));\n }\n\n if (this.attrs.onDeselect) {\n this.attrs.onDeselect(tag, this.selected);\n }\n }\n }\n\n protected toggleTag(tag: Tag) {\n // Won't happen, needed for type safety.\n if (!this.tags) return;\n\n if (this.selected.includes(tag)) {\n this.removeTag(tag);\n } else {\n this.addTag(tag);\n }\n\n if (this.filter()) {\n this.filter('');\n this.indexTag = this.tags[0];\n }\n\n this.onready();\n }\n\n /**\n * Gives human text instructions based on the current number of selected tags and set limits.\n */\n protected getInstruction(primaryCount: number, secondaryCount: number) {\n if (this.bypassReqs) {\n return '';\n }\n\n if (primaryCount < this.attrs.limits!.min!.primary!) {\n const remaining = this.attrs.limits!.min!.primary! - primaryCount;\n return extractText(app.translator.trans('flarum-tags.lib.tag_selection_modal.choose_primary_placeholder', { count: remaining }));\n } else if (secondaryCount < this.attrs.limits!.min!.secondary!) {\n const remaining = this.attrs.limits!.min!.secondary! - secondaryCount;\n return extractText(app.translator.trans('flarum-tags.lib.tag_selection_modal.choose_secondary_placeholder', { count: remaining }));\n } else if (this.selected.length < this.attrs.limits!.min!.total!) {\n const remaining = this.attrs.limits!.min!.total! - this.selected.length;\n return extractText(app.translator.trans('flarum-tags.lib.tag_selection_modal.choose_tags_placeholder', { count: remaining }));\n }\n\n return '';\n }\n\n /**\n * Submit tag selection.\n */\n onsubmit(e: SubmitEvent) {\n e.preventDefault();\n\n if (this.attrs.onsubmit) this.attrs.onsubmit(this.selected);\n\n this.hide();\n }\n\n protected select(e: KeyboardEvent) {\n // Ctrl + Enter submits the selection, just Enter completes the current entry\n if (e.metaKey || e.ctrlKey || (this.indexTag && this.selected.includes(this.indexTag))) {\n if (this.selected.length) {\n // The DOM submit method doesn't emit a `submit event, so we\n // simulate a manual submission so our `onsubmit` logic is run.\n this.$('button[type=\"submit\"]').click();\n }\n } else if (this.indexTag) {\n this.getItem(this.indexTag)[0].dispatchEvent(new Event('click'));\n }\n }\n\n protected selectableItems() {\n return this.$('.TagSelectionModal-list > li');\n }\n\n protected getCurrentNumericIndex() {\n if (!this.indexTag) return -1;\n\n return this.selectableItems().index(this.getItem(this.indexTag));\n }\n\n protected getItem(selectedTag: Tag) {\n return this.selectableItems().filter(`[data-index=\"${selectedTag.id()}\"]`);\n }\n\n protected setIndex(index: number, scrollToItem: boolean) {\n const $items = this.selectableItems();\n const $dropdown = $items.parent();\n\n if (index < 0) {\n index = $items.length - 1;\n } else if (index >= $items.length) {\n index = 0;\n }\n\n const $item = $items.eq(index);\n\n this.indexTag = app.store.getById('tags', $item.attr('data-index')!);\n\n m.redraw();\n\n if (scrollToItem && this.indexTag) {\n const dropdownScroll = $dropdown.scrollTop()!;\n const dropdownTop = $dropdown.offset()!.top;\n const dropdownBottom = dropdownTop + $dropdown.outerHeight()!;\n const itemTop = $item.offset()!.top;\n const itemBottom = itemTop + $item.outerHeight()!;\n\n let scrollTop;\n if (itemTop < dropdownTop) {\n scrollTop = dropdownScroll - dropdownTop + itemTop - parseInt($dropdown.css('padding-top'), 10);\n } else if (itemBottom > dropdownBottom) {\n scrollTop = dropdownScroll - dropdownBottom + itemBottom + parseInt($dropdown.css('padding-bottom'), 10);\n }\n\n if (typeof scrollTop !== 'undefined') {\n $dropdown.stop(true).animate({ scrollTop }, 100);\n }\n }\n }\n}\n\n/**\n * Catch invalid limits provided to the tag selection modal.\n */\nfunction catchInvalidLimits(limits: ITagSelectionModalLimits) {\n if (limits.min!.primary! > limits.max!.primary!) {\n throw new Error('The minimum number of primary tags allowed cannot be more than the maximum number of primary tags allowed.');\n }\n\n if (limits.min!.secondary! > limits.max!.secondary!) {\n throw new Error('The minimum number of secondary tags allowed cannot be more than the maximum number of secondary tags allowed.');\n }\n\n if (limits.min!.total! > limits.max!.primary! + limits.max!.secondary!) {\n throw new Error('The minimum number of tags allowed cannot be more than the maximum number of primary and secondary tags allowed together.');\n }\n\n if (limits.max!.total! < limits.min!.primary! + limits.min!.secondary!) {\n throw new Error('The maximum number of tags allowed cannot be less than the minimum number of primary and secondary tags allowed together.');\n }\n\n if (limits.min!.total! > limits.max!.total!) {\n throw new Error('The minimum number of tags allowed cannot be more than the maximum number of tags allowed.');\n }\n}\n","import app from 'flarum/forum/app';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport classList from 'flarum/common/utils/classList';\nimport extractText from 'flarum/common/utils/extractText';\n\nimport getSelectableTags from '../utils/getSelectableTags';\nimport TagSelectionModal, { ITagSelectionModalAttrs } from '../../common/components/TagSelectionModal';\n\nimport type Discussion from 'flarum/common/models/Discussion';\nimport type Tag from '../../common/models/Tag';\n\nexport interface TagDiscussionModalAttrs extends ITagSelectionModalAttrs {\n discussion?: Discussion;\n}\n\nexport default class TagDiscussionModal extends TagSelectionModal {\n static initAttrs(attrs: TagDiscussionModalAttrs) {\n super.initAttrs(attrs);\n\n const title = attrs.discussion\n ? app.translator.trans('flarum-tags.forum.choose_tags.edit_title', { title: {attrs.discussion.title()} })\n : app.translator.trans('flarum-tags.forum.choose_tags.title');\n\n attrs.className = classList(attrs.className, 'TagDiscussionModal');\n attrs.title = extractText(title);\n attrs.allowResetting = !!app.forum.attribute('canBypassTagCounts');\n attrs.limits = {\n allowBypassing: attrs.allowResetting,\n max: {\n primary: app.forum.attribute('minPrimaryTags'),\n secondary: app.forum.attribute('maxSecondaryTags'),\n },\n min: {\n primary: app.forum.attribute('maxPrimaryTags'),\n secondary: app.forum.attribute('minSecondaryTags'),\n },\n };\n attrs.requireParentTag = true;\n attrs.selectableTags = () => getSelectableTags(attrs.discussion);\n attrs.selectedTags ??= (attrs.discussion?.tags() as Tag[]) || [];\n attrs.canSelect = (tag) => tag.canStartDiscussion();\n\n const suppliedOnsubmit = attrs.onsubmit || null;\n\n // Save changes.\n attrs.onsubmit = function (tags) {\n const discussion = attrs.discussion;\n\n if (discussion) {\n discussion.save({ relationships: { tags } }).then(() => {\n if (app.current.matches(DiscussionPage)) {\n app.current.get('stream').update();\n }\n\n m.redraw();\n });\n }\n\n if (suppliedOnsubmit) suppliedOnsubmit(tags);\n };\n }\n}\n","import { extend } from 'flarum/common/extend';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\nimport Button from 'flarum/common/components/Button';\n\nimport TagDiscussionModal from './components/TagDiscussionModal';\n\nexport default function () {\n // Add a control allowing the discussion to be moved to another category.\n extend(DiscussionControls, 'moderationControls', function (items, discussion) {\n if (discussion.canTag()) {\n items.add(\n 'tags',\n \n );\n }\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionComposer'];","import { extend, override } from 'flarum/common/extend';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport DiscussionComposer from 'flarum/forum/components/DiscussionComposer';\nimport classList from 'flarum/common/utils/classList';\n\nimport TagDiscussionModal from './components/TagDiscussionModal';\nimport tagsLabel from '../common/helpers/tagsLabel';\nimport getSelectableTags from './utils/getSelectableTags';\n\nexport default function () {\n extend(IndexPage.prototype, 'newDiscussionAction', function (promise) {\n // From `addTagFilter\n const tag = this.currentTag();\n\n if (tag) {\n const parent = tag.parent();\n const tags = parent ? [parent, tag] : [tag];\n promise.then((composer) => (composer.fields.tags = tags));\n } else {\n app.composer.fields.tags = [];\n }\n });\n\n extend(DiscussionComposer.prototype, 'oninit', function () {\n app.tagList.load(['parent']).then(() => m.redraw());\n });\n\n // Add tag-selection abilities to the discussion composer.\n DiscussionComposer.prototype.chooseTags = function () {\n const selectableTags = getSelectableTags();\n\n if (!selectableTags.length) return;\n\n app.modal.show(TagDiscussionModal, {\n selectedTags: (this.composer.fields.tags || []).slice(0),\n onsubmit: (tags) => {\n this.composer.fields.tags = tags;\n this.$('textarea').focus();\n },\n });\n };\n\n // Add a tag-selection menu to the discussion composer's header, after the\n // title.\n extend(DiscussionComposer.prototype, 'headerItems', function (items) {\n const tags = this.composer.fields.tags || [];\n const selectableTags = getSelectableTags();\n\n items.add(\n 'tags',\n \n {tags.length ? (\n tagsLabel(tags)\n ) : (\n {app.translator.trans('flarum-tags.forum.composer_discussion.choose_tags_link')}\n )}\n ,\n 10\n );\n });\n\n override(DiscussionComposer.prototype, 'onsubmit', function (original) {\n const chosenTags = this.composer.fields.tags || [];\n const chosenPrimaryTags = chosenTags.filter((tag) => tag.position() !== null && !tag.isChild());\n const chosenSecondaryTags = chosenTags.filter((tag) => tag.position() === null);\n const selectableTags = getSelectableTags();\n\n const minPrimaryTags = parseInt(app.forum.attribute('minPrimaryTags'));\n const minSecondaryTags = parseInt(app.forum.attribute('minSecondaryTags'));\n const maxPrimaryTags = parseInt(app.forum.attribute('maxPrimaryTags'));\n const maxSecondaryTags = parseInt(app.forum.attribute('maxSecondaryTags'));\n\n if (\n ((!chosenTags.length && maxPrimaryTags !== 0 && maxSecondaryTags !== 0) ||\n chosenPrimaryTags.length < minPrimaryTags ||\n chosenSecondaryTags.length < minSecondaryTags) &&\n selectableTags.length\n ) {\n app.modal.show(TagDiscussionModal, {\n selectedTags: chosenTags,\n onsubmit: (tags) => {\n this.composer.fields.tags = tags;\n original();\n },\n });\n } else {\n original();\n }\n });\n\n // Add the selected tags as data to submit to the server.\n extend(DiscussionComposer.prototype, 'data', function (data) {\n data.relationships = data.relationships || {};\n data.relationships.tags = this.composer.fields.tags;\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extenders'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Discussion'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/EventPost'];","import EventPost from 'flarum/forum/components/EventPost';\nimport tagsLabel from '../../common/helpers/tagsLabel';\n\nexport default class DiscussionTaggedPost extends EventPost {\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n\n const oldTags = attrs.post.content()[0];\n const newTags = attrs.post.content()[1];\n\n function diffTags(tags1, tags2) {\n return tags1.filter((tag) => tags2.indexOf(tag) === -1).map((id) => app.store.getById('tags', id));\n }\n\n attrs.tagsAdded = diffTags(newTags, oldTags);\n attrs.tagsRemoved = diffTags(oldTags, newTags);\n }\n\n icon() {\n return 'fas fa-tag';\n }\n\n descriptionKey() {\n if (this.attrs.tagsAdded.length) {\n if (this.attrs.tagsRemoved.length) {\n return 'flarum-tags.forum.post_stream.added_and_removed_tags_text';\n }\n\n return 'flarum-tags.forum.post_stream.added_tags_text';\n }\n\n return 'flarum-tags.forum.post_stream.removed_tags_text';\n }\n\n descriptionData() {\n const data = {};\n\n if (this.attrs.tagsAdded.length) {\n data.tagsAdded = app.translator.trans('flarum-tags.forum.post_stream.tags_text', {\n tags: tagsLabel(this.attrs.tagsAdded, { link: true }),\n count: this.attrs.tagsAdded.length,\n });\n }\n\n if (this.attrs.tagsRemoved.length) {\n data.tagsRemoved = app.translator.trans('flarum-tags.forum.post_stream.tags_text', {\n tags: tagsLabel(this.attrs.tagsRemoved, { link: true }),\n count: this.attrs.tagsRemoved.length,\n });\n }\n\n return data;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/computed'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","import computed from 'flarum/common/utils/computed';\nimport Model from 'flarum/common/Model';\nimport type Discussion from 'flarum/common/models/Discussion';\n\nexport default class Tag extends Model {\n name() {\n return Model.attribute('name').call(this);\n }\n slug() {\n return Model.attribute('slug').call(this);\n }\n description() {\n return Model.attribute('description').call(this);\n }\n\n color() {\n return Model.attribute('color').call(this);\n }\n backgroundUrl() {\n return Model.attribute('backgroundUrl').call(this);\n }\n backgroundMode() {\n return Model.attribute('backgroundMode').call(this);\n }\n icon() {\n return Model.attribute('icon').call(this);\n }\n\n position() {\n return Model.attribute('position').call(this);\n }\n parent() {\n return Model.hasOne('parent').call(this);\n }\n children() {\n return Model.hasMany('children').call(this);\n }\n defaultSort() {\n return Model.attribute('defaultSort').call(this);\n }\n isChild() {\n return Model.attribute('isChild').call(this);\n }\n isHidden() {\n return Model.attribute('isHidden').call(this);\n }\n\n discussionCount() {\n return Model.attribute('discussionCount').call(this);\n }\n lastPostedAt() {\n return Model.attribute('lastPostedAt', Model.transformDate).call(this);\n }\n lastPostedDiscussion() {\n return Model.hasOne('lastPostedDiscussion').call(this);\n }\n\n isRestricted() {\n return Model.attribute('isRestricted').call(this);\n }\n canStartDiscussion() {\n return Model.attribute('canStartDiscussion').call(this);\n }\n canAddToDiscussion() {\n return Model.attribute('canAddToDiscussion').call(this);\n }\n\n isPrimary() {\n return computed('position', 'parent', (position, parent) => position !== null && parent === false).call(this);\n }\n}\n","import Extend from 'flarum/common/extenders';\nimport Tag from './models/Tag';\n\nexport default [\n new Extend.Store() //\n .add('tags', Tag),\n];\n","import app from 'flarum/forum/app';\nimport Extend from 'flarum/common/extenders';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport Discussion from 'flarum/common/models/Discussion';\nimport DiscussionTaggedPost from './components/DiscussionTaggedPost';\nimport TagsPage from './components/TagsPage';\nimport Tag from '../common/models/Tag';\n\nimport commonExtend from '../common/extend';\n\nexport default [\n ...commonExtend,\n\n new Extend.Routes() //\n .add('tags', '/tags', TagsPage) //\n .add('tag', '/t/:tags', IndexPage) //\n .helper('tag', (tag) => app.route('tag', { tags: tag.slug() })),\n\n new Extend.PostTypes() //\n .add('discussionTagged', DiscussionTaggedPost),\n\n new Extend.Model(Discussion) //\n .hasMany('tags') //\n .attribute('canTag'),\n];\n","import sortTags from './utils/sortTags';\nimport Tag from './models/Tag';\nimport tagsLabel from './helpers/tagsLabel';\nimport tagIcon from './helpers/tagIcon';\nimport tagLabel from './helpers/tagLabel';\nimport TagSelectionModal from './components/TagSelectionModal';\nimport TagListState from './states/TagListState';\n\nexport default {\n 'tags/utils/sortTags': sortTags,\n 'tags/models/Tag': Tag,\n 'tags/helpers/tagsLabel': tagsLabel,\n 'tags/helpers/tagIcon': tagIcon,\n 'tags/helpers/tagLabel': tagLabel,\n 'tags/components/TagSelectionModal': TagSelectionModal,\n 'tags/states/TagListState': TagListState,\n};\n","import compat from '../common/compat';\n\nimport addTagFilter from './addTagFilter';\nimport addTagControl from './addTagControl';\nimport TagHero from './components/TagHero';\nimport TagDiscussionModal from './components/TagDiscussionModal';\nimport TagsPage from './components/TagsPage';\nimport DiscussionTaggedPost from './components/DiscussionTaggedPost';\nimport TagLinkButton from './components/TagLinkButton';\nimport addTagList from './addTagList';\nimport addTagLabels from './addTagLabels';\nimport addTagComposer from './addTagComposer';\nimport getSelectableTags from './utils/getSelectableTags';\n\nexport default Object.assign(compat, {\n 'tags/addTagFilter': addTagFilter,\n 'tags/addTagControl': addTagControl,\n 'tags/components/TagHero': TagHero,\n 'tags/components/TagDiscussionModal': TagDiscussionModal,\n 'tags/components/TagsPage': TagsPage,\n 'tags/components/DiscussionTaggedPost': DiscussionTaggedPost,\n 'tags/components/TagLinkButton': TagLinkButton,\n 'tags/addTagList': addTagList,\n 'tags/addTagLabels': addTagLabels,\n 'tags/addTagComposer': addTagComposer,\n 'tags/utils/getSelectableTags': getSelectableTags,\n});\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core;","import app from 'flarum/forum/app';\n\nimport TagListState from '../common/states/TagListState';\n\nimport addTagList from './addTagList';\nimport addTagFilter from './addTagFilter';\nimport addTagLabels from './addTagLabels';\nimport addTagControl from './addTagControl';\nimport addTagComposer from './addTagComposer';\n\nexport { default as extend } from './extend';\n\napp.initializers.add('flarum-tags', function () {\n app.tagList = new TagListState();\n\n addTagList();\n addTagFilter();\n addTagLabels();\n addTagControl();\n addTagComposer();\n});\n\n// Expose compat API\nimport tagsCompat from './compat';\nimport { compat } from '@flarum/core/forum';\n\nObject.assign(compat, tagsCompat);\n","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _regeneratorRuntime() {\n \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */\n module.exports = _regeneratorRuntime = function _regeneratorRuntime() {\n return exports;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n var exports = {},\n Op = Object.prototype,\n hasOwn = Op.hasOwnProperty,\n defineProperty = Object.defineProperty || function (obj, key, desc) {\n obj[key] = desc.value;\n },\n $Symbol = \"function\" == typeof Symbol ? Symbol : {},\n iteratorSymbol = $Symbol.iterator || \"@@iterator\",\n asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\",\n toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n function define(obj, key, value) {\n return Object.defineProperty(obj, key, {\n value: value,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), obj[key];\n }\n try {\n define({}, \"\");\n } catch (err) {\n define = function define(obj, key, value) {\n return obj[key] = value;\n };\n }\n function wrap(innerFn, outerFn, self, tryLocsList) {\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,\n generator = Object.create(protoGenerator.prototype),\n context = new Context(tryLocsList || []);\n return defineProperty(generator, \"_invoke\", {\n value: makeInvokeMethod(innerFn, self, context)\n }), generator;\n }\n function tryCatch(fn, obj, arg) {\n try {\n return {\n type: \"normal\",\n arg: fn.call(obj, arg)\n };\n } catch (err) {\n return {\n type: \"throw\",\n arg: err\n };\n }\n }\n exports.wrap = wrap;\n var ContinueSentinel = {};\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n var getProto = Object.getPrototypeOf,\n NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);\n var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n define(prototype, method, function (arg) {\n return this._invoke(method, arg);\n });\n });\n }\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (\"throw\" !== record.type) {\n var result = record.arg,\n value = result.value;\n return value && \"object\" == _typeof(value) && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) {\n invoke(\"next\", value, resolve, reject);\n }, function (err) {\n invoke(\"throw\", err, resolve, reject);\n }) : PromiseImpl.resolve(value).then(function (unwrapped) {\n result.value = unwrapped, resolve(result);\n }, function (error) {\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n reject(record.arg);\n }\n var previousPromise;\n defineProperty(this, \"_invoke\", {\n value: function value(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function (resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n }\n });\n }\n function makeInvokeMethod(innerFn, self, context) {\n var state = \"suspendedStart\";\n return function (method, arg) {\n if (\"executing\" === state) throw new Error(\"Generator is already running\");\n if (\"completed\" === state) {\n if (\"throw\" === method) throw arg;\n return doneResult();\n }\n for (context.method = method, context.arg = arg;;) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) {\n if (\"suspendedStart\" === state) throw state = \"completed\", context.arg;\n context.dispatchException(context.arg);\n } else \"return\" === context.method && context.abrupt(\"return\", context.arg);\n state = \"executing\";\n var record = tryCatch(innerFn, self, context);\n if (\"normal\" === record.type) {\n if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue;\n return {\n value: record.arg,\n done: context.done\n };\n }\n \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg);\n }\n };\n }\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (undefined === method) {\n if (context.delegate = null, \"throw\" === context.method) {\n if (delegate.iterator[\"return\"] && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method)) return ContinueSentinel;\n context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a 'throw' method\");\n }\n return ContinueSentinel;\n }\n var record = tryCatch(method, delegate.iterator, context.arg);\n if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel;\n var info = record.arg;\n return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel);\n }\n function pushTryEntry(locs) {\n var entry = {\n tryLoc: locs[0]\n };\n 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);\n }\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\", delete record.arg, entry.completion = record;\n }\n function Context(tryLocsList) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);\n }\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) return iteratorMethod.call(iterable);\n if (\"function\" == typeof iterable.next) return iterable;\n if (!isNaN(iterable.length)) {\n var i = -1,\n next = function next() {\n for (; ++i < iterable.length;) {\n if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;\n }\n return next.value = undefined, next.done = !0, next;\n };\n return next.next = next;\n }\n }\n return {\n next: doneResult\n };\n }\n function doneResult() {\n return {\n value: undefined,\n done: !0\n };\n }\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, \"constructor\", {\n value: GeneratorFunctionPrototype,\n configurable: !0\n }), defineProperty(GeneratorFunctionPrototype, \"constructor\", {\n value: GeneratorFunction,\n configurable: !0\n }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) {\n var ctor = \"function\" == typeof genFun && genFun.constructor;\n return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name));\n }, exports.mark = function (genFun) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun;\n }, exports.awrap = function (arg) {\n return {\n __await: arg\n };\n }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n void 0 === PromiseImpl && (PromiseImpl = Promise);\n var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);\n return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {\n return result.done ? result.value : iter.next();\n });\n }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () {\n return this;\n }), define(Gp, \"toString\", function () {\n return \"[object Generator]\";\n }), exports.keys = function (val) {\n var object = Object(val),\n keys = [];\n for (var key in object) {\n keys.push(key);\n }\n return keys.reverse(), function next() {\n for (; keys.length;) {\n var key = keys.pop();\n if (key in object) return next.value = key, next.done = !1, next;\n }\n return next.done = !0, next;\n };\n }, exports.values = values, Context.prototype = {\n constructor: Context,\n reset: function reset(skipTempReset) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) {\n \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);\n }\n },\n stop: function stop() {\n this.done = !0;\n var rootRecord = this.tryEntries[0].completion;\n if (\"throw\" === rootRecord.type) throw rootRecord.arg;\n return this.rval;\n },\n dispatchException: function dispatchException(exception) {\n if (this.done) throw exception;\n var context = this;\n function handle(loc, caught) {\n return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught;\n }\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i],\n record = entry.completion;\n if (\"root\" === entry.tryLoc) return handle(\"end\");\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\"),\n hasFinally = hasOwn.call(entry, \"finallyLoc\");\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);\n if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);\n } else {\n if (!hasFinally) throw new Error(\"try statement without catch or finally\");\n if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);\n var record = finallyEntry ? finallyEntry.completion : {};\n return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);\n },\n complete: function complete(record, afterLoc) {\n if (\"throw\" === record.type) throw record.arg;\n return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;\n },\n finish: function finish(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;\n }\n },\n \"catch\": function _catch(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (\"throw\" === record.type) {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n throw new Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(iterable, resultName, nextLoc) {\n return this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel;\n }\n }, exports;\n}\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(obj);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","// TODO(Babel 8): Remove this file.\n\nvar runtime = require(\"../helpers/regeneratorRuntime\")();\nmodule.exports = runtime;\n\n// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.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};"],"names":["flarum","core","compat","asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","TagListState","loadedIncludes","Set","load","fn","includes","unloadedIncludes","filter","include","has","length","app","join","val","forEach","add","self","this","args","arguments","apply","err","undefined","_setPrototypeOf","o","p","Object","setPrototypeOf","bind","__proto__","_inheritsLoose","subClass","superClass","prototype","create","constructor","tagIcon","tag","attrs","settings","hasIcon","icon","useColor","className","classList","style","color","TagLinkButton","view","vnode","model","description","isActive","isChild","href","route","title","name","translator","trans","initAttrs","params","tags","slug","LinkButton","tagLabel","link","extract","tagText","textContrastClass","m","Link","sortTags","slice","sort","a","b","aPos","position","bPos","discussionCount","aParent","parent","bParent","TagsPage","oninit","history","push","preloaded","preloadedApiDocument","loading","tagList","store","all","redraw","pinned","cloud","IndexPage","listItems","toArray","map","lastPostedDiscussion","children","colored","child","discussion","lastPostNumber","humanTime","lastPostedAt","oncreate","setTitle","setTitleCount","Page","extend","items","current","matches","Separator","search","stickyParams","currentTag","addTag","active","id","component","more","splice","TagHero","Component","findTag","find","localeCompare","sensitivity","currentActiveTag","currentTagLoading","override","original","vdom","canStartDiscussion","newDiscussion","get","disabled","GlobalSearchState","param","DiscussionListState","q","tagsLabel","DiscussionListItem","DiscussionHero","getSelectableTags","canAddToDiscussion","indexOf","ToggleButton","isToggled","source","excluded","i","target","sourceKeys","keys","TagSelectionModal","selected","bypassReqs","Stream","focused","navigator","KeyboardNavigatable","indexTag","extractText","canSelect","allowResetting","limits","min","total","primary","secondary","max","Infinity","Error","catchInvalidLimits","onUp","setIndex","getCurrentNumericIndex","onDown","onSelect","select","onRemove","selectableTags","selectedTags","content","toLowerCase","primaryCount","secondaryCount","getFilteredTags","inputWidth","Math","getInstruction","onclick","$","focus","removeTag","onready","placeholder","bidi","width","onkeydown","navigate","onfocus","onblur","type","meetsRequirements","onmouseover","toggleTag","highlight","allowBypassing","requireParentTag","isPrimary","substring","index","t","onDeselect","remaining","count","onsubmit","e","preventDefault","hide","metaKey","ctrlKey","click","getItem","dispatchEvent","Event","selectableItems","selectedTag","scrollToItem","$items","$dropdown","$item","eq","attr","scrollTop","dropdownScroll","dropdownTop","offset","top","dropdownBottom","outerHeight","itemTop","itemBottom","parseInt","css","stop","animate","Modal","TagDiscussionModal","suppliedOnsubmit","save","relationships","DiscussionPage","update","DiscussionControls","canTag","modal","show","promise","composer","fields","DiscussionComposer","chooseTags","chosenTags","chosenPrimaryTags","chosenSecondaryTags","minPrimaryTags","forum","attribute","minSecondaryTags","maxPrimaryTags","maxSecondaryTags","data","DiscussionTaggedPost","oldTags","post","newTags","diffTags","tags1","tags2","getById","tagsAdded","tagsRemoved","descriptionKey","descriptionData","EventPost","Tag","Model","call","backgroundUrl","backgroundMode","defaultSort","isHidden","isRestricted","computed","Extend","commonExtend","helper","Discussion","hasMany","assign","addTagFilter","addTagControl","addTagList","addTagLabels","addTagComposer","tagsCompat","_typeof","require","_regeneratorRuntime","module","exports","__esModule","Op","hasOwn","hasOwnProperty","defineProperty","obj","desc","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","enumerable","configurable","writable","wrap","innerFn","outerFn","tryLocsList","protoGenerator","Generator","generator","context","Context","makeInvokeMethod","tryCatch","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","method","_invoke","AsyncIterator","PromiseImpl","invoke","record","result","__await","unwrapped","previousPromise","callInvokeWithMethodAndArg","state","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","TypeError","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","doneResult","displayName","isGeneratorFunction","genFun","ctor","mark","awrap","async","iter","object","reverse","pop","skipTempReset","prev","charAt","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","runtime","regeneratorRuntime","accidentalStrictMode","globalThis","Function","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","n","getter","d","definition","prop","r"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.js","mappings":";qEAAA,MAAM,EAA+BA,OAAOC,KAAKC,OAAO,0BCAxD,SAASC,EAAmBC,EAAKC,EAASC,EAAQC,EAAOC,EAAQC,EAAKC,GACpE,IACE,IAAIC,EAAOP,EAAIK,G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AKkH,IAAU5Z,OAAOO,UAAUiS,eAAe3B,KAAK6B,EAAKkH,GCClFR,EAAoBS,EAAKzH,IACH,oBAAXS,QAA0BA,OAAOM,aAC1CnT,OAAOyS,eAAeL,EAASS,OAAOM,YAAa,CAAElV,MAAO,WAE7D+B,OAAOyS,eAAeL,EAAS,aAAc,CAAEnU,OAAO,GAAO","sources":["webpack://@flarum/tags/external root \"flarum.core.compat['forum/app']\"","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","webpack://@flarum/tags/external root \"flarum.core.compat['common/app']\"","webpack://@flarum/tags/./src/common/states/TagListState.ts","webpack://@flarum/tags/external root \"flarum.core.compat['common/extend']\"","webpack://@flarum/tags/external root \"flarum.core.compat['forum/components/IndexPage']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/components/Separator']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/components/LinkButton']\"","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/tags/external root \"flarum.core.compat['common/components/Link']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/utils/classList']\"","webpack://@flarum/tags/./src/common/helpers/tagIcon.js","webpack://@flarum/tags/./src/forum/components/TagLinkButton.js","webpack://@flarum/tags/external root \"flarum.core.compat['common/components/Page']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/helpers/listItems']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/helpers/humanTime']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/helpers/textContrastClass']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/utils/extract']\"","webpack://@flarum/tags/./src/common/helpers/tagLabel.js","webpack://@flarum/tags/./src/common/utils/sortTags.tsx","webpack://@flarum/tags/./src/forum/components/TagsPage.js","webpack://@flarum/tags/./src/forum/addTagList.js","webpack://@flarum/tags/external root \"flarum.core.compat['forum/states/DiscussionListState']\"","webpack://@flarum/tags/external root \"flarum.core.compat['forum/states/GlobalSearchState']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/Component']\"","webpack://@flarum/tags/./src/forum/components/TagHero.js","webpack://@flarum/tags/./src/forum/addTagFilter.tsx","webpack://@flarum/tags/external root \"flarum.core.compat['forum/components/DiscussionListItem']\"","webpack://@flarum/tags/external root \"flarum.core.compat['forum/components/DiscussionHero']\"","webpack://@flarum/tags/./src/common/helpers/tagsLabel.js","webpack://@flarum/tags/./src/forum/addTagLabels.js","webpack://@flarum/tags/external root \"flarum.core.compat['forum/utils/DiscussionControls']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/components/Button']\"","webpack://@flarum/tags/external root \"flarum.core.compat['forum/components/DiscussionPage']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/utils/extractText']\"","webpack://@flarum/tags/./src/forum/utils/getSelectableTags.js","webpack://@flarum/tags/external root \"flarum.core.compat['common/helpers/highlight']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/utils/KeyboardNavigatable']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@flarum/tags/./src/forum/components/ToggleButton.js","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","webpack://@flarum/tags/./src/common/components/TagSelectionModal.tsx","webpack://@flarum/tags/./src/forum/components/TagDiscussionModal.tsx","webpack://@flarum/tags/./src/forum/addTagControl.js","webpack://@flarum/tags/external root \"flarum.core.compat['forum/components/DiscussionComposer']\"","webpack://@flarum/tags/./src/forum/addTagComposer.js","webpack://@flarum/tags/external root \"flarum.core.compat['common/extenders']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/models/Discussion']\"","webpack://@flarum/tags/external root \"flarum.core.compat['forum/components/EventPost']\"","webpack://@flarum/tags/./src/forum/components/DiscussionTaggedPost.js","webpack://@flarum/tags/external root \"flarum.core.compat['common/utils/computed']\"","webpack://@flarum/tags/external root \"flarum.core.compat['common/Model']\"","webpack://@flarum/tags/./src/common/models/Tag.ts","webpack://@flarum/tags/./src/common/extend.ts","webpack://@flarum/tags/./src/forum/extend.ts","webpack://@flarum/tags/./src/common/compat.js","webpack://@flarum/tags/./src/forum/compat.js","webpack://@flarum/tags/external assign \"flarum.core\"","webpack://@flarum/tags/./src/forum/index.ts","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/regeneratorRuntime.js","webpack://@flarum/tags/../../../node_modules/@babel/runtime/helpers/typeof.js","webpack://@flarum/tags/../../../node_modules/@babel/runtime/regenerator/index.js","webpack://@flarum/tags/webpack/bootstrap","webpack://@flarum/tags/webpack/runtime/compat get default export","webpack://@flarum/tags/webpack/runtime/define property getters","webpack://@flarum/tags/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/tags/webpack/runtime/make namespace object"],"sourcesContent":["const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n _next(undefined);\n });\n };\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/app'];","import app from 'flarum/common/app';\nimport type Tag from '../../common/models/Tag';\n\nexport default class TagListState {\n loadedIncludes = new Set();\n\n async load(includes: string[] = []): Promise {\n const unloadedIncludes = includes.filter((include) => !this.loadedIncludes.has(include));\n\n if (unloadedIncludes.length === 0) {\n return Promise.resolve(app.store.all('tags'));\n }\n\n return app.store.find('tags', { include: unloadedIncludes.join(',') }).then((val) => {\n unloadedIncludes.forEach((include) => this.loadedIncludes.add(include));\n return val;\n });\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/IndexPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Separator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","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/Link'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/classList'];","import classList from 'flarum/common/utils/classList';\n\nexport default function tagIcon(tag, attrs = {}, settings = {}) {\n const hasIcon = tag && tag.icon();\n const { useColor = true } = settings;\n\n attrs.className = classList([attrs.className, 'icon', hasIcon ? tag.icon() : 'TagIcon']);\n\n if (tag && useColor) {\n attrs.style = attrs.style || {};\n attrs.style['--color'] = tag.color();\n\n if (hasIcon) {\n attrs.style.color = tag.color();\n }\n } else if (!tag) {\n attrs.className += ' untagged';\n }\n\n return hasIcon ? : ;\n}\n","import Link from 'flarum/common/components/Link';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport classList from 'flarum/common/utils/classList';\nimport tagIcon from '../../common/helpers/tagIcon';\n\nexport default class TagLinkButton extends LinkButton {\n view(vnode) {\n const tag = this.attrs.model;\n const active = this.constructor.isActive(this.attrs);\n const description = tag && tag.description();\n const className = classList(['TagLinkButton', 'hasIcon', this.attrs.className, tag.isChild() && 'child']);\n\n return (\n \n {tagIcon(tag, { className: 'Button-icon' })}\n {tag ? tag.name() : app.translator.trans('flarum-tags.forum.index.untagged_link')}\n \n );\n }\n\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n\n const tag = attrs.model;\n\n attrs.params.tags = tag ? tag.slug() : 'untagged';\n attrs.route = app.route('tag', attrs.params);\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Page'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/listItems'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/humanTime'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/textContrastClass'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extract'];","import extract from 'flarum/common/utils/extract';\nimport Link from 'flarum/common/components/Link';\nimport classList from 'flarum/common/utils/classList';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport tagIcon from './tagIcon';\n\nexport default function tagLabel(tag, attrs = {}) {\n attrs.style = attrs.style || {};\n attrs.className = 'TagLabel ' + (attrs.className || '');\n\n const link = extract(attrs, 'link');\n const tagText = tag ? tag.name() : app.translator.trans('flarum-tags.lib.deleted_tag_text');\n\n if (tag) {\n const color = tag.color();\n if (color) {\n attrs.style['--tag-bg'] = color;\n attrs.className = classList(attrs.className, 'colored', textContrastClass(color));\n }\n\n if (link) {\n attrs.title = tag.description() || '';\n attrs.href = app.route('tag', { tags: tag.slug() });\n }\n\n if (tag.isChild()) {\n attrs.className += ' TagLabel--child';\n }\n } else {\n attrs.className += ' untagged';\n }\n\n return m(\n link ? Link : 'span',\n attrs,\n \n {tag && tag.icon() && tagIcon(tag, {}, { useColor: false })} {tagText}\n \n );\n}\n","import Tag from '../models/Tag';\n\nexport default function sortTags(tags: Tag[]) {\n return tags.slice(0).sort((a, b) => {\n const aPos = a.position();\n const bPos = b.position();\n\n // If they're both secondary tags, sort them by their discussions count,\n // descending.\n if (aPos === null && bPos === null) return b.discussionCount() - a.discussionCount();\n\n // If just one is a secondary tag, then the primary tag should\n // come first.\n if (bPos === null) return -1;\n if (aPos === null) return 1;\n\n // If we've made it this far, we know they're both primary tags. So we'll\n // need to see if they have parents.\n const aParent = a.parent();\n const bParent = b.parent();\n\n // If they both have the same parent, then their positions are local,\n // so we can compare them directly.\n if (aParent === bParent) return aPos - bPos;\n // If they are both child tags, then we will compare the positions of their\n // parents.\n else if (aParent && bParent) return aParent.position()! - bParent.position()!;\n // If we are comparing a child tag with its parent, then we let the parent\n // come first. If we are comparing an unrelated parent/child, then we\n // compare both of the parents.\n else if (aParent) return aParent === b ? 1 : aParent.position()! - bPos;\n else if (bParent) return bParent === a ? -1 : aPos - bParent.position()!;\n\n return 0;\n });\n}\n","import Page from 'flarum/common/components/Page';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport Link from 'flarum/common/components/Link';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport listItems from 'flarum/common/helpers/listItems';\nimport humanTime from 'flarum/common/helpers/humanTime';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport classList from 'flarum/common/utils/classList';\n\nimport tagIcon from '../../common/helpers/tagIcon';\nimport tagLabel from '../../common/helpers/tagLabel';\nimport sortTags from '../../common/utils/sortTags';\n\nexport default class TagsPage extends Page {\n oninit(vnode) {\n super.oninit(vnode);\n\n app.history.push('tags', app.translator.trans('flarum-tags.forum.header.back_to_tags_tooltip'));\n\n this.tags = [];\n\n const preloaded = app.preloadedApiDocument();\n\n if (preloaded) {\n this.tags = sortTags(preloaded.filter((tag) => !tag.isChild()));\n return;\n }\n\n this.loading = true;\n\n app.tagList.load(['children', 'lastPostedDiscussion', 'parent']).then(() => {\n this.tags = sortTags(app.store.all('tags').filter((tag) => !tag.isChild()));\n\n this.loading = false;\n\n m.redraw();\n });\n }\n\n view() {\n if (this.loading) {\n return ;\n }\n\n const pinned = this.tags.filter((tag) => tag.position() !== null);\n const cloud = this.tags.filter((tag) => tag.position() === null);\n\n return (\n
\n {IndexPage.prototype.hero()}\n
\n \n\n
\n
    \n {pinned.map((tag) => {\n const lastPostedDiscussion = tag.lastPostedDiscussion();\n const children = sortTags(tag.children() || []);\n\n return (\n
  • \n \n {tag.icon() && tagIcon(tag, {}, { useColor: false })}\n

    {tag.name()}

    \n

    {tag.description()}

    \n {children ? (\n
    \n {children.map((child) => [{child.name()}, ' '])}\n
    \n ) : (\n ''\n )}\n \n {lastPostedDiscussion ? (\n \n {lastPostedDiscussion.title()}\n {humanTime(lastPostedDiscussion.lastPostedAt())}\n \n ) : (\n \n )}\n
  • \n );\n })}\n
\n\n {cloud.length ?
{cloud.map((tag) => [tagLabel(tag, { link: true }), ' '])}
: ''}\n
\n
\n
\n );\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n app.setTitle(app.translator.trans('flarum-tags.forum.all_tags.meta_title_text'));\n app.setTitleCount(0);\n }\n}\n","import { extend } from 'flarum/common/extend';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport Separator from 'flarum/common/components/Separator';\nimport LinkButton from 'flarum/common/components/LinkButton';\n\nimport TagLinkButton from './components/TagLinkButton';\nimport TagsPage from './components/TagsPage';\nimport sortTags from '../common/utils/sortTags';\n\nexport default function () {\n // Add a link to the tags page, as well as a list of all the tags,\n // to the index page's sidebar.\n extend(IndexPage.prototype, 'navItems', function (items) {\n items.add(\n 'tags',\n \n {app.translator.trans('flarum-tags.forum.index.tags_link')}\n ,\n -10\n );\n\n if (app.current.matches(TagsPage)) return;\n\n items.add('separator', Separator.component(), -12);\n\n const params = app.search.stickyParams();\n const tags = app.store.all('tags');\n const currentTag = this.currentTag();\n\n const addTag = (tag) => {\n let active = currentTag === tag;\n\n if (!active && currentTag) {\n active = currentTag.parent() === tag;\n }\n\n // tag.name() is passed here as children even though it isn't used directly\n // because when we need to get the active child in SelectDropdown, we need to\n // use its children to populate the dropdown. The problem here is that `view`\n // on TagLinkButton is only called AFTER SelectDropdown, so no children are available\n // for SelectDropdown to use at the time.\n items.add('tag' + tag.id(), TagLinkButton.component({ model: tag, params, active }, tag?.name()), -14);\n };\n\n sortTags(tags)\n .filter(\n (tag) => tag.position() !== null && (!tag.isChild() || (currentTag && (tag.parent() === currentTag || tag.parent() === currentTag.parent())))\n )\n .forEach(addTag);\n\n const more = tags.filter((tag) => tag.position() === null).sort((a, b) => b.discussionCount() - a.discussionCount());\n\n more.splice(0, 3).forEach(addTag);\n\n if (more.length) {\n items.add('moreTags', {app.translator.trans('flarum-tags.forum.index.more_link')}, -16);\n }\n });\n}\n","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['common/Component'];","import Component from 'flarum/common/Component';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport tagIcon from '../../common/helpers/tagIcon';\nimport classList from 'flarum/common/utils/classList';\n\nexport default class TagHero extends Component {\n view() {\n const tag = this.attrs.model;\n const color = tag.color();\n\n return (\n \n
\n
\n

\n {tag.icon() && tagIcon(tag, {}, { useColor: false })} {tag.name()}\n

\n
{tag.description()}
\n
\n
\n \n );\n }\n}\n","import app from 'flarum/forum/app';\nimport type Mithril from 'mithril';\nimport { extend, override } from 'flarum/common/extend';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport GlobalSearchState from 'flarum/forum/states/GlobalSearchState';\nimport classList from 'flarum/common/utils/classList';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\n\nimport TagHero from './components/TagHero';\nimport Tag from '../common/models/Tag';\nimport { ComponentAttrs } from 'flarum/common/Component';\n\nconst findTag = (slug: string) => app.store.all('tags').find((tag) => tag.slug().localeCompare(slug, undefined, { sensitivity: 'base' }) === 0);\n\nexport default function () {\n IndexPage.prototype.currentTag = function () {\n if (this.currentActiveTag) {\n return this.currentActiveTag;\n }\n\n const slug = app.search.params().tags;\n let tag = null;\n\n if (slug) {\n tag = findTag(slug);\n }\n\n if ((slug && !tag) || (tag && !tag.isChild() && !tag.children())) {\n if (this.currentTagLoading) {\n return;\n }\n\n this.currentTagLoading = true;\n\n // Unlike the backend, no need to fetch parent.children because if we're on\n // a child tag page, then either:\n // - We loaded in that child tag (and its siblings) in the API document\n // - We first navigated to the current tag's parent, which would have loaded in the current tag's siblings.\n app.store\n .find('tags', slug, { include: 'children,children.parent,parent,state' })\n .then(() => {\n this.currentActiveTag = findTag(slug);\n\n m.redraw();\n })\n .finally(() => {\n this.currentTagLoading = false;\n });\n }\n\n if (tag) {\n this.currentActiveTag = tag;\n return this.currentActiveTag;\n }\n\n return;\n };\n\n // If currently viewing a tag, insert a tag hero at the top of the view.\n override(IndexPage.prototype, 'hero', function (original) {\n const tag = this.currentTag();\n\n if (tag) return ;\n\n return original();\n });\n\n extend(IndexPage.prototype, 'view', function (vdom: Mithril.Vnode) {\n const tag = this.currentTag();\n\n if (tag) vdom.attrs.className += ' IndexPage--tag' + tag.id();\n });\n\n extend(IndexPage.prototype, 'setTitle', function () {\n const tag = this.currentTag();\n\n if (tag) {\n app.setTitle(tag.name());\n }\n });\n\n // If currently viewing a tag, restyle the 'new discussion' button to use\n // the tag's color, and disable if the user isn't allowed to edit.\n extend(IndexPage.prototype, 'sidebarItems', function (items) {\n const tag = this.currentTag();\n\n if (tag) {\n const color = tag.color();\n const canStartDiscussion = tag.canStartDiscussion() || !app.session.user;\n const newDiscussion = items.get('newDiscussion') as Mithril.Vnode;\n\n if (color) {\n newDiscussion.attrs.className = classList([newDiscussion.attrs.className, 'Button--tagColored', textContrastClass(color)]);\n newDiscussion.attrs.style = { '--color': color };\n }\n\n newDiscussion.attrs.disabled = !canStartDiscussion;\n newDiscussion.children = app.translator.trans(\n canStartDiscussion ? 'core.forum.index.start_discussion_button' : 'core.forum.index.cannot_start_discussion_button'\n );\n }\n });\n\n // Add a parameter for the global search state to pass on to the\n // DiscussionListState that will let us filter discussions by tag.\n extend(GlobalSearchState.prototype, 'params', function (params) {\n params.tags = m.route.param('tags');\n });\n\n // Translate that parameter into a gambit appended to the search query.\n extend(DiscussionListState.prototype, 'requestParams', function (this: DiscussionListState, params) {\n if (typeof params.include === 'string') {\n params.include = [params.include];\n } else {\n params.include?.push('tags', 'tags.parent');\n }\n\n if (this.params.tags) {\n const filter = params.filter ?? {};\n filter.tag = this.params.tags;\n // TODO: replace this with a more robust system.\n const q = filter.q;\n if (q) {\n filter.q = `${q} tag:${this.params.tags}`;\n }\n params.filter = filter;\n }\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionListItem'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionHero'];","import extract from 'flarum/common/utils/extract';\nimport tagLabel from './tagLabel';\nimport sortTags from '../utils/sortTags';\n\nexport default function tagsLabel(tags, attrs = {}) {\n const children = [];\n const link = extract(attrs, 'link');\n\n attrs.className = 'TagsLabel ' + (attrs.className || '');\n\n if (tags) {\n sortTags(tags).forEach((tag) => {\n if (tag || tags.length === 1) {\n children.push(tagLabel(tag, { link }));\n }\n });\n } else {\n children.push(tagLabel());\n }\n\n return {children};\n}\n","import { extend } from 'flarum/common/extend';\nimport DiscussionListItem from 'flarum/forum/components/DiscussionListItem';\nimport DiscussionHero from 'flarum/forum/components/DiscussionHero';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport classList from 'flarum/common/utils/classList';\n\nimport tagsLabel from '../common/helpers/tagsLabel';\nimport sortTags from '../common/utils/sortTags';\n\nexport default function () {\n // Add tag labels to each discussion in the discussion list.\n extend(DiscussionListItem.prototype, 'infoItems', function (items) {\n const tags = this.attrs.discussion.tags();\n\n if (tags && tags.length) {\n items.add('tags', tagsLabel(tags), 10);\n }\n });\n\n // Restyle a discussion's hero to use its first tag's color.\n extend(DiscussionHero.prototype, 'view', function (view) {\n const tags = sortTags(this.attrs.discussion.tags());\n\n if (tags && tags.length) {\n const color = tags[0].color();\n if (color) {\n view.attrs.style = { '--hero-bg': color };\n view.attrs.className = classList(view.attrs.className, 'DiscussionHero--colored', textContrastClass(color));\n }\n }\n });\n\n // Add a list of a discussion's tags to the discussion hero, displayed\n // before the title. Put the title on its own line.\n extend(DiscussionHero.prototype, 'items', function (items) {\n const tags = this.attrs.discussion.tags();\n\n if (tags && tags.length) {\n items.add('tags', tagsLabel(tags, { link: true }), 5);\n }\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/DiscussionControls'];","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['common/utils/extractText'];","export default function getSelectableTags(discussion) {\n let tags = app.store.all('tags');\n\n if (discussion) {\n tags = tags.filter((tag) => tag.canAddToDiscussion() || discussion.tags().indexOf(tag) !== -1);\n } else {\n tags = tags.filter((tag) => tag.canStartDiscussion());\n }\n\n return tags;\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/highlight'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/KeyboardNavigatable'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","import Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport classList from 'flarum/common/utils/classList';\n\n/**\n * @TODO move to core\n */\nexport default class ToggleButton extends Component {\n view(vnode) {\n const { className, isToggled, ...attrs } = this.attrs;\n const icon = isToggled ? 'far fa-check-circle' : 'far fa-circle';\n\n return (\n \n );\n }\n}\n","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}","import app from 'flarum/common/app';\nimport Button from 'flarum/common/components/Button';\nimport classList from 'flarum/common/utils/classList';\nimport extractText from 'flarum/common/utils/extractText';\nimport highlight from 'flarum/common/helpers/highlight';\nimport KeyboardNavigatable from 'flarum/common/utils/KeyboardNavigatable';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Modal from 'flarum/common/components/Modal';\nimport Stream from 'flarum/common/utils/Stream';\n\nimport sortTags from '../utils/sortTags';\nimport tagLabel from '../helpers/tagLabel';\nimport tagIcon from '../helpers/tagIcon';\nimport ToggleButton from '../../forum/components/ToggleButton';\n\nimport type Tag from '../models/Tag';\nimport type { IInternalModalAttrs } from 'flarum/common/components/Modal';\nimport type Mithril from 'mithril';\n\nexport interface ITagSelectionModalLimits {\n /** Whether to allow bypassing the limits set here. This will show a toggle button to bypass limits. */\n allowBypassing?: boolean;\n /** Maximum number of primary/secondary tags allowed. */\n max?: {\n total?: number;\n primary?: number;\n secondary?: number;\n };\n /** Minimum number of primary/secondary tags to be selected. */\n min?: {\n total?: number;\n primary?: number;\n secondary?: number;\n };\n}\n\nexport interface ITagSelectionModalAttrs extends IInternalModalAttrs {\n /** Custom modal className to use. */\n className?: string;\n /** Modal title, defaults to 'Choose Tags'. */\n title?: string;\n /** Initial tag selection value. */\n selectedTags?: Tag[];\n /** Limits set based on minimum and maximum number of primary/secondary tags that can be selected. */\n limits?: ITagSelectionModalLimits;\n /** Whether to allow resetting the value. Defaults to true. */\n allowResetting?: boolean;\n /** Whether to require the parent tag of a selected tag to be selected as well. */\n requireParentTag?: boolean;\n /** Filter tags that can be selected. */\n selectableTags?: (tags: Tag[]) => Tag[];\n /** Whether a tag can be selected. */\n canSelect: (tag: Tag) => boolean;\n /** Callback for when a tag is selected. */\n onSelect?: (tag: Tag, selected: Tag[]) => void;\n /** Callback for when a tag is deselected. */\n onDeselect?: (tag: Tag, selected: Tag[]) => void;\n /** Callback for when the selection is submitted. */\n onsubmit?: (selected: Tag[]) => void;\n}\n\nexport type ITagSelectionModalState = undefined;\n\nexport default class TagSelectionModal<\n CustomAttrs extends ITagSelectionModalAttrs = ITagSelectionModalAttrs,\n CustomState extends ITagSelectionModalState = ITagSelectionModalState\n> extends Modal {\n protected loading = true;\n protected tags!: Tag[];\n protected selected: Tag[] = [];\n protected bypassReqs: boolean = false;\n\n protected filter = Stream('');\n protected focused = false;\n protected navigator = new KeyboardNavigatable();\n protected indexTag?: Tag;\n\n static initAttrs(attrs: ITagSelectionModalAttrs) {\n super.initAttrs(attrs);\n\n // Default values for optional attributes.\n attrs.title ||= extractText(app.translator.trans('flarum-tags.lib.tag_selection_modal.title'));\n attrs.canSelect ||= () => true;\n attrs.allowResetting ??= true;\n attrs.limits = {\n min: {\n total: attrs.limits?.min?.total ?? -Infinity,\n primary: attrs.limits?.min?.primary ?? -Infinity,\n secondary: attrs.limits?.min?.secondary ?? -Infinity,\n },\n max: {\n total: attrs.limits?.max?.total ?? Infinity,\n primary: attrs.limits?.max?.primary ?? Infinity,\n secondary: attrs.limits?.max?.secondary ?? Infinity,\n },\n };\n\n // Prevent illogical limits from being provided.\n catchInvalidLimits(attrs.limits);\n }\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.navigator\n .onUp(() => this.setIndex(this.getCurrentNumericIndex() - 1, true))\n .onDown(() => this.setIndex(this.getCurrentNumericIndex() + 1, true))\n .onSelect(this.select.bind(this))\n .onRemove(() => this.selected.splice(this.selected.length - 1, 1));\n\n app.tagList.load(['parent']).then((tags) => {\n this.loading = false;\n\n if (this.attrs.selectableTags) {\n tags = this.attrs.selectableTags(tags);\n }\n\n this.tags = sortTags(tags);\n\n if (this.attrs.selectedTags) {\n this.attrs.selectedTags.map(this.addTag.bind(this));\n }\n\n this.indexTag = tags[0];\n\n m.redraw();\n });\n }\n\n className() {\n return classList('TagSelectionModal', this.attrs.className);\n }\n\n title() {\n return this.attrs.title;\n }\n\n content() {\n if (this.loading || !this.tags) {\n return ;\n }\n\n const filter = this.filter().toLowerCase();\n const primaryCount = this.primaryCount();\n const secondaryCount = this.secondaryCount();\n const tags = this.getFilteredTags();\n\n const inputWidth = Math.max(extractText(this.getInstruction(primaryCount, secondaryCount)).length, this.filter().length);\n\n return [\n
\n
\n
\n
this.$('.TagsInput input').focus()}>\n \n {this.selected.map((tag) => (\n {\n this.removeTag(tag);\n this.onready();\n }}\n >\n {tagLabel(tag)}\n \n ))}\n \n (this.focused = true)}\n onblur={() => (this.focused = false)}\n />\n
\n
\n
\n \n {app.translator.trans('flarum-tags.lib.tag_selection_modal.submit_button')}\n \n
\n
\n
,\n\n
\n
    \n {tags.map((tag) => (\n (this.indexTag = tag)}\n onclick={this.toggleTag.bind(this, tag)}\n >\n {tagIcon(tag)}\n {highlight(tag.name(), filter)}\n {tag.description() ? {tag.description()} : ''}\n \n ))}\n
\n {this.attrs.limits!.allowBypassing && (\n
\n (this.bypassReqs = !this.bypassReqs)} isToggled={this.bypassReqs}>\n {app.translator.trans('flarum-tags.lib.tag_selection_modal.bypass_requirements')}\n \n
\n )}\n
,\n ];\n }\n\n /**\n * Filters the available tags on every state change.\n */\n private getFilteredTags(): Tag[] {\n const filter = this.filter().toLowerCase();\n const primaryCount = this.primaryCount();\n const secondaryCount = this.secondaryCount();\n let tags = this.tags;\n\n if (this.attrs.requireParentTag) {\n // Filter out all child tags whose parents have not been selected. This\n // makes it impossible to select a child if its parent hasn't been selected.\n tags = tags.filter((tag) => {\n const parent = tag.parent();\n return parent !== null && (parent === false || this.selected.includes(parent));\n });\n }\n\n if (!this.bypassReqs) {\n // If we reached the total maximum number of tags, we can't select anymore.\n if (this.selected.length >= this.attrs.limits!.max!.total!) {\n tags = tags.filter((tag) => this.selected.includes(tag));\n }\n // If the number of selected primary/secondary tags is at the maximum, then\n // we'll filter out all other tags of that type.\n else {\n if (primaryCount >= this.attrs.limits!.max!.primary!) {\n tags = tags.filter((tag) => !tag.isPrimary() || this.selected.includes(tag));\n }\n if (secondaryCount >= this.attrs.limits!.max!.secondary!) {\n tags = tags.filter((tag) => tag.isPrimary() || this.selected.includes(tag));\n }\n }\n }\n\n // If the user has entered text in the filter input, then filter by tags\n // whose name matches what they've entered.\n if (filter) {\n tags = tags.filter((tag) => tag.name().substring(0, filter.length).toLowerCase() === filter);\n }\n\n if (!this.indexTag || !tags.includes(this.indexTag)) this.indexTag = tags[0];\n\n return tags;\n }\n\n /**\n * Counts the number of selected primary tags.\n */\n protected primaryCount(): number {\n return this.selected.filter((tag) => tag.isPrimary()).length;\n }\n\n /**\n * Counts the number of selected secondary tags.\n */\n protected secondaryCount(): number {\n return this.selected.filter((tag) => !tag.isPrimary()).length;\n }\n\n /**\n * Validates the number of selected primary/secondary tags against the set min max limits.\n */\n protected meetsRequirements(primaryCount: number, secondaryCount: number) {\n if (this.bypassReqs || (this.attrs.allowResetting && this.selected.length === 0)) {\n return true;\n }\n\n if (this.selected.length < this.attrs.limits!.min!.total!) {\n return false;\n }\n\n return primaryCount >= this.attrs.limits!.min!.primary! && secondaryCount >= this.attrs.limits!.min!.secondary!;\n }\n\n /**\n * Add the given tag to the list of selected tags.\n */\n protected addTag(tag: Tag | undefined) {\n if (!tag || !this.attrs.canSelect(tag)) return;\n\n if (this.attrs.onSelect) {\n this.attrs.onSelect(tag, this.selected);\n }\n\n // If this tag has a parent, we'll also need to add the parent tag to the\n // selected list if it's not already in there.\n if (this.attrs.requireParentTag) {\n const parent = tag.parent();\n if (parent && !this.selected.includes(parent)) {\n this.selected.push(parent);\n }\n }\n\n if (!this.selected.includes(tag)) {\n this.selected.push(tag);\n }\n }\n\n /**\n * Remove the given tag from the list of selected tags.\n */\n protected removeTag(tag: Tag) {\n const index = this.selected.indexOf(tag);\n\n if (index !== -1) {\n this.selected.splice(index, 1);\n\n // Look through the list of selected tags for any tags which have the tag\n // we just removed as their parent. We'll need to remove them too.\n if (this.attrs.requireParentTag) {\n this.selected.filter((t) => t.parent() === tag).forEach(this.removeTag.bind(this));\n }\n\n if (this.attrs.onDeselect) {\n this.attrs.onDeselect(tag, this.selected);\n }\n }\n }\n\n protected toggleTag(tag: Tag) {\n // Won't happen, needed for type safety.\n if (!this.tags) return;\n\n if (this.selected.includes(tag)) {\n this.removeTag(tag);\n } else {\n this.addTag(tag);\n }\n\n if (this.filter()) {\n this.filter('');\n this.indexTag = this.tags[0];\n }\n\n this.onready();\n }\n\n /**\n * Gives human text instructions based on the current number of selected tags and set limits.\n */\n protected getInstruction(primaryCount: number, secondaryCount: number) {\n if (this.bypassReqs) {\n return '';\n }\n\n if (primaryCount < this.attrs.limits!.min!.primary!) {\n const remaining = this.attrs.limits!.min!.primary! - primaryCount;\n return extractText(app.translator.trans('flarum-tags.lib.tag_selection_modal.choose_primary_placeholder', { count: remaining }));\n } else if (secondaryCount < this.attrs.limits!.min!.secondary!) {\n const remaining = this.attrs.limits!.min!.secondary! - secondaryCount;\n return extractText(app.translator.trans('flarum-tags.lib.tag_selection_modal.choose_secondary_placeholder', { count: remaining }));\n } else if (this.selected.length < this.attrs.limits!.min!.total!) {\n const remaining = this.attrs.limits!.min!.total! - this.selected.length;\n return extractText(app.translator.trans('flarum-tags.lib.tag_selection_modal.choose_tags_placeholder', { count: remaining }));\n }\n\n return '';\n }\n\n /**\n * Submit tag selection.\n */\n onsubmit(e: SubmitEvent) {\n e.preventDefault();\n\n if (this.attrs.onsubmit) this.attrs.onsubmit(this.selected);\n\n this.hide();\n }\n\n protected select(e: KeyboardEvent) {\n // Ctrl + Enter submits the selection, just Enter completes the current entry\n if (e.metaKey || e.ctrlKey || (this.indexTag && this.selected.includes(this.indexTag))) {\n if (this.selected.length) {\n // The DOM submit method doesn't emit a `submit event, so we\n // simulate a manual submission so our `onsubmit` logic is run.\n this.$('button[type=\"submit\"]').click();\n }\n } else if (this.indexTag) {\n this.getItem(this.indexTag)[0].dispatchEvent(new Event('click'));\n }\n }\n\n protected selectableItems() {\n return this.$('.TagSelectionModal-list > li');\n }\n\n protected getCurrentNumericIndex() {\n if (!this.indexTag) return -1;\n\n return this.selectableItems().index(this.getItem(this.indexTag));\n }\n\n protected getItem(selectedTag: Tag) {\n return this.selectableItems().filter(`[data-index=\"${selectedTag.id()}\"]`);\n }\n\n protected setIndex(index: number, scrollToItem: boolean) {\n const $items = this.selectableItems();\n const $dropdown = $items.parent();\n\n if (index < 0) {\n index = $items.length - 1;\n } else if (index >= $items.length) {\n index = 0;\n }\n\n const $item = $items.eq(index);\n\n this.indexTag = app.store.getById('tags', $item.attr('data-index')!);\n\n m.redraw();\n\n if (scrollToItem && this.indexTag) {\n const dropdownScroll = $dropdown.scrollTop()!;\n const dropdownTop = $dropdown.offset()!.top;\n const dropdownBottom = dropdownTop + $dropdown.outerHeight()!;\n const itemTop = $item.offset()!.top;\n const itemBottom = itemTop + $item.outerHeight()!;\n\n let scrollTop;\n if (itemTop < dropdownTop) {\n scrollTop = dropdownScroll - dropdownTop + itemTop - parseInt($dropdown.css('padding-top'), 10);\n } else if (itemBottom > dropdownBottom) {\n scrollTop = dropdownScroll - dropdownBottom + itemBottom + parseInt($dropdown.css('padding-bottom'), 10);\n }\n\n if (typeof scrollTop !== 'undefined') {\n $dropdown.stop(true).animate({ scrollTop }, 100);\n }\n }\n }\n}\n\n/**\n * Catch invalid limits provided to the tag selection modal.\n */\nfunction catchInvalidLimits(limits: ITagSelectionModalLimits) {\n if (limits.min!.primary! > limits.max!.primary!) {\n throw new Error('The minimum number of primary tags allowed cannot be more than the maximum number of primary tags allowed.');\n }\n\n if (limits.min!.secondary! > limits.max!.secondary!) {\n throw new Error('The minimum number of secondary tags allowed cannot be more than the maximum number of secondary tags allowed.');\n }\n\n if (limits.min!.total! > limits.max!.primary! + limits.max!.secondary!) {\n throw new Error('The minimum number of tags allowed cannot be more than the maximum number of primary and secondary tags allowed together.');\n }\n\n if (limits.max!.total! < limits.min!.primary! + limits.min!.secondary!) {\n throw new Error('The maximum number of tags allowed cannot be less than the minimum number of primary and secondary tags allowed together.');\n }\n\n if (limits.min!.total! > limits.max!.total!) {\n throw new Error('The minimum number of tags allowed cannot be more than the maximum number of tags allowed.');\n }\n}\n","import app from 'flarum/forum/app';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport classList from 'flarum/common/utils/classList';\nimport extractText from 'flarum/common/utils/extractText';\n\nimport getSelectableTags from '../utils/getSelectableTags';\nimport TagSelectionModal, { ITagSelectionModalAttrs } from '../../common/components/TagSelectionModal';\n\nimport type Discussion from 'flarum/common/models/Discussion';\nimport type Tag from '../../common/models/Tag';\n\nexport interface TagDiscussionModalAttrs extends ITagSelectionModalAttrs {\n discussion?: Discussion;\n}\n\nexport default class TagDiscussionModal extends TagSelectionModal {\n static initAttrs(attrs: TagDiscussionModalAttrs) {\n super.initAttrs(attrs);\n\n const title = attrs.discussion\n ? app.translator.trans('flarum-tags.forum.choose_tags.edit_title', { title: {attrs.discussion.title()} })\n : app.translator.trans('flarum-tags.forum.choose_tags.title');\n\n attrs.className = classList(attrs.className, 'TagDiscussionModal');\n attrs.title = extractText(title);\n attrs.allowResetting = !!app.forum.attribute('canBypassTagCounts');\n attrs.limits = {\n allowBypassing: attrs.allowResetting,\n max: {\n primary: app.forum.attribute('minPrimaryTags'),\n secondary: app.forum.attribute('maxSecondaryTags'),\n },\n min: {\n primary: app.forum.attribute('maxPrimaryTags'),\n secondary: app.forum.attribute('minSecondaryTags'),\n },\n };\n attrs.requireParentTag = true;\n attrs.selectableTags = () => getSelectableTags(attrs.discussion);\n attrs.selectedTags ??= (attrs.discussion?.tags() as Tag[]) || [];\n attrs.canSelect = (tag) => tag.canStartDiscussion();\n\n const suppliedOnsubmit = attrs.onsubmit || null;\n\n // Save changes.\n attrs.onsubmit = function (tags) {\n const discussion = attrs.discussion;\n\n if (discussion) {\n discussion.save({ relationships: { tags } }).then(() => {\n if (app.current.matches(DiscussionPage)) {\n app.current.get('stream').update();\n }\n\n m.redraw();\n });\n }\n\n if (suppliedOnsubmit) suppliedOnsubmit(tags);\n };\n }\n}\n","import { extend } from 'flarum/common/extend';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\nimport Button from 'flarum/common/components/Button';\n\nimport TagDiscussionModal from './components/TagDiscussionModal';\n\nexport default function () {\n // Add a control allowing the discussion to be moved to another category.\n extend(DiscussionControls, 'moderationControls', function (items, discussion) {\n if (discussion.canTag()) {\n items.add(\n 'tags',\n \n );\n }\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionComposer'];","import { extend, override } from 'flarum/common/extend';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport DiscussionComposer from 'flarum/forum/components/DiscussionComposer';\nimport classList from 'flarum/common/utils/classList';\n\nimport TagDiscussionModal from './components/TagDiscussionModal';\nimport tagsLabel from '../common/helpers/tagsLabel';\nimport getSelectableTags from './utils/getSelectableTags';\n\nexport default function () {\n extend(IndexPage.prototype, 'newDiscussionAction', function (promise) {\n // From `addTagFilter\n const tag = this.currentTag();\n\n if (tag) {\n const parent = tag.parent();\n const tags = parent ? [parent, tag] : [tag];\n promise.then((composer) => (composer.fields.tags = tags));\n } else {\n app.composer.fields.tags = [];\n }\n });\n\n extend(DiscussionComposer.prototype, 'oninit', function () {\n app.tagList.load(['parent']).then(() => m.redraw());\n });\n\n // Add tag-selection abilities to the discussion composer.\n DiscussionComposer.prototype.chooseTags = function () {\n const selectableTags = getSelectableTags();\n\n if (!selectableTags.length) return;\n\n app.modal.show(TagDiscussionModal, {\n selectedTags: (this.composer.fields.tags || []).slice(0),\n onsubmit: (tags) => {\n this.composer.fields.tags = tags;\n this.$('textarea').focus();\n },\n });\n };\n\n // Add a tag-selection menu to the discussion composer's header, after the\n // title.\n extend(DiscussionComposer.prototype, 'headerItems', function (items) {\n const tags = this.composer.fields.tags || [];\n const selectableTags = getSelectableTags();\n\n items.add(\n 'tags',\n \n {tags.length ? (\n tagsLabel(tags)\n ) : (\n {app.translator.trans('flarum-tags.forum.composer_discussion.choose_tags_link')}\n )}\n ,\n 10\n );\n });\n\n override(DiscussionComposer.prototype, 'onsubmit', function (original) {\n const chosenTags = this.composer.fields.tags || [];\n const chosenPrimaryTags = chosenTags.filter((tag) => tag.position() !== null && !tag.isChild());\n const chosenSecondaryTags = chosenTags.filter((tag) => tag.position() === null);\n const selectableTags = getSelectableTags();\n\n const minPrimaryTags = parseInt(app.forum.attribute('minPrimaryTags'));\n const minSecondaryTags = parseInt(app.forum.attribute('minSecondaryTags'));\n const maxPrimaryTags = parseInt(app.forum.attribute('maxPrimaryTags'));\n const maxSecondaryTags = parseInt(app.forum.attribute('maxSecondaryTags'));\n\n if (\n ((!chosenTags.length && maxPrimaryTags !== 0 && maxSecondaryTags !== 0) ||\n chosenPrimaryTags.length < minPrimaryTags ||\n chosenSecondaryTags.length < minSecondaryTags) &&\n selectableTags.length\n ) {\n app.modal.show(TagDiscussionModal, {\n selectedTags: chosenTags,\n onsubmit: (tags) => {\n this.composer.fields.tags = tags;\n original();\n },\n });\n } else {\n original();\n }\n });\n\n // Add the selected tags as data to submit to the server.\n extend(DiscussionComposer.prototype, 'data', function (data) {\n data.relationships = data.relationships || {};\n data.relationships.tags = this.composer.fields.tags;\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extenders'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Discussion'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/EventPost'];","import EventPost from 'flarum/forum/components/EventPost';\nimport tagsLabel from '../../common/helpers/tagsLabel';\n\nexport default class DiscussionTaggedPost extends EventPost {\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n\n const oldTags = attrs.post.content()[0];\n const newTags = attrs.post.content()[1];\n\n function diffTags(tags1, tags2) {\n return tags1.filter((tag) => tags2.indexOf(tag) === -1).map((id) => app.store.getById('tags', id));\n }\n\n attrs.tagsAdded = diffTags(newTags, oldTags);\n attrs.tagsRemoved = diffTags(oldTags, newTags);\n }\n\n icon() {\n return 'fas fa-tag';\n }\n\n descriptionKey() {\n if (this.attrs.tagsAdded.length) {\n if (this.attrs.tagsRemoved.length) {\n return 'flarum-tags.forum.post_stream.added_and_removed_tags_text';\n }\n\n return 'flarum-tags.forum.post_stream.added_tags_text';\n }\n\n return 'flarum-tags.forum.post_stream.removed_tags_text';\n }\n\n descriptionData() {\n const data = {};\n\n if (this.attrs.tagsAdded.length) {\n data.tagsAdded = app.translator.trans('flarum-tags.forum.post_stream.tags_text', {\n tags: tagsLabel(this.attrs.tagsAdded, { link: true }),\n count: this.attrs.tagsAdded.length,\n });\n }\n\n if (this.attrs.tagsRemoved.length) {\n data.tagsRemoved = app.translator.trans('flarum-tags.forum.post_stream.tags_text', {\n tags: tagsLabel(this.attrs.tagsRemoved, { link: true }),\n count: this.attrs.tagsRemoved.length,\n });\n }\n\n return data;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/computed'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","import computed from 'flarum/common/utils/computed';\nimport Model from 'flarum/common/Model';\nimport type Discussion from 'flarum/common/models/Discussion';\n\nexport default class Tag extends Model {\n name() {\n return Model.attribute('name').call(this);\n }\n slug() {\n return Model.attribute('slug').call(this);\n }\n description() {\n return Model.attribute('description').call(this);\n }\n\n color() {\n return Model.attribute('color').call(this);\n }\n backgroundUrl() {\n return Model.attribute('backgroundUrl').call(this);\n }\n backgroundMode() {\n return Model.attribute('backgroundMode').call(this);\n }\n icon() {\n return Model.attribute('icon').call(this);\n }\n\n position() {\n return Model.attribute('position').call(this);\n }\n parent() {\n return Model.hasOne('parent').call(this);\n }\n children() {\n return Model.hasMany('children').call(this);\n }\n defaultSort() {\n return Model.attribute('defaultSort').call(this);\n }\n isChild() {\n return Model.attribute('isChild').call(this);\n }\n isHidden() {\n return Model.attribute('isHidden').call(this);\n }\n\n discussionCount() {\n return Model.attribute('discussionCount').call(this);\n }\n lastPostedAt() {\n return Model.attribute('lastPostedAt', Model.transformDate).call(this);\n }\n lastPostedDiscussion() {\n return Model.hasOne('lastPostedDiscussion').call(this);\n }\n\n isRestricted() {\n return Model.attribute('isRestricted').call(this);\n }\n canStartDiscussion() {\n return Model.attribute('canStartDiscussion').call(this);\n }\n canAddToDiscussion() {\n return Model.attribute('canAddToDiscussion').call(this);\n }\n\n isPrimary() {\n return computed('position', 'parent', (position, parent) => position !== null && parent === false).call(this);\n }\n}\n","import Extend from 'flarum/common/extenders';\nimport Tag from './models/Tag';\n\nexport default [\n new Extend.Store() //\n .add('tags', Tag),\n];\n","import app from 'flarum/forum/app';\nimport Extend from 'flarum/common/extenders';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport Discussion from 'flarum/common/models/Discussion';\nimport DiscussionTaggedPost from './components/DiscussionTaggedPost';\nimport TagsPage from './components/TagsPage';\nimport Tag from '../common/models/Tag';\n\nimport commonExtend from '../common/extend';\n\nexport default [\n ...commonExtend,\n\n new Extend.Routes() //\n .add('tags', '/tags', TagsPage) //\n .add('tag', '/t/:tags', IndexPage) //\n .helper('tag', (tag) => app.route('tag', { tags: tag.slug() })),\n\n new Extend.PostTypes() //\n .add('discussionTagged', DiscussionTaggedPost),\n\n new Extend.Model(Discussion) //\n .hasMany('tags') //\n .attribute('canTag'),\n];\n","import sortTags from './utils/sortTags';\nimport Tag from './models/Tag';\nimport tagsLabel from './helpers/tagsLabel';\nimport tagIcon from './helpers/tagIcon';\nimport tagLabel from './helpers/tagLabel';\nimport TagSelectionModal from './components/TagSelectionModal';\nimport TagListState from './states/TagListState';\n\nexport default {\n 'tags/utils/sortTags': sortTags,\n 'tags/models/Tag': Tag,\n 'tags/helpers/tagsLabel': tagsLabel,\n 'tags/helpers/tagIcon': tagIcon,\n 'tags/helpers/tagLabel': tagLabel,\n 'tags/components/TagSelectionModal': TagSelectionModal,\n 'tags/states/TagListState': TagListState,\n};\n","import compat from '../common/compat';\n\nimport addTagFilter from './addTagFilter';\nimport addTagControl from './addTagControl';\nimport TagHero from './components/TagHero';\nimport TagDiscussionModal from './components/TagDiscussionModal';\nimport TagsPage from './components/TagsPage';\nimport DiscussionTaggedPost from './components/DiscussionTaggedPost';\nimport TagLinkButton from './components/TagLinkButton';\nimport addTagList from './addTagList';\nimport addTagLabels from './addTagLabels';\nimport addTagComposer from './addTagComposer';\nimport getSelectableTags from './utils/getSelectableTags';\n\nexport default Object.assign(compat, {\n 'tags/addTagFilter': addTagFilter,\n 'tags/addTagControl': addTagControl,\n 'tags/components/TagHero': TagHero,\n 'tags/components/TagDiscussionModal': TagDiscussionModal,\n 'tags/components/TagsPage': TagsPage,\n 'tags/components/DiscussionTaggedPost': DiscussionTaggedPost,\n 'tags/components/TagLinkButton': TagLinkButton,\n 'tags/addTagList': addTagList,\n 'tags/addTagLabels': addTagLabels,\n 'tags/addTagComposer': addTagComposer,\n 'tags/utils/getSelectableTags': getSelectableTags,\n});\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core;","import app from 'flarum/forum/app';\n\nimport TagListState from '../common/states/TagListState';\n\nimport addTagList from './addTagList';\nimport addTagFilter from './addTagFilter';\nimport addTagLabels from './addTagLabels';\nimport addTagControl from './addTagControl';\nimport addTagComposer from './addTagComposer';\n\nexport { default as extend } from './extend';\n\napp.initializers.add('flarum-tags', function () {\n app.tagList = new TagListState();\n\n addTagList();\n addTagFilter();\n addTagLabels();\n addTagControl();\n addTagComposer();\n});\n\n// Expose compat API\nimport tagsCompat from './compat';\nimport { compat } from '@flarum/core/forum';\n\nObject.assign(compat, tagsCompat);\n","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _regeneratorRuntime() {\n \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */\n module.exports = _regeneratorRuntime = function _regeneratorRuntime() {\n return exports;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n var exports = {},\n Op = Object.prototype,\n hasOwn = Op.hasOwnProperty,\n defineProperty = Object.defineProperty || function (obj, key, desc) {\n obj[key] = desc.value;\n },\n $Symbol = \"function\" == typeof Symbol ? Symbol : {},\n iteratorSymbol = $Symbol.iterator || \"@@iterator\",\n asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\",\n toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n function define(obj, key, value) {\n return Object.defineProperty(obj, key, {\n value: value,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), obj[key];\n }\n try {\n define({}, \"\");\n } catch (err) {\n define = function define(obj, key, value) {\n return obj[key] = value;\n };\n }\n function wrap(innerFn, outerFn, self, tryLocsList) {\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,\n generator = Object.create(protoGenerator.prototype),\n context = new Context(tryLocsList || []);\n return defineProperty(generator, \"_invoke\", {\n value: makeInvokeMethod(innerFn, self, context)\n }), generator;\n }\n function tryCatch(fn, obj, arg) {\n try {\n return {\n type: \"normal\",\n arg: fn.call(obj, arg)\n };\n } catch (err) {\n return {\n type: \"throw\",\n arg: err\n };\n }\n }\n exports.wrap = wrap;\n var ContinueSentinel = {};\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n var getProto = Object.getPrototypeOf,\n NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);\n var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n define(prototype, method, function (arg) {\n return this._invoke(method, arg);\n });\n });\n }\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (\"throw\" !== record.type) {\n var result = record.arg,\n value = result.value;\n return value && \"object\" == _typeof(value) && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) {\n invoke(\"next\", value, resolve, reject);\n }, function (err) {\n invoke(\"throw\", err, resolve, reject);\n }) : PromiseImpl.resolve(value).then(function (unwrapped) {\n result.value = unwrapped, resolve(result);\n }, function (error) {\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n reject(record.arg);\n }\n var previousPromise;\n defineProperty(this, \"_invoke\", {\n value: function value(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function (resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n }\n });\n }\n function makeInvokeMethod(innerFn, self, context) {\n var state = \"suspendedStart\";\n return function (method, arg) {\n if (\"executing\" === state) throw new Error(\"Generator is already running\");\n if (\"completed\" === state) {\n if (\"throw\" === method) throw arg;\n return doneResult();\n }\n for (context.method = method, context.arg = arg;;) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) {\n if (\"suspendedStart\" === state) throw state = \"completed\", context.arg;\n context.dispatchException(context.arg);\n } else \"return\" === context.method && context.abrupt(\"return\", context.arg);\n state = \"executing\";\n var record = tryCatch(innerFn, self, context);\n if (\"normal\" === record.type) {\n if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue;\n return {\n value: record.arg,\n done: context.done\n };\n }\n \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg);\n }\n };\n }\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (undefined === method) {\n if (context.delegate = null, \"throw\" === context.method) {\n if (delegate.iterator[\"return\"] && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method)) return ContinueSentinel;\n context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a 'throw' method\");\n }\n return ContinueSentinel;\n }\n var record = tryCatch(method, delegate.iterator, context.arg);\n if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel;\n var info = record.arg;\n return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel);\n }\n function pushTryEntry(locs) {\n var entry = {\n tryLoc: locs[0]\n };\n 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);\n }\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\", delete record.arg, entry.completion = record;\n }\n function Context(tryLocsList) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);\n }\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) return iteratorMethod.call(iterable);\n if (\"function\" == typeof iterable.next) return iterable;\n if (!isNaN(iterable.length)) {\n var i = -1,\n next = function next() {\n for (; ++i < iterable.length;) {\n if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;\n }\n return next.value = undefined, next.done = !0, next;\n };\n return next.next = next;\n }\n }\n return {\n next: doneResult\n };\n }\n function doneResult() {\n return {\n value: undefined,\n done: !0\n };\n }\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, \"constructor\", {\n value: GeneratorFunctionPrototype,\n configurable: !0\n }), defineProperty(GeneratorFunctionPrototype, \"constructor\", {\n value: GeneratorFunction,\n configurable: !0\n }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) {\n var ctor = \"function\" == typeof genFun && genFun.constructor;\n return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name));\n }, exports.mark = function (genFun) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun;\n }, exports.awrap = function (arg) {\n return {\n __await: arg\n };\n }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n void 0 === PromiseImpl && (PromiseImpl = Promise);\n var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);\n return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {\n return result.done ? result.value : iter.next();\n });\n }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () {\n return this;\n }), define(Gp, \"toString\", function () {\n return \"[object Generator]\";\n }), exports.keys = function (val) {\n var object = Object(val),\n keys = [];\n for (var key in object) {\n keys.push(key);\n }\n return keys.reverse(), function next() {\n for (; keys.length;) {\n var key = keys.pop();\n if (key in object) return next.value = key, next.done = !1, next;\n }\n return next.done = !0, next;\n };\n }, exports.values = values, Context.prototype = {\n constructor: Context,\n reset: function reset(skipTempReset) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) {\n \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);\n }\n },\n stop: function stop() {\n this.done = !0;\n var rootRecord = this.tryEntries[0].completion;\n if (\"throw\" === rootRecord.type) throw rootRecord.arg;\n return this.rval;\n },\n dispatchException: function dispatchException(exception) {\n if (this.done) throw exception;\n var context = this;\n function handle(loc, caught) {\n return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught;\n }\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i],\n record = entry.completion;\n if (\"root\" === entry.tryLoc) return handle(\"end\");\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\"),\n hasFinally = hasOwn.call(entry, \"finallyLoc\");\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);\n if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);\n } else {\n if (!hasFinally) throw new Error(\"try statement without catch or finally\");\n if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);\n var record = finallyEntry ? finallyEntry.completion : {};\n return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);\n },\n complete: function complete(record, afterLoc) {\n if (\"throw\" === record.type) throw record.arg;\n return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;\n },\n finish: function finish(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;\n }\n },\n \"catch\": function _catch(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (\"throw\" === record.type) {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n throw new Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(iterable, resultName, nextLoc) {\n return this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel;\n }\n }, exports;\n}\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(obj);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","// TODO(Babel 8): Remove this file.\n\nvar runtime = require(\"../helpers/regeneratorRuntime\")();\nmodule.exports = runtime;\n\n// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.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};"],"names":["flarum","core","compat","asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","TagListState","loadedIncludes","Set","load","fn","includes","unloadedIncludes","filter","include","has","length","app","join","val","forEach","add","self","this","args","arguments","apply","err","undefined","_setPrototypeOf","o","p","Object","setPrototypeOf","bind","__proto__","_inheritsLoose","subClass","superClass","prototype","create","constructor","tagIcon","tag","attrs","settings","hasIcon","icon","useColor","className","classList","style","color","TagLinkButton","view","vnode","model","description","isActive","isChild","href","route","title","name","translator","trans","initAttrs","params","tags","slug","LinkButton","tagLabel","link","extract","tagText","textContrastClass","m","Link","sortTags","slice","sort","a","b","aPos","position","bPos","discussionCount","aParent","parent","bParent","TagsPage","oninit","history","push","preloaded","preloadedApiDocument","loading","tagList","store","all","redraw","pinned","cloud","IndexPage","listItems","toArray","map","lastPostedDiscussion","children","colored","child","discussion","lastPostNumber","humanTime","lastPostedAt","oncreate","setTitle","setTitleCount","Page","extend","items","current","matches","Separator","search","stickyParams","currentTag","addTag","active","id","component","more","splice","TagHero","Component","findTag","find","localeCompare","sensitivity","currentActiveTag","currentTagLoading","override","original","vdom","canStartDiscussion","newDiscussion","get","disabled","GlobalSearchState","param","DiscussionListState","q","tagsLabel","DiscussionListItem","DiscussionHero","getSelectableTags","canAddToDiscussion","indexOf","ToggleButton","isToggled","source","excluded","i","target","sourceKeys","keys","TagSelectionModal","selected","bypassReqs","Stream","focused","navigator","KeyboardNavigatable","indexTag","extractText","canSelect","allowResetting","limits","min","total","primary","secondary","max","Infinity","Error","catchInvalidLimits","onUp","setIndex","getCurrentNumericIndex","onDown","onSelect","select","onRemove","selectableTags","selectedTags","content","toLowerCase","primaryCount","secondaryCount","getFilteredTags","inputWidth","Math","getInstruction","onclick","$","focus","removeTag","onready","placeholder","bidi","width","onkeydown","navigate","onfocus","onblur","type","meetsRequirements","onmouseover","toggleTag","highlight","allowBypassing","requireParentTag","isPrimary","substring","index","t","onDeselect","remaining","count","onsubmit","e","preventDefault","hide","metaKey","ctrlKey","click","getItem","dispatchEvent","Event","selectableItems","selectedTag","scrollToItem","$items","$dropdown","$item","eq","attr","scrollTop","dropdownScroll","dropdownTop","offset","top","dropdownBottom","outerHeight","itemTop","itemBottom","parseInt","css","stop","animate","Modal","TagDiscussionModal","suppliedOnsubmit","save","relationships","DiscussionPage","update","DiscussionControls","canTag","modal","show","promise","composer","fields","DiscussionComposer","chooseTags","chosenTags","chosenPrimaryTags","chosenSecondaryTags","minPrimaryTags","forum","attribute","minSecondaryTags","maxPrimaryTags","maxSecondaryTags","data","DiscussionTaggedPost","oldTags","post","newTags","diffTags","tags1","tags2","getById","tagsAdded","tagsRemoved","descriptionKey","descriptionData","EventPost","Tag","Model","call","backgroundUrl","backgroundMode","defaultSort","isHidden","isRestricted","computed","Extend","commonExtend","helper","Discussion","hasMany","assign","addTagFilter","addTagControl","addTagList","addTagLabels","addTagComposer","tagsCompat","_typeof","require","_regeneratorRuntime","module","exports","__esModule","Op","hasOwn","hasOwnProperty","defineProperty","obj","desc","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","enumerable","configurable","writable","wrap","innerFn","outerFn","tryLocsList","protoGenerator","Generator","generator","context","Context","makeInvokeMethod","tryCatch","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","method","_invoke","AsyncIterator","PromiseImpl","invoke","record","result","__await","unwrapped","previousPromise","callInvokeWithMethodAndArg","state","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","TypeError","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","doneResult","displayName","isGeneratorFunction","genFun","ctor","mark","awrap","async","iter","object","reverse","pop","skipTempReset","prev","charAt","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","runtime","regeneratorRuntime","accidentalStrictMode","globalThis","Function","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","n","getter","d","definition","prop","r"],"sourceRoot":""} \ No newline at end of file