diff --git a/extensions/emoji/js/dist/forum.js b/extensions/emoji/js/dist/forum.js index 30cf64039d..3db03582f8 100644 --- a/extensions/emoji/js/dist/forum.js +++ b/extensions/emoji/js/dist/forum.js @@ -1,3 +1,3 @@ /*! For license information please see forum.js.LICENSE.txt */ -(()=>{var d,u,f={},e={};function c(d){var u=e[d];if(void 0!==u)return u.exports;var t=e[d]={exports:{}};return f[d](t,t.exports,c),t.exports}c.m=f,c.n=d=>{var u=d&&d.__esModule?()=>d.default:()=>d;return c.d(u,{a:u}),u},c.d=(d,u)=>{for(var f in u)c.o(u,f)&&!c.o(d,f)&&Object.defineProperty(d,f,{enumerable:!0,get:u[f]})},c.f={},c.e=d=>Promise.all(Object.keys(c.f).reduce(((u,f)=>(c.f[f](d,u),u)),[])),c.u=d=>"forum/emojiMap.js",c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(d){if("object"==typeof window)return window}}(),c.o=(d,u)=>Object.prototype.hasOwnProperty.call(d,u),d={},u="module.exports:",c.l=(f,e,t,o)=>{if(d[f])d[f].push(e);else{var r,n;if(void 0!==t)for(var a=document.getElementsByTagName("script"),i=0;i{r.onerror=r.onload=null,clearTimeout(m);var c=d[f];if(delete d[f],r.parentNode&&r.parentNode.removeChild(r),c&&c.forEach((d=>d(e))),u)return u(e)},m=setTimeout(b.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=b.bind(null,r.onerror),r.onload=b.bind(null,r.onload),n&&document.head.appendChild(r)}},c.r=d=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(d,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(d,"__esModule",{value:!0})},(()=>{var d;c.g.importScripts&&(d=c.g.location+"");var u=c.g.document;if(!d&&u&&(u.currentScript&&(d=u.currentScript.src),!d)){var f=u.getElementsByTagName("script");f.length&&(d=f[f.length-1].src)}if(!d)throw new Error("Automatic publicPath is not supported in this browser");d=d.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),c.p=d})(),c.f.compat=(d,u)=>{const f=c.l;c.l=flarum.reg.loadChunk.bind(flarum.reg,f)},(()=>{var d={315:0};c.f.j=(u,f)=>{var e=c.o(d,u)?d[u]:void 0;if(0!==e)if(e)f.push(e[2]);else{var t=new Promise(((f,c)=>e=d[u]=[f,c]));f.push(e[2]=t);var o=c.p+c.u(u),r=new Error;c.l(o,(f=>{if(c.o(d,u)&&(0!==(e=d[u])&&(d[u]=void 0),e)){var t=f&&("load"===f.type?"missing":f.type),o=f&&f.target&&f.target.src;r.message="Loading chunk "+u+" failed.\n("+t+": "+o+")",r.name="ChunkLoadError",r.type=t,r.request=o,e[1](r)}}),"chunk-"+u,u)}};var u=(u,f)=>{var e,t,[o,r,n]=f,a=0;if(o.some((u=>0!==d[u]))){for(e in r)c.o(r,e)&&(c.m[e]=r[e]);n&&n(c)}for(u&&u(f);a{"use strict";c.r(t);const d=flarum.reg.get("core","forum/app");var u=c.n(d);const f=flarum.reg.get("core","common/extend"),e=flarum.reg.get("core","common/components/TextEditorButton");var o=c.n(e);const r=flarum.reg.get("core","common/utils/KeyboardNavigatable");var n=c.n(r);const a=flarum.reg.get("core","common/components/Tooltip");var i=c.n(a);const s=flarum.reg.get("core","common/utils/AutocompleteReader");var b=c.n(s);function l(d){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(d){return typeof d}:function(d){return d&&"function"==typeof Symbol&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},l(d)}function p(d,u,f){return(u=function(d){var u=function(d,u){if("object"!==l(d)||null===d)return d;var f=d[Symbol.toPrimitive];if(void 0!==f){var e=f.call(d,u);if("object"!==l(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(d)}(d,"string");return"symbol"===l(u)?u:String(u)}(u))in d?Object.defineProperty(d,u,{value:f,enumerable:!0,configurable:!0,writable:!0}):d[u]=f,d}const h=flarum.reg.get("core","common/Fragment");var g=c.n(h);class w extends(g()){constructor(){super(...arguments),p(this,"items",[]),p(this,"active",!1),p(this,"index",0),p(this,"keyWasJustPressed",!1)}view(){return m("ul",{className:"Dropdown-menu EmojiDropdown"},m("li",{className:"Dropdown-header"},app.translator.trans("flarum-emoji.forum.composer.type_to_search_text")),this.items.map((d=>m("li",{key:d.attrs.key},d))))}show(d,u){this.$().show().css({left:d+"px",top:u+"px"}),this.active=!0}hide(){this.$().hide(),this.active=!1}navigate(d){this.keyWasJustPressed=!0,this.setIndex(this.index+d,!0),clearTimeout(this.keyWasJustPressedTimeout),this.keyWasJustPressedTimeout=setTimeout((()=>this.keyWasJustPressed=!1),500)}complete(){this.$("li:not(.Dropdown-header)").eq(this.index).find("button").click()}setIndex(d,u){if(this.keyWasJustPressed&&!u)return;const f=this.$(),e=f.find("li:not(.Dropdown-header)");let c=d;c<0?c=e.length-1:c>=e.length&&(c=0),this.index=c;const t=e.removeClass("active").eq(c).addClass("active");if(u){const d=f.scrollTop(),u=f.offset().top,e=u+f.outerHeight(),c=t.offset().top,o=c+t.outerHeight();let r;ce&&(r=d-e+o+parseInt(f.css("padding-bottom"),10)),void 0!==r&&f.stop(!0).animate({scrollTop:r},100)}}}flarum.reg.add("flarum-emoji","forum/fragments/AutocompleteDropdown",w);var v=function(){var d={base:"https://twemoji.maxcdn.com/v/14.0.2/",ext:".png",size:"72x72",className:"emoji",convert:{fromCodePoint:function(d){var u="string"==typeof d?parseInt(d,16):d;return u<65536?r(u):r(55296+((u-=65536)>>10),56320+(1023&u))},toCodePoint:g},onerror:function(){this.parentNode&&this.parentNode.replaceChild(n(this.alt,!1),this)},parse:function(u,f){return f&&"function"!=typeof f||(f={callback:f}),("string"==typeof u?m:b)(u,{callback:f.callback||a,attributes:"function"==typeof f.attributes?f.attributes:p,base:"string"==typeof f.base?f.base:d.base,ext:f.ext||d.ext,size:f.folder||(e=f.size||d.size,"number"==typeof e?e+"x"+e:e),className:f.className||d.className,onerror:f.onerror||d.onerror});var e},replace:h,test:function(d){f.lastIndex=0;var u=f.test(d);return f.lastIndex=0,u}},u={"&":"&","<":"<",">":">","'":"'",'"':"""},f=/(?:\ud83d\udc68\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffc-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb\udffd-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb-\udffd\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb-\udffe]|\ud83d\udc68\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc68\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc68\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffe]|\ud83e\uddd1\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffc-\udfff]|\ud83e\uddd1\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb\udffd-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb-\udffd\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb-\udffe]|\ud83e\uddd1\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d[\udc68\udc69]|\ud83e\udef1\ud83c\udffb\u200d\ud83e\udef2\ud83c[\udffc-\udfff]|\ud83e\udef1\ud83c\udffc\u200d\ud83e\udef2\ud83c[\udffb\udffd-\udfff]|\ud83e\udef1\ud83c\udffd\u200d\ud83e\udef2\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\udef1\ud83c\udffe\u200d\ud83e\udef2\ud83c[\udffb-\udffd\udfff]|\ud83e\udef1\ud83c\udfff\u200d\ud83e\udef2\ud83c[\udffb-\udffe]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc68|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d[\udc68\udc69]|\ud83e\uddd1\u200d\ud83e\udd1d\u200d\ud83e\uddd1|\ud83d\udc6b\ud83c[\udffb-\udfff]|\ud83d\udc6c\ud83c[\udffb-\udfff]|\ud83d\udc6d\ud83c[\udffb-\udfff]|\ud83d\udc8f\ud83c[\udffb-\udfff]|\ud83d\udc91\ud83c[\udffb-\udfff]|\ud83e\udd1d\ud83c[\udffb-\udfff]|\ud83d[\udc6b-\udc6d\udc8f\udc91]|\ud83e\udd1d)|(?:\ud83d[\udc68\udc69]|\ud83e\uddd1)(?:\ud83c[\udffb-\udfff])?\u200d(?:\u2695\ufe0f|\u2696\ufe0f|\u2708\ufe0f|\ud83c[\udf3e\udf73\udf7c\udf84\udf93\udfa4\udfa8\udfeb\udfed]|\ud83d[\udcbb\udcbc\udd27\udd2c\ude80\ude92]|\ud83e[\uddaf-\uddb3\uddbc\uddbd])|(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75]|\u26f9)((?:\ud83c[\udffb-\udfff]|\ufe0f)\u200d[\u2640\u2642]\ufe0f)|(?:\ud83c[\udfc3\udfc4\udfca]|\ud83d[\udc6e\udc70\udc71\udc73\udc77\udc81\udc82\udc86\udc87\ude45-\ude47\ude4b\ude4d\ude4e\udea3\udeb4-\udeb6]|\ud83e[\udd26\udd35\udd37-\udd39\udd3d\udd3e\uddb8\uddb9\uddcd-\uddcf\uddd4\uddd6-\udddd])(?:\ud83c[\udffb-\udfff])?\u200d[\u2640\u2642]\ufe0f|(?:\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f|\ud83c\udff3\ufe0f\u200d\ud83c\udf08|\ud83d\ude36\u200d\ud83c\udf2b\ufe0f|\u2764\ufe0f\u200d\ud83d\udd25|\u2764\ufe0f\u200d\ud83e\ude79|\ud83c\udff4\u200d\u2620\ufe0f|\ud83d\udc15\u200d\ud83e\uddba|\ud83d\udc3b\u200d\u2744\ufe0f|\ud83d\udc41\u200d\ud83d\udde8|\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc6f\u200d\u2640\ufe0f|\ud83d\udc6f\u200d\u2642\ufe0f|\ud83d\ude2e\u200d\ud83d\udca8|\ud83d\ude35\u200d\ud83d\udcab|\ud83e\udd3c\u200d\u2640\ufe0f|\ud83e\udd3c\u200d\u2642\ufe0f|\ud83e\uddde\u200d\u2640\ufe0f|\ud83e\uddde\u200d\u2642\ufe0f|\ud83e\udddf\u200d\u2640\ufe0f|\ud83e\udddf\u200d\u2642\ufe0f|\ud83d\udc08\u200d\u2b1b)|[#*0-9]\ufe0f?\u20e3|(?:[©®\u2122\u265f]\ufe0f)|(?:\ud83c[\udc04\udd70\udd71\udd7e\udd7f\ude02\ude1a\ude2f\ude37\udf21\udf24-\udf2c\udf36\udf7d\udf96\udf97\udf99-\udf9b\udf9e\udf9f\udfcd\udfce\udfd4-\udfdf\udff3\udff5\udff7]|\ud83d[\udc3f\udc41\udcfd\udd49\udd4a\udd6f\udd70\udd73\udd76-\udd79\udd87\udd8a-\udd8d\udda5\udda8\uddb1\uddb2\uddbc\uddc2-\uddc4\uddd1-\uddd3\udddc-\uddde\udde1\udde3\udde8\uddef\uddf3\uddfa\udecb\udecd-\udecf\udee0-\udee5\udee9\udef0\udef3]|[\u203c\u2049\u2139\u2194-\u2199\u21a9\u21aa\u231a\u231b\u2328\u23cf\u23ed-\u23ef\u23f1\u23f2\u23f8-\u23fa\u24c2\u25aa\u25ab\u25b6\u25c0\u25fb-\u25fe\u2600-\u2604\u260e\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262a\u262e\u262f\u2638-\u263a\u2640\u2642\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267b\u267f\u2692-\u2697\u2699\u269b\u269c\u26a0\u26a1\u26a7\u26aa\u26ab\u26b0\u26b1\u26bd\u26be\u26c4\u26c5\u26c8\u26cf\u26d1\u26d3\u26d4\u26e9\u26ea\u26f0-\u26f5\u26f8\u26fa\u26fd\u2702\u2708\u2709\u270f\u2712\u2714\u2716\u271d\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u2764\u27a1\u2934\u2935\u2b05-\u2b07\u2b1b\u2b1c\u2b50\u2b55\u3030\u303d\u3297\u3299])(?:\ufe0f|(?!\ufe0e))|(?:(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75\udd90]|[\u261d\u26f7\u26f9\u270c\u270d])(?:\ufe0f|(?!\ufe0e))|(?:\ud83c[\udf85\udfc2-\udfc4\udfc7\udfca]|\ud83d[\udc42\udc43\udc46-\udc50\udc66-\udc69\udc6e\udc70-\udc78\udc7c\udc81-\udc83\udc85-\udc87\udcaa\udd7a\udd95\udd96\ude45-\ude47\ude4b-\ude4f\udea3\udeb4-\udeb6\udec0\udecc]|\ud83e[\udd0c\udd0f\udd18-\udd1c\udd1e\udd1f\udd26\udd30-\udd39\udd3d\udd3e\udd77\uddb5\uddb6\uddb8\uddb9\uddbb\uddcd-\uddcf\uddd1-\udddd\udec3-\udec5\udef0-\udef6]|[\u270a\u270b]))(?:\ud83c[\udffb-\udfff])?|(?:\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc73\udb40\udc63\udb40\udc74\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc77\udb40\udc6c\udb40\udc73\udb40\udc7f|\ud83c\udde6\ud83c[\udde8-\uddec\uddee\uddf1\uddf2\uddf4\uddf6-\uddfa\uddfc\uddfd\uddff]|\ud83c\udde7\ud83c[\udde6\udde7\udde9-\uddef\uddf1-\uddf4\uddf6-\uddf9\uddfb\uddfc\uddfe\uddff]|\ud83c\udde8\ud83c[\udde6\udde8\udde9\uddeb-\uddee\uddf0-\uddf5\uddf7\uddfa-\uddff]|\ud83c\udde9\ud83c[\uddea\uddec\uddef\uddf0\uddf2\uddf4\uddff]|\ud83c\uddea\ud83c[\udde6\udde8\uddea\uddec\udded\uddf7-\uddfa]|\ud83c\uddeb\ud83c[\uddee-\uddf0\uddf2\uddf4\uddf7]|\ud83c\uddec\ud83c[\udde6\udde7\udde9-\uddee\uddf1-\uddf3\uddf5-\uddfa\uddfc\uddfe]|\ud83c\udded\ud83c[\uddf0\uddf2\uddf3\uddf7\uddf9\uddfa]|\ud83c\uddee\ud83c[\udde8-\uddea\uddf1-\uddf4\uddf6-\uddf9]|\ud83c\uddef\ud83c[\uddea\uddf2\uddf4\uddf5]|\ud83c\uddf0\ud83c[\uddea\uddec-\uddee\uddf2\uddf3\uddf5\uddf7\uddfc\uddfe\uddff]|\ud83c\uddf1\ud83c[\udde6-\udde8\uddee\uddf0\uddf7-\uddfb\uddfe]|\ud83c\uddf2\ud83c[\udde6\udde8-\udded\uddf0-\uddff]|\ud83c\uddf3\ud83c[\udde6\udde8\uddea-\uddec\uddee\uddf1\uddf4\uddf5\uddf7\uddfa\uddff]|\ud83c\uddf4\ud83c\uddf2|\ud83c\uddf5\ud83c[\udde6\uddea-\udded\uddf0-\uddf3\uddf7-\uddf9\uddfc\uddfe]|\ud83c\uddf6\ud83c\udde6|\ud83c\uddf7\ud83c[\uddea\uddf4\uddf8\uddfa\uddfc]|\ud83c\uddf8\ud83c[\udde6-\uddea\uddec-\uddf4\uddf7-\uddf9\uddfb\uddfd-\uddff]|\ud83c\uddf9\ud83c[\udde6\udde8\udde9\uddeb-\udded\uddef-\uddf4\uddf7\uddf9\uddfb\uddfc\uddff]|\ud83c\uddfa\ud83c[\udde6\uddec\uddf2\uddf3\uddf8\uddfe\uddff]|\ud83c\uddfb\ud83c[\udde6\udde8\uddea\uddec\uddee\uddf3\uddfa]|\ud83c\uddfc\ud83c[\uddeb\uddf8]|\ud83c\uddfd\ud83c\uddf0|\ud83c\uddfe\ud83c[\uddea\uddf9]|\ud83c\uddff\ud83c[\udde6\uddf2\uddfc]|\ud83c[\udccf\udd8e\udd91-\udd9a\udde6-\uddff\ude01\ude32-\ude36\ude38-\ude3a\ude50\ude51\udf00-\udf20\udf2d-\udf35\udf37-\udf7c\udf7e-\udf84\udf86-\udf93\udfa0-\udfc1\udfc5\udfc6\udfc8\udfc9\udfcf-\udfd3\udfe0-\udff0\udff4\udff8-\udfff]|\ud83d[\udc00-\udc3e\udc40\udc44\udc45\udc51-\udc65\udc6a\udc6f\udc79-\udc7b\udc7d-\udc80\udc84\udc88-\udc8e\udc90\udc92-\udca9\udcab-\udcfc\udcff-\udd3d\udd4b-\udd4e\udd50-\udd67\udda4\uddfb-\ude44\ude48-\ude4a\ude80-\udea2\udea4-\udeb3\udeb7-\udebf\udec1-\udec5\uded0-\uded2\uded5-\uded7\udedd-\udedf\udeeb\udeec\udef4-\udefc\udfe0-\udfeb\udff0]|\ud83e[\udd0d\udd0e\udd10-\udd17\udd20-\udd25\udd27-\udd2f\udd3a\udd3c\udd3f-\udd45\udd47-\udd76\udd78-\uddb4\uddb7\uddba\uddbc-\uddcc\uddd0\uddde-\uddff\ude70-\ude74\ude78-\ude7c\ude80-\ude86\ude90-\udeac\udeb0-\udeba\udec0-\udec2\uded0-\uded9\udee0-\udee7]|[\u23e9-\u23ec\u23f0\u23f3\u267e\u26ce\u2705\u2728\u274c\u274e\u2753-\u2755\u2795-\u2797\u27b0\u27bf\ue50a])|\ufe0f/g,e=/\uFE0F/g,c=String.fromCharCode(8205),t=/[&<>'"]/g,o=/^(?:iframe|noframes|noscript|script|select|style|textarea)$/,r=String.fromCharCode;return d;function n(d,u){return document.createTextNode(u?d.replace(e,""):d)}function a(d,u){return"".concat(u.base,u.size,"/",d,u.ext)}function i(d,u){for(var f,e,c=d.childNodes,t=c.length;t--;)3===(e=(f=c[t]).nodeType)?u.push(f):1!==e||"ownerSVGElement"in f||o.test(f.nodeName.toLowerCase())||i(f,u);return u}function s(d){return g(d.indexOf(c)<0?d.replace(e,""):d)}function b(d,u){for(var e,c,t,o,r,a,b,m,l,p,h,g,w,v=i(d,[]),j=v.length;j--;){for(t=!1,o=document.createDocumentFragment(),a=(r=v[j]).nodeValue,m=0;b=f.exec(a);){if((l=b.index)!==m&&o.appendChild(n(a.slice(m,l),!0)),g=s(h=b[0]),m=l+h.length,w=u.callback(g,u),g&&w){for(c in(p=new Image).onerror=u.onerror,p.setAttribute("draggable","false"),e=u.attributes(h,g))e.hasOwnProperty(c)&&0!==c.indexOf("on")&&!p.hasAttribute(c)&&p.setAttribute(c,e[c]);p.className=u.className,p.alt=h,p.src=w,t=!0,o.appendChild(p)}p||o.appendChild(n(h,!1)),p=null}t&&(m")}return c}))}function l(d){return u[d]}function p(){return null}function h(d,u){return String(d).replace(f,u)}function g(d,u){for(var f=[],e=0,c=0,t=0;t({loading:"lazy"})};u().initializers.add("flarum-emoji",(()=>{!function(){let d=null;(0,f.extend)("flarum/common/components/TextEditor","oninit",(function(){this._loaders.push((async()=>await c.e(411).then(c.bind(c,948)).then((u=>d=u.default)))),this.commonEmoji=["😀","😁","😂","😃","😄","😅","😆","😇","😈","😉","😊","😋","😌","😍","😎","😏","😐️","😑","😒","😓","😔","😕","😖","😗","😘","😙","😚","😛","😜","😝","😞","😟","😠","😡","😢","😣","😤","😥","😦","😧","😨","😩","😪","😫","😬","😭","😮","😮‍💨","😯","😰","😱","😲","😳","😴","😵","😵‍💫","😶","😶‍🌫️","😷","😸","😹","😺","😻","😼","😽","😾","😿","🙀","🙁","🙂","🙃","🙄"]})),(0,f.extend)("flarum/common/components/TextEditor","onbuild",(function(){this.emojiDropdown=new w;const d=this.$(".TextEditor-editor").wrap('
');this.navigator=new(n()),this.navigator.when((()=>this.emojiDropdown.active)).onUp((()=>this.emojiDropdown.navigate(-1))).onDown((()=>this.emojiDropdown.navigate(1))).onSelect(this.emojiDropdown.complete.bind(this.emojiDropdown)).onCancel(this.emojiDropdown.hide.bind(this.emojiDropdown)).bindTo(d),d.after($('
'))})),(0,f.extend)("flarum/common/components/TextEditor","buildEditorParams",(function(u){const f=Object.keys(d),e=new(b())(":");u.inputListeners.push((()=>{const u=this.attrs.composer.editor.getSelectionRange(),c=u[0];if(u[1]-c>0)return;const t=this.attrs.composer.editor.getLastNChars(15),o=e.check(t,c,/[a-z0-9]|\+|\-|_|\:/);if(this.emojiDropdown.hide(),this.emojiDropdown.active=!1,o){const u=o.typed,e=this.emojiDropdown,c=d=>{this.attrs.composer.editor.replaceBeforeCursor(o.absoluteStart-1,d+" "),this.emojiDropdown.hide()},t=function(d){let{emoji:u,name:f,code:t}=d;return m(i(),{text:f},m("button",{key:u,onclick:()=>c(u),onmouseenter:function(){e.setIndex($(this).parent().index()-1)}},m("img",{alt:u,className:"emoji",draggable:"false",loading:"lazy",src:"".concat(D,"72x72/").concat(t,".png"),title:f})))};(()=>{const e=[],c=function(d){const u=new RegExp("\\((["+"+.*?[]{}()^$|\\".replace(/(.)/g,"\\$1")+"])\\)","g");return new RegExp("(.*)"+d.toLowerCase().replace(/(.)/g,"($1)(.*?)").replace(u,"(\\$1)")+"$","i")}(u);let r=40;const n=u=>{for(let c=0;c0;c++){const t=f[c];if(-1===e.indexOf(t)){const f=d[t];for(let d of f)if(u(d,t)){--r,e.push(t);break}}}};n(((d,f)=>{var e;return u?0===d.indexOf(u):null==(e=this.commonEmoji)?void 0:e.includes(f)})),n((d=>c.test(d)));const a=e.map((u=>({emoji:u,name:d[u][0],code:k(u)}))).map(t);if(a.length){this.emojiDropdown.items=a,m.render(this.$(".ComposerBody-emojiDropdownContainer")[0],this.emojiDropdown.render()),this.emojiDropdown.show();const d=this.attrs.composer.editor.getCaretCoordinates(o.absoluteStart),u=this.emojiDropdown.$().outerWidth(),f=this.emojiDropdown.$().outerHeight(),e=this.emojiDropdown.$().offsetParent();let c=d.left,t=d.top+15;t+f>e.height()&&(t=d.top-f-15),c+u>e.width()&&(c=e.width()-u),t=Math.max(-(e.offset().top-$(document).scrollTop()),t),c=Math.max(-e.offset().left,c),this.emojiDropdown.show(c,t)}})(),this.emojiDropdown.setIndex(0),this.emojiDropdown.$().scrollTop(0),this.emojiDropdown.active=!0}}))})),(0,f.extend)("flarum/common/components/TextEditor","toolbarItems",(function(d){d.add("emoji",m(o(),{onclick:()=>this.attrs.composer.editor.insertAtCursor(" :"),icon:"far fa-smile"},app.translator.trans("flarum-emoji.forum.composer.emoji_tooltip")))}))}(),(0,f.override)(S().prototype,"contentHtml",(function(d){const u=d();if(this.oldContentHtml!==u){const d=j.parse(function(d){const u=document.implementation.createHTMLDocument();return u.body.innerHTML=d,u.body}(u),E);this.emojifiedContentHtml=d.innerHTML,this.oldContentHtml=u}return this.emojifiedContentHtml})),(0,f.override)(s9e.TextFormatter,"preview",((d,u,f)=>{d(u,f),j.parse(f,E)}))}))})(),module.exports=t})(); +(()=>{var d,u,f={},e={};function c(d){var u=e[d];if(void 0!==u)return u.exports;var t=e[d]={exports:{}};return f[d](t,t.exports,c),t.exports}c.m=f,c.n=d=>{var u=d&&d.__esModule?()=>d.default:()=>d;return c.d(u,{a:u}),u},c.d=(d,u)=>{for(var f in u)c.o(u,f)&&!c.o(d,f)&&Object.defineProperty(d,f,{enumerable:!0,get:u[f]})},c.f={},c.e=d=>Promise.all(Object.keys(c.f).reduce(((u,f)=>(c.f[f](d,u),u)),[])),c.u=d=>"forum/emojiMap.js",c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(d){if("object"==typeof window)return window}}(),c.o=(d,u)=>Object.prototype.hasOwnProperty.call(d,u),d={},u="module.exports:",c.l=(f,e,t,o)=>{if(d[f])d[f].push(e);else{var r,n;if(void 0!==t)for(var a=document.getElementsByTagName("script"),i=0;i{r.onerror=r.onload=null,clearTimeout(l);var c=d[f];if(delete d[f],r.parentNode&&r.parentNode.removeChild(r),c&&c.forEach((d=>d(e))),u)return u(e)},l=setTimeout(b.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=b.bind(null,r.onerror),r.onload=b.bind(null,r.onload),n&&document.head.appendChild(r)}},c.r=d=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(d,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(d,"__esModule",{value:!0})},(()=>{var d;c.g.importScripts&&(d=c.g.location+"");var u=c.g.document;if(!d&&u&&(u.currentScript&&(d=u.currentScript.src),!d)){var f=u.getElementsByTagName("script");f.length&&(d=f[f.length-1].src)}if(!d)throw new Error("Automatic publicPath is not supported in this browser");d=d.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),c.p=d})(),c.f.compat=(d,u)=>{const f=c.l;c.l=flarum.reg.loadChunk.bind(flarum.reg,f)},(()=>{var d={315:0};c.f.j=(u,f)=>{var e=c.o(d,u)?d[u]:void 0;if(0!==e)if(e)f.push(e[2]);else{var t=new Promise(((f,c)=>e=d[u]=[f,c]));f.push(e[2]=t);var o=c.p+c.u(u),r=new Error;c.l(o,(f=>{if(c.o(d,u)&&(0!==(e=d[u])&&(d[u]=void 0),e)){var t=f&&("load"===f.type?"missing":f.type),o=f&&f.target&&f.target.src;r.message="Loading chunk "+u+" failed.\n("+t+": "+o+")",r.name="ChunkLoadError",r.type=t,r.request=o,e[1](r)}}),"chunk-"+u,u)}};var u=(u,f)=>{var e,t,[o,r,n]=f,a=0;if(o.some((u=>0!==d[u]))){for(e in r)c.o(r,e)&&(c.m[e]=r[e]);n&&n(c)}for(u&&u(f);a{"use strict";c.r(t);const d=flarum.reg.get("core","forum/app");var u=c.n(d);const f=flarum.reg.get("core","common/extend"),e=flarum.reg.get("core","common/components/TextEditorButton");var o=c.n(e);const r=flarum.reg.get("core","common/utils/KeyboardNavigatable");var n=c.n(r);const a=flarum.reg.get("core","common/components/Tooltip");var i=c.n(a);const s=flarum.reg.get("core","common/utils/AutocompleteReader");var b=c.n(s);function l(d){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(d){return typeof d}:function(d){return d&&"function"==typeof Symbol&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},l(d)}function p(d,u,f){return(u=function(d){var u=function(d,u){if("object"!==l(d)||null===d)return d;var f=d[Symbol.toPrimitive];if(void 0!==f){var e=f.call(d,u);if("object"!==l(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(d)}(d,"string");return"symbol"===l(u)?u:String(u)}(u))in d?Object.defineProperty(d,u,{value:f,enumerable:!0,configurable:!0,writable:!0}):d[u]=f,d}const h=flarum.reg.get("core","common/Fragment");var g=c.n(h);class v extends(g()){constructor(){super(...arguments),p(this,"items",[]),p(this,"active",!1),p(this,"index",0),p(this,"keyWasJustPressed",!1)}view(){return m("ul",{className:"Dropdown-menu EmojiDropdown"},m("li",{className:"Dropdown-header"},app.translator.trans("flarum-emoji.forum.composer.type_to_search_text")),this.items.map((d=>m("li",{key:d.attrs.key},d))))}show(d,u){this.$().show().css({left:d+"px",top:u+"px"}),this.active=!0}hide(){this.$().hide(),this.active=!1}navigate(d){this.keyWasJustPressed=!0,this.setIndex(this.index+d,!0),clearTimeout(this.keyWasJustPressedTimeout),this.keyWasJustPressedTimeout=setTimeout((()=>this.keyWasJustPressed=!1),500)}complete(){this.$("li:not(.Dropdown-header)").eq(this.index).find("button").click()}setIndex(d,u){if(this.keyWasJustPressed&&!u)return;const f=this.$(),e=f.find("li:not(.Dropdown-header)");let c=d;c<0?c=e.length-1:c>=e.length&&(c=0),this.index=c;const t=e.removeClass("active").eq(c).addClass("active");if(u){const d=f.scrollTop(),u=f.offset().top,e=u+f.outerHeight(),c=t.offset().top,o=c+t.outerHeight();let r;ce&&(r=d-e+o+parseInt(f.css("padding-bottom"),10)),void 0!==r&&f.stop(!0).animate({scrollTop:r},100)}}}flarum.reg.add("flarum-emoji","forum/fragments/AutocompleteDropdown",v);var w=function(){var d={base:"https://twemoji.maxcdn.com/v/14.0.2/",ext:".png",size:"72x72",className:"emoji",convert:{fromCodePoint:function(d){var u="string"==typeof d?parseInt(d,16):d;return u<65536?r(u):r(55296+((u-=65536)>>10),56320+(1023&u))},toCodePoint:g},onerror:function(){this.parentNode&&this.parentNode.replaceChild(n(this.alt,!1),this)},parse:function(u,f){return f&&"function"!=typeof f||(f={callback:f}),("string"==typeof u?l:b)(u,{callback:f.callback||a,attributes:"function"==typeof f.attributes?f.attributes:p,base:"string"==typeof f.base?f.base:d.base,ext:f.ext||d.ext,size:f.folder||(e=f.size||d.size,"number"==typeof e?e+"x"+e:e),className:f.className||d.className,onerror:f.onerror||d.onerror});var e},replace:h,test:function(d){f.lastIndex=0;var u=f.test(d);return f.lastIndex=0,u}},u={"&":"&","<":"<",">":">","'":"'",'"':"""},f=/(?:\ud83d\udc68\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffc-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb\udffd-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb-\udffd\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb-\udffe]|\ud83d\udc68\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc68\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc68\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffe]|\ud83e\uddd1\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffc-\udfff]|\ud83e\uddd1\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb\udffd-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb-\udffd\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb-\udffe]|\ud83e\uddd1\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d[\udc68\udc69]|\ud83e\udef1\ud83c\udffb\u200d\ud83e\udef2\ud83c[\udffc-\udfff]|\ud83e\udef1\ud83c\udffc\u200d\ud83e\udef2\ud83c[\udffb\udffd-\udfff]|\ud83e\udef1\ud83c\udffd\u200d\ud83e\udef2\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\udef1\ud83c\udffe\u200d\ud83e\udef2\ud83c[\udffb-\udffd\udfff]|\ud83e\udef1\ud83c\udfff\u200d\ud83e\udef2\ud83c[\udffb-\udffe]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc68|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d[\udc68\udc69]|\ud83e\uddd1\u200d\ud83e\udd1d\u200d\ud83e\uddd1|\ud83d\udc6b\ud83c[\udffb-\udfff]|\ud83d\udc6c\ud83c[\udffb-\udfff]|\ud83d\udc6d\ud83c[\udffb-\udfff]|\ud83d\udc8f\ud83c[\udffb-\udfff]|\ud83d\udc91\ud83c[\udffb-\udfff]|\ud83e\udd1d\ud83c[\udffb-\udfff]|\ud83d[\udc6b-\udc6d\udc8f\udc91]|\ud83e\udd1d)|(?:\ud83d[\udc68\udc69]|\ud83e\uddd1)(?:\ud83c[\udffb-\udfff])?\u200d(?:\u2695\ufe0f|\u2696\ufe0f|\u2708\ufe0f|\ud83c[\udf3e\udf73\udf7c\udf84\udf93\udfa4\udfa8\udfeb\udfed]|\ud83d[\udcbb\udcbc\udd27\udd2c\ude80\ude92]|\ud83e[\uddaf-\uddb3\uddbc\uddbd])|(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75]|\u26f9)((?:\ud83c[\udffb-\udfff]|\ufe0f)\u200d[\u2640\u2642]\ufe0f)|(?:\ud83c[\udfc3\udfc4\udfca]|\ud83d[\udc6e\udc70\udc71\udc73\udc77\udc81\udc82\udc86\udc87\ude45-\ude47\ude4b\ude4d\ude4e\udea3\udeb4-\udeb6]|\ud83e[\udd26\udd35\udd37-\udd39\udd3d\udd3e\uddb8\uddb9\uddcd-\uddcf\uddd4\uddd6-\udddd])(?:\ud83c[\udffb-\udfff])?\u200d[\u2640\u2642]\ufe0f|(?:\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f|\ud83c\udff3\ufe0f\u200d\ud83c\udf08|\ud83d\ude36\u200d\ud83c\udf2b\ufe0f|\u2764\ufe0f\u200d\ud83d\udd25|\u2764\ufe0f\u200d\ud83e\ude79|\ud83c\udff4\u200d\u2620\ufe0f|\ud83d\udc15\u200d\ud83e\uddba|\ud83d\udc3b\u200d\u2744\ufe0f|\ud83d\udc41\u200d\ud83d\udde8|\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc6f\u200d\u2640\ufe0f|\ud83d\udc6f\u200d\u2642\ufe0f|\ud83d\ude2e\u200d\ud83d\udca8|\ud83d\ude35\u200d\ud83d\udcab|\ud83e\udd3c\u200d\u2640\ufe0f|\ud83e\udd3c\u200d\u2642\ufe0f|\ud83e\uddde\u200d\u2640\ufe0f|\ud83e\uddde\u200d\u2642\ufe0f|\ud83e\udddf\u200d\u2640\ufe0f|\ud83e\udddf\u200d\u2642\ufe0f|\ud83d\udc08\u200d\u2b1b)|[#*0-9]\ufe0f?\u20e3|(?:[©®\u2122\u265f]\ufe0f)|(?:\ud83c[\udc04\udd70\udd71\udd7e\udd7f\ude02\ude1a\ude2f\ude37\udf21\udf24-\udf2c\udf36\udf7d\udf96\udf97\udf99-\udf9b\udf9e\udf9f\udfcd\udfce\udfd4-\udfdf\udff3\udff5\udff7]|\ud83d[\udc3f\udc41\udcfd\udd49\udd4a\udd6f\udd70\udd73\udd76-\udd79\udd87\udd8a-\udd8d\udda5\udda8\uddb1\uddb2\uddbc\uddc2-\uddc4\uddd1-\uddd3\udddc-\uddde\udde1\udde3\udde8\uddef\uddf3\uddfa\udecb\udecd-\udecf\udee0-\udee5\udee9\udef0\udef3]|[\u203c\u2049\u2139\u2194-\u2199\u21a9\u21aa\u231a\u231b\u2328\u23cf\u23ed-\u23ef\u23f1\u23f2\u23f8-\u23fa\u24c2\u25aa\u25ab\u25b6\u25c0\u25fb-\u25fe\u2600-\u2604\u260e\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262a\u262e\u262f\u2638-\u263a\u2640\u2642\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267b\u267f\u2692-\u2697\u2699\u269b\u269c\u26a0\u26a1\u26a7\u26aa\u26ab\u26b0\u26b1\u26bd\u26be\u26c4\u26c5\u26c8\u26cf\u26d1\u26d3\u26d4\u26e9\u26ea\u26f0-\u26f5\u26f8\u26fa\u26fd\u2702\u2708\u2709\u270f\u2712\u2714\u2716\u271d\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u2764\u27a1\u2934\u2935\u2b05-\u2b07\u2b1b\u2b1c\u2b50\u2b55\u3030\u303d\u3297\u3299])(?:\ufe0f|(?!\ufe0e))|(?:(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75\udd90]|[\u261d\u26f7\u26f9\u270c\u270d])(?:\ufe0f|(?!\ufe0e))|(?:\ud83c[\udf85\udfc2-\udfc4\udfc7\udfca]|\ud83d[\udc42\udc43\udc46-\udc50\udc66-\udc69\udc6e\udc70-\udc78\udc7c\udc81-\udc83\udc85-\udc87\udcaa\udd7a\udd95\udd96\ude45-\ude47\ude4b-\ude4f\udea3\udeb4-\udeb6\udec0\udecc]|\ud83e[\udd0c\udd0f\udd18-\udd1c\udd1e\udd1f\udd26\udd30-\udd39\udd3d\udd3e\udd77\uddb5\uddb6\uddb8\uddb9\uddbb\uddcd-\uddcf\uddd1-\udddd\udec3-\udec5\udef0-\udef6]|[\u270a\u270b]))(?:\ud83c[\udffb-\udfff])?|(?:\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc73\udb40\udc63\udb40\udc74\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc77\udb40\udc6c\udb40\udc73\udb40\udc7f|\ud83c\udde6\ud83c[\udde8-\uddec\uddee\uddf1\uddf2\uddf4\uddf6-\uddfa\uddfc\uddfd\uddff]|\ud83c\udde7\ud83c[\udde6\udde7\udde9-\uddef\uddf1-\uddf4\uddf6-\uddf9\uddfb\uddfc\uddfe\uddff]|\ud83c\udde8\ud83c[\udde6\udde8\udde9\uddeb-\uddee\uddf0-\uddf5\uddf7\uddfa-\uddff]|\ud83c\udde9\ud83c[\uddea\uddec\uddef\uddf0\uddf2\uddf4\uddff]|\ud83c\uddea\ud83c[\udde6\udde8\uddea\uddec\udded\uddf7-\uddfa]|\ud83c\uddeb\ud83c[\uddee-\uddf0\uddf2\uddf4\uddf7]|\ud83c\uddec\ud83c[\udde6\udde7\udde9-\uddee\uddf1-\uddf3\uddf5-\uddfa\uddfc\uddfe]|\ud83c\udded\ud83c[\uddf0\uddf2\uddf3\uddf7\uddf9\uddfa]|\ud83c\uddee\ud83c[\udde8-\uddea\uddf1-\uddf4\uddf6-\uddf9]|\ud83c\uddef\ud83c[\uddea\uddf2\uddf4\uddf5]|\ud83c\uddf0\ud83c[\uddea\uddec-\uddee\uddf2\uddf3\uddf5\uddf7\uddfc\uddfe\uddff]|\ud83c\uddf1\ud83c[\udde6-\udde8\uddee\uddf0\uddf7-\uddfb\uddfe]|\ud83c\uddf2\ud83c[\udde6\udde8-\udded\uddf0-\uddff]|\ud83c\uddf3\ud83c[\udde6\udde8\uddea-\uddec\uddee\uddf1\uddf4\uddf5\uddf7\uddfa\uddff]|\ud83c\uddf4\ud83c\uddf2|\ud83c\uddf5\ud83c[\udde6\uddea-\udded\uddf0-\uddf3\uddf7-\uddf9\uddfc\uddfe]|\ud83c\uddf6\ud83c\udde6|\ud83c\uddf7\ud83c[\uddea\uddf4\uddf8\uddfa\uddfc]|\ud83c\uddf8\ud83c[\udde6-\uddea\uddec-\uddf4\uddf7-\uddf9\uddfb\uddfd-\uddff]|\ud83c\uddf9\ud83c[\udde6\udde8\udde9\uddeb-\udded\uddef-\uddf4\uddf7\uddf9\uddfb\uddfc\uddff]|\ud83c\uddfa\ud83c[\udde6\uddec\uddf2\uddf3\uddf8\uddfe\uddff]|\ud83c\uddfb\ud83c[\udde6\udde8\uddea\uddec\uddee\uddf3\uddfa]|\ud83c\uddfc\ud83c[\uddeb\uddf8]|\ud83c\uddfd\ud83c\uddf0|\ud83c\uddfe\ud83c[\uddea\uddf9]|\ud83c\uddff\ud83c[\udde6\uddf2\uddfc]|\ud83c[\udccf\udd8e\udd91-\udd9a\udde6-\uddff\ude01\ude32-\ude36\ude38-\ude3a\ude50\ude51\udf00-\udf20\udf2d-\udf35\udf37-\udf7c\udf7e-\udf84\udf86-\udf93\udfa0-\udfc1\udfc5\udfc6\udfc8\udfc9\udfcf-\udfd3\udfe0-\udff0\udff4\udff8-\udfff]|\ud83d[\udc00-\udc3e\udc40\udc44\udc45\udc51-\udc65\udc6a\udc6f\udc79-\udc7b\udc7d-\udc80\udc84\udc88-\udc8e\udc90\udc92-\udca9\udcab-\udcfc\udcff-\udd3d\udd4b-\udd4e\udd50-\udd67\udda4\uddfb-\ude44\ude48-\ude4a\ude80-\udea2\udea4-\udeb3\udeb7-\udebf\udec1-\udec5\uded0-\uded2\uded5-\uded7\udedd-\udedf\udeeb\udeec\udef4-\udefc\udfe0-\udfeb\udff0]|\ud83e[\udd0d\udd0e\udd10-\udd17\udd20-\udd25\udd27-\udd2f\udd3a\udd3c\udd3f-\udd45\udd47-\udd76\udd78-\uddb4\uddb7\uddba\uddbc-\uddcc\uddd0\uddde-\uddff\ude70-\ude74\ude78-\ude7c\ude80-\ude86\ude90-\udeac\udeb0-\udeba\udec0-\udec2\uded0-\uded9\udee0-\udee7]|[\u23e9-\u23ec\u23f0\u23f3\u267e\u26ce\u2705\u2728\u274c\u274e\u2753-\u2755\u2795-\u2797\u27b0\u27bf\ue50a])|\ufe0f/g,e=/\uFE0F/g,c=String.fromCharCode(8205),t=/[&<>'"]/g,o=/^(?:iframe|noframes|noscript|script|select|style|textarea)$/,r=String.fromCharCode;return d;function n(d,u){return document.createTextNode(u?d.replace(e,""):d)}function a(d,u){return"".concat(u.base,u.size,"/",d,u.ext)}function i(d,u){for(var f,e,c=d.childNodes,t=c.length;t--;)3===(e=(f=c[t]).nodeType)?u.push(f):1!==e||"ownerSVGElement"in f||o.test(f.nodeName.toLowerCase())||i(f,u);return u}function s(d){return g(d.indexOf(c)<0?d.replace(e,""):d)}function b(d,u){for(var e,c,t,o,r,a,b,l,m,p,h,g,v,w=i(d,[]),y=w.length;y--;){for(t=!1,o=document.createDocumentFragment(),a=(r=w[y]).nodeValue,l=0;b=f.exec(a);){if((m=b.index)!==l&&o.appendChild(n(a.slice(l,m),!0)),g=s(h=b[0]),l=m+h.length,v=u.callback(g,u),g&&v){for(c in(p=new Image).onerror=u.onerror,p.setAttribute("draggable","false"),e=u.attributes(h,g))e.hasOwnProperty(c)&&0!==c.indexOf("on")&&!p.hasAttribute(c)&&p.setAttribute(c,e[c]);p.className=u.className,p.alt=h,p.src=v,t=!0,o.appendChild(p)}p||o.appendChild(n(h,!1)),p=null}t&&(l")}return c}))}function m(d){return u[d]}function p(){return null}function h(d,u){return String(d).replace(f,u)}function g(d,u){for(var f=[],e=0,c=0,t=0;t({loading:"lazy"})};u().initializers.add("flarum-emoji",(()=>{!function(){let d=null;(0,f.extend)("flarum/common/components/TextEditor","oninit",(function(){this._loaders.push((async()=>await c.e(411).then(c.bind(c,948)).then((u=>d=u.default)))),this.commonEmoji=["😀","😁","😂","😃","😄","😅","😆","😇","😈","😉","😊","😋","😌","😍","😎","😏","😐️","😑","😒","😓","😔","😕","😖","😗","😘","😙","😚","😛","😜","😝","😞","😟","😠","😡","😢","😣","😤","😥","😦","😧","😨","😩","😪","😫","😬","😭","😮","😮‍💨","😯","😰","😱","😲","😳","😴","😵","😵‍💫","😶","😶‍🌫️","😷","😸","😹","😺","😻","😼","😽","😾","😿","🙀","🙁","🙂","🙃","🙄"]})),(0,f.extend)("flarum/common/components/TextEditor","onbuild",(function(){this.emojiDropdown=new v;const d=this.$(".TextEditor-editor").wrap('
');this.navigator=new(n()),this.navigator.when((()=>this.emojiDropdown.active)).onUp((()=>this.emojiDropdown.navigate(-1))).onDown((()=>this.emojiDropdown.navigate(1))).onSelect(this.emojiDropdown.complete.bind(this.emojiDropdown)).onCancel(this.emojiDropdown.hide.bind(this.emojiDropdown)).bindTo(d),d.after($('
'))})),(0,f.extend)("flarum/common/components/TextEditor","buildEditorParams",(function(u){const f=Object.keys(d),e=new(b())(":");u.inputListeners.push((()=>{const u=this.attrs.composer.editor.getSelectionRange(),c=u[0];if(u[1]-c>0)return;const t=this.attrs.composer.editor.getLastNChars(15),o=e.check(t,c,/[a-z0-9]|\+|\-|_|\:/);if(this.emojiDropdown.hide(),this.emojiDropdown.active=!1,o){const u=o.typed,e=this.emojiDropdown,c=d=>{this.attrs.composer.editor.replaceBeforeCursor(o.absoluteStart-1,d+" "),this.emojiDropdown.hide()},t=function(d){let{emoji:u,name:f,code:t}=d;return m(i(),{text:f},m("button",{key:u,onclick:()=>c(u),onmouseenter:function(){e.setIndex($(this).parent().index()-1)}},m("img",{alt:u,className:"emoji",draggable:"false",loading:"lazy",src:"".concat(D,"72x72/").concat(t,".png"),title:f})))};(()=>{const e=[],c=function(d){const u=new RegExp("\\((["+"+.*?[]{}()^$|\\".replace(/(.)/g,"\\$1")+"])\\)","g");return new RegExp("(.*)"+d.toLowerCase().replace(/(.)/g,"($1)(.*?)").replace(u,"(\\$1)")+"$","i")}(u);let r=40;const n=u=>{for(let c=0;c0;c++){const t=f[c];if(-1===e.indexOf(t)){const f=d[t];for(let d of f)if(u(d,t)){--r,e.push(t);break}}}};n(((d,f)=>{var e;return u?0===d.indexOf(u):null==(e=this.commonEmoji)?void 0:e.includes(f)})),n((d=>c.test(d)));const a=e.map((u=>({emoji:u,name:d[u][0],code:C(u)}))).map(t);if(a.length){this.emojiDropdown.items=a,m.render(this.$(".ComposerBody-emojiDropdownContainer")[0],this.emojiDropdown.render()),this.emojiDropdown.show();const d=this.attrs.composer.editor.getCaretCoordinates(o.absoluteStart),u=this.emojiDropdown.$().outerWidth(),f=this.emojiDropdown.$().outerHeight(),e=this.emojiDropdown.$().offsetParent();let c=d.left,t=d.top+15;t+f>e.height()&&(t=d.top-f-15),c+u>e.width()&&(c=e.width()-u),t=Math.max(-(e.offset().top-$(document).scrollTop()),t),c=Math.max(-e.offset().left,c),this.emojiDropdown.show(c,t)}})(),this.emojiDropdown.setIndex(0),this.emojiDropdown.$().scrollTop(0),this.emojiDropdown.active=!0}}))})),(0,f.extend)("flarum/common/components/TextEditor","toolbarItems",(function(d){d.add("emoji",m(o(),{onclick:()=>this.attrs.composer.editor.insertAtCursor(" :"),icon:"far fa-smile"},app.translator.trans("flarum-emoji.forum.composer.emoji_tooltip")))}))}(),(0,f.override)(S().prototype,"contentHtml",(function(d){const u=d();if(this.oldContentHtml!==u){const d=y.parse(function(d){const u=document.implementation.createHTMLDocument();return u.body.innerHTML=d,u.body}(u),E);this.emojifiedContentHtml=d.innerHTML,this.oldContentHtml=u}return this.emojifiedContentHtml})),(0,f.override)(s9e.TextFormatter,"preview",((d,u,f)=>{d(u,f),y.parse(f,E)}))}))})(),module.exports=t})(); //# sourceMappingURL=forum.js.map \ No newline at end of file diff --git a/extensions/emoji/js/dist/forum.js.map b/extensions/emoji/js/dist/forum.js.map index 97d15e3bf0..3f0a2ae01e 100644 --- a/extensions/emoji/js/dist/forum.js.map +++ b/extensions/emoji/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"file":"forum.js","mappings":";UAAIA,EACAC,OCAAC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaE,QAGrB,IAAIC,EAASN,EAAyBE,GAAY,CAGjDG,QAAS,CAAC,GAOX,OAHAE,EAAoBL,GA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O,cAAcvH,KAAKC,EAAMC,EAChC,GAEFiL,GACAhS,KAAKoO,cAAc7G,SAAS,GAC5BvH,KAAKoO,cAAcpH,IAAIsB,UAAU,GACjCtI,KAAKoO,cAAclH,QAAS,CAC9B,IAEJ,KACA,IAAA4G,QAAO,sCAAuC,gBAAgB,SAAUrH,GACtEA,EAAMuC,IAAI,QAASxK,EAAE,IAAkB,CACrC2R,QAAS,IAAMnQ,KAAK4G,MAAMwI,SAASC,OAAO4C,eAAe,MACzD7G,KAAM,gBACL9E,IAAIC,WAAWC,MAAM,8CAC1B,GACF,CG1IE0L,IDiBA,IAAAC,UAAS,cAAgB,eAAe,SAAUC,GAChD,MAAMC,EAAcD,IACpB,GAAIpS,KAAKsS,iBAAmBD,EAAa,CAWvC,MAAME,EAAe,QAnB3B,SAAmBxF,GACjB,MAAMyF,EAAMzR,SAAS0R,eAAeC,qBAEpC,OADAF,EAAIG,KAAKC,UAAY7F,EACdyF,EAAIG,IACb,CAeyCE,CAAUR,GAAchH,GAG3DrL,KAAK8S,qBAAuBP,EAAaK,UACzC5S,KAAKsS,eAAiBD,CACxB,CACA,OAAOrS,KAAK8S,oBACd,KACA,IAAAX,UAASY,IAAIC,cAAe,WAAW,CAACZ,EAAU3H,EAAMwI,KACtDb,EAAS3H,EAAMwI,GACf,QAAcA,EAAS5H,EAAQ,GCrCpB","sources":["webpack://@flarum/emoji/webpack/runtime/load script","webpack://@flarum/emoji/webpack/bootstrap","webpack://@flarum/emoji/webpack/runtime/compat get default export","webpack://@flarum/emoji/webpack/runtime/define property getters","webpack://@flarum/emoji/webpack/runtime/ensure chunk","webpack://@flarum/emoji/webpack/runtime/get javascript chunk filename","webpack://@flarum/emoji/webpack/runtime/global","webpack://@flarum/emoji/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/emoji/webpack/runtime/make namespace object","webpack://@flarum/emoji/webpack/runtime/publicPath","webpack://@flarum/emoji/webpack/runtime/compat","webpack://@flarum/emoji/webpack/runtime/jsonp chunk loading","webpack://@flarum/emoji/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/emoji/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/emoji/external root \"flarum.reg.get('core', 'common/components/TextEditorButton')\"","webpack://@flarum/emoji/external root \"flarum.reg.get('core', 'common/utils/KeyboardNavigatable')\"","webpack://@flarum/emoji/external root \"flarum.reg.get('core', 'common/components/Tooltip')\"","webpack://@flarum/emoji/external root \"flarum.reg.get('core', 'common/utils/AutocompleteReader')\"","webpack://@flarum/emoji/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/emoji/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/emoji/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/emoji/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@flarum/emoji/external root \"flarum.reg.get('core', 'common/Fragment')\"","webpack://@flarum/emoji/./src/forum/fragments/AutocompleteDropdown.js","webpack://@flarum/emoji/../../../node_modules/twemoji/dist/twemoji.esm.js","webpack://@flarum/emoji/./src/forum/helpers/getEmojiIconCode.js","webpack://@flarum/emoji/./src/forum/cdn.js","webpack://@flarum/emoji/./src/forum/addComposerAutocomplete.js","webpack://@flarum/emoji/external root \"flarum.reg.get('core', 'common/models/Post')\"","webpack://@flarum/emoji/./src/forum/renderEmoji.js","webpack://@flarum/emoji/./src/forum/index.js"],"sourcesContent":["var inProgress = {};\nvar dataWebpackPrefix = \"module.exports:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t};\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\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// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\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__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + \"forum/emojiMap\" + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\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};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.f.compat = (chunkId, promises) => {\n\n\tconst originalLoadChunk = __webpack_require__.l;\n\t__webpack_require__.l = flarum.reg.loadChunk.bind(flarum.reg, originalLoadChunk);\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t315: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkmodule_exports\"] = self[\"webpackChunkmodule_exports\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/TextEditorButton');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/KeyboardNavigatable');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Tooltip');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/AutocompleteReader');","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _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 }, _typeof(obj);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Fragment');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport Fragment from 'flarum/common/Fragment';\nexport default class AutocompleteDropdown extends Fragment {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"items\", []);\n _defineProperty(this, \"active\", false);\n _defineProperty(this, \"index\", 0);\n _defineProperty(this, \"keyWasJustPressed\", false);\n }\n view() {\n return m(\"ul\", {\n className: \"Dropdown-menu EmojiDropdown\"\n }, m(\"li\", {\n className: \"Dropdown-header\"\n }, app.translator.trans('flarum-emoji.forum.composer.type_to_search_text')), this.items.map(item => m(\"li\", {\n key: item.attrs.key\n }, item)));\n }\n show(left, top) {\n this.$().show().css({\n left: left + 'px',\n top: top + 'px'\n });\n this.active = true;\n }\n hide() {\n this.$().hide();\n this.active = false;\n }\n navigate(delta) {\n this.keyWasJustPressed = true;\n this.setIndex(this.index + delta, true);\n clearTimeout(this.keyWasJustPressedTimeout);\n this.keyWasJustPressedTimeout = setTimeout(() => this.keyWasJustPressed = false, 500);\n }\n complete() {\n this.$('li:not(.Dropdown-header)').eq(this.index).find('button').click();\n }\n setIndex(index, scrollToItem) {\n if (this.keyWasJustPressed && !scrollToItem) return;\n const $dropdown = this.$();\n const $items = $dropdown.find('li:not(.Dropdown-header)');\n let rangedIndex = index;\n if (rangedIndex < 0) {\n rangedIndex = $items.length - 1;\n } else if (rangedIndex >= $items.length) {\n rangedIndex = 0;\n }\n this.index = rangedIndex;\n const $item = $items.removeClass('active').eq(rangedIndex).addClass('active');\n if (scrollToItem) {\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 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 if (typeof scrollTop !== 'undefined') {\n $dropdown.stop(true).animate({\n scrollTop\n }, 100);\n }\n }\n }\n}\nflarum.reg.add('flarum-emoji', 'forum/fragments/AutocompleteDropdown', AutocompleteDropdown);","/*! Copyright Twitter Inc. and other contributors. Licensed under MIT */\nvar twemoji=function(){\"use strict\";var twemoji={base:\"https://twemoji.maxcdn.com/v/14.0.2/\",ext:\".png\",size:\"72x72\",className:\"emoji\",convert:{fromCodePoint:fromCodePoint,toCodePoint:toCodePoint},onerror:function onerror(){if(this.parentNode){this.parentNode.replaceChild(createText(this.alt,false),this)}},parse:parse,replace:replace,test:test},escaper={\"&\":\"&\",\"<\":\"<\",\">\":\">\",\"'\":\"'\",'\"':\""\"},re=/(?:\\ud83d\\udc68\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffc-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc68\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udffe]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffc-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffe]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68|\\ud83d\\udc69\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d[\\udc68\\udc69]|\\ud83e\\udef1\\ud83c\\udffb\\u200d\\ud83e\\udef2\\ud83c[\\udffc-\\udfff]|\\ud83e\\udef1\\ud83c\\udffc\\u200d\\ud83e\\udef2\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\udef1\\ud83c\\udffd\\u200d\\ud83e\\udef2\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\udef1\\ud83c\\udffe\\u200d\\ud83e\\udef2\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\udef1\\ud83c\\udfff\\u200d\\ud83e\\udef2\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc68\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68|\\ud83d\\udc69\\u200d\\u2764\\ufe0f\\u200d\\ud83d[\\udc68\\udc69]|\\ud83e\\uddd1\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1|\\ud83d\\udc6b\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc6c\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc6d\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc8f\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc91\\ud83c[\\udffb-\\udfff]|\\ud83e\\udd1d\\ud83c[\\udffb-\\udfff]|\\ud83d[\\udc6b-\\udc6d\\udc8f\\udc91]|\\ud83e\\udd1d)|(?:\\ud83d[\\udc68\\udc69]|\\ud83e\\uddd1)(?:\\ud83c[\\udffb-\\udfff])?\\u200d(?:\\u2695\\ufe0f|\\u2696\\ufe0f|\\u2708\\ufe0f|\\ud83c[\\udf3e\\udf73\\udf7c\\udf84\\udf93\\udfa4\\udfa8\\udfeb\\udfed]|\\ud83d[\\udcbb\\udcbc\\udd27\\udd2c\\ude80\\ude92]|\\ud83e[\\uddaf-\\uddb3\\uddbc\\uddbd])|(?:\\ud83c[\\udfcb\\udfcc]|\\ud83d[\\udd74\\udd75]|\\u26f9)((?:\\ud83c[\\udffb-\\udfff]|\\ufe0f)\\u200d[\\u2640\\u2642]\\ufe0f)|(?:\\ud83c[\\udfc3\\udfc4\\udfca]|\\ud83d[\\udc6e\\udc70\\udc71\\udc73\\udc77\\udc81\\udc82\\udc86\\udc87\\ude45-\\ude47\\ude4b\\ude4d\\ude4e\\udea3\\udeb4-\\udeb6]|\\ud83e[\\udd26\\udd35\\udd37-\\udd39\\udd3d\\udd3e\\uddb8\\uddb9\\uddcd-\\uddcf\\uddd4\\uddd6-\\udddd])(?:\\ud83c[\\udffb-\\udfff])?\\u200d[\\u2640\\u2642]\\ufe0f|(?:\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83c\\udff3\\ufe0f\\u200d\\u26a7\\ufe0f|\\ud83c\\udff3\\ufe0f\\u200d\\ud83c\\udf08|\\ud83d\\ude36\\u200d\\ud83c\\udf2b\\ufe0f|\\u2764\\ufe0f\\u200d\\ud83d\\udd25|\\u2764\\ufe0f\\u200d\\ud83e\\ude79|\\ud83c\\udff4\\u200d\\u2620\\ufe0f|\\ud83d\\udc15\\u200d\\ud83e\\uddba|\\ud83d\\udc3b\\u200d\\u2744\\ufe0f|\\ud83d\\udc41\\u200d\\ud83d\\udde8|\\ud83d\\udc68\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc6f\\u200d\\u2640\\ufe0f|\\ud83d\\udc6f\\u200d\\u2642\\ufe0f|\\ud83d\\ude2e\\u200d\\ud83d\\udca8|\\ud83d\\ude35\\u200d\\ud83d\\udcab|\\ud83e\\udd3c\\u200d\\u2640\\ufe0f|\\ud83e\\udd3c\\u200d\\u2642\\ufe0f|\\ud83e\\uddde\\u200d\\u2640\\ufe0f|\\ud83e\\uddde\\u200d\\u2642\\ufe0f|\\ud83e\\udddf\\u200d\\u2640\\ufe0f|\\ud83e\\udddf\\u200d\\u2642\\ufe0f|\\ud83d\\udc08\\u200d\\u2b1b)|[#*0-9]\\ufe0f?\\u20e3|(?:[©®\\u2122\\u265f]\\ufe0f)|(?:\\ud83c[\\udc04\\udd70\\udd71\\udd7e\\udd7f\\ude02\\ude1a\\ude2f\\ude37\\udf21\\udf24-\\udf2c\\udf36\\udf7d\\udf96\\udf97\\udf99-\\udf9b\\udf9e\\udf9f\\udfcd\\udfce\\udfd4-\\udfdf\\udff3\\udff5\\udff7]|\\ud83d[\\udc3f\\udc41\\udcfd\\udd49\\udd4a\\udd6f\\udd70\\udd73\\udd76-\\udd79\\udd87\\udd8a-\\udd8d\\udda5\\udda8\\uddb1\\uddb2\\uddbc\\uddc2-\\uddc4\\uddd1-\\uddd3\\udddc-\\uddde\\udde1\\udde3\\udde8\\uddef\\uddf3\\uddfa\\udecb\\udecd-\\udecf\\udee0-\\udee5\\udee9\\udef0\\udef3]|[\\u203c\\u2049\\u2139\\u2194-\\u2199\\u21a9\\u21aa\\u231a\\u231b\\u2328\\u23cf\\u23ed-\\u23ef\\u23f1\\u23f2\\u23f8-\\u23fa\\u24c2\\u25aa\\u25ab\\u25b6\\u25c0\\u25fb-\\u25fe\\u2600-\\u2604\\u260e\\u2611\\u2614\\u2615\\u2618\\u2620\\u2622\\u2623\\u2626\\u262a\\u262e\\u262f\\u2638-\\u263a\\u2640\\u2642\\u2648-\\u2653\\u2660\\u2663\\u2665\\u2666\\u2668\\u267b\\u267f\\u2692-\\u2697\\u2699\\u269b\\u269c\\u26a0\\u26a1\\u26a7\\u26aa\\u26ab\\u26b0\\u26b1\\u26bd\\u26be\\u26c4\\u26c5\\u26c8\\u26cf\\u26d1\\u26d3\\u26d4\\u26e9\\u26ea\\u26f0-\\u26f5\\u26f8\\u26fa\\u26fd\\u2702\\u2708\\u2709\\u270f\\u2712\\u2714\\u2716\\u271d\\u2721\\u2733\\u2734\\u2744\\u2747\\u2757\\u2763\\u2764\\u27a1\\u2934\\u2935\\u2b05-\\u2b07\\u2b1b\\u2b1c\\u2b50\\u2b55\\u3030\\u303d\\u3297\\u3299])(?:\\ufe0f|(?!\\ufe0e))|(?:(?:\\ud83c[\\udfcb\\udfcc]|\\ud83d[\\udd74\\udd75\\udd90]|[\\u261d\\u26f7\\u26f9\\u270c\\u270d])(?:\\ufe0f|(?!\\ufe0e))|(?:\\ud83c[\\udf85\\udfc2-\\udfc4\\udfc7\\udfca]|\\ud83d[\\udc42\\udc43\\udc46-\\udc50\\udc66-\\udc69\\udc6e\\udc70-\\udc78\\udc7c\\udc81-\\udc83\\udc85-\\udc87\\udcaa\\udd7a\\udd95\\udd96\\ude45-\\ude47\\ude4b-\\ude4f\\udea3\\udeb4-\\udeb6\\udec0\\udecc]|\\ud83e[\\udd0c\\udd0f\\udd18-\\udd1c\\udd1e\\udd1f\\udd26\\udd30-\\udd39\\udd3d\\udd3e\\udd77\\uddb5\\uddb6\\uddb8\\uddb9\\uddbb\\uddcd-\\uddcf\\uddd1-\\udddd\\udec3-\\udec5\\udef0-\\udef6]|[\\u270a\\u270b]))(?:\\ud83c[\\udffb-\\udfff])?|(?:\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc65\\udb40\\udc6e\\udb40\\udc67\\udb40\\udc7f|\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc73\\udb40\\udc63\\udb40\\udc74\\udb40\\udc7f|\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc77\\udb40\\udc6c\\udb40\\udc73\\udb40\\udc7f|\\ud83c\\udde6\\ud83c[\\udde8-\\uddec\\uddee\\uddf1\\uddf2\\uddf4\\uddf6-\\uddfa\\uddfc\\uddfd\\uddff]|\\ud83c\\udde7\\ud83c[\\udde6\\udde7\\udde9-\\uddef\\uddf1-\\uddf4\\uddf6-\\uddf9\\uddfb\\uddfc\\uddfe\\uddff]|\\ud83c\\udde8\\ud83c[\\udde6\\udde8\\udde9\\uddeb-\\uddee\\uddf0-\\uddf5\\uddf7\\uddfa-\\uddff]|\\ud83c\\udde9\\ud83c[\\uddea\\uddec\\uddef\\uddf0\\uddf2\\uddf4\\uddff]|\\ud83c\\uddea\\ud83c[\\udde6\\udde8\\uddea\\uddec\\udded\\uddf7-\\uddfa]|\\ud83c\\uddeb\\ud83c[\\uddee-\\uddf0\\uddf2\\uddf4\\uddf7]|\\ud83c\\uddec\\ud83c[\\udde6\\udde7\\udde9-\\uddee\\uddf1-\\uddf3\\uddf5-\\uddfa\\uddfc\\uddfe]|\\ud83c\\udded\\ud83c[\\uddf0\\uddf2\\uddf3\\uddf7\\uddf9\\uddfa]|\\ud83c\\uddee\\ud83c[\\udde8-\\uddea\\uddf1-\\uddf4\\uddf6-\\uddf9]|\\ud83c\\uddef\\ud83c[\\uddea\\uddf2\\uddf4\\uddf5]|\\ud83c\\uddf0\\ud83c[\\uddea\\uddec-\\uddee\\uddf2\\uddf3\\uddf5\\uddf7\\uddfc\\uddfe\\uddff]|\\ud83c\\uddf1\\ud83c[\\udde6-\\udde8\\uddee\\uddf0\\uddf7-\\uddfb\\uddfe]|\\ud83c\\uddf2\\ud83c[\\udde6\\udde8-\\udded\\uddf0-\\uddff]|\\ud83c\\uddf3\\ud83c[\\udde6\\udde8\\uddea-\\uddec\\uddee\\uddf1\\uddf4\\uddf5\\uddf7\\uddfa\\uddff]|\\ud83c\\uddf4\\ud83c\\uddf2|\\ud83c\\uddf5\\ud83c[\\udde6\\uddea-\\udded\\uddf0-\\uddf3\\uddf7-\\uddf9\\uddfc\\uddfe]|\\ud83c\\uddf6\\ud83c\\udde6|\\ud83c\\uddf7\\ud83c[\\uddea\\uddf4\\uddf8\\uddfa\\uddfc]|\\ud83c\\uddf8\\ud83c[\\udde6-\\uddea\\uddec-\\uddf4\\uddf7-\\uddf9\\uddfb\\uddfd-\\uddff]|\\ud83c\\uddf9\\ud83c[\\udde6\\udde8\\udde9\\uddeb-\\udded\\uddef-\\uddf4\\uddf7\\uddf9\\uddfb\\uddfc\\uddff]|\\ud83c\\uddfa\\ud83c[\\udde6\\uddec\\uddf2\\uddf3\\uddf8\\uddfe\\uddff]|\\ud83c\\uddfb\\ud83c[\\udde6\\udde8\\uddea\\uddec\\uddee\\uddf3\\uddfa]|\\ud83c\\uddfc\\ud83c[\\uddeb\\uddf8]|\\ud83c\\uddfd\\ud83c\\uddf0|\\ud83c\\uddfe\\ud83c[\\uddea\\uddf9]|\\ud83c\\uddff\\ud83c[\\udde6\\uddf2\\uddfc]|\\ud83c[\\udccf\\udd8e\\udd91-\\udd9a\\udde6-\\uddff\\ude01\\ude32-\\ude36\\ude38-\\ude3a\\ude50\\ude51\\udf00-\\udf20\\udf2d-\\udf35\\udf37-\\udf7c\\udf7e-\\udf84\\udf86-\\udf93\\udfa0-\\udfc1\\udfc5\\udfc6\\udfc8\\udfc9\\udfcf-\\udfd3\\udfe0-\\udff0\\udff4\\udff8-\\udfff]|\\ud83d[\\udc00-\\udc3e\\udc40\\udc44\\udc45\\udc51-\\udc65\\udc6a\\udc6f\\udc79-\\udc7b\\udc7d-\\udc80\\udc84\\udc88-\\udc8e\\udc90\\udc92-\\udca9\\udcab-\\udcfc\\udcff-\\udd3d\\udd4b-\\udd4e\\udd50-\\udd67\\udda4\\uddfb-\\ude44\\ude48-\\ude4a\\ude80-\\udea2\\udea4-\\udeb3\\udeb7-\\udebf\\udec1-\\udec5\\uded0-\\uded2\\uded5-\\uded7\\udedd-\\udedf\\udeeb\\udeec\\udef4-\\udefc\\udfe0-\\udfeb\\udff0]|\\ud83e[\\udd0d\\udd0e\\udd10-\\udd17\\udd20-\\udd25\\udd27-\\udd2f\\udd3a\\udd3c\\udd3f-\\udd45\\udd47-\\udd76\\udd78-\\uddb4\\uddb7\\uddba\\uddbc-\\uddcc\\uddd0\\uddde-\\uddff\\ude70-\\ude74\\ude78-\\ude7c\\ude80-\\ude86\\ude90-\\udeac\\udeb0-\\udeba\\udec0-\\udec2\\uded0-\\uded9\\udee0-\\udee7]|[\\u23e9-\\u23ec\\u23f0\\u23f3\\u267e\\u26ce\\u2705\\u2728\\u274c\\u274e\\u2753-\\u2755\\u2795-\\u2797\\u27b0\\u27bf\\ue50a])|\\ufe0f/g,UFE0Fg=/\\uFE0F/g,U200D=String.fromCharCode(8205),rescaper=/[&<>'\"]/g,shouldntBeParsed=/^(?:iframe|noframes|noscript|script|select|style|textarea)$/,fromCharCode=String.fromCharCode;return twemoji;function createText(text,clean){return document.createTextNode(clean?text.replace(UFE0Fg,\"\"):text)}function escapeHTML(s){return s.replace(rescaper,replacer)}function defaultImageSrcGenerator(icon,options){return\"\".concat(options.base,options.size,\"/\",icon,options.ext)}function grabAllTextNodes(node,allText){var childNodes=node.childNodes,length=childNodes.length,subnode,nodeType;while(length--){subnode=childNodes[length];nodeType=subnode.nodeType;if(nodeType===3){allText.push(subnode)}else if(nodeType===1&&!(\"ownerSVGElement\"in subnode)&&!shouldntBeParsed.test(subnode.nodeName.toLowerCase())){grabAllTextNodes(subnode,allText)}}return allText}function grabTheRightIcon(rawText){return toCodePoint(rawText.indexOf(U200D)<0?rawText.replace(UFE0Fg,\"\"):rawText)}function parseNode(node,options){var allText=grabAllTextNodes(node,[]),length=allText.length,attrib,attrname,modified,fragment,subnode,text,match,i,index,img,rawText,iconId,src;while(length--){modified=false;fragment=document.createDocumentFragment();subnode=allText[length];text=subnode.nodeValue;i=0;while(match=re.exec(text)){index=match.index;if(index!==i){fragment.appendChild(createText(text.slice(i,index),true))}rawText=match[0];iconId=grabTheRightIcon(rawText);i=index+rawText.length;src=options.callback(iconId,options);if(iconId&&src){img=new Image;img.onerror=options.onerror;img.setAttribute(\"draggable\",\"false\");attrib=options.attributes(rawText,iconId);for(attrname in attrib){if(attrib.hasOwnProperty(attrname)&&attrname.indexOf(\"on\")!==0&&!img.hasAttribute(attrname)){img.setAttribute(attrname,attrib[attrname])}}img.className=options.className;img.alt=rawText;img.src=src;modified=true;fragment.appendChild(img)}if(!img)fragment.appendChild(createText(rawText,false));img=null}if(modified){if(i\")}return ret})}function replacer(m){return escaper[m]}function returnNull(){return null}function toSizeSquaredAsset(value){return typeof value===\"number\"?value+\"x\"+value:value}function fromCodePoint(codepoint){var code=typeof codepoint===\"string\"?parseInt(codepoint,16):codepoint;if(code<65536){return fromCharCode(code)}code-=65536;return fromCharCode(55296+(code>>10),56320+(code&1023))}function parse(what,how){if(!how||typeof how===\"function\"){how={callback:how}}return(typeof what===\"string\"?parseString:parseNode)(what,{callback:how.callback||defaultImageSrcGenerator,attributes:typeof how.attributes===\"function\"?how.attributes:returnNull,base:typeof how.base===\"string\"?how.base:twemoji.base,ext:how.ext||twemoji.ext,size:how.folder||toSizeSquaredAsset(how.size||twemoji.size),className:how.className||twemoji.className,onerror:how.onerror||twemoji.onerror})}function replace(text,callback){return String(text).replace(re,callback)}function test(text){re.lastIndex=0;var result=re.test(text);re.lastIndex=0;return result}function toCodePoint(unicodeSurrogates,sep){var r=[],c=0,p=0,i=0;while(i await import(/* webpackChunkName: 'forum/emojiMap', webpackMode: 'lazy-once' */ './emojiMap').then(m => emojiMap = m.default));\n // prettier-ignore\n this.commonEmoji = ['😀', '😁', '😂', '😃', '😄', '😅', '😆', '😇', '😈', '😉', '😊', '😋', '😌', '😍', '😎', '😏', '😐️', '😑', '😒', '😓', '😔', '😕', '😖', '😗', '😘', '😙', '😚', '😛', '😜', '😝', '😞', '😟', '😠', '😡', '😢', '😣', '😤', '😥', '😦', '😧', '😨', '😩', '😪', '😫', '😬', '😭', '😮', '😮‍💨', '😯', '😰', '😱', '😲', '😳', '😴', '😵', '😵‍💫', '😶', '😶‍🌫️', '😷', '😸', '😹', '😺', '😻', '😼', '😽', '😾', '😿', '🙀', '🙁', '🙂', '🙃', '🙄'];\n });\n extend('flarum/common/components/TextEditor', 'onbuild', function () {\n this.emojiDropdown = new AutocompleteDropdown();\n const $editor = this.$('.TextEditor-editor').wrap('
');\n this.navigator = new KeyboardNavigatable();\n this.navigator.when(() => this.emojiDropdown.active).onUp(() => this.emojiDropdown.navigate(-1)).onDown(() => this.emojiDropdown.navigate(1)).onSelect(this.emojiDropdown.complete.bind(this.emojiDropdown)).onCancel(this.emojiDropdown.hide.bind(this.emojiDropdown)).bindTo($editor);\n $editor.after($('
'));\n });\n extend('flarum/common/components/TextEditor', 'buildEditorParams', function (params) {\n const emojiKeys = Object.keys(emojiMap);\n const autocompleteReader = new AutocompleteReader(':');\n params.inputListeners.push(() => {\n const selection = this.attrs.composer.editor.getSelectionRange();\n const cursor = selection[0];\n if (selection[1] - cursor > 0) return;\n const lastChunk = this.attrs.composer.editor.getLastNChars(15);\n const autocompleting = autocompleteReader.check(lastChunk, cursor, /[a-z0-9]|\\+|\\-|_|\\:/);\n this.emojiDropdown.hide();\n this.emojiDropdown.active = false;\n if (autocompleting) {\n const typed = autocompleting.typed;\n const emojiDropdown = this.emojiDropdown;\n const applySuggestion = replacement => {\n this.attrs.composer.editor.replaceBeforeCursor(autocompleting.absoluteStart - 1, replacement + ' ');\n this.emojiDropdown.hide();\n };\n const makeSuggestion = function (_ref) {\n let {\n emoji,\n name,\n code\n } = _ref;\n return m(Tooltip, {\n text: name\n }, m(\"button\", {\n key: emoji,\n onclick: () => applySuggestion(emoji),\n onmouseenter: function () {\n emojiDropdown.setIndex($(this).parent().index() - 1);\n }\n }, m(\"img\", {\n alt: emoji,\n className: \"emoji\",\n draggable: \"false\",\n loading: \"lazy\",\n src: \"\".concat(cdn, \"72x72/\").concat(code, \".png\"),\n title: name\n })));\n };\n const buildSuggestions = () => {\n const similarEmoji = [];\n\n // Build a regular expression to do a fuzzy match of the given input string\n const fuzzyRegexp = function (str) {\n const reEscape = new RegExp('\\\\(([' + '+.*?[]{}()^$|\\\\'.replace(/(.)/g, '\\\\$1') + '])\\\\)', 'g');\n return new RegExp('(.*)' + str.toLowerCase().replace(/(.)/g, '($1)(.*?)').replace(reEscape, '(\\\\$1)') + '$', 'i');\n };\n const regTyped = fuzzyRegexp(typed);\n let maxSuggestions = 40;\n const findMatchingEmojis = matcher => {\n for (let i = 0; i < emojiKeys.length && maxSuggestions > 0; i++) {\n const curEmoji = emojiKeys[i];\n if (similarEmoji.indexOf(curEmoji) === -1) {\n const names = emojiMap[curEmoji];\n for (let name of names) {\n if (matcher(name, curEmoji)) {\n --maxSuggestions;\n similarEmoji.push(curEmoji);\n break;\n }\n }\n }\n }\n };\n\n // First, try to find all emojis starting with the given string\n findMatchingEmojis((emojiName, emoji) => {\n // If no input is provided yet, match the most common emojis.\n if (!typed) {\n var _this$commonEmoji;\n return (_this$commonEmoji = this.commonEmoji) == null ? void 0 : _this$commonEmoji.includes(emoji);\n }\n return emojiName.indexOf(typed) === 0;\n });\n\n // If there are still suggestions left, try for some fuzzy matches\n findMatchingEmojis(emojiName => regTyped.test(emojiName));\n const suggestions = similarEmoji.map(emoji => ({\n emoji,\n name: emojiMap[emoji][0],\n code: getEmojiIconCode(emoji)\n })).map(makeSuggestion);\n if (suggestions.length) {\n this.emojiDropdown.items = suggestions;\n m.render(this.$('.ComposerBody-emojiDropdownContainer')[0], this.emojiDropdown.render());\n this.emojiDropdown.show();\n const coordinates = this.attrs.composer.editor.getCaretCoordinates(autocompleting.absoluteStart);\n const width = this.emojiDropdown.$().outerWidth();\n const height = this.emojiDropdown.$().outerHeight();\n const parent = this.emojiDropdown.$().offsetParent();\n let left = coordinates.left;\n let top = coordinates.top + 15;\n\n // Keep the dropdown inside the editor.\n if (top + height > parent.height()) {\n top = coordinates.top - height - 15;\n }\n if (left + width > parent.width()) {\n left = parent.width() - width;\n }\n\n // Prevent the dropdown from going off screen on mobile\n top = Math.max(-(parent.offset().top - $(document).scrollTop()), top);\n left = Math.max(-parent.offset().left, left);\n this.emojiDropdown.show(left, top);\n }\n };\n buildSuggestions();\n this.emojiDropdown.setIndex(0);\n this.emojiDropdown.$().scrollTop(0);\n this.emojiDropdown.active = true;\n }\n });\n });\n extend('flarum/common/components/TextEditor', 'toolbarItems', function (items) {\n items.add('emoji', m(TextEditorButton, {\n onclick: () => this.attrs.composer.editor.insertAtCursor(' :'),\n icon: \"far fa-smile\"\n }, app.translator.trans('flarum-emoji.forum.composer.emoji_tooltip')));\n });\n}flarum.reg.addChunkModule('411', '948', 'flarum-emoji', 'forum/emojiMap');\nflarum.reg.addChunkModule('411', '948', 'flarum-emoji', '/home/runner/work/framework/framework/extensions/emoji/js/src/forum/emojiMap.ts');\nflarum.reg.addChunkModule('411', '948', 'flarum-emoji', '/home/runner/work/framework/framework/node_modules/simple-emoji-map/index.mjs');\nflarum.reg.addChunkModule('411', '948', 'flarum-emoji', '/home/runner/work/framework/framework/node_modules/simple-emoji-map/generated/emojis.json');\nflarum.reg.addChunkModule('411', '948', 'flarum-emoji', '/home/runner/work/framework/framework/node_modules/simple-emoji-map/generated/variants.json');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/Post');","import twemoji from 'twemoji';\nimport { override } from 'flarum/common/extend';\nimport Post from 'flarum/common/models/Post';\nimport base from './cdn';\nconst options = {\n base,\n attributes: () => ({\n loading: 'lazy'\n })\n};\n\n/**\n * Parses an HTML string into a `` node containing the HTML content.\n *\n * Vanilla JS implementation of jQuery's `$.parseHTML()`,\n * sourced from http://youmightnotneedjquery.com/\n */\nfunction parseHTML(str) {\n const tmp = document.implementation.createHTMLDocument();\n tmp.body.innerHTML = str;\n return tmp.body;\n}\nexport default function renderEmoji() {\n override(Post.prototype, 'contentHtml', function (original) {\n const contentHtml = original();\n if (this.oldContentHtml !== contentHtml) {\n // We need to parse the HTML string into a DOM node, then give it to Twemoji.\n //\n // This prevents some issues with the default find-replace that would be performed\n // on a string passed to `Twemoji.parse()`.\n //\n // The parse function can only handle a single DOM node provided, so we need to\n // wrap it in a node. In our `parseHTML` implementation, we wrap it in a ``\n // element. This gets stripped below.\n //\n // See https://github.com/flarum/core/issues/2958\n const emojifiedDom = twemoji.parse(parseHTML(contentHtml), options);\n\n // Steal the HTML string inside the emojified DOM `` tag.\n this.emojifiedContentHtml = emojifiedDom.innerHTML;\n this.oldContentHtml = contentHtml;\n }\n return this.emojifiedContentHtml;\n });\n override(s9e.TextFormatter, 'preview', (original, text, element) => {\n original(text, element);\n twemoji.parse(element, options);\n });\n}","import app from 'flarum/forum/app';\nimport addComposerAutocomplete from './addComposerAutocomplete';\nimport renderEmoji from './renderEmoji';\napp.initializers.add('flarum-emoji', () => {\n // After typing ':' in the composer, show a dropdown suggesting a bunch of\n // emoji that the user could use.\n addComposerAutocomplete();\n\n // render emoji as image in Posts content and title.\n renderEmoji();\n});"],"names":["inProgress","dataWebpackPrefix","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","m","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","f","e","chunkId","Promise","all","keys","reduce","promises","u","g","globalThis","this","Function","window","obj","prop","prototype","hasOwnProperty","call","l","url","done","push","script","needAttach","scripts","document","getElementsByTagName","i","length","s","getAttribute","createElement","charset","timeout","nc","setAttribute","src","onScriptComplete","prev","event","onerror","onload","clearTimeout","doneFns","parentNode","removeChild","forEach","fn","setTimeout","bind","type","target","head","appendChild","r","Symbol","toStringTag","value","scriptUrl","importScripts","location","currentScript","Error","replace","p","compat","originalLoadChunk","flarum","reg","loadChunk","installedChunks","j","installedChunkData","promise","resolve","reject","error","errorType","realSrc","message","name","request","webpackJsonpCallback","parentChunkLoadingFunction","data","chunkIds","moreModules","runtime","some","id","chunkLoadingGlobal","self","_typeof","iterator","constructor","_defineProperty","arg","input","hint","prim","toPrimitive","res","TypeError","String","toPropertyKey","configurable","writable","AutocompleteDropdown","super","arguments","view","className","app","translator","trans","items","map","item","attrs","show","left","top","$","css","active","hide","navigate","delta","keyWasJustPressed","setIndex","index","keyWasJustPressedTimeout","complete","eq","find","click","scrollToItem","$dropdown","$items","rangedIndex","$item","removeClass","addClass","dropdownScroll","scrollTop","dropdownTop","offset","dropdownBottom","outerHeight","itemTop","itemBottom","parseInt","stop","animate","add","twemoji","base","ext","size","convert","fromCodePoint","codepoint","code","fromCharCode","toCodePoint","replaceChild","createText","alt","parse","what","how","callback","parseString","parseNode","defaultImageSrcGenerator","attributes","returnNull","folder","test","text","re","lastIndex","result","escaper","UFE0Fg","U200D","rescaper","shouldntBeParsed","clean","createTextNode","icon","options","concat","grabAllTextNodes","node","allText","subnode","nodeType","childNodes","nodeName","toLowerCase","grabTheRightIcon","rawText","indexOf","attrib","attrname","modified","fragment","match","img","iconId","createDocumentFragment","nodeValue","exec","slice","Image","hasAttribute","str","ret","replacer","unicodeSurrogates","sep","c","charCodeAt","toString","join","getEmojiIconCode","emoji","version","addChunkModule","loading","emojiMap","extend","_loaders","async","then","default","commonEmoji","emojiDropdown","$editor","wrap","navigator","when","onUp","onDown","onSelect","onCancel","bindTo","after","params","emojiKeys","autocompleteReader","inputListeners","selection","composer","editor","getSelectionRange","cursor","lastChunk","getLastNChars","autocompleting","check","typed","applySuggestion","replacement","replaceBeforeCursor","absoluteStart","makeSuggestion","_ref","onclick","onmouseenter","parent","draggable","cdn","title","similarEmoji","regTyped","reEscape","RegExp","fuzzyRegexp","maxSuggestions","findMatchingEmojis","matcher","curEmoji","names","emojiName","_this$commonEmoji","includes","suggestions","render","coordinates","getCaretCoordinates","width","outerWidth","height","offsetParent","Math","max","buildSuggestions","insertAtCursor","addComposerAutocomplete","override","original","contentHtml","oldContentHtml","emojifiedDom","tmp","implementation","createHTMLDocument","body","innerHTML","parseHTML","emojifiedContentHtml","s9e","TextFormatter","element"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.js","mappings":";UAAIA,EACAC,OCAAC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaE,QAGrB,IAAIC,EAASN,EAAyBE,GAAY,CAGjDG,QAAS,CAAC,GAOX,OAHAE,EAAoBL,GAAUI,EAAQA,EAAOD,QAASJ,GAG/CK,EAAOD,OACf,CAGAJ,EAAoBO,EAAID,ECxBxBN,EAAoBQ,EAAKH,IACxB,IAAII,EAASJ,GAAUA,EAAOK,WAC7B,IAAOL,EAAiB,QACxB,IAAM,EAEP,OADAL,EAAoBW,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdT,EAAoBW,EAAI,CAACP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AmBD,EAAa,CAWvC,MAAME,EAAe,QAnB3B,SAAmBxF,GACjB,MAAMyF,EAAMzR,SAAS0R,eAAeC,qBAEpC,OADAF,EAAIG,KAAKC,UAAY7F,EACdyF,EAAIG,IACb,CAeyCE,CAAUR,GAAchH,GAG3DrL,KAAK8S,qBAAuBP,EAAaK,UACzC5S,KAAKsS,eAAiBD,CACxB,CACA,OAAOrS,KAAK8S,oBACd,KACA,IAAAX,UAASY,IAAIC,cAAe,WAAW,CAACZ,EAAU3H,EAAMwI,KACtDb,EAAS3H,EAAMwI,GACf,QAAcA,EAAS5H,EAAQ,GCrCpB","sources":["webpack://@flarum/emoji/webpack/runtime/load script","webpack://@flarum/emoji/webpack/bootstrap","webpack://@flarum/emoji/webpack/runtime/compat get default export","webpack://@flarum/emoji/webpack/runtime/define property getters","webpack://@flarum/emoji/webpack/runtime/ensure chunk","webpack://@flarum/emoji/webpack/runtime/get javascript chunk filename","webpack://@flarum/emoji/webpack/runtime/global","webpack://@flarum/emoji/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/emoji/webpack/runtime/make namespace object","webpack://@flarum/emoji/webpack/runtime/publicPath","webpack://@flarum/emoji/webpack/runtime/compat","webpack://@flarum/emoji/webpack/runtime/jsonp chunk loading","webpack://@flarum/emoji/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/emoji/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/emoji/external root \"flarum.reg.get('core', 'common/components/TextEditorButton')\"","webpack://@flarum/emoji/external root \"flarum.reg.get('core', 'common/utils/KeyboardNavigatable')\"","webpack://@flarum/emoji/external root \"flarum.reg.get('core', 'common/components/Tooltip')\"","webpack://@flarum/emoji/external root \"flarum.reg.get('core', 'common/utils/AutocompleteReader')\"","webpack://@flarum/emoji/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/emoji/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/emoji/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/emoji/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@flarum/emoji/external root \"flarum.reg.get('core', 'common/Fragment')\"","webpack://@flarum/emoji/./src/forum/fragments/AutocompleteDropdown.js","webpack://@flarum/emoji/../../../node_modules/twemoji/dist/twemoji.esm.js","webpack://@flarum/emoji/./src/forum/helpers/getEmojiIconCode.js","webpack://@flarum/emoji/./src/forum/cdn.js","webpack://@flarum/emoji/./src/forum/addComposerAutocomplete.js","webpack://@flarum/emoji/external root \"flarum.reg.get('core', 'common/models/Post')\"","webpack://@flarum/emoji/./src/forum/renderEmoji.js","webpack://@flarum/emoji/./src/forum/index.js"],"sourcesContent":["var inProgress = {};\nvar dataWebpackPrefix = \"module.exports:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t};\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\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// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\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__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + \"forum/emojiMap\" + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\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};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.f.compat = (chunkId, promises) => {\n\n\tconst originalLoadChunk = __webpack_require__.l;\n\t__webpack_require__.l = flarum.reg.loadChunk.bind(flarum.reg, originalLoadChunk);\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t315: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkmodule_exports\"] = self[\"webpackChunkmodule_exports\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/TextEditorButton');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/KeyboardNavigatable');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Tooltip');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/AutocompleteReader');","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _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 }, _typeof(obj);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Fragment');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport Fragment from 'flarum/common/Fragment';\nexport default class AutocompleteDropdown extends Fragment {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"items\", []);\n _defineProperty(this, \"active\", false);\n _defineProperty(this, \"index\", 0);\n _defineProperty(this, \"keyWasJustPressed\", false);\n }\n view() {\n return m(\"ul\", {\n className: \"Dropdown-menu EmojiDropdown\"\n }, m(\"li\", {\n className: \"Dropdown-header\"\n }, app.translator.trans('flarum-emoji.forum.composer.type_to_search_text')), this.items.map(item => m(\"li\", {\n key: item.attrs.key\n }, item)));\n }\n show(left, top) {\n this.$().show().css({\n left: left + 'px',\n top: top + 'px'\n });\n this.active = true;\n }\n hide() {\n this.$().hide();\n this.active = false;\n }\n navigate(delta) {\n this.keyWasJustPressed = true;\n this.setIndex(this.index + delta, true);\n clearTimeout(this.keyWasJustPressedTimeout);\n this.keyWasJustPressedTimeout = setTimeout(() => this.keyWasJustPressed = false, 500);\n }\n complete() {\n this.$('li:not(.Dropdown-header)').eq(this.index).find('button').click();\n }\n setIndex(index, scrollToItem) {\n if (this.keyWasJustPressed && !scrollToItem) return;\n const $dropdown = this.$();\n const $items = $dropdown.find('li:not(.Dropdown-header)');\n let rangedIndex = index;\n if (rangedIndex < 0) {\n rangedIndex = $items.length - 1;\n } else if (rangedIndex >= $items.length) {\n rangedIndex = 0;\n }\n this.index = rangedIndex;\n const $item = $items.removeClass('active').eq(rangedIndex).addClass('active');\n if (scrollToItem) {\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 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 if (typeof scrollTop !== 'undefined') {\n $dropdown.stop(true).animate({\n scrollTop\n }, 100);\n }\n }\n }\n}\nflarum.reg.add('flarum-emoji', 'forum/fragments/AutocompleteDropdown', AutocompleteDropdown);","/*! Copyright Twitter Inc. and other contributors. Licensed under MIT */\nvar twemoji=function(){\"use strict\";var twemoji={base:\"https://twemoji.maxcdn.com/v/14.0.2/\",ext:\".png\",size:\"72x72\",className:\"emoji\",convert:{fromCodePoint:fromCodePoint,toCodePoint:toCodePoint},onerror:function onerror(){if(this.parentNode){this.parentNode.replaceChild(createText(this.alt,false),this)}},parse:parse,replace:replace,test:test},escaper={\"&\":\"&\",\"<\":\"<\",\">\":\">\",\"'\":\"'\",'\"':\""\"},re=/(?:\\ud83d\\udc68\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffc-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc68\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udffe]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffc-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffe]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68|\\ud83d\\udc69\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d[\\udc68\\udc69]|\\ud83e\\udef1\\ud83c\\udffb\\u200d\\ud83e\\udef2\\ud83c[\\udffc-\\udfff]|\\ud83e\\udef1\\ud83c\\udffc\\u200d\\ud83e\\udef2\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\udef1\\ud83c\\udffd\\u200d\\ud83e\\udef2\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\udef1\\ud83c\\udffe\\u200d\\ud83e\\udef2\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\udef1\\ud83c\\udfff\\u200d\\ud83e\\udef2\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc68\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68|\\ud83d\\udc69\\u200d\\u2764\\ufe0f\\u200d\\ud83d[\\udc68\\udc69]|\\ud83e\\uddd1\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1|\\ud83d\\udc6b\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc6c\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc6d\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc8f\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc91\\ud83c[\\udffb-\\udfff]|\\ud83e\\udd1d\\ud83c[\\udffb-\\udfff]|\\ud83d[\\udc6b-\\udc6d\\udc8f\\udc91]|\\ud83e\\udd1d)|(?:\\ud83d[\\udc68\\udc69]|\\ud83e\\uddd1)(?:\\ud83c[\\udffb-\\udfff])?\\u200d(?:\\u2695\\ufe0f|\\u2696\\ufe0f|\\u2708\\ufe0f|\\ud83c[\\udf3e\\udf73\\udf7c\\udf84\\udf93\\udfa4\\udfa8\\udfeb\\udfed]|\\ud83d[\\udcbb\\udcbc\\udd27\\udd2c\\ude80\\ude92]|\\ud83e[\\uddaf-\\uddb3\\uddbc\\uddbd])|(?:\\ud83c[\\udfcb\\udfcc]|\\ud83d[\\udd74\\udd75]|\\u26f9)((?:\\ud83c[\\udffb-\\udfff]|\\ufe0f)\\u200d[\\u2640\\u2642]\\ufe0f)|(?:\\ud83c[\\udfc3\\udfc4\\udfca]|\\ud83d[\\udc6e\\udc70\\udc71\\udc73\\udc77\\udc81\\udc82\\udc86\\udc87\\ude45-\\ude47\\ude4b\\ude4d\\ude4e\\udea3\\udeb4-\\udeb6]|\\ud83e[\\udd26\\udd35\\udd37-\\udd39\\udd3d\\udd3e\\uddb8\\uddb9\\uddcd-\\uddcf\\uddd4\\uddd6-\\udddd])(?:\\ud83c[\\udffb-\\udfff])?\\u200d[\\u2640\\u2642]\\ufe0f|(?:\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83c\\udff3\\ufe0f\\u200d\\u26a7\\ufe0f|\\ud83c\\udff3\\ufe0f\\u200d\\ud83c\\udf08|\\ud83d\\ude36\\u200d\\ud83c\\udf2b\\ufe0f|\\u2764\\ufe0f\\u200d\\ud83d\\udd25|\\u2764\\ufe0f\\u200d\\ud83e\\ude79|\\ud83c\\udff4\\u200d\\u2620\\ufe0f|\\ud83d\\udc15\\u200d\\ud83e\\uddba|\\ud83d\\udc3b\\u200d\\u2744\\ufe0f|\\ud83d\\udc41\\u200d\\ud83d\\udde8|\\ud83d\\udc68\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc6f\\u200d\\u2640\\ufe0f|\\ud83d\\udc6f\\u200d\\u2642\\ufe0f|\\ud83d\\ude2e\\u200d\\ud83d\\udca8|\\ud83d\\ude35\\u200d\\ud83d\\udcab|\\ud83e\\udd3c\\u200d\\u2640\\ufe0f|\\ud83e\\udd3c\\u200d\\u2642\\ufe0f|\\ud83e\\uddde\\u200d\\u2640\\ufe0f|\\ud83e\\uddde\\u200d\\u2642\\ufe0f|\\ud83e\\udddf\\u200d\\u2640\\ufe0f|\\ud83e\\udddf\\u200d\\u2642\\ufe0f|\\ud83d\\udc08\\u200d\\u2b1b)|[#*0-9]\\ufe0f?\\u20e3|(?:[©®\\u2122\\u265f]\\ufe0f)|(?:\\ud83c[\\udc04\\udd70\\udd71\\udd7e\\udd7f\\ude02\\ude1a\\ude2f\\ude37\\udf21\\udf24-\\udf2c\\udf36\\udf7d\\udf96\\udf97\\udf99-\\udf9b\\udf9e\\udf9f\\udfcd\\udfce\\udfd4-\\udfdf\\udff3\\udff5\\udff7]|\\ud83d[\\udc3f\\udc41\\udcfd\\udd49\\udd4a\\udd6f\\udd70\\udd73\\udd76-\\udd79\\udd87\\udd8a-\\udd8d\\udda5\\udda8\\uddb1\\uddb2\\uddbc\\uddc2-\\uddc4\\uddd1-\\uddd3\\udddc-\\uddde\\udde1\\udde3\\udde8\\uddef\\uddf3\\uddfa\\udecb\\udecd-\\udecf\\udee0-\\udee5\\udee9\\udef0\\udef3]|[\\u203c\\u2049\\u2139\\u2194-\\u2199\\u21a9\\u21aa\\u231a\\u231b\\u2328\\u23cf\\u23ed-\\u23ef\\u23f1\\u23f2\\u23f8-\\u23fa\\u24c2\\u25aa\\u25ab\\u25b6\\u25c0\\u25fb-\\u25fe\\u2600-\\u2604\\u260e\\u2611\\u2614\\u2615\\u2618\\u2620\\u2622\\u2623\\u2626\\u262a\\u262e\\u262f\\u2638-\\u263a\\u2640\\u2642\\u2648-\\u2653\\u2660\\u2663\\u2665\\u2666\\u2668\\u267b\\u267f\\u2692-\\u2697\\u2699\\u269b\\u269c\\u26a0\\u26a1\\u26a7\\u26aa\\u26ab\\u26b0\\u26b1\\u26bd\\u26be\\u26c4\\u26c5\\u26c8\\u26cf\\u26d1\\u26d3\\u26d4\\u26e9\\u26ea\\u26f0-\\u26f5\\u26f8\\u26fa\\u26fd\\u2702\\u2708\\u2709\\u270f\\u2712\\u2714\\u2716\\u271d\\u2721\\u2733\\u2734\\u2744\\u2747\\u2757\\u2763\\u2764\\u27a1\\u2934\\u2935\\u2b05-\\u2b07\\u2b1b\\u2b1c\\u2b50\\u2b55\\u3030\\u303d\\u3297\\u3299])(?:\\ufe0f|(?!\\ufe0e))|(?:(?:\\ud83c[\\udfcb\\udfcc]|\\ud83d[\\udd74\\udd75\\udd90]|[\\u261d\\u26f7\\u26f9\\u270c\\u270d])(?:\\ufe0f|(?!\\ufe0e))|(?:\\ud83c[\\udf85\\udfc2-\\udfc4\\udfc7\\udfca]|\\ud83d[\\udc42\\udc43\\udc46-\\udc50\\udc66-\\udc69\\udc6e\\udc70-\\udc78\\udc7c\\udc81-\\udc83\\udc85-\\udc87\\udcaa\\udd7a\\udd95\\udd96\\ude45-\\ude47\\ude4b-\\ude4f\\udea3\\udeb4-\\udeb6\\udec0\\udecc]|\\ud83e[\\udd0c\\udd0f\\udd18-\\udd1c\\udd1e\\udd1f\\udd26\\udd30-\\udd39\\udd3d\\udd3e\\udd77\\uddb5\\uddb6\\uddb8\\uddb9\\uddbb\\uddcd-\\uddcf\\uddd1-\\udddd\\udec3-\\udec5\\udef0-\\udef6]|[\\u270a\\u270b]))(?:\\ud83c[\\udffb-\\udfff])?|(?:\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc65\\udb40\\udc6e\\udb40\\udc67\\udb40\\udc7f|\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc73\\udb40\\udc63\\udb40\\udc74\\udb40\\udc7f|\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc77\\udb40\\udc6c\\udb40\\udc73\\udb40\\udc7f|\\ud83c\\udde6\\ud83c[\\udde8-\\uddec\\uddee\\uddf1\\uddf2\\uddf4\\uddf6-\\uddfa\\uddfc\\uddfd\\uddff]|\\ud83c\\udde7\\ud83c[\\udde6\\udde7\\udde9-\\uddef\\uddf1-\\uddf4\\uddf6-\\uddf9\\uddfb\\uddfc\\uddfe\\uddff]|\\ud83c\\udde8\\ud83c[\\udde6\\udde8\\udde9\\uddeb-\\uddee\\uddf0-\\uddf5\\uddf7\\uddfa-\\uddff]|\\ud83c\\udde9\\ud83c[\\uddea\\uddec\\uddef\\uddf0\\uddf2\\uddf4\\uddff]|\\ud83c\\uddea\\ud83c[\\udde6\\udde8\\uddea\\uddec\\udded\\uddf7-\\uddfa]|\\ud83c\\uddeb\\ud83c[\\uddee-\\uddf0\\uddf2\\uddf4\\uddf7]|\\ud83c\\uddec\\ud83c[\\udde6\\udde7\\udde9-\\uddee\\uddf1-\\uddf3\\uddf5-\\uddfa\\uddfc\\uddfe]|\\ud83c\\udded\\ud83c[\\uddf0\\uddf2\\uddf3\\uddf7\\uddf9\\uddfa]|\\ud83c\\uddee\\ud83c[\\udde8-\\uddea\\uddf1-\\uddf4\\uddf6-\\uddf9]|\\ud83c\\uddef\\ud83c[\\uddea\\uddf2\\uddf4\\uddf5]|\\ud83c\\uddf0\\ud83c[\\uddea\\uddec-\\uddee\\uddf2\\uddf3\\uddf5\\uddf7\\uddfc\\uddfe\\uddff]|\\ud83c\\uddf1\\ud83c[\\udde6-\\udde8\\uddee\\uddf0\\uddf7-\\uddfb\\uddfe]|\\ud83c\\uddf2\\ud83c[\\udde6\\udde8-\\udded\\uddf0-\\uddff]|\\ud83c\\uddf3\\ud83c[\\udde6\\udde8\\uddea-\\uddec\\uddee\\uddf1\\uddf4\\uddf5\\uddf7\\uddfa\\uddff]|\\ud83c\\uddf4\\ud83c\\uddf2|\\ud83c\\uddf5\\ud83c[\\udde6\\uddea-\\udded\\uddf0-\\uddf3\\uddf7-\\uddf9\\uddfc\\uddfe]|\\ud83c\\uddf6\\ud83c\\udde6|\\ud83c\\uddf7\\ud83c[\\uddea\\uddf4\\uddf8\\uddfa\\uddfc]|\\ud83c\\uddf8\\ud83c[\\udde6-\\uddea\\uddec-\\uddf4\\uddf7-\\uddf9\\uddfb\\uddfd-\\uddff]|\\ud83c\\uddf9\\ud83c[\\udde6\\udde8\\udde9\\uddeb-\\udded\\uddef-\\uddf4\\uddf7\\uddf9\\uddfb\\uddfc\\uddff]|\\ud83c\\uddfa\\ud83c[\\udde6\\uddec\\uddf2\\uddf3\\uddf8\\uddfe\\uddff]|\\ud83c\\uddfb\\ud83c[\\udde6\\udde8\\uddea\\uddec\\uddee\\uddf3\\uddfa]|\\ud83c\\uddfc\\ud83c[\\uddeb\\uddf8]|\\ud83c\\uddfd\\ud83c\\uddf0|\\ud83c\\uddfe\\ud83c[\\uddea\\uddf9]|\\ud83c\\uddff\\ud83c[\\udde6\\uddf2\\uddfc]|\\ud83c[\\udccf\\udd8e\\udd91-\\udd9a\\udde6-\\uddff\\ude01\\ude32-\\ude36\\ude38-\\ude3a\\ude50\\ude51\\udf00-\\udf20\\udf2d-\\udf35\\udf37-\\udf7c\\udf7e-\\udf84\\udf86-\\udf93\\udfa0-\\udfc1\\udfc5\\udfc6\\udfc8\\udfc9\\udfcf-\\udfd3\\udfe0-\\udff0\\udff4\\udff8-\\udfff]|\\ud83d[\\udc00-\\udc3e\\udc40\\udc44\\udc45\\udc51-\\udc65\\udc6a\\udc6f\\udc79-\\udc7b\\udc7d-\\udc80\\udc84\\udc88-\\udc8e\\udc90\\udc92-\\udca9\\udcab-\\udcfc\\udcff-\\udd3d\\udd4b-\\udd4e\\udd50-\\udd67\\udda4\\uddfb-\\ude44\\ude48-\\ude4a\\ude80-\\udea2\\udea4-\\udeb3\\udeb7-\\udebf\\udec1-\\udec5\\uded0-\\uded2\\uded5-\\uded7\\udedd-\\udedf\\udeeb\\udeec\\udef4-\\udefc\\udfe0-\\udfeb\\udff0]|\\ud83e[\\udd0d\\udd0e\\udd10-\\udd17\\udd20-\\udd25\\udd27-\\udd2f\\udd3a\\udd3c\\udd3f-\\udd45\\udd47-\\udd76\\udd78-\\uddb4\\uddb7\\uddba\\uddbc-\\uddcc\\uddd0\\uddde-\\uddff\\ude70-\\ude74\\ude78-\\ude7c\\ude80-\\ude86\\ude90-\\udeac\\udeb0-\\udeba\\udec0-\\udec2\\uded0-\\uded9\\udee0-\\udee7]|[\\u23e9-\\u23ec\\u23f0\\u23f3\\u267e\\u26ce\\u2705\\u2728\\u274c\\u274e\\u2753-\\u2755\\u2795-\\u2797\\u27b0\\u27bf\\ue50a])|\\ufe0f/g,UFE0Fg=/\\uFE0F/g,U200D=String.fromCharCode(8205),rescaper=/[&<>'\"]/g,shouldntBeParsed=/^(?:iframe|noframes|noscript|script|select|style|textarea)$/,fromCharCode=String.fromCharCode;return twemoji;function createText(text,clean){return document.createTextNode(clean?text.replace(UFE0Fg,\"\"):text)}function escapeHTML(s){return s.replace(rescaper,replacer)}function defaultImageSrcGenerator(icon,options){return\"\".concat(options.base,options.size,\"/\",icon,options.ext)}function grabAllTextNodes(node,allText){var childNodes=node.childNodes,length=childNodes.length,subnode,nodeType;while(length--){subnode=childNodes[length];nodeType=subnode.nodeType;if(nodeType===3){allText.push(subnode)}else if(nodeType===1&&!(\"ownerSVGElement\"in subnode)&&!shouldntBeParsed.test(subnode.nodeName.toLowerCase())){grabAllTextNodes(subnode,allText)}}return allText}function grabTheRightIcon(rawText){return toCodePoint(rawText.indexOf(U200D)<0?rawText.replace(UFE0Fg,\"\"):rawText)}function parseNode(node,options){var allText=grabAllTextNodes(node,[]),length=allText.length,attrib,attrname,modified,fragment,subnode,text,match,i,index,img,rawText,iconId,src;while(length--){modified=false;fragment=document.createDocumentFragment();subnode=allText[length];text=subnode.nodeValue;i=0;while(match=re.exec(text)){index=match.index;if(index!==i){fragment.appendChild(createText(text.slice(i,index),true))}rawText=match[0];iconId=grabTheRightIcon(rawText);i=index+rawText.length;src=options.callback(iconId,options);if(iconId&&src){img=new Image;img.onerror=options.onerror;img.setAttribute(\"draggable\",\"false\");attrib=options.attributes(rawText,iconId);for(attrname in attrib){if(attrib.hasOwnProperty(attrname)&&attrname.indexOf(\"on\")!==0&&!img.hasAttribute(attrname)){img.setAttribute(attrname,attrib[attrname])}}img.className=options.className;img.alt=rawText;img.src=src;modified=true;fragment.appendChild(img)}if(!img)fragment.appendChild(createText(rawText,false));img=null}if(modified){if(i\")}return ret})}function replacer(m){return escaper[m]}function returnNull(){return null}function toSizeSquaredAsset(value){return typeof value===\"number\"?value+\"x\"+value:value}function fromCodePoint(codepoint){var code=typeof codepoint===\"string\"?parseInt(codepoint,16):codepoint;if(code<65536){return fromCharCode(code)}code-=65536;return fromCharCode(55296+(code>>10),56320+(code&1023))}function parse(what,how){if(!how||typeof how===\"function\"){how={callback:how}}return(typeof what===\"string\"?parseString:parseNode)(what,{callback:how.callback||defaultImageSrcGenerator,attributes:typeof how.attributes===\"function\"?how.attributes:returnNull,base:typeof how.base===\"string\"?how.base:twemoji.base,ext:how.ext||twemoji.ext,size:how.folder||toSizeSquaredAsset(how.size||twemoji.size),className:how.className||twemoji.className,onerror:how.onerror||twemoji.onerror})}function replace(text,callback){return String(text).replace(re,callback)}function test(text){re.lastIndex=0;var result=re.test(text);re.lastIndex=0;return result}function toCodePoint(unicodeSurrogates,sep){var r=[],c=0,p=0,i=0;while(i await import(/* webpackChunkName: 'forum/emojiMap', webpackMode: 'lazy-once' */ './emojiMap').then(m => emojiMap = m.default));\n // prettier-ignore\n this.commonEmoji = ['😀', '😁', '😂', '😃', '😄', '😅', '😆', '😇', '😈', '😉', '😊', '😋', '😌', '😍', '😎', '😏', '😐️', '😑', '😒', '😓', '😔', '😕', '😖', '😗', '😘', '😙', '😚', '😛', '😜', '😝', '😞', '😟', '😠', '😡', '😢', '😣', '😤', '😥', '😦', '😧', '😨', '😩', '😪', '😫', '😬', '😭', '😮', '😮‍💨', '😯', '😰', '😱', '😲', '😳', '😴', '😵', '😵‍💫', '😶', '😶‍🌫️', '😷', '😸', '😹', '😺', '😻', '😼', '😽', '😾', '😿', '🙀', '🙁', '🙂', '🙃', '🙄'];\n });\n extend('flarum/common/components/TextEditor', 'onbuild', function () {\n this.emojiDropdown = new AutocompleteDropdown();\n const $editor = this.$('.TextEditor-editor').wrap('
');\n this.navigator = new KeyboardNavigatable();\n this.navigator.when(() => this.emojiDropdown.active).onUp(() => this.emojiDropdown.navigate(-1)).onDown(() => this.emojiDropdown.navigate(1)).onSelect(this.emojiDropdown.complete.bind(this.emojiDropdown)).onCancel(this.emojiDropdown.hide.bind(this.emojiDropdown)).bindTo($editor);\n $editor.after($('
'));\n });\n extend('flarum/common/components/TextEditor', 'buildEditorParams', function (params) {\n const emojiKeys = Object.keys(emojiMap);\n const autocompleteReader = new AutocompleteReader(':');\n params.inputListeners.push(() => {\n const selection = this.attrs.composer.editor.getSelectionRange();\n const cursor = selection[0];\n if (selection[1] - cursor > 0) return;\n const lastChunk = this.attrs.composer.editor.getLastNChars(15);\n const autocompleting = autocompleteReader.check(lastChunk, cursor, /[a-z0-9]|\\+|\\-|_|\\:/);\n this.emojiDropdown.hide();\n this.emojiDropdown.active = false;\n if (autocompleting) {\n const typed = autocompleting.typed;\n const emojiDropdown = this.emojiDropdown;\n const applySuggestion = replacement => {\n this.attrs.composer.editor.replaceBeforeCursor(autocompleting.absoluteStart - 1, replacement + ' ');\n this.emojiDropdown.hide();\n };\n const makeSuggestion = function (_ref) {\n let {\n emoji,\n name,\n code\n } = _ref;\n return m(Tooltip, {\n text: name\n }, m(\"button\", {\n key: emoji,\n onclick: () => applySuggestion(emoji),\n onmouseenter: function () {\n emojiDropdown.setIndex($(this).parent().index() - 1);\n }\n }, m(\"img\", {\n alt: emoji,\n className: \"emoji\",\n draggable: \"false\",\n loading: \"lazy\",\n src: \"\".concat(cdn, \"72x72/\").concat(code, \".png\"),\n title: name\n })));\n };\n const buildSuggestions = () => {\n const similarEmoji = [];\n\n // Build a regular expression to do a fuzzy match of the given input string\n const fuzzyRegexp = function (str) {\n const reEscape = new RegExp('\\\\(([' + '+.*?[]{}()^$|\\\\'.replace(/(.)/g, '\\\\$1') + '])\\\\)', 'g');\n return new RegExp('(.*)' + str.toLowerCase().replace(/(.)/g, '($1)(.*?)').replace(reEscape, '(\\\\$1)') + '$', 'i');\n };\n const regTyped = fuzzyRegexp(typed);\n let maxSuggestions = 40;\n const findMatchingEmojis = matcher => {\n for (let i = 0; i < emojiKeys.length && maxSuggestions > 0; i++) {\n const curEmoji = emojiKeys[i];\n if (similarEmoji.indexOf(curEmoji) === -1) {\n const names = emojiMap[curEmoji];\n for (let name of names) {\n if (matcher(name, curEmoji)) {\n --maxSuggestions;\n similarEmoji.push(curEmoji);\n break;\n }\n }\n }\n }\n };\n\n // First, try to find all emojis starting with the given string\n findMatchingEmojis((emojiName, emoji) => {\n // If no input is provided yet, match the most common emojis.\n if (!typed) {\n var _this$commonEmoji;\n return (_this$commonEmoji = this.commonEmoji) == null ? void 0 : _this$commonEmoji.includes(emoji);\n }\n return emojiName.indexOf(typed) === 0;\n });\n\n // If there are still suggestions left, try for some fuzzy matches\n findMatchingEmojis(emojiName => regTyped.test(emojiName));\n const suggestions = similarEmoji.map(emoji => ({\n emoji,\n name: emojiMap[emoji][0],\n code: getEmojiIconCode(emoji)\n })).map(makeSuggestion);\n if (suggestions.length) {\n this.emojiDropdown.items = suggestions;\n m.render(this.$('.ComposerBody-emojiDropdownContainer')[0], this.emojiDropdown.render());\n this.emojiDropdown.show();\n const coordinates = this.attrs.composer.editor.getCaretCoordinates(autocompleting.absoluteStart);\n const width = this.emojiDropdown.$().outerWidth();\n const height = this.emojiDropdown.$().outerHeight();\n const parent = this.emojiDropdown.$().offsetParent();\n let left = coordinates.left;\n let top = coordinates.top + 15;\n\n // Keep the dropdown inside the editor.\n if (top + height > parent.height()) {\n top = coordinates.top - height - 15;\n }\n if (left + width > parent.width()) {\n left = parent.width() - width;\n }\n\n // Prevent the dropdown from going off screen on mobile\n top = Math.max(-(parent.offset().top - $(document).scrollTop()), top);\n left = Math.max(-parent.offset().left, left);\n this.emojiDropdown.show(left, top);\n }\n };\n buildSuggestions();\n this.emojiDropdown.setIndex(0);\n this.emojiDropdown.$().scrollTop(0);\n this.emojiDropdown.active = true;\n }\n });\n });\n extend('flarum/common/components/TextEditor', 'toolbarItems', function (items) {\n items.add('emoji', m(TextEditorButton, {\n onclick: () => this.attrs.composer.editor.insertAtCursor(' :'),\n icon: \"far fa-smile\"\n }, app.translator.trans('flarum-emoji.forum.composer.emoji_tooltip')));\n });\n}flarum.reg.addChunkModule('411', '948', 'flarum-emoji', 'forum/emojiMap');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/Post');","import twemoji from 'twemoji';\nimport { override } from 'flarum/common/extend';\nimport Post from 'flarum/common/models/Post';\nimport base from './cdn';\nconst options = {\n base,\n attributes: () => ({\n loading: 'lazy'\n })\n};\n\n/**\n * Parses an HTML string into a `` node containing the HTML content.\n *\n * Vanilla JS implementation of jQuery's `$.parseHTML()`,\n * sourced from http://youmightnotneedjquery.com/\n */\nfunction parseHTML(str) {\n const tmp = document.implementation.createHTMLDocument();\n tmp.body.innerHTML = str;\n return tmp.body;\n}\nexport default function renderEmoji() {\n override(Post.prototype, 'contentHtml', function (original) {\n const contentHtml = original();\n if (this.oldContentHtml !== contentHtml) {\n // We need to parse the HTML string into a DOM node, then give it to Twemoji.\n //\n // This prevents some issues with the default find-replace that would be performed\n // on a string passed to `Twemoji.parse()`.\n //\n // The parse function can only handle a single DOM node provided, so we need to\n // wrap it in a node. In our `parseHTML` implementation, we wrap it in a ``\n // element. This gets stripped below.\n //\n // See https://github.com/flarum/core/issues/2958\n const emojifiedDom = twemoji.parse(parseHTML(contentHtml), options);\n\n // Steal the HTML string inside the emojified DOM `` tag.\n this.emojifiedContentHtml = emojifiedDom.innerHTML;\n this.oldContentHtml = contentHtml;\n }\n return this.emojifiedContentHtml;\n });\n override(s9e.TextFormatter, 'preview', (original, text, element) => {\n original(text, element);\n twemoji.parse(element, options);\n });\n}","import app from 'flarum/forum/app';\nimport addComposerAutocomplete from './addComposerAutocomplete';\nimport renderEmoji from './renderEmoji';\napp.initializers.add('flarum-emoji', () => {\n // After typing ':' in the composer, show a dropdown suggesting a bunch of\n // emoji that the user could use.\n addComposerAutocomplete();\n\n // render emoji as image in Posts content and title.\n renderEmoji();\n});"],"names":["inProgress","dataWebpackPrefix","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","m","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","f","e","chunkId","Promise","all","keys","reduce","promises","u","g","globalThis","this","Function","window","obj","prop","prototype","hasOwnProperty","call","l","url","done","push","script","needAttach","scripts","document","getElementsByTagName","i","length","s","getAttribute","createElement","charset","timeout","nc","setAttribute","src","onScriptComplete","prev","event","onerror","onload","clearTimeout","doneFns","parentNode","removeChild","forEach","fn","setTimeout","bind","type","target","head","appendChild","r","Symbol","toStringTag","value","scriptUrl","importScripts","location","currentScript","Error","replace","p","compat","originalLoadChunk","flarum","reg","loadChunk","installedChunks","j","installedChunkData","promise","resolve","reject","error","errorType","realSrc","message","name","request","webpackJsonpCallback","parentChunkLoadingFunction","data","chunkIds","moreModules","runtime","some","id","chunkLoadingGlobal","self","_typeof","iterator","constructor","_defineProperty","arg","input","hint","prim","toPrimitive","res","TypeError","String","toPropertyKey","configurable","writable","AutocompleteDropdown","super","arguments","view","className","app","translator","trans","items","map","item","attrs","show","left","top","$","css","active","hide","navigate","delta","keyWasJustPressed","setIndex","index","keyWasJustPressedTimeout","complete","eq","find","click","scrollToItem","$dropdown","$items","rangedIndex","$item","removeClass","addClass","dropdownScroll","scrollTop","dropdownTop","offset","dropdownBottom","outerHeight","itemTop","itemBottom","parseInt","stop","animate","add","twemoji","base","ext","size","convert","fromCodePoint","codepoint","code","fromCharCode","toCodePoint","replaceChild","createText","alt","parse","what","how","callback","parseString","parseNode","defaultImageSrcGenerator","attributes","returnNull","folder","test","text","re","lastIndex","result","escaper","UFE0Fg","U200D","rescaper","shouldntBeParsed","clean","createTextNode","icon","options","concat","grabAllTextNodes","node","allText","subnode","nodeType","childNodes","nodeName","toLowerCase","grabTheRightIcon","rawText","indexOf","attrib","attrname","modified","fragment","match","img","iconId","createDocumentFragment","nodeValue","exec","slice","Image","hasAttribute","str","ret","replacer","unicodeSurrogates","sep","c","charCodeAt","toString","join","getEmojiIconCode","emoji","version","addChunkModule","loading","emojiMap","extend","_loaders","async","then","default","commonEmoji","emojiDropdown","$editor","wrap","navigator","when","onUp","onDown","onSelect","onCancel","bindTo","after","params","emojiKeys","autocompleteReader","inputListeners","selection","composer","editor","getSelectionRange","cursor","lastChunk","getLastNChars","autocompleting","check","typed","applySuggestion","replacement","replaceBeforeCursor","absoluteStart","makeSuggestion","_ref","onclick","onmouseenter","parent","draggable","cdn","title","similarEmoji","regTyped","reEscape","RegExp","fuzzyRegexp","maxSuggestions","findMatchingEmojis","matcher","curEmoji","names","emojiName","_this$commonEmoji","includes","suggestions","render","coordinates","getCaretCoordinates","width","outerWidth","height","offsetParent","Math","max","buildSuggestions","insertAtCursor","addComposerAutocomplete","override","original","contentHtml","oldContentHtml","emojifiedDom","tmp","implementation","createHTMLDocument","body","innerHTML","parseHTML","emojifiedContentHtml","s9e","TextFormatter","element"],"sourceRoot":""} \ No newline at end of file diff --git a/extensions/nicknames/js/dist/forum.js b/extensions/nicknames/js/dist/forum.js index d30d3e7396..96a7bc27a8 100644 --- a/extensions/nicknames/js/dist/forum.js +++ b/extensions/nicknames/js/dist/forum.js @@ -1,2 +1,2 @@ -(()=>{var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};(()=>{"use strict";e.r(t),e.d(t,{extend:()=>_});const n=flarum.reg.get("core","forum/app");var r=e.n(n);const a=flarum.reg.get("core","common/extend"),o=flarum.reg.get("core","common/components/Button");var i=e.n(o);const s=flarum.reg.get("core","common/utils/extractText");var c=e.n(s);const u=flarum.reg.get("core","common/utils/Stream");var l=e.n(u);const d=flarum.reg.get("core","common/components/FormModal");var f=e.n(d);function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function h(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==p(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==p(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===p(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class b{constructor(){h(this,"element",void 0),h(this,"attrs",void 0),h(this,"state",void 0)}oninit(e){this.setAttrs(e.attrs)}oncreate(e){this.element=e.dom}onbeforeupdate(e){this.setAttrs(e.attrs)}onupdate(e){}onbeforeremove(e){}onremove(e){}$(e){const t=$(this.element);return e?t.find(e):t}static component(e,t){void 0===e&&(e={}),void 0===t&&(t=null);const n={...e};return m(this,n,t)}setAttrs(e){if(void 0===e&&(e={}),this.constructor.initAttrs(e),e){if("children"in e)throw new Error("[".concat(this.constructor.name,'] The "children" attribute of attrs should never be used. Either pass children in as the vnode children or rename the attribute'));if("tag"in e)throw new Error("[".concat(this.constructor.name,'] You cannot use the "tag" attribute name with Mithril 2.'))}this.attrs=e}static initAttrs(e){}}function g(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t{this.loading=!1,m.redraw()}))):this.hide()}}flarum.reg.add("flarum-nicknames","forum/components/NicknameModal",N);const x=flarum.reg.get("core","common/extenders");var S=e.n(x);const w=flarum.reg.get("core","common/models/User");var M=e.n(w);const _=[new(S().Model)(M()).attribute("canEditNickname")];r().initializers.add("flarum-nicknames",(()=>{(0,a.extend)("flarum/forum/components/SettingsPage","accountItems",(function(e){"nickname"===r().forum.attribute("displayNameDriver")&&this.user.canEditNickname()&&e.add("changeNickname",m(i(),{className:"Button",onclick:()=>r().modal.show(N)},r().translator.trans("flarum-nicknames.forum.settings.change_nickname_button")))})),(0,a.extend)("flarum/common/components/EditUserModal","oninit",(function(){this.nickname=l()(this.attrs.user.displayName())})),(0,a.extend)("flarum/common/components/EditUserModal","fields",(function(e){"nickname"===r().forum.attribute("displayNameDriver")&&this.attrs.user.canEditNickname()&&e.add("nickname",m("div",{className:"Form-group"},m("label",null,r().translator.trans("flarum-nicknames.forum.edit_user.nicknames_heading")),m("input",{className:"FormControl",placeholder:c()(r().translator.trans("flarum-nicknames.forum.edit_user.nicknames_text")),bidi:this.nickname})),100)})),(0,a.extend)("flarum/common/components/EditUserModal","data",(function(e){"nickname"===r().forum.attribute("displayNameDriver")&&this.attrs.user.canEditNickname()&&this.nickname()!==this.attrs.user.displayName()&&(e.nickname=this.nickname())})),(0,a.extend)("flarum/forum/components/SignUpModal","oninit",(function(){"nickname"===r().forum.attribute("displayNameDriver")&&(this.nickname=l()(this.attrs.username||""))})),(0,a.extend)("flarum/forum/components/SignUpModal","onready",(function(){"nickname"===r().forum.attribute("displayNameDriver")&&r().forum.attribute("setNicknameOnRegistration")&&r().forum.attribute("randomizeUsernameOnRegistration")&&this.$("[name=nickname]").select()})),(0,a.extend)("flarum/forum/components/SignUpModal","fields",(function(e){"nickname"===r().forum.attribute("displayNameDriver")&&r().forum.attribute("setNicknameOnRegistration")&&(e.add("nickname",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"nickname",type:"text",placeholder:c()(r().translator.trans("flarum-nicknames.forum.sign_up.nickname_placeholder")),bidi:this.nickname,disabled:this.loading||this.isProvided("nickname"),required:r().forum.attribute("randomizeUsernameOnRegistration")})),25),r().forum.attribute("randomizeUsernameOnRegistration")&&e.remove("username"))})),(0,a.extend)("flarum/forum/components/SignUpModal","submitData",(function(e){if("nickname"===r().forum.attribute("displayNameDriver")&&r().forum.attribute("setNicknameOnRegistration")&&(e.nickname=this.nickname(),r().forum.attribute("randomizeUsernameOnRegistration"))){const t=new Uint32Array(2);crypto.getRandomValues(t),e.username=t.join("")}}))}))})(),module.exports=t})(); +(()=>{var e={n:n=>{var t=n&&n.__esModule?()=>n.default:()=>n;return e.d(t,{a:t}),t},d:(n,t)=>{for(var a in t)e.o(t,a)&&!e.o(n,a)&&Object.defineProperty(n,a,{enumerable:!0,get:t[a]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};(()=>{"use strict";e.r(n),e.d(n,{extend:()=>y});const t=flarum.reg.get("core","forum/app");var a=e.n(t);const r=flarum.reg.get("core","common/extend"),i=flarum.reg.get("core","common/components/Button");var o=e.n(i);const s=flarum.reg.get("core","common/utils/extractText");var c=e.n(s);const u=flarum.reg.get("core","common/utils/Stream");var l=e.n(u);const d=flarum.reg.get("core","common/components/FormModal");var f=e.n(d);const p=flarum.reg.get("core","common/components/Form");var g=e.n(p);class k extends(f()){oninit(e){super.oninit(e),this.nickname=l()(a().session.user.displayName())}className(){return"NickameModal Modal--small"}title(){return a().translator.trans("flarum-nicknames.forum.change_nickname.title")}content(){return m("div",{className:"Modal-body"},m(g(),{className:"Form--centered"},m("div",{className:"Form-group"},m("input",{type:"text",autocomplete:"off",name:"nickname",className:"FormControl",bidi:this.nickname,disabled:this.loading})),m("div",{className:"Form-group Form-controls"},m(o(),{className:"Button Button--primary Button--block",type:"submit",loading:this.loading},a().translator.trans("flarum-nicknames.forum.change_nickname.submit_button")))))}onsubmit(e){e.preventDefault(),this.nickname()!==a().session.user.displayName()?(this.loading=!0,a().session.user.save({nickname:this.nickname()},{errorHandler:this.onerror.bind(this)}).then(this.hide.bind(this)).catch((()=>{this.loading=!1,m.redraw()}))):this.hide()}}flarum.reg.add("flarum-nicknames","forum/components/NicknameModal",k);const h=flarum.reg.get("core","common/extenders");var b=e.n(h);const N=flarum.reg.get("core","common/models/User");var v=e.n(N);const y=[new(b().Model)(v()).attribute("canEditNickname")];a().initializers.add("flarum-nicknames",(()=>{(0,r.extend)("flarum/forum/components/SettingsPage","accountItems",(function(e){"nickname"===a().forum.attribute("displayNameDriver")&&this.user.canEditNickname()&&e.add("changeNickname",m(o(),{className:"Button",onclick:()=>a().modal.show(k)},a().translator.trans("flarum-nicknames.forum.settings.change_nickname_button")))})),(0,r.extend)("flarum/common/components/EditUserModal","oninit",(function(){this.nickname=l()(this.attrs.user.displayName())})),(0,r.extend)("flarum/common/components/EditUserModal","fields",(function(e){"nickname"===a().forum.attribute("displayNameDriver")&&this.attrs.user.canEditNickname()&&e.add("nickname",m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-nicknames.forum.edit_user.nicknames_heading")),m("input",{className:"FormControl",placeholder:c()(a().translator.trans("flarum-nicknames.forum.edit_user.nicknames_text")),bidi:this.nickname})),100)})),(0,r.extend)("flarum/common/components/EditUserModal","data",(function(e){"nickname"===a().forum.attribute("displayNameDriver")&&this.attrs.user.canEditNickname()&&this.nickname()!==this.attrs.user.displayName()&&(e.nickname=this.nickname())})),(0,r.extend)("flarum/forum/components/SignUpModal","oninit",(function(){"nickname"===a().forum.attribute("displayNameDriver")&&(this.nickname=l()(this.attrs.username||""))})),(0,r.extend)("flarum/forum/components/SignUpModal","onready",(function(){"nickname"===a().forum.attribute("displayNameDriver")&&a().forum.attribute("setNicknameOnRegistration")&&a().forum.attribute("randomizeUsernameOnRegistration")&&this.$("[name=nickname]").select()})),(0,r.extend)("flarum/forum/components/SignUpModal","fields",(function(e){"nickname"===a().forum.attribute("displayNameDriver")&&a().forum.attribute("setNicknameOnRegistration")&&(e.add("nickname",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"nickname",type:"text",placeholder:c()(a().translator.trans("flarum-nicknames.forum.sign_up.nickname_placeholder")),bidi:this.nickname,disabled:this.loading||this.isProvided("nickname"),required:a().forum.attribute("randomizeUsernameOnRegistration")})),25),a().forum.attribute("randomizeUsernameOnRegistration")&&e.remove("username"))})),(0,r.extend)("flarum/forum/components/SignUpModal","submitData",(function(e){if("nickname"===a().forum.attribute("displayNameDriver")&&a().forum.attribute("setNicknameOnRegistration")&&(e.nickname=this.nickname(),a().forum.attribute("randomizeUsernameOnRegistration"))){const n=new Uint32Array(2);crypto.getRandomValues(n),e.username=n.join("")}}))}))})(),module.exports=n})(); //# sourceMappingURL=forum.js.map \ No newline at end of file diff --git a/extensions/nicknames/js/dist/forum.js.map b/extensions/nicknames/js/dist/forum.js.map index 6b7c0958f8..ccfc6ddc97 100644 --- a/extensions/nicknames/js/dist/forum.js.map +++ b/extensions/nicknames/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CA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AAII,KAAK,GAC3B,CAEJ,GAAE,G","sources":["webpack://@flarum/nicknames/webpack/bootstrap","webpack://@flarum/nicknames/webpack/runtime/compat get default export","webpack://@flarum/nicknames/webpack/runtime/define property getters","webpack://@flarum/nicknames/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/nicknames/webpack/runtime/make namespace object","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/utils/Stream')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/components/FormModal')\"","webpack://@flarum/nicknames/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/nicknames/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/nicknames/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/nicknames/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@flarum/nicknames/../../../framework/core/js/src/common/Component.ts","webpack://@flarum/nicknames/../../../node_modules/clsx/dist/clsx.m.js","webpack://@flarum/nicknames/../../../framework/core/js/src/common/utils/classList.ts","webpack://@flarum/nicknames/../../../framework/core/js/src/common/components/Form.tsx","webpack://@flarum/nicknames/./src/forum/components/NicknameModal.js","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/models/User')\"","webpack://@flarum/nicknames/./src/forum/extend.ts","webpack://@flarum/nicknames/./src/forum/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Button');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/extractText');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/Stream');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/FormModal');","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _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 }, _typeof(obj);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\n/**\n * The `Component` class defines a user interface 'building block'. A component\n * generates a virtual DOM to be rendered on each redraw.\n *\n * Essentially, this is a wrapper for Mithril's components that adds several useful features:\n *\n * - In the `oninit` and `onbeforeupdate` lifecycle hooks, we store vnode attrs in `this.attrs.\n * This allows us to use attrs across components without having to pass the vnode to every single\n * method.\n * - The static `initAttrs` method allows a convenient way to provide defaults (or to otherwise modify)\n * the attrs that have been passed into a component.\n * - When the component is created in the DOM, we store its DOM element under `this.element`; this lets\n * us use jQuery to modify child DOM state from internal methods via the `this.$()` method.\n * - A convenience `component` method, which serves as an alternative to hyperscript and JSX.\n *\n * As with other Mithril components, components extending Component can be initialized\n * and nested using JSX, hyperscript, or a combination of both. The `component` method can also\n * be used.\n *\n * @example\n * return m('div',

Hello World

);\n *\n * @example\n * return m('div', MyComponent.component({foo: 'bar'), m('p', 'Hello World!'));\n *\n * @see https://mithril.js.org/components.html\n */\nexport default class Component {\n constructor() {\n /**\n * The root DOM element for the component.\n */\n _defineProperty(this, \"element\", void 0);\n /**\n * The attributes passed into the component.\n *\n * @see https://mithril.js.org/components.html#passing-data-to-components\n */\n _defineProperty(this, \"attrs\", void 0);\n /**\n * Class component state that is persisted between redraws.\n *\n * Updating this will **not** automatically trigger a redraw, unlike\n * other frameworks.\n *\n * This is different to Vnode state, which is always an instance of your\n * class component.\n *\n * This is `undefined` by default.\n */\n _defineProperty(this, \"state\", void 0);\n }\n /**\n * @inheritdoc\n */\n /**\n * @inheritdoc\n */\n oninit(vnode) {\n this.setAttrs(vnode.attrs);\n }\n\n /**\n * @inheritdoc\n */\n oncreate(vnode) {\n this.element = vnode.dom;\n }\n\n /**\n * @inheritdoc\n */\n onbeforeupdate(vnode) {\n this.setAttrs(vnode.attrs);\n }\n\n /**\n * @inheritdoc\n */\n onupdate(vnode) {}\n\n /**\n * @inheritdoc\n */\n onbeforeremove(vnode) {}\n\n /**\n * @inheritdoc\n */\n onremove(vnode) {}\n\n /**\n * Returns a jQuery object for this component's element. If you pass in a\n * selector string, this method will return a jQuery object, using the current\n * element as its buffer.\n *\n * For example, calling `component.$('li')` will return a jQuery object\n * containing all of the `li` elements inside the DOM element of this\n * component.\n *\n * @param [selector] a jQuery-compatible selector string\n * @returns the jQuery object for the DOM node\n * @final\n */\n $(selector) {\n const $element = $(this.element);\n return selector ? $element.find(selector) : $element;\n }\n\n /**\n * Convenience method to attach a component without JSX.\n * Has the same effect as calling `m(THIS_CLASS, attrs, children)`.\n *\n * @see https://mithril.js.org/hyperscript.html#mselector,-attributes,-children\n */\n static component(attrs, children) {\n if (attrs === void 0) {\n attrs = {};\n }\n if (children === void 0) {\n children = null;\n }\n const componentAttrs = {\n ...attrs\n };\n return m(this, componentAttrs, children);\n }\n\n /**\n * Saves a reference to the vnode attrs after running them through initAttrs,\n * and checking for common issues.\n */\n setAttrs(attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n this.constructor.initAttrs(attrs);\n if (attrs) {\n if ('children' in attrs) {\n throw new Error(\"[\".concat(this.constructor.name, \"] The \\\"children\\\" attribute of attrs should never be used. Either pass children in as the vnode children or rename the attribute\"));\n }\n if ('tag' in attrs) {\n throw new Error(\"[\".concat(this.constructor.name, \"] You cannot use the \\\"tag\\\" attribute name with Mithril 2.\"));\n }\n }\n this.attrs = attrs;\n }\n\n /**\n * Initialize the component's attrs.\n *\n * This can be used to assign default values for missing, optional attrs.\n */\n static initAttrs(attrs) {}\n}\nflarum.reg.add('flarum-nicknames', '../../../../framework/core/js/src/common/Component', Component);","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e))for(t=0;t {\n this.loading = false;\n m.redraw();\n });\n }\n}\nflarum.reg.add('flarum-nicknames', 'forum/components/NicknameModal', NicknameModal);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/User');","import Extend from 'flarum/common/extenders';\nimport User from 'flarum/common/models/User';\nexport default [new Extend.Model(User) //\n.attribute('canEditNickname')];","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Button from 'flarum/common/components/Button';\nimport extractText from 'flarum/common/utils/extractText';\nimport Stream from 'flarum/common/utils/Stream';\nimport NickNameModal from './components/NicknameModal';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-nicknames', () => {\n extend('flarum/forum/components/SettingsPage', 'accountItems', function (items) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (this.user.canEditNickname()) {\n items.add('changeNickname', m(Button, {\n className: \"Button\",\n onclick: () => app.modal.show(NickNameModal)\n }, app.translator.trans('flarum-nicknames.forum.settings.change_nickname_button')));\n }\n });\n extend('flarum/common/components/EditUserModal', 'oninit', function () {\n this.nickname = Stream(this.attrs.user.displayName());\n });\n extend('flarum/common/components/EditUserModal', 'fields', function (items) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (!this.attrs.user.canEditNickname()) return;\n items.add('nickname', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-nicknames.forum.edit_user.nicknames_heading')), m(\"input\", {\n className: \"FormControl\",\n placeholder: extractText(app.translator.trans('flarum-nicknames.forum.edit_user.nicknames_text')),\n bidi: this.nickname\n })), 100);\n });\n extend('flarum/common/components/EditUserModal', 'data', function (data) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (!this.attrs.user.canEditNickname()) return;\n if (this.nickname() !== this.attrs.user.displayName()) {\n data.nickname = this.nickname();\n }\n });\n extend('flarum/forum/components/SignUpModal', 'oninit', function () {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n this.nickname = Stream(this.attrs.username || '');\n });\n extend('flarum/forum/components/SignUpModal', 'onready', function () {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (app.forum.attribute('setNicknameOnRegistration') && app.forum.attribute('randomizeUsernameOnRegistration')) {\n this.$('[name=nickname]').select();\n }\n });\n extend('flarum/forum/components/SignUpModal', 'fields', function (items) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (app.forum.attribute('setNicknameOnRegistration')) {\n items.add('nickname', m(\"div\", {\n className: \"Form-group\"\n }, m(\"input\", {\n className: \"FormControl\",\n name: \"nickname\",\n type: \"text\",\n placeholder: extractText(app.translator.trans('flarum-nicknames.forum.sign_up.nickname_placeholder')),\n bidi: this.nickname,\n disabled: this.loading || this.isProvided('nickname'),\n required: app.forum.attribute('randomizeUsernameOnRegistration')\n })), 25);\n if (app.forum.attribute('randomizeUsernameOnRegistration')) {\n items.remove('username');\n }\n }\n });\n extend('flarum/forum/components/SignUpModal', 'submitData', function (data) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (app.forum.attribute('setNicknameOnRegistration')) {\n data.nickname = this.nickname();\n if (app.forum.attribute('randomizeUsernameOnRegistration')) {\n const arr = new Uint32Array(2);\n crypto.getRandomValues(arr);\n data.username = arr.join('');\n }\n }\n });\n});"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","reg","_typeof","iterator","constructor","_defineProperty","arg","input","hint","prim","toPrimitive","undefined","res","TypeError","String","toPropertyKey","configurable","writable","Component","this","oninit","vnode","setAttrs","attrs","oncreate","element","dom","onbeforeupdate","onupdate","onbeforeremove","onremove","$","selector","$element","find","static","children","componentAttrs","m","initAttrs","Error","concat","name","r","e","t","f","n","Array","isArray","length","add","classList","arguments","Form","view","label","description","className","assign","NicknameModal","super","nickname","title","content","type","autocomplete","bidi","disabled","loading","onsubmit","preventDefault","errorHandler","onerror","bind","then","hide","catch","redraw","attribute","extend","items","user","canEditNickname","onclick","displayName","placeholder","data","username","select","isProvided","required","remove","arr","Uint32Array","crypto","getRandomValues","join"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,qDCL9D,MAAM,EAA+BC,OAAOC,IAAIV,IAAI,OAAQ,a,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,iBCAtD,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,4B,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,4B,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,uB,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV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oB,+BACtBA,EAAK/B,SAAWD,KAAKC,WACjB,oBAAoB,oCAAoC,CAC1D,MAAMsC,EAAM,IAAIC,YAAY,GAC5BC,OAAOC,gBAAgBH,GACvBP,EAAKC,SAAWM,EAAII,KAAK,GAC3B,CAEJ,GAAE,G","sources":["webpack://@flarum/nicknames/webpack/bootstrap","webpack://@flarum/nicknames/webpack/runtime/compat get default export","webpack://@flarum/nicknames/webpack/runtime/define property getters","webpack://@flarum/nicknames/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/nicknames/webpack/runtime/make namespace object","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/utils/Stream')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/components/FormModal')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/components/Form')\"","webpack://@flarum/nicknames/./src/forum/components/NicknameModal.js","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/models/User')\"","webpack://@flarum/nicknames/./src/forum/extend.ts","webpack://@flarum/nicknames/./src/forum/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Button');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/extractText');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/Stream');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/FormModal');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Form');","import app from 'flarum/forum/app';\nimport FormModal from 'flarum/common/components/FormModal';\nimport Button from 'flarum/common/components/Button';\nimport Stream from 'flarum/common/utils/Stream';\nimport Form from 'flarum/common/components/Form';\nexport default class NicknameModal extends FormModal {\n oninit(vnode) {\n super.oninit(vnode);\n this.nickname = Stream(app.session.user.displayName());\n }\n className() {\n return 'NickameModal Modal--small';\n }\n title() {\n return app.translator.trans('flarum-nicknames.forum.change_nickname.title');\n }\n content() {\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(Form, {\n className: \"Form--centered\"\n }, m(\"div\", {\n className: \"Form-group\"\n }, m(\"input\", {\n type: \"text\",\n autocomplete: \"off\",\n name: \"nickname\",\n className: \"FormControl\",\n bidi: this.nickname,\n disabled: this.loading\n })), m(\"div\", {\n className: \"Form-group Form-controls\"\n }, m(Button, {\n className: \"Button Button--primary Button--block\",\n type: \"submit\",\n loading: this.loading\n }, app.translator.trans('flarum-nicknames.forum.change_nickname.submit_button')))));\n }\n onsubmit(e) {\n e.preventDefault();\n if (this.nickname() === app.session.user.displayName()) {\n this.hide();\n return;\n }\n this.loading = true;\n app.session.user.save({\n nickname: this.nickname()\n }, {\n errorHandler: this.onerror.bind(this)\n }).then(this.hide.bind(this)).catch(() => {\n this.loading = false;\n m.redraw();\n });\n }\n}\nflarum.reg.add('flarum-nicknames', 'forum/components/NicknameModal', NicknameModal);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/User');","import Extend from 'flarum/common/extenders';\nimport User from 'flarum/common/models/User';\nexport default [new Extend.Model(User) //\n.attribute('canEditNickname')];","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Button from 'flarum/common/components/Button';\nimport extractText from 'flarum/common/utils/extractText';\nimport Stream from 'flarum/common/utils/Stream';\nimport NickNameModal from './components/NicknameModal';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-nicknames', () => {\n extend('flarum/forum/components/SettingsPage', 'accountItems', function (items) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (this.user.canEditNickname()) {\n items.add('changeNickname', m(Button, {\n className: \"Button\",\n onclick: () => app.modal.show(NickNameModal)\n }, app.translator.trans('flarum-nicknames.forum.settings.change_nickname_button')));\n }\n });\n extend('flarum/common/components/EditUserModal', 'oninit', function () {\n this.nickname = Stream(this.attrs.user.displayName());\n });\n extend('flarum/common/components/EditUserModal', 'fields', function (items) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (!this.attrs.user.canEditNickname()) return;\n items.add('nickname', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-nicknames.forum.edit_user.nicknames_heading')), m(\"input\", {\n className: \"FormControl\",\n placeholder: extractText(app.translator.trans('flarum-nicknames.forum.edit_user.nicknames_text')),\n bidi: this.nickname\n })), 100);\n });\n extend('flarum/common/components/EditUserModal', 'data', function (data) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (!this.attrs.user.canEditNickname()) return;\n if (this.nickname() !== this.attrs.user.displayName()) {\n data.nickname = this.nickname();\n }\n });\n extend('flarum/forum/components/SignUpModal', 'oninit', function () {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n this.nickname = Stream(this.attrs.username || '');\n });\n extend('flarum/forum/components/SignUpModal', 'onready', function () {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (app.forum.attribute('setNicknameOnRegistration') && app.forum.attribute('randomizeUsernameOnRegistration')) {\n this.$('[name=nickname]').select();\n }\n });\n extend('flarum/forum/components/SignUpModal', 'fields', function (items) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (app.forum.attribute('setNicknameOnRegistration')) {\n items.add('nickname', m(\"div\", {\n className: \"Form-group\"\n }, m(\"input\", {\n className: \"FormControl\",\n name: \"nickname\",\n type: \"text\",\n placeholder: extractText(app.translator.trans('flarum-nicknames.forum.sign_up.nickname_placeholder')),\n bidi: this.nickname,\n disabled: this.loading || this.isProvided('nickname'),\n required: app.forum.attribute('randomizeUsernameOnRegistration')\n })), 25);\n if (app.forum.attribute('randomizeUsernameOnRegistration')) {\n items.remove('username');\n }\n }\n });\n extend('flarum/forum/components/SignUpModal', 'submitData', function (data) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (app.forum.attribute('setNicknameOnRegistration')) {\n data.nickname = this.nickname();\n if (app.forum.attribute('randomizeUsernameOnRegistration')) {\n const arr = new Uint32Array(2);\n crypto.getRandomValues(arr);\n data.username = arr.join('');\n }\n }\n });\n});"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","reg","NicknameModal","oninit","vnode","super","this","nickname","className","title","content","m","type","autocomplete","name","bidi","disabled","loading","onsubmit","e","preventDefault","errorHandler","onerror","bind","then","hide","catch","redraw","add","attribute","extend","items","user","canEditNickname","onclick","attrs","displayName","placeholder","data","username","$","select","isProvided","required","remove","arr","Uint32Array","crypto","getRandomValues","join"],"sourceRoot":""} \ No newline at end of file diff --git a/extensions/suspend/js/dist/forum.js b/extensions/suspend/js/dist/forum.js index 9537414ca6..3717bb4a65 100644 --- a/extensions/suspend/js/dist/forum.js +++ b/extensions/suspend/js/dist/forum.js @@ -1,2 +1,2 @@ -(()=>{var t={860:function(t){t.exports=function(){"use strict";var t=6e4,e=36e5,s="millisecond",n="second",r="minute",a="hour",i="day",o="week",u="month",l="quarter",d="year",c="date",m="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],s=t%100;return"["+t+(e[(s-20)%10]||e[s]||e[0])+"]"}},g=function(t,e,s){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(s)+t},v={s:g,z:function(t){var e=-t.utcOffset(),s=Math.abs(e),n=Math.floor(s/60),r=s%60;return(e<=0?"+":"-")+g(n,2,"0")+":"+g(r,2,"0")},m:function t(e,s){if(e.date()1)return t(i[0])}else{var o=e.name;y[o]=e,r=o}return!n&&r&&($=r),r||!n&&$},M=function(t,e){if(b(t))return t.clone();var s="object"==typeof e?e:{};return s.date=t,s.args=arguments,new _(s)},w=v;w.l=S,w.i=b,w.w=function(t,e){return M(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function p(t){this.$L=S(t.locale,null,!0),this.parse(t)}var g=p.prototype;return g.parse=function(t){this.$d=function(t){var e=t.date,s=t.utc;if(null===e)return new Date(NaN);if(w.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var n=e.match(f);if(n){var r=n[2]-1||0,a=(n[7]||"0").substring(0,3);return s?new Date(Date.UTC(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)):new Date(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},g.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},g.$utils=function(){return w},g.isValid=function(){return!(this.$d.toString()===m)},g.isSame=function(t,e){var s=M(t);return this.startOf(e)<=s&&s<=this.endOf(e)},g.isAfter=function(t,e){return M(t){var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{for(var n in e)s.o(e,n)&&!s.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),s.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";s.r(n),s.d(n,{extend:()=>st});const t=flarum.reg.get("core","common/extend"),e=flarum.reg.get("core","forum/app");var r=s.n(e);const a=flarum.reg.get("core","forum/utils/UserControls");var i=s.n(a);const o=flarum.reg.get("core","common/components/Button");var u=s.n(o);const l=flarum.reg.get("core","common/components/Badge");var d=s.n(l);const c=flarum.reg.get("core","common/models/User");var f=s.n(c);const h=flarum.reg.get("core","common/components/FormModal");var p=s.n(h);const g=flarum.reg.get("core","common/utils/Stream");var v=s.n(g);const y=flarum.reg.get("core","common/utils/withAttr");var b=s.n(y);const S=flarum.reg.get("core","common/utils/ItemList");var M=s.n(S),w=s(860),_=s.n(w),D=s(329),x=s.n(D);function O(){return new Date("2038-01-01")}function N(t){return _().utc(t).isSame(_().utc("2038-01-01"))}function T(t){return T="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(t)}function U(t,e,s){return(e=function(t){var e=function(t,e){if("object"!==T(t)||null===t)return t;var s=t[Symbol.toPrimitive];if(void 0!==s){var n=s.call(t,e);if("object"!==T(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"===T(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}_().extend(x()),flarum.reg.add("flarum-suspend","forum/helpers/suspensionHelper",{getPermanentSuspensionDate:O,isPermanentSuspensionDate:N,localStorageKey:function(){return"flarum-suspend.acknowledge-suspension"}});class k{constructor(){U(this,"element",void 0),U(this,"attrs",void 0),U(this,"state",void 0)}oninit(t){this.setAttrs(t.attrs)}oncreate(t){this.element=t.dom}onbeforeupdate(t){this.setAttrs(t.attrs)}onupdate(t){}onbeforeremove(t){}onremove(t){}$(t){const e=$(this.element);return t?e.find(t):e}static component(t,e){void 0===t&&(t={}),void 0===e&&(e=null);const s={...t};return m(this,s,e)}setAttrs(t){if(void 0===t&&(t={}),this.constructor.initAttrs(t),t){if("children"in t)throw new Error("[".concat(this.constructor.name,'] The "children" attribute of attrs should never be used. Either pass children in as the vnode children or rename the attribute'));if("tag"in t)throw new Error("[".concat(this.constructor.name,'] You cannot use the "tag" attribute name with Mithril 2.'))}this.attrs=t}static initAttrs(t){}}function F(t){var e,s,n="";if("string"==typeof t||"number"==typeof t)n+=t;else if("object"==typeof t)if(Array.isArray(t))for(e=0;ee&&(e=null),e&&(r=9999===e.getFullYear()?"indefinitely":"limited"),this.status=v()(r),this.reason=v()(s),this.message=v()(n),this.daysRemaining=v()("limited"===r&&1-dayjs().diff(e,"days"))}className(){return"SuspendUserModal Modal--medium"}title(){return r().translator.trans("flarum-suspend.forum.suspend_user.title",{user:this.attrs.user})}content(){return m("div",{className:"Modal-body"},m(j,null,this.formItems().toArray(),m("div",{className:"Form-group Form-controls"},m(u(),{className:"Button Button--primary",loading:this.loading,type:"submit"},r().translator.trans("flarum-suspend.forum.suspend_user.submit_button")))))}radioItems(){const t=new(M());return t.add("not-suspended",m("label",{className:"checkbox"},m("input",{type:"radio",name:"status",checked:!this.status(),value:"",onclick:b()("value",this.status)}),r().translator.trans("flarum-suspend.forum.suspend_user.not_suspended_label")),100),t.add("indefinitely",m("label",{className:"checkbox"},m("input",{type:"radio",name:"status",checked:"indefinitely"===this.status(),value:"indefinitely",onclick:b()("value",this.status)}),r().translator.trans("flarum-suspend.forum.suspend_user.indefinitely_label")),90),t.add("time-suspension",m("label",{className:"checkbox SuspendUserModal-days"},m("input",{type:"radio",name:"status",checked:"limited"===this.status(),value:"limited",onclick:t=>{this.status(t.target.value),m.redraw.sync(),this.$(".SuspendUserModal-days-input input").select(),t.redraw=!1}}),r().translator.trans("flarum-suspend.forum.suspend_user.limited_time_label"),"limited"===this.status()&&m("div",{className:"SuspendUserModal-days-input"},m("input",{type:"number",min:"0",value:this.daysRemaining(),oninput:b()("value",this.daysRemaining),className:"FormControl"}),r().translator.trans("flarum-suspend.forum.suspend_user.limited_time_days_text"))),80),t}formItems(){const t=new(M());return t.add("radioItems",m(I,{label:r().translator.trans("flarum-suspend.forum.suspend_user.status_heading")},this.radioItems().toArray()),100),t.add("reason",m("div",{className:"Form-group"},m("label",null,r().translator.trans("flarum-suspend.forum.suspend_user.reason")),m("textarea",{className:"FormControl",bidi:this.reason,placeholder:r().translator.trans("flarum-suspend.forum.suspend_user.placeholder_optional"),rows:"4"})),90),t.add("message",m("div",{className:"Form-group"},m("label",null,r().translator.trans("flarum-suspend.forum.suspend_user.display_message")),m("textarea",{className:"FormControl",bidi:this.message,placeholder:r().translator.trans("flarum-suspend.forum.suspend_user.placeholder_optional"),rows:"4"})),80),t}onsubmit(t){t.preventDefault(),this.loading=!0;let e=null;switch(this.status()){case"indefinitely":e=O();break;case"limited":e=dayjs().add(this.daysRemaining(),"days").toDate()}this.attrs.user.save({suspendedUntil:e,suspendReason:this.reason(),suspendMessage:this.message()}).then((()=>this.hide()),this.loaded.bind(this))}}flarum.reg.add("flarum-suspend","forum/components/SuspendUserModal",H);const A=flarum.reg.get("core","common/components/Modal");var L=s.n(A);const P=flarum.reg.get("core","common/helpers/fullTime");var W=s.n(P);class B extends(L()){oninit(t){super.oninit(t),this.message=this.attrs.message,this.until=this.attrs.until}className(){return"SuspensionInfoModal Modal"}title(){return r().translator.trans("flarum-suspend.forum.suspension_info.title")}content(){const t=N(new Date(this.until))?r().translator.trans("flarum-suspend.forum.suspension_info.indefinite"):r().translator.trans("flarum-suspend.forum.suspension_info.limited",{date:W()(this.until)});return m("div",{className:"Modal-body"},m(j,{className:"Form--centered"},m("p",{className:"helpText"},this.message),m("p",{className:"helpText"},t),m("div",{className:"Form-group Form-controls"},m(u(),{className:"Button Button--primary Button--block",onclick:this.hide.bind(this)},r().translator.trans("flarum-suspend.forum.suspension_info.dismiss_button")))))}hide(){localStorage.setItem("flarum-suspend.acknowledge-suspension",this.attrs.until.getTime()),this.attrs.state.close()}}flarum.reg.add("flarum-suspend","forum/components/SuspensionInfoModal",B);const R=flarum.reg.get("core","common/extenders");var z=s.n(R);const E=flarum.reg.get("core","common/Model");var Z=s.n(E);const J=flarum.reg.get("core","common/app");var q=s.n(J);const G=flarum.reg.get("core","common/query/IGambit");class V extends G.BooleanGambit{key(){return q().translator.trans("flarum-suspend.lib.gambits.users.suspended.key",{},!0)}filterKey(){return"suspended"}enabled(){return!!q().session.user&&q().forum.attribute("canSuspendUsers")}}flarum.reg.add("flarum-suspend","common/query/users/SuspendedGambit",V);const K=[(new(z().Search)).gambit("users",V),new(z().Model)(f()).attribute("canSuspend")],Q=flarum.reg.get("core","forum/components/Notification");var X=s.n(Q);class tt extends(X()){icon(){return"fas fa-ban"}href(){return r().route.user(this.attrs.notification.subject())}content(){const t=this.attrs.notification,e=t.content(),s=dayjs(e).from(t.createdAt(),!0);return N(e)?r().translator.trans("flarum-suspend.forum.notifications.user_suspended_indefinite_text"):r().translator.trans("flarum-suspend.forum.notifications.user_suspended_text",{timeReadable:s})}excerpt(){return null}}flarum.reg.add("flarum-suspend","forum/components/UserSuspendedNotification",tt);class et extends(X()){icon(){return"fas fa-ban"}href(){return r().route.user(this.attrs.notification.subject())}content(){return this.attrs.notification,r().translator.trans("flarum-suspend.forum.notifications.user_unsuspended_text")}excerpt(){return null}}flarum.reg.add("flarum-suspend","forum/components/UserUnsuspendedNotification",et);const st=[...K,(new(z().Notification)).add("userSuspended",tt).add("userUnsuspended",et),new(z().Model)(f()).attribute("suspendedUntil",Z().transformDate).attribute("suspendReason").attribute("suspendMessage")];r().initializers.add("flarum-suspend",(()=>{(0,t.extend)(i(),"moderationControls",((t,e)=>{e.canSuspend()&&t.add("suspend",m(u(),{icon:"fas fa-ban",onclick:()=>r().modal.show(H,{user:e})},r().translator.trans("flarum-suspend.forum.user_controls.suspend_button")))})),(0,t.extend)(f().prototype,"badges",(function(t){const e=this.suspendedUntil();new Date{if(r().session.user){const t=r().session.user.suspendMessage(),e=r().session.user.suspendedUntil(),s=t&&e&&new Date{var t={860:function(t){t.exports=function(){"use strict";var t=6e4,e=36e5,s="millisecond",n="second",r="minute",a="hour",i="day",u="week",o="month",l="quarter",d="year",c="date",f="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],s=t%100;return"["+t+(e[(s-20)%10]||e[s]||e[0])+"]"}},g=function(t,e,s){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(s)+t},$={s:g,z:function(t){var e=-t.utcOffset(),s=Math.abs(e),n=Math.floor(s/60),r=s%60;return(e<=0?"+":"-")+g(n,2,"0")+":"+g(r,2,"0")},m:function t(e,s){if(e.date()1)return t(i[0])}else{var u=e.name;y[u]=e,r=u}return!n&&r&&(v=r),r||!n&&v},b=function(t,e){if(M(t))return t.clone();var s="object"==typeof e?e:{};return s.date=t,s.args=arguments,new D(s)},_=$;_.l=S,_.i=M,_.w=function(t,e){return b(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var D=function(){function p(t){this.$L=S(t.locale,null,!0),this.parse(t)}var g=p.prototype;return g.parse=function(t){this.$d=function(t){var e=t.date,s=t.utc;if(null===e)return new Date(NaN);if(_.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var n=e.match(m);if(n){var r=n[2]-1||0,a=(n[7]||"0").substring(0,3);return s?new Date(Date.UTC(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)):new Date(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},g.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},g.$utils=function(){return _},g.isValid=function(){return!(this.$d.toString()===f)},g.isSame=function(t,e){var s=b(t);return this.startOf(e)<=s&&s<=this.endOf(e)},g.isAfter=function(t,e){return b(t){var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{for(var n in e)s.o(e,n)&&!s.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),s.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";s.r(n),s.d(n,{extend:()=>E});const t=flarum.reg.get("core","common/extend"),e=flarum.reg.get("core","forum/app");var r=s.n(e);const a=flarum.reg.get("core","forum/utils/UserControls");var i=s.n(a);const u=flarum.reg.get("core","common/components/Button");var o=s.n(u);const l=flarum.reg.get("core","common/components/Badge");var d=s.n(l);const c=flarum.reg.get("core","common/models/User");var f=s.n(c);const h=flarum.reg.get("core","common/components/FormModal");var p=s.n(h);const g=flarum.reg.get("core","common/utils/Stream");var $=s.n(g);const v=flarum.reg.get("core","common/utils/withAttr");var y=s.n(v);const M=flarum.reg.get("core","common/utils/ItemList");var S=s.n(M);const b=flarum.reg.get("core","common/components/Form");var _=s.n(b);const D=flarum.reg.get("core","common/components/FieldSet");var w=s.n(D),x=s(860),O=s.n(x),T=s(329),U=s.n(T);function N(){return new Date("2038-01-01")}function k(t){return O().utc(t).isSame(O().utc("2038-01-01"))}O().extend(U()),flarum.reg.add("flarum-suspend","forum/helpers/suspensionHelper",{getPermanentSuspensionDate:N,isPermanentSuspensionDate:k,localStorageKey:function(){return"flarum-suspend.acknowledge-suspension"}});class C extends(p()){oninit(t){super.oninit(t);let e=this.attrs.user.suspendedUntil();const s=this.attrs.user.suspendReason(),n=this.attrs.user.suspendMessage();let r=null;new Date>e&&(e=null),e&&(r=9999===e.getFullYear()?"indefinitely":"limited"),this.status=$()(r),this.reason=$()(s),this.message=$()(n),this.daysRemaining=$()("limited"===r&&1-dayjs().diff(e,"days"))}className(){return"SuspendUserModal Modal--medium"}title(){return r().translator.trans("flarum-suspend.forum.suspend_user.title",{user:this.attrs.user})}content(){return m("div",{className:"Modal-body"},m(_(),null,this.formItems().toArray(),m("div",{className:"Form-group Form-controls"},m(o(),{className:"Button Button--primary",loading:this.loading,type:"submit"},r().translator.trans("flarum-suspend.forum.suspend_user.submit_button")))))}radioItems(){const t=new(S());return t.add("not-suspended",m("label",{className:"checkbox"},m("input",{type:"radio",name:"status",checked:!this.status(),value:"",onclick:y()("value",this.status)}),r().translator.trans("flarum-suspend.forum.suspend_user.not_suspended_label")),100),t.add("indefinitely",m("label",{className:"checkbox"},m("input",{type:"radio",name:"status",checked:"indefinitely"===this.status(),value:"indefinitely",onclick:y()("value",this.status)}),r().translator.trans("flarum-suspend.forum.suspend_user.indefinitely_label")),90),t.add("time-suspension",m("label",{className:"checkbox SuspendUserModal-days"},m("input",{type:"radio",name:"status",checked:"limited"===this.status(),value:"limited",onclick:t=>{this.status(t.target.value),m.redraw.sync(),this.$(".SuspendUserModal-days-input input").select(),t.redraw=!1}}),r().translator.trans("flarum-suspend.forum.suspend_user.limited_time_label"),"limited"===this.status()&&m("div",{className:"SuspendUserModal-days-input"},m("input",{type:"number",min:"0",value:this.daysRemaining(),oninput:y()("value",this.daysRemaining),className:"FormControl"}),r().translator.trans("flarum-suspend.forum.suspend_user.limited_time_days_text"))),80),t}formItems(){const t=new(S());return t.add("radioItems",m(w(),{label:r().translator.trans("flarum-suspend.forum.suspend_user.status_heading")},this.radioItems().toArray()),100),t.add("reason",m("div",{className:"Form-group"},m("label",null,r().translator.trans("flarum-suspend.forum.suspend_user.reason")),m("textarea",{className:"FormControl",bidi:this.reason,placeholder:r().translator.trans("flarum-suspend.forum.suspend_user.placeholder_optional"),rows:"4"})),90),t.add("message",m("div",{className:"Form-group"},m("label",null,r().translator.trans("flarum-suspend.forum.suspend_user.display_message")),m("textarea",{className:"FormControl",bidi:this.message,placeholder:r().translator.trans("flarum-suspend.forum.suspend_user.placeholder_optional"),rows:"4"})),80),t}onsubmit(t){t.preventDefault(),this.loading=!0;let e=null;switch(this.status()){case"indefinitely":e=N();break;case"limited":e=dayjs().add(this.daysRemaining(),"days").toDate()}this.attrs.user.save({suspendedUntil:e,suspendReason:this.reason(),suspendMessage:this.message()}).then((()=>this.hide()),this.loaded.bind(this))}}flarum.reg.add("flarum-suspend","forum/components/SuspendUserModal",C);const Y=flarum.reg.get("core","common/components/Modal");var I=s.n(Y);const F=flarum.reg.get("core","common/helpers/fullTime");var H=s.n(F);class j extends(I()){oninit(t){super.oninit(t),this.message=this.attrs.message,this.until=this.attrs.until}className(){return"SuspensionInfoModal Modal"}title(){return r().translator.trans("flarum-suspend.forum.suspension_info.title")}content(){const t=k(new Date(this.until))?r().translator.trans("flarum-suspend.forum.suspension_info.indefinite"):r().translator.trans("flarum-suspend.forum.suspension_info.limited",{date:H()(this.until)});return m("div",{className:"Modal-body"},m(_(),{className:"Form--centered"},m("p",{className:"helpText"},this.message),m("p",{className:"helpText"},t),m("div",{className:"Form-group Form-controls"},m(o(),{className:"Button Button--primary Button--block",onclick:this.hide.bind(this)},r().translator.trans("flarum-suspend.forum.suspension_info.dismiss_button")))))}hide(){localStorage.setItem("flarum-suspend.acknowledge-suspension",this.attrs.until.getTime()),this.attrs.state.close()}}flarum.reg.add("flarum-suspend","forum/components/SuspensionInfoModal",j);const L=flarum.reg.get("core","common/extenders");var A=s.n(L);const W=flarum.reg.get("core","common/Model");var B=s.n(W);const R=flarum.reg.get("core","common/app");var P=s.n(R);const z=flarum.reg.get("core","common/query/IGambit");class Z extends z.BooleanGambit{key(){return P().translator.trans("flarum-suspend.lib.gambits.users.suspended.key",{},!0)}filterKey(){return"suspended"}enabled(){return!!P().session.user&&P().forum.attribute("canSuspendUsers")}}flarum.reg.add("flarum-suspend","common/query/users/SuspendedGambit",Z);const J=[(new(A().Search)).gambit("users",Z),new(A().Model)(f()).attribute("canSuspend")],q=flarum.reg.get("core","forum/components/Notification");var G=s.n(q);class V extends(G()){icon(){return"fas fa-ban"}href(){return r().route.user(this.attrs.notification.subject())}content(){const t=this.attrs.notification,e=t.content(),s=dayjs(e).from(t.createdAt(),!0);return k(e)?r().translator.trans("flarum-suspend.forum.notifications.user_suspended_indefinite_text"):r().translator.trans("flarum-suspend.forum.notifications.user_suspended_text",{timeReadable:s})}excerpt(){return null}}flarum.reg.add("flarum-suspend","forum/components/UserSuspendedNotification",V);class K extends(G()){icon(){return"fas fa-ban"}href(){return r().route.user(this.attrs.notification.subject())}content(){return this.attrs.notification,r().translator.trans("flarum-suspend.forum.notifications.user_unsuspended_text")}excerpt(){return null}}flarum.reg.add("flarum-suspend","forum/components/UserUnsuspendedNotification",K);const E=[...J,(new(A().Notification)).add("userSuspended",V).add("userUnsuspended",K),new(A().Model)(f()).attribute("suspendedUntil",B().transformDate).attribute("suspendReason").attribute("suspendMessage")];r().initializers.add("flarum-suspend",(()=>{(0,t.extend)(i(),"moderationControls",((t,e)=>{e.canSuspend()&&t.add("suspend",m(o(),{icon:"fas fa-ban",onclick:()=>r().modal.show(C,{user:e})},r().translator.trans("flarum-suspend.forum.user_controls.suspend_button")))})),(0,t.extend)(f().prototype,"badges",(function(t){const e=this.suspendedUntil();new Date{if(r().session.user){const t=r().session.user.suspendMessage(),e=r().session.user.suspendedUntil(),s=t&&e&&new Date=e?t:\"\"+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+m(r,2,\"0\")+\":\"+m(i,2,\"0\")},m:function t(e,n){if(e.date()1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},w=function(t,e){if(p(t))return t.clone();var n=\"object\"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=v;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t)}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if(\"string\"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||\"0\").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return O},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t) {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/utils/UserControls');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Button');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Badge');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/User');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/FormModal');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/Stream');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/withAttr');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/ItemList');","import dayjs from 'dayjs';\nimport utc from 'dayjs/plugin/utc';\ndayjs.extend(utc);\nexport function getPermanentSuspensionDate() {\n return new Date('2038-01-01');\n}\nexport function isPermanentSuspensionDate(date) {\n return dayjs.utc(date).isSame(dayjs.utc('2038-01-01'));\n}\nexport function localStorageKey() {\n return 'flarum-suspend.acknowledge-suspension';\n}\nflarum.reg.add('flarum-suspend', 'forum/helpers/suspensionHelper', { getPermanentSuspensionDate: getPermanentSuspensionDate,isPermanentSuspensionDate: isPermanentSuspensionDate,localStorageKey: localStorageKey, });","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _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 }, _typeof(obj);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\n/**\n * The `Component` class defines a user interface 'building block'. A component\n * generates a virtual DOM to be rendered on each redraw.\n *\n * Essentially, this is a wrapper for Mithril's components that adds several useful features:\n *\n * - In the `oninit` and `onbeforeupdate` lifecycle hooks, we store vnode attrs in `this.attrs.\n * This allows us to use attrs across components without having to pass the vnode to every single\n * method.\n * - The static `initAttrs` method allows a convenient way to provide defaults (or to otherwise modify)\n * the attrs that have been passed into a component.\n * - When the component is created in the DOM, we store its DOM element under `this.element`; this lets\n * us use jQuery to modify child DOM state from internal methods via the `this.$()` method.\n * - A convenience `component` method, which serves as an alternative to hyperscript and JSX.\n *\n * As with other Mithril components, components extending Component can be initialized\n * and nested using JSX, hyperscript, or a combination of both. The `component` method can also\n * be used.\n *\n * @example\n * return m('div',

Hello World

);\n *\n * @example\n * return m('div', MyComponent.component({foo: 'bar'), m('p', 'Hello World!'));\n *\n * @see https://mithril.js.org/components.html\n */\nexport default class Component {\n constructor() {\n /**\n * The root DOM element for the component.\n */\n _defineProperty(this, \"element\", void 0);\n /**\n * The attributes passed into the component.\n *\n * @see https://mithril.js.org/components.html#passing-data-to-components\n */\n _defineProperty(this, \"attrs\", void 0);\n /**\n * Class component state that is persisted between redraws.\n *\n * Updating this will **not** automatically trigger a redraw, unlike\n * other frameworks.\n *\n * This is different to Vnode state, which is always an instance of your\n * class component.\n *\n * This is `undefined` by default.\n */\n _defineProperty(this, \"state\", void 0);\n }\n /**\n * @inheritdoc\n */\n /**\n * @inheritdoc\n */\n oninit(vnode) {\n this.setAttrs(vnode.attrs);\n }\n\n /**\n * @inheritdoc\n */\n oncreate(vnode) {\n this.element = vnode.dom;\n }\n\n /**\n * @inheritdoc\n */\n onbeforeupdate(vnode) {\n this.setAttrs(vnode.attrs);\n }\n\n /**\n * @inheritdoc\n */\n onupdate(vnode) {}\n\n /**\n * @inheritdoc\n */\n onbeforeremove(vnode) {}\n\n /**\n * @inheritdoc\n */\n onremove(vnode) {}\n\n /**\n * Returns a jQuery object for this component's element. If you pass in a\n * selector string, this method will return a jQuery object, using the current\n * element as its buffer.\n *\n * For example, calling `component.$('li')` will return a jQuery object\n * containing all of the `li` elements inside the DOM element of this\n * component.\n *\n * @param [selector] a jQuery-compatible selector string\n * @returns the jQuery object for the DOM node\n * @final\n */\n $(selector) {\n const $element = $(this.element);\n return selector ? $element.find(selector) : $element;\n }\n\n /**\n * Convenience method to attach a component without JSX.\n * Has the same effect as calling `m(THIS_CLASS, attrs, children)`.\n *\n * @see https://mithril.js.org/hyperscript.html#mselector,-attributes,-children\n */\n static component(attrs, children) {\n if (attrs === void 0) {\n attrs = {};\n }\n if (children === void 0) {\n children = null;\n }\n const componentAttrs = {\n ...attrs\n };\n return m(this, componentAttrs, children);\n }\n\n /**\n * Saves a reference to the vnode attrs after running them through initAttrs,\n * and checking for common issues.\n */\n setAttrs(attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n this.constructor.initAttrs(attrs);\n if (attrs) {\n if ('children' in attrs) {\n throw new Error(\"[\".concat(this.constructor.name, \"] The \\\"children\\\" attribute of attrs should never be used. Either pass children in as the vnode children or rename the attribute\"));\n }\n if ('tag' in attrs) {\n throw new Error(\"[\".concat(this.constructor.name, \"] You cannot use the \\\"tag\\\" attribute name with Mithril 2.\"));\n }\n }\n this.attrs = attrs;\n }\n\n /**\n * Initialize the component's attrs.\n *\n * This can be used to assign default values for missing, optional attrs.\n */\n static initAttrs(attrs) {}\n}\nflarum.reg.add('flarum-suspend', '../../../../framework/core/js/src/common/Component', Component);","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e))for(t=0;t until) until = null;\n if (until) {\n if (until.getFullYear() === 9999) status = 'indefinitely';else status = 'limited';\n }\n this.status = Stream(status);\n this.reason = Stream(reason);\n this.message = Stream(message);\n this.daysRemaining = Stream(status === 'limited' && -dayjs().diff(until, 'days') + 1);\n }\n className() {\n return 'SuspendUserModal Modal--medium';\n }\n title() {\n return app.translator.trans('flarum-suspend.forum.suspend_user.title', {\n user: this.attrs.user\n });\n }\n content() {\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(Form, null, this.formItems().toArray(), m(\"div\", {\n className: \"Form-group Form-controls\"\n }, m(Button, {\n className: \"Button Button--primary\",\n loading: this.loading,\n type: \"submit\"\n }, app.translator.trans('flarum-suspend.forum.suspend_user.submit_button')))));\n }\n radioItems() {\n const items = new ItemList();\n items.add('not-suspended', m(\"label\", {\n className: \"checkbox\"\n }, m(\"input\", {\n type: \"radio\",\n name: \"status\",\n checked: !this.status(),\n value: \"\",\n onclick: withAttr('value', this.status)\n }), app.translator.trans('flarum-suspend.forum.suspend_user.not_suspended_label')), 100);\n items.add('indefinitely', m(\"label\", {\n className: \"checkbox\"\n }, m(\"input\", {\n type: \"radio\",\n name: \"status\",\n checked: this.status() === 'indefinitely',\n value: \"indefinitely\",\n onclick: withAttr('value', this.status)\n }), app.translator.trans('flarum-suspend.forum.suspend_user.indefinitely_label')), 90);\n items.add('time-suspension', m(\"label\", {\n className: \"checkbox SuspendUserModal-days\"\n }, m(\"input\", {\n type: \"radio\",\n name: \"status\",\n checked: this.status() === 'limited',\n value: \"limited\",\n onclick: e => {\n this.status(e.target.value);\n m.redraw.sync();\n this.$('.SuspendUserModal-days-input input').select();\n e.redraw = false;\n }\n }), app.translator.trans('flarum-suspend.forum.suspend_user.limited_time_label'), this.status() === 'limited' && m(\"div\", {\n className: \"SuspendUserModal-days-input\"\n }, m(\"input\", {\n type: \"number\",\n min: \"0\",\n value: this.daysRemaining(),\n oninput: withAttr('value', this.daysRemaining),\n className: \"FormControl\"\n }), app.translator.trans('flarum-suspend.forum.suspend_user.limited_time_days_text'))), 80);\n return items;\n }\n formItems() {\n const items = new ItemList();\n items.add('radioItems', m(FieldSet, {\n label: app.translator.trans('flarum-suspend.forum.suspend_user.status_heading')\n }, this.radioItems().toArray()), 100);\n items.add('reason', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-suspend.forum.suspend_user.reason')), m(\"textarea\", {\n className: \"FormControl\",\n bidi: this.reason,\n placeholder: app.translator.trans('flarum-suspend.forum.suspend_user.placeholder_optional'),\n rows: \"4\"\n })), 90);\n items.add('message', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-suspend.forum.suspend_user.display_message')), m(\"textarea\", {\n className: \"FormControl\",\n bidi: this.message,\n placeholder: app.translator.trans('flarum-suspend.forum.suspend_user.placeholder_optional'),\n rows: \"4\"\n })), 80);\n return items;\n }\n onsubmit(e) {\n e.preventDefault();\n this.loading = true;\n let suspendedUntil = null;\n switch (this.status()) {\n case 'indefinitely':\n suspendedUntil = getPermanentSuspensionDate();\n break;\n case 'limited':\n suspendedUntil = dayjs().add(this.daysRemaining(), 'days').toDate();\n break;\n default:\n // no default\n }\n\n this.attrs.user.save({\n suspendedUntil,\n suspendReason: this.reason(),\n suspendMessage: this.message()\n }).then(() => this.hide(), this.loaded.bind(this));\n }\n}\nflarum.reg.add('flarum-suspend', 'forum/components/SuspendUserModal', SuspendUserModal);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Modal');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/fullTime');","import app from 'flarum/forum/app';\nimport Modal from 'flarum/common/components/Modal';\nimport Button from 'flarum/common/components/Button';\nimport fullTime from 'flarum/common/helpers/fullTime';\nimport { isPermanentSuspensionDate, localStorageKey } from '../helpers/suspensionHelper';\nimport Form from '@flarum/core/src/common/components/Form';\nexport default class SuspensionInfoModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n this.message = this.attrs.message;\n this.until = this.attrs.until;\n }\n className() {\n return 'SuspensionInfoModal Modal';\n }\n title() {\n return app.translator.trans('flarum-suspend.forum.suspension_info.title');\n }\n content() {\n const timespan = isPermanentSuspensionDate(new Date(this.until)) ? app.translator.trans('flarum-suspend.forum.suspension_info.indefinite') : app.translator.trans('flarum-suspend.forum.suspension_info.limited', {\n date: fullTime(this.until)\n });\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(Form, {\n className: \"Form--centered\"\n }, m(\"p\", {\n className: \"helpText\"\n }, this.message), m(\"p\", {\n className: \"helpText\"\n }, timespan), m(\"div\", {\n className: \"Form-group Form-controls\"\n }, m(Button, {\n className: \"Button Button--primary Button--block\",\n onclick: this.hide.bind(this)\n }, app.translator.trans('flarum-suspend.forum.suspension_info.dismiss_button')))));\n }\n hide() {\n localStorage.setItem(localStorageKey(), this.attrs.until.getTime());\n this.attrs.state.close();\n }\n}\nflarum.reg.add('flarum-suspend', 'forum/components/SuspensionInfoModal', SuspensionInfoModal);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Model');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/query/IGambit');","import app from 'flarum/common/app';\nimport { BooleanGambit } from 'flarum/common/query/IGambit';\nexport default class SuspendedGambit extends BooleanGambit {\n key() {\n return app.translator.trans('flarum-suspend.lib.gambits.users.suspended.key', {}, true);\n }\n filterKey() {\n return 'suspended';\n }\n enabled() {\n return !!app.session.user && app.forum.attribute('canSuspendUsers');\n }\n}\nflarum.reg.add('flarum-suspend', 'common/query/users/SuspendedGambit', SuspendedGambit);","import Extend from 'flarum/common/extenders';\nimport SuspendedGambit from './query/users/SuspendedGambit';\nimport User from 'flarum/common/models/User';\n\n// prettier-ignore\nexport default [new Extend.Search().gambit('users', SuspendedGambit), new Extend.Model(User).attribute('canSuspend')];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/Notification');","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nimport { isPermanentSuspensionDate } from '../helpers/suspensionHelper';\nexport default class UserSuspendedNotification extends Notification {\n icon() {\n return 'fas fa-ban';\n }\n href() {\n return app.route.user(this.attrs.notification.subject());\n }\n content() {\n const notification = this.attrs.notification;\n const suspendedUntil = notification.content();\n const timeReadable = dayjs(suspendedUntil).from(notification.createdAt(), true);\n return isPermanentSuspensionDate(suspendedUntil) ? app.translator.trans('flarum-suspend.forum.notifications.user_suspended_indefinite_text') : app.translator.trans('flarum-suspend.forum.notifications.user_suspended_text', {\n timeReadable\n });\n }\n excerpt() {\n return null;\n }\n}\nflarum.reg.add('flarum-suspend', 'forum/components/UserSuspendedNotification', UserSuspendedNotification);","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nexport default class UserUnsuspendedNotification extends Notification {\n icon() {\n return 'fas fa-ban';\n }\n href() {\n return app.route.user(this.attrs.notification.subject());\n }\n content() {\n const notification = this.attrs.notification;\n return app.translator.trans('flarum-suspend.forum.notifications.user_unsuspended_text');\n }\n excerpt() {\n return null;\n }\n}\nflarum.reg.add('flarum-suspend', 'forum/components/UserUnsuspendedNotification', UserUnsuspendedNotification);","import Extend from 'flarum/common/extenders';\nimport User from 'flarum/common/models/User';\nimport Model from 'flarum/common/Model';\nimport commonExtend from '../common/extend';\nimport UserSuspendedNotification from './components/UserSuspendedNotification';\nimport UserUnsuspendedNotification from './components/UserUnsuspendedNotification';\nexport default [...commonExtend, new Extend.Notification() //\n.add('userSuspended', UserSuspendedNotification).add('userUnsuspended', UserUnsuspendedNotification), new Extend.Model(User).attribute('suspendedUntil', Model.transformDate).attribute('suspendReason').attribute('suspendMessage')];","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport UserControls from 'flarum/forum/utils/UserControls';\nimport Button from 'flarum/common/components/Button';\nimport Badge from 'flarum/common/components/Badge';\nimport User from 'flarum/common/models/User';\nimport SuspendUserModal from './components/SuspendUserModal';\nimport checkForSuspension from './checkForSuspension';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-suspend', () => {\n extend(UserControls, 'moderationControls', (items, user) => {\n if (user.canSuspend()) {\n items.add('suspend', m(Button, {\n icon: \"fas fa-ban\",\n onclick: () => app.modal.show(SuspendUserModal, {\n user\n })\n }, app.translator.trans('flarum-suspend.forum.user_controls.suspend_button')));\n }\n });\n extend(User.prototype, 'badges', function (items) {\n const until = this.suspendedUntil();\n if (new Date() < until) {\n items.add('suspended', m(Badge, {\n icon: \"fas fa-ban\",\n type: \"suspended\",\n label: app.translator.trans('flarum-suspend.forum.user_badge.suspended_tooltip')\n }), 100);\n }\n });\n checkForSuspension();\n});\nimport './forum';","import app from 'flarum/forum/app';\nimport SuspensionInfoModal from './components/SuspensionInfoModal';\nimport { localStorageKey } from './helpers/suspensionHelper';\nexport default function () {\n return setTimeout(() => {\n if (app.session.user) {\n const message = app.session.user.suspendMessage();\n const until = app.session.user.suspendedUntil();\n const isSuspended = message && until && new Date() < until;\n const alreadyDisplayed = localStorage.getItem(localStorageKey()) === (until == null ? void 0 : until.getTime().toString());\n if (isSuspended && !alreadyDisplayed) {\n app.modal.show(SuspensionInfoModal, {\n message,\n until\n });\n } else if (localStorage.getItem(localStorageKey())) {\n localStorage.removeItem(localStorageKey());\n }\n }\n }, 0);\n}"],"names":["module","exports","e","n","r","i","s","u","a","o","f","h","c","d","l","$","y","M","name","weekdays","split","months","ordinal","t","m","String","length","Array","join","v","z","utcOffset","Math","abs","floor","date","year","month","clone","add","ceil","p","w","D","ms","Q","toLowerCase","replace","g","_","S","args","arguments","O","locale","$L","utc","$u","x","$x","$offset","this","parse","prototype","$d","Date","NaN","test","match","substring","UTC","init","$y","getFullYear","$M","getMonth","$D","getDate","$W","getDay","$H","getHours","$m","getMinutes","$s","getSeconds","$ms","getMilliseconds","$utils","isValid","toString","isSame","startOf","endOf","isAfter","isBefore","$g","set","unix","valueOf","getTime","toDate","apply","slice","$locale","weekStart","$set","min","daysInMonth","get","Number","round","subtract","format","invalidDate","meridiem","YY","YYYY","MM","MMM","monthsShort","MMMM","DD","dd","weekdaysMin","ddd","weekdaysShort","dddd","H","HH","hh","A","mm","ss","SSS","Z","getTimezoneOffset","diff","toJSON","toISOString","toUTCString","T","forEach","extend","$i","isDayjs","en","Ls","local","call","getUTCFullYear","getUTCMonth","getUTCDate","getUTCDay","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","$localOffset","isUTC","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","getter","__esModule","definition","key","Object","defineProperty","enumerable","obj","prop","hasOwnProperty","Symbol","toStringTag","value","flarum","reg","getPermanentSuspensionDate","isPermanentSuspensionDate","_typeof","iterator","constructor","_defineProperty","arg","input","hint","prim","toPrimitive","res","TypeError","toPropertyKey","configurable","writable","localStorageKey","Component","oninit","vnode","setAttrs","attrs","oncreate","element","dom","onbeforeupdate","onupdate","onbeforeremove","onremove","selector","$element","find","static","children","componentAttrs","initAttrs","Error","concat","isArray","classList","Form","view","label","description","className","assign","FieldSet","role","SuspendUserModal","super","until","user","suspendedUntil","reason","suspendReason","message","suspendMessage","status","daysRemaining","dayjs","title","content","formItems","toArray","loading","type","radioItems","items","checked","onclick","target","redraw","sync","select","oninput","bidi","placeholder","rows","onsubmit","preventDefault","save","then","hide","loaded","bind","SuspensionInfoModal","timespan","localStorage","setItem","state","close","SuspendedGambit","BooleanGambit","filterKey","enabled","gambit","attribute","UserSuspendedNotification","icon","href","notification","subject","timeReadable","from","createdAt","excerpt","UserUnsuspendedNotification","canSuspend","setTimeout","isSuspended","alreadyDisplayed","getItem","removeItem"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.js","mappings":"6BAAoEA,EAAOC,QAAmI,WAAW,aA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BNZ,wCgBQL,IACC,EDWiB,G","sources":["webpack://@flarum/suspend/../../../node_modules/dayjs/dayjs.min.js","webpack://@flarum/suspend/../../../node_modules/dayjs/plugin/utc.js","webpack://@flarum/suspend/webpack/bootstrap","webpack://@flarum/suspend/webpack/runtime/compat get default export","webpack://@flarum/suspend/webpack/runtime/define property getters","webpack://@flarum/suspend/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/suspend/webpack/runtime/make namespace object","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'forum/utils/UserControls')\"","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'common/components/Badge')\"","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'common/models/User')\"","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'common/components/FormModal')\"","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'common/utils/Stream')\"","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'common/utils/withAttr')\"","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'common/utils/ItemList')\"","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'common/components/Form')\"","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'common/components/FieldSet')\"","webpack://@flarum/suspend/./src/forum/helpers/suspensionHelper.ts","webpack://@flarum/suspend/./src/forum/components/SuspendUserModal.js","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'common/components/Modal')\"","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'common/helpers/fullTime')\"","webpack://@flarum/suspend/./src/forum/components/SuspensionInfoModal.js","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'common/Model')\"","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'common/app')\"","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'common/query/IGambit')\"","webpack://@flarum/suspend/./src/common/query/users/SuspendedGambit.ts","webpack://@flarum/suspend/./src/common/extend.ts","webpack://@flarum/suspend/external root \"flarum.reg.get('core', 'forum/components/Notification')\"","webpack://@flarum/suspend/./src/forum/components/UserSuspendedNotification.js","webpack://@flarum/suspend/./src/forum/components/UserUnsuspendedNotification.js","webpack://@flarum/suspend/./src/forum/extend.ts","webpack://@flarum/suspend/./src/forum/index.js","webpack://@flarum/suspend/./src/forum/checkForSuspension.js"],"sourcesContent":["!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){\"use strict\";var t=1e3,e=6e4,n=36e5,r=\"millisecond\",i=\"second\",s=\"minute\",u=\"hour\",a=\"day\",o=\"week\",f=\"month\",h=\"quarter\",c=\"year\",d=\"date\",l=\"Invalid Date\",$=/^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[Tt\\s]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/,y=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\"),ordinal:function(t){var e=[\"th\",\"st\",\"nd\",\"rd\"],n=t%100;return\"[\"+t+(e[(n-20)%10]||e[n]||e[0])+\"]\"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:\"\"+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+m(r,2,\"0\")+\":\"+m(i,2,\"0\")},m:function t(e,n){if(e.date()1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},w=function(t,e){if(p(t))return t.clone();var n=\"object\"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=v;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t)}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if(\"string\"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||\"0\").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return O},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t) {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/utils/UserControls');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Button');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Badge');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/User');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/FormModal');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/Stream');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/withAttr');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/ItemList');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Form');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/FieldSet');","import dayjs from 'dayjs';\nimport utc from 'dayjs/plugin/utc';\ndayjs.extend(utc);\nexport function getPermanentSuspensionDate() {\n return new Date('2038-01-01');\n}\nexport function isPermanentSuspensionDate(date) {\n return dayjs.utc(date).isSame(dayjs.utc('2038-01-01'));\n}\nexport function localStorageKey() {\n return 'flarum-suspend.acknowledge-suspension';\n}\nflarum.reg.add('flarum-suspend', 'forum/helpers/suspensionHelper', { getPermanentSuspensionDate: getPermanentSuspensionDate,isPermanentSuspensionDate: isPermanentSuspensionDate,localStorageKey: localStorageKey, });","import app from 'flarum/forum/app';\nimport FormModal from 'flarum/common/components/FormModal';\nimport Button from 'flarum/common/components/Button';\nimport Stream from 'flarum/common/utils/Stream';\nimport withAttr from 'flarum/common/utils/withAttr';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Form from 'flarum/common/components/Form';\nimport FieldSet from 'flarum/common/components/FieldSet';\nimport { getPermanentSuspensionDate } from '../helpers/suspensionHelper';\nexport default class SuspendUserModal extends FormModal {\n oninit(vnode) {\n super.oninit(vnode);\n let until = this.attrs.user.suspendedUntil();\n const reason = this.attrs.user.suspendReason();\n const message = this.attrs.user.suspendMessage();\n let status = null;\n if (new Date() > until) until = null;\n if (until) {\n if (until.getFullYear() === 9999) status = 'indefinitely';else status = 'limited';\n }\n this.status = Stream(status);\n this.reason = Stream(reason);\n this.message = Stream(message);\n this.daysRemaining = Stream(status === 'limited' && -dayjs().diff(until, 'days') + 1);\n }\n className() {\n return 'SuspendUserModal Modal--medium';\n }\n title() {\n return app.translator.trans('flarum-suspend.forum.suspend_user.title', {\n user: this.attrs.user\n });\n }\n content() {\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(Form, null, this.formItems().toArray(), m(\"div\", {\n className: \"Form-group Form-controls\"\n }, m(Button, {\n className: \"Button Button--primary\",\n loading: this.loading,\n type: \"submit\"\n }, app.translator.trans('flarum-suspend.forum.suspend_user.submit_button')))));\n }\n radioItems() {\n const items = new ItemList();\n items.add('not-suspended', m(\"label\", {\n className: \"checkbox\"\n }, m(\"input\", {\n type: \"radio\",\n name: \"status\",\n checked: !this.status(),\n value: \"\",\n onclick: withAttr('value', this.status)\n }), app.translator.trans('flarum-suspend.forum.suspend_user.not_suspended_label')), 100);\n items.add('indefinitely', m(\"label\", {\n className: \"checkbox\"\n }, m(\"input\", {\n type: \"radio\",\n name: \"status\",\n checked: this.status() === 'indefinitely',\n value: \"indefinitely\",\n onclick: withAttr('value', this.status)\n }), app.translator.trans('flarum-suspend.forum.suspend_user.indefinitely_label')), 90);\n items.add('time-suspension', m(\"label\", {\n className: \"checkbox SuspendUserModal-days\"\n }, m(\"input\", {\n type: \"radio\",\n name: \"status\",\n checked: this.status() === 'limited',\n value: \"limited\",\n onclick: e => {\n this.status(e.target.value);\n m.redraw.sync();\n this.$('.SuspendUserModal-days-input input').select();\n e.redraw = false;\n }\n }), app.translator.trans('flarum-suspend.forum.suspend_user.limited_time_label'), this.status() === 'limited' && m(\"div\", {\n className: \"SuspendUserModal-days-input\"\n }, m(\"input\", {\n type: \"number\",\n min: \"0\",\n value: this.daysRemaining(),\n oninput: withAttr('value', this.daysRemaining),\n className: \"FormControl\"\n }), app.translator.trans('flarum-suspend.forum.suspend_user.limited_time_days_text'))), 80);\n return items;\n }\n formItems() {\n const items = new ItemList();\n items.add('radioItems', m(FieldSet, {\n label: app.translator.trans('flarum-suspend.forum.suspend_user.status_heading')\n }, this.radioItems().toArray()), 100);\n items.add('reason', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-suspend.forum.suspend_user.reason')), m(\"textarea\", {\n className: \"FormControl\",\n bidi: this.reason,\n placeholder: app.translator.trans('flarum-suspend.forum.suspend_user.placeholder_optional'),\n rows: \"4\"\n })), 90);\n items.add('message', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-suspend.forum.suspend_user.display_message')), m(\"textarea\", {\n className: \"FormControl\",\n bidi: this.message,\n placeholder: app.translator.trans('flarum-suspend.forum.suspend_user.placeholder_optional'),\n rows: \"4\"\n })), 80);\n return items;\n }\n onsubmit(e) {\n e.preventDefault();\n this.loading = true;\n let suspendedUntil = null;\n switch (this.status()) {\n case 'indefinitely':\n suspendedUntil = getPermanentSuspensionDate();\n break;\n case 'limited':\n suspendedUntil = dayjs().add(this.daysRemaining(), 'days').toDate();\n break;\n default:\n // no default\n }\n\n this.attrs.user.save({\n suspendedUntil,\n suspendReason: this.reason(),\n suspendMessage: this.message()\n }).then(() => this.hide(), this.loaded.bind(this));\n }\n}\nflarum.reg.add('flarum-suspend', 'forum/components/SuspendUserModal', SuspendUserModal);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Modal');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/fullTime');","import app from 'flarum/forum/app';\nimport Modal from 'flarum/common/components/Modal';\nimport Button from 'flarum/common/components/Button';\nimport fullTime from 'flarum/common/helpers/fullTime';\nimport Form from 'flarum/common/components/Form';\nimport { isPermanentSuspensionDate, localStorageKey } from '../helpers/suspensionHelper';\nexport default class SuspensionInfoModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n this.message = this.attrs.message;\n this.until = this.attrs.until;\n }\n className() {\n return 'SuspensionInfoModal Modal';\n }\n title() {\n return app.translator.trans('flarum-suspend.forum.suspension_info.title');\n }\n content() {\n const timespan = isPermanentSuspensionDate(new Date(this.until)) ? app.translator.trans('flarum-suspend.forum.suspension_info.indefinite') : app.translator.trans('flarum-suspend.forum.suspension_info.limited', {\n date: fullTime(this.until)\n });\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(Form, {\n className: \"Form--centered\"\n }, m(\"p\", {\n className: \"helpText\"\n }, this.message), m(\"p\", {\n className: \"helpText\"\n }, timespan), m(\"div\", {\n className: \"Form-group Form-controls\"\n }, m(Button, {\n className: \"Button Button--primary Button--block\",\n onclick: this.hide.bind(this)\n }, app.translator.trans('flarum-suspend.forum.suspension_info.dismiss_button')))));\n }\n hide() {\n localStorage.setItem(localStorageKey(), this.attrs.until.getTime());\n this.attrs.state.close();\n }\n}\nflarum.reg.add('flarum-suspend', 'forum/components/SuspensionInfoModal', SuspensionInfoModal);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Model');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/query/IGambit');","import app from 'flarum/common/app';\nimport { BooleanGambit } from 'flarum/common/query/IGambit';\nexport default class SuspendedGambit extends BooleanGambit {\n key() {\n return app.translator.trans('flarum-suspend.lib.gambits.users.suspended.key', {}, true);\n }\n filterKey() {\n return 'suspended';\n }\n enabled() {\n return !!app.session.user && app.forum.attribute('canSuspendUsers');\n }\n}\nflarum.reg.add('flarum-suspend', 'common/query/users/SuspendedGambit', SuspendedGambit);","import Extend from 'flarum/common/extenders';\nimport SuspendedGambit from './query/users/SuspendedGambit';\nimport User from 'flarum/common/models/User';\n\n// prettier-ignore\nexport default [new Extend.Search().gambit('users', SuspendedGambit), new Extend.Model(User).attribute('canSuspend')];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/Notification');","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nimport { isPermanentSuspensionDate } from '../helpers/suspensionHelper';\nexport default class UserSuspendedNotification extends Notification {\n icon() {\n return 'fas fa-ban';\n }\n href() {\n return app.route.user(this.attrs.notification.subject());\n }\n content() {\n const notification = this.attrs.notification;\n const suspendedUntil = notification.content();\n const timeReadable = dayjs(suspendedUntil).from(notification.createdAt(), true);\n return isPermanentSuspensionDate(suspendedUntil) ? app.translator.trans('flarum-suspend.forum.notifications.user_suspended_indefinite_text') : app.translator.trans('flarum-suspend.forum.notifications.user_suspended_text', {\n timeReadable\n });\n }\n excerpt() {\n return null;\n }\n}\nflarum.reg.add('flarum-suspend', 'forum/components/UserSuspendedNotification', UserSuspendedNotification);","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nexport default class UserUnsuspendedNotification extends Notification {\n icon() {\n return 'fas fa-ban';\n }\n href() {\n return app.route.user(this.attrs.notification.subject());\n }\n content() {\n const notification = this.attrs.notification;\n return app.translator.trans('flarum-suspend.forum.notifications.user_unsuspended_text');\n }\n excerpt() {\n return null;\n }\n}\nflarum.reg.add('flarum-suspend', 'forum/components/UserUnsuspendedNotification', UserUnsuspendedNotification);","import Extend from 'flarum/common/extenders';\nimport User from 'flarum/common/models/User';\nimport Model from 'flarum/common/Model';\nimport commonExtend from '../common/extend';\nimport UserSuspendedNotification from './components/UserSuspendedNotification';\nimport UserUnsuspendedNotification from './components/UserUnsuspendedNotification';\nexport default [...commonExtend, new Extend.Notification() //\n.add('userSuspended', UserSuspendedNotification).add('userUnsuspended', UserUnsuspendedNotification), new Extend.Model(User).attribute('suspendedUntil', Model.transformDate).attribute('suspendReason').attribute('suspendMessage')];","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport UserControls from 'flarum/forum/utils/UserControls';\nimport Button from 'flarum/common/components/Button';\nimport Badge from 'flarum/common/components/Badge';\nimport User from 'flarum/common/models/User';\nimport SuspendUserModal from './components/SuspendUserModal';\nimport checkForSuspension from './checkForSuspension';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-suspend', () => {\n extend(UserControls, 'moderationControls', (items, user) => {\n if (user.canSuspend()) {\n items.add('suspend', m(Button, {\n icon: \"fas fa-ban\",\n onclick: () => app.modal.show(SuspendUserModal, {\n user\n })\n }, app.translator.trans('flarum-suspend.forum.user_controls.suspend_button')));\n }\n });\n extend(User.prototype, 'badges', function (items) {\n const until = this.suspendedUntil();\n if (new Date() < until) {\n items.add('suspended', m(Badge, {\n icon: \"fas fa-ban\",\n type: \"suspended\",\n label: app.translator.trans('flarum-suspend.forum.user_badge.suspended_tooltip')\n }), 100);\n }\n });\n checkForSuspension();\n});\nimport './forum';","import app from 'flarum/forum/app';\nimport SuspensionInfoModal from './components/SuspensionInfoModal';\nimport { localStorageKey } from './helpers/suspensionHelper';\nexport default function () {\n return setTimeout(() => {\n if (app.session.user) {\n const message = app.session.user.suspendMessage();\n const until = app.session.user.suspendedUntil();\n const isSuspended = message && until && new Date() < until;\n const alreadyDisplayed = localStorage.getItem(localStorageKey()) === (until == null ? void 0 : until.getTime().toString());\n if (isSuspended && !alreadyDisplayed) {\n app.modal.show(SuspensionInfoModal, {\n message,\n until\n });\n } else if (localStorage.getItem(localStorageKey())) {\n localStorage.removeItem(localStorageKey());\n }\n }\n }, 0);\n}"],"names":["module","exports","e","n","r","i","s","u","a","o","f","h","c","d","l","$","y","M","name","weekdays","split","months","ordinal","t","m","String","length","Array","join","v","z","utcOffset","Math","abs","floor","date","year","month","clone","add","ceil","p","w","D","ms","Q","toLowerCase","replace","g","_","S","args","arguments","O","locale","$L","utc","$u","x","$x","$offset","this","parse","prototype","$d","Date","NaN","test","match","substring","UTC","init","$y","getFullYear","$M","getMonth","$D","getDate","$W","getDay","$H","getHours","$m","getMinutes","$s","getSeconds","$ms","getMilliseconds","$utils","isValid","toString","isSame","startOf","endOf","isAfter","isBefore","$g","set","unix","valueOf","getTime","toDate","apply","slice","$locale","weekStart","$set","min","daysInMonth","get","Number","round","subtract","format","invalidDate","meridiem","YY","YYYY","MM","MMM","monthsShort","MMMM","DD","dd","weekdaysMin","ddd","weekdaysShort","dddd","H","HH","hh","A","mm","ss","SSS","Z","getTimezoneOffset","diff","toJSON","toISOString","toUTCString","T","forEach","extend","$i","isDayjs","en","Ls","local","call","getUTCFullYear","getUTCMonth","getUTCDate","getUTCDay","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","$localOffset","isUTC","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","getter","__esModule","definition","key","Object","defineProperty","enumerable","obj","prop","hasOwnProperty","Symbol","toStringTag","value","flarum","reg","getPermanentSuspensionDate","isPermanentSuspensionDate","localStorageKey","SuspendUserModal","oninit","vnode","super","until","attrs","user","suspendedUntil","reason","suspendReason","message","suspendMessage","status","daysRemaining","dayjs","className","title","content","formItems","toArray","loading","type","radioItems","items","checked","onclick","target","redraw","sync","select","oninput","label","bidi","placeholder","rows","onsubmit","preventDefault","save","then","hide","loaded","bind","SuspensionInfoModal","timespan","localStorage","setItem","state","close","SuspendedGambit","BooleanGambit","filterKey","enabled","gambit","attribute","UserSuspendedNotification","icon","href","notification","subject","timeReadable","from","createdAt","excerpt","UserUnsuspendedNotification","canSuspend","setTimeout","isSuspended","alreadyDisplayed","getItem","removeItem"],"sourceRoot":""} \ No newline at end of file diff --git a/extensions/tags/js/dist-typings/admin/components/EditTagModal.d.ts b/extensions/tags/js/dist-typings/admin/components/EditTagModal.d.ts index d20ef17fcd..89844a829f 100644 --- a/extensions/tags/js/dist-typings/admin/components/EditTagModal.d.ts +++ b/extensions/tags/js/dist-typings/admin/components/EditTagModal.d.ts @@ -1,4 +1,4 @@ -/// +/// import FormModal, { IFormModalAttrs } from 'flarum/common/components/FormModal'; import ItemList from 'flarum/common/utils/ItemList'; import Stream from 'flarum/common/utils/Stream'; diff --git a/extensions/tags/js/dist-typings/forum/components/DiscussionTaggedPost.d.ts b/extensions/tags/js/dist-typings/forum/components/DiscussionTaggedPost.d.ts index 27900eacdd..1125020ebc 100644 --- a/extensions/tags/js/dist-typings/forum/components/DiscussionTaggedPost.d.ts +++ b/extensions/tags/js/dist-typings/forum/components/DiscussionTaggedPost.d.ts @@ -1,4 +1,4 @@ -/// +/// export default class DiscussionTaggedPost extends EventPost { static initAttrs(attrs: any): void; descriptionKey(): "flarum-tags.forum.post_stream.added_and_removed_tags_text" | "flarum-tags.forum.post_stream.added_tags_text" | "flarum-tags.forum.post_stream.removed_tags_text"; diff --git a/extensions/tags/js/dist/admin.js b/extensions/tags/js/dist/admin.js index 32e70a2c6e..a195e7ccc7 100644 --- a/extensions/tags/js/dist/admin.js +++ b/extensions/tags/js/dist/admin.js @@ -1,3 +1,3 @@ /*! For license information please see admin.js.LICENSE.txt */ -(()=>{var t,e,n={110:(t,e,n)=>{"use strict";n.d(e,{l:()=>Sn});const o=flarum.reg.get("core","admin/app");var r=n.n(o);const a=flarum.reg.get("core","common/extend"),i=flarum.reg.get("core","admin/components/PermissionGrid");var s=n.n(i);const l=flarum.reg.get("core","admin/components/PermissionDropdown");var c=n.n(l);const u=flarum.reg.get("core","common/components/Dropdown");var d=n.n(u),h=n(645),g=n.n(h),p=n(149),f=n.n(p),v=n(924),b=n(974),y=n(648);function w(){app.extensionData.for("flarum-tags").registerPermission({icon:"fas fa-tag",label:app.translator.trans("flarum-tags.admin.permissions.tag_discussions_label"),permission:"discussion.tag"},"moderate",95).registerPermission({icon:"fas fa-tags",label:app.translator.trans("flarum-tags.admin.permissions.bypass_tag_counts_label"),permission:"bypassTagCounts"},"start",89)}const _=flarum.reg.get("core","admin/components/BasicsPage");var T=n.n(_);function S(){(0,a.extend)(T().prototype,"homePageItems",(t=>{t.add("tags",{path:"/tags",label:app.translator.trans("flarum-tags.admin.basics.tags_label")})}))}const E=flarum.reg.get("core","admin/components/SettingDropdown");var D=n.n(E),C=n(905),x=n(433),N=n.n(x),P=(n(780),n(836)),O=n.n(P);function I(t,e){void 0===e&&(e={});const n=[],{link:o,...r}=e;return r.className=O()("TagsLabel",r.className),t?(0,y.Z)(t).forEach((e=>{(e||1===t.length)&&n.push((0,v.Z)(e,{link:o}))})):n.push((0,v.Z)()),m("span",r,n)}flarum.reg.add("flarum-tags","common/helpers/tagsLabel",I);class M extends(N()){constructor(){super(...arguments),(0,C.Z)(this,"tags",[]),(0,C.Z)(this,"loaded",!1)}view(){const t=JSON.parse(this.attrs.settingValue()||"[]");return this.loaded||r().tagList.load(["parent"]).then((e=>{this.tags=e.filter((e=>t.includes(e.id()))),this.loaded=!0,m.redraw()})),m("div",{className:"Form-group SelectTagsSettingComponent"},m("label",null,this.attrs.label),this.attrs.help&&m("p",{className:"helpText"},this.attrs.help),this.loaded?m(g(),{className:"Button Button--text",onclick:()=>r().modal.show((()=>n.e(162).then(n.bind(n,610))),{selectedTags:this.tags,onsubmit:t=>{this.tags=t,this.attrs.settingValue(JSON.stringify(t.map((t=>t.id()))))},...this.attrs.options})},this.tags.length?I(this.tags):m("span",{className:"TagLabel untagged"},r().translator.trans("flarum-tags.admin.settings.button_text"))):m(f(),{size:"small",display:"inline"}))}}flarum.reg.add("flarum-tags","admin/components/SelectTagsSettingComponent",M),flarum.reg.addChunkModule("162","610","flarum-tags","common/components/TagSelectionModal");const A=flarum.reg.get("core","common/components/FormGroup");var k=n.n(A);function F(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function L(t){for(var e=1;e=0||(r[n]=t[n]);return r}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Y(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var Z=Y(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),H=Y(/Edge/i),G=Y(/firefox/i),W=Y(/safari/i)&&!Y(/chrome/i)&&!Y(/android/i),q=Y(/iP(ad|od|hone)/i),z=Y(/chrome/i)&&Y(/android/i),V={capture:!1,passive:!1};function U(t,e,n){t.addEventListener(e,n,!Z&&V)}function K(t,e,n){t.removeEventListener(e,n,!Z&&V)}function J(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function Q(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function tt(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&J(t,e):J(t,e))||o&&t===n)return t;if(t===n)break}while(t=Q(t))}return null}var et,nt=/\s+/g;function ot(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(nt," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(nt," ")}}function rt(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function at(t,e){var n="";if("string"==typeof t)n=t;else do{var o=rt(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(n)}function it(t,e,n){if(t){var o=t.getElementsByTagName(e),r=0,a=o.length;if(n)for(;r=a:r<=a))return o;if(o===st())break;o=gt(o,!1)}return!1}function ut(t,e,n,o){for(var r=0,a=0,i=t.children;a2&&void 0!==arguments[2]?arguments[2]:{},o=n.evt,r=X(n,St);Tt.pluginEvent.bind(fe)(t,e,L({dragEl:Ct,parentEl:xt,ghostEl:Nt,rootEl:Pt,nextEl:Ot,lastDownEl:It,cloneEl:Mt,cloneHidden:At,dragStarted:qt,putSortable:jt,activeSortable:fe.active,originalEvent:o,oldIndex:kt,oldDraggableIndex:Lt,newIndex:Ft,newDraggableIndex:Bt,hideGhostForTarget:me,unhideGhostForTarget:he,cloneNowHidden:function(){At=!0},cloneNowShown:function(){At=!1},dispatchSortableEvent:function(t){Dt({sortable:e,name:t,originalEvent:o})}},r))};function Dt(t){!function(t){var e=t.sortable,n=t.rootEl,o=t.name,r=t.targetEl,a=t.cloneEl,i=t.toEl,s=t.fromEl,l=t.oldIndex,c=t.newIndex,u=t.oldDraggableIndex,d=t.newDraggableIndex,m=t.originalEvent,h=t.putSortable,g=t.extraEventProperties;if(e=e||n&&n[yt]){var p,f=e.options,v="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||Z||H?(p=document.createEvent("Event")).initEvent(o,!0,!0):p=new CustomEvent(o,{bubbles:!0,cancelable:!0}),p.to=i||n,p.from=s||n,p.item=r||n,p.clone=a,p.oldIndex=l,p.newIndex=c,p.oldDraggableIndex=u,p.newDraggableIndex=d,p.originalEvent=m,p.pullMode=h?h.lastPutMode:void 0;var b=L(L({},g),Tt.getEventProperties(o,e));for(var y in b)p[y]=b[y];n&&n.dispatchEvent(p),f[v]&&f[v].call(e,p)}}(L({putSortable:jt,cloneEl:Mt,targetEl:Ct,rootEl:Pt,oldIndex:kt,oldDraggableIndex:Lt,newIndex:Ft,newDraggableIndex:Bt},t))}var Ct,xt,Nt,Pt,Ot,It,Mt,At,kt,Ft,Lt,Bt,Rt,jt,Xt,Yt,Zt,Ht,Gt,Wt,qt,zt,Vt,Ut,$t,Kt=!1,Jt=!1,Qt=[],te=!1,ee=!1,ne=[],oe=!1,re=[],ae="undefined"!=typeof document,ie=q,se=H||Z?"cssFloat":"float",le=ae&&!z&&!q&&"draggable"in document.createElement("div"),ce=function(){if(ae){if(Z)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),ue=function(t,e){var n=rt(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),r=ut(t,0,e),a=ut(t,1,e),i=r&&rt(r),s=a&&rt(a),l=i&&parseInt(i.marginLeft)+parseInt(i.marginRight)+lt(r).width,c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+lt(a).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&i.float&&"none"!==i.float){var u="left"===i.float?"left":"right";return!a||"both"!==s.clear&&s.clear!==u?"horizontal":"vertical"}return r&&("block"===i.display||"flex"===i.display||"table"===i.display||"grid"===i.display||l>=o&&"none"===n[se]||a&&"none"===n[se]&&l+c>o)?"vertical":"horizontal"},de=function(t){function e(t,n){return function(o,r,a,i){var s=o.options.group.name&&r.options.group.name&&o.options.group.name===r.options.group.name;if(null==t&&(n||s))return!0;if(null==t||!1===t)return!1;if(n&&"clone"===t)return t;if("function"==typeof t)return e(t(o,r,a,i),n)(o,r,a,i);var l=(n?o:r).options.group.name;return!0===t||"string"==typeof t&&t===l||t.join&&t.indexOf(l)>-1}}var n={},o=t.group;o&&"object"==B(o)||(o={name:o}),n.name=o.name,n.checkPull=e(o.pull,!0),n.checkPut=e(o.put),n.revertClone=o.revertClone,t.group=n},me=function(){!ce&&Nt&&rt(Nt,"display","none")},he=function(){!ce&&Nt&&rt(Nt,"display","")};ae&&!z&&document.addEventListener("click",(function(t){if(Jt)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Jt=!1,!1}),!0);var ge=function(t){if(Ct){t=t.touches?t.touches[0]:t;var e=(r=t.clientX,a=t.clientY,Qt.some((function(t){var e=t[yt].options.emptyInsertThreshold;if(e&&!dt(t)){var n=lt(t),o=r>=n.left-e&&r<=n.right+e,s=a>=n.top-e&&a<=n.bottom+e;return o&&s?i=t:void 0}})),i);if(e){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[yt]._onDragOver(n)}}var r,a,i},pe=function(t){Ct&&Ct.parentNode[yt]._isOutsideThisEl(t.target)};function fe(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=j({},e),t[yt]=this;var n,o,r={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return ue(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==fe.supportPointer&&"PointerEvent"in window&&!W,emptyInsertThreshold:5};for(var a in Tt.initializePlugins(this,t,r),r)!(a in e)&&(e[a]=r[a]);for(var i in de(e),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!e.forceFallback&&le,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?U(t,"pointerdown",this._onTapStart):(U(t,"mousedown",this._onTapStart),U(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(U(t,"dragover",this),U(t,"dragenter",this)),Qt.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),j(this,(o=[],{captureAnimationState:function(){o=[],this.options.animation&&[].slice.call(this.el.children).forEach((function(t){if("none"!==rt(t,"display")&&t!==fe.ghost){o.push({target:t,rect:lt(t)});var e=L({},o[o.length-1].rect);if(t.thisAnimationDuration){var n=at(t,!0);n&&(e.top-=n.f,e.left-=n.e)}t.fromRect=e}}))},addAnimationState:function(t){o.push(t)},removeAnimationState:function(t){o.splice(function(t,e){for(var n in t)if(t.hasOwnProperty(n))for(var o in e)if(e.hasOwnProperty(o)&&e[o]===t[n][o])return Number(n);return-1}(o,{target:t}),1)},animateAll:function(t){var e=this;if(!this.options.animation)return clearTimeout(n),void("function"==typeof t&&t());var r=!1,a=0;o.forEach((function(t){var n=0,o=t.target,i=o.fromRect,s=lt(o),l=o.prevFromRect,c=o.prevToRect,u=t.rect,d=at(o,!0);d&&(s.top-=d.f,s.left-=d.e),o.toRect=s,o.thisAnimationDuration&&pt(l,s)&&!pt(i,s)&&(u.top-s.top)/(u.left-s.left)==(i.top-s.top)/(i.left-s.left)&&(n=function(t,e,n,o){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*o.animation}(u,l,c,e.options)),pt(s,i)||(o.prevFromRect=i,o.prevToRect=s,n||(n=e.options.animation),e.animate(o,u,s,n)),n&&(r=!0,a=Math.max(a,n),clearTimeout(o.animationResetTimer),o.animationResetTimer=setTimeout((function(){o.animationTime=0,o.prevFromRect=null,o.fromRect=null,o.prevToRect=null,o.thisAnimationDuration=null}),n),o.thisAnimationDuration=n)})),clearTimeout(n),r?n=setTimeout((function(){"function"==typeof t&&t()}),a):"function"==typeof t&&t(),o=[]},animate:function(t,e,n,o){if(o){rt(t,"transition",""),rt(t,"transform","");var r=at(this.el),a=r&&r.a,i=r&&r.d,s=(e.left-n.left)/(a||1),l=(e.top-n.top)/(i||1);t.animatingX=!!s,t.animatingY=!!l,rt(t,"transform","translate3d("+s+"px,"+l+"px,0)"),this.forRepaintDummy=function(t){return t.offsetWidth}(t),rt(t,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),rt(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){rt(t,"transition",""),rt(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1}),o)}}}))}function ve(t,e,n,o,r,a,i,s){var l,c,u=t[yt],d=u.options.onMove;return!window.CustomEvent||Z||H?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=e,l.from=t,l.dragged=n,l.draggedRect=o,l.related=r||e,l.relatedRect=a||lt(e),l.willInsertAfter=s,l.originalEvent=i,t.dispatchEvent(l),d&&(c=d.call(u,l,i)),c}function be(t){t.draggable=!1}function ye(){oe=!1}function we(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function _e(t){return setTimeout(t,0)}function Te(t){return clearTimeout(t)}fe.prototype={constructor:fe,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(zt=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,Ct):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,o=this.options,r=o.preventOnFilter,a=t.type,i=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,s=(i||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||s,c=o.filter;if(function(t){re.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var o=e[n];o.checked&&re.push(o)}}(n),!Ct&&!(/mousedown|pointerdown/.test(a)&&0!==t.button||o.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!W||!s||"SELECT"!==s.tagName.toUpperCase())&&!((s=tt(s,o.draggable,n,!1))&&s.animated||It===s)){if(kt=mt(s),Lt=mt(s,o.draggable),"function"==typeof c){if(c.call(this,t,s,this))return Dt({sortable:e,rootEl:l,name:"filter",targetEl:s,toEl:n,fromEl:n}),Et("filter",e,{evt:t}),void(r&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(o){if(o=tt(l,o.trim(),n,!1))return Dt({sortable:e,rootEl:o,name:"filter",targetEl:s,fromEl:n,toEl:n}),Et("filter",e,{evt:t}),!0}))))return void(r&&t.cancelable&&t.preventDefault());o.handle&&!tt(l,o.handle,n,!1)||this._prepareDragStart(t,i,s)}}},_prepareDragStart:function(t,e,n){var o,r=this,a=r.el,i=r.options,s=a.ownerDocument;if(n&&!Ct&&n.parentNode===a){var l=lt(n);if(Pt=a,xt=(Ct=n).parentNode,Ot=Ct.nextSibling,It=n,Rt=i.group,fe.dragged=Ct,Xt={target:Ct,clientX:(e||t).clientX,clientY:(e||t).clientY},Gt=Xt.clientX-l.left,Wt=Xt.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,Ct.style["will-change"]="all",o=function(){Et("delayEnded",r,{evt:t}),fe.eventCanceled?r._onDrop():(r._disableDelayedDragEvents(),!G&&r.nativeDraggable&&(Ct.draggable=!0),r._triggerDragStart(t,e),Dt({sortable:r,name:"choose",originalEvent:t}),ot(Ct,i.chosenClass,!0))},i.ignore.split(",").forEach((function(t){it(Ct,t.trim(),be)})),U(s,"dragover",ge),U(s,"mousemove",ge),U(s,"touchmove",ge),U(s,"mouseup",r._onDrop),U(s,"touchend",r._onDrop),U(s,"touchcancel",r._onDrop),G&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Ct.draggable=!0),Et("delayStart",this,{evt:t}),!i.delay||i.delayOnTouchOnly&&!e||this.nativeDraggable&&(H||Z))o();else{if(fe.eventCanceled)return void this._onDrop();U(s,"mouseup",r._disableDelayedDrag),U(s,"touchend",r._disableDelayedDrag),U(s,"touchcancel",r._disableDelayedDrag),U(s,"mousemove",r._delayedDragTouchMoveHandler),U(s,"touchmove",r._delayedDragTouchMoveHandler),i.supportPointer&&U(s,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(o,i.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Ct&&be(Ct),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;K(t,"mouseup",this._disableDelayedDrag),K(t,"touchend",this._disableDelayedDrag),K(t,"touchcancel",this._disableDelayedDrag),K(t,"mousemove",this._delayedDragTouchMoveHandler),K(t,"touchmove",this._delayedDragTouchMoveHandler),K(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?U(document,"pointermove",this._onTouchMove):U(document,e?"touchmove":"mousemove",this._onTouchMove):(U(Ct,"dragend",this),U(Pt,"dragstart",this._onDragStart));try{document.selection?_e((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){if(Kt=!1,Pt&&Ct){Et("dragStarted",this,{evt:e}),this.nativeDraggable&&U(document,"dragover",pe);var n=this.options;!t&&ot(Ct,n.dragClass,!1),ot(Ct,n.ghostClass,!0),fe.active=this,t&&this._appendGhost(),Dt({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(Yt){this._lastX=Yt.clientX,this._lastY=Yt.clientY,me();for(var t=document.elementFromPoint(Yt.clientX,Yt.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Yt.clientX,Yt.clientY))!==e;)e=t;if(Ct.parentNode[yt]._isOutsideThisEl(t),e)do{if(e[yt]&&e[yt]._onDragOver({clientX:Yt.clientX,clientY:Yt.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break;t=e}while(e=e.parentNode);he()}},_onTouchMove:function(t){if(Xt){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,r=t.touches?t.touches[0]:t,a=Nt&&at(Nt,!0),i=Nt&&a&&a.a,s=Nt&&a&&a.d,l=ie&&$t&&ht($t),c=(r.clientX-Xt.clientX+o.x)/(i||1)+(l?l[0]-ne[0]:0)/(i||1),u=(r.clientY-Xt.clientY+o.y)/(s||1)+(l?l[1]-ne[1]:0)/(s||1);if(!fe.active&&!Kt){if(n&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))o.right+10||t.clientX<=o.right&&t.clientY>o.bottom&&t.clientX>=o.left:t.clientX>o.right&&t.clientY>o.top||t.clientX<=o.right&&t.clientY>o.bottom+10}(t,r,this)&&!p.animated){if(p===Ct)return I(!1);if(p&&a===t.target&&(i=p),i&&(n=lt(i)),!1!==ve(Pt,a,Ct,e,i,n,t,!!i))return O(),p&&p.nextSibling?a.insertBefore(Ct,p.nextSibling):a.appendChild(Ct),xt=a,M(),I(!0)}else if(p&&function(t,e,n){var o=lt(ut(n.el,0,n.options,!0));return e?t.clientXu+c*a/2:ld-Ut)return-Vt}else if(l>u+c*(1-r)/2&&ld-c*a/2)?l>u+c/2?1:-1:0}(t,i,n,r,_?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,ee,zt===i),0!==v){var D=mt(Ct);do{D-=v,y=xt.children[D]}while(y&&("none"===rt(y,"display")||y===Nt))}if(0===v||y===i)return I(!1);zt=i,Vt=v;var C=i.nextElementSibling,x=!1,N=ve(Pt,a,Ct,e,i,n,t,x=1===v);if(!1!==N)return 1!==N&&-1!==N||(x=1===N),oe=!0,setTimeout(ye,30),O(),x&&!C?a.appendChild(Ct):i.parentNode.insertBefore(Ct,x?C:i),S&&vt(S,0,E-S.scrollTop),xt=Ct.parentNode,void 0===b||ee||(Ut=Math.abs(b-lt(i)[T])),M(),I(!0)}if(a.contains(Ct))return I(!1)}return!1}function P(s,l){Et(s,h,L({evt:t,isOwner:u,axis:r?"vertical":"horizontal",revert:o,dragRect:e,targetRect:n,canSort:d,fromSortable:m,target:i,completed:I,onMove:function(n,o){return ve(Pt,a,Ct,e,n,lt(n),t,o)},changed:M},l))}function O(){P("dragOverAnimationCapture"),h.captureAnimationState(),h!==m&&m.captureAnimationState()}function I(e){return P("dragOverCompleted",{insertion:e}),e&&(u?c._hideClone():c._showClone(h),h!==m&&(ot(Ct,jt?jt.options.ghostClass:c.options.ghostClass,!1),ot(Ct,s.ghostClass,!0)),jt!==h&&h!==fe.active?jt=h:h===fe.active&&jt&&(jt=null),m===h&&(h._ignoreWhileAnimating=i),h.animateAll((function(){P("dragOverAnimationComplete"),h._ignoreWhileAnimating=null})),h!==m&&(m.animateAll(),m._ignoreWhileAnimating=null)),(i===Ct&&!Ct.animated||i===a&&!i.animated)&&(zt=null),s.dragoverBubble||t.rootEl||i===document||(Ct.parentNode[yt]._isOutsideThisEl(t.target),!e&&ge(t)),!s.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function M(){Ft=mt(Ct),Bt=mt(Ct,s.draggable),Dt({sortable:h,name:"change",toEl:a,newIndex:Ft,newDraggableIndex:Bt,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){K(document,"mousemove",this._onTouchMove),K(document,"touchmove",this._onTouchMove),K(document,"pointermove",this._onTouchMove),K(document,"dragover",ge),K(document,"mousemove",ge),K(document,"touchmove",ge)},_offUpEvents:function(){var t=this.el.ownerDocument;K(t,"mouseup",this._onDrop),K(t,"touchend",this._onDrop),K(t,"pointerup",this._onDrop),K(t,"touchcancel",this._onDrop),K(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;Ft=mt(Ct),Bt=mt(Ct,n.draggable),Et("drop",this,{evt:t}),xt=Ct&&Ct.parentNode,Ft=mt(Ct),Bt=mt(Ct,n.draggable),fe.eventCanceled||(Kt=!1,ee=!1,te=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Te(this.cloneId),Te(this._dragStartId),this.nativeDraggable&&(K(document,"drop",this),K(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),W&&rt(document.body,"user-select",""),rt(Ct,"transform",""),t&&(qt&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),Nt&&Nt.parentNode&&Nt.parentNode.removeChild(Nt),(Pt===xt||jt&&"clone"!==jt.lastPutMode)&&Mt&&Mt.parentNode&&Mt.parentNode.removeChild(Mt),Ct&&(this.nativeDraggable&&K(Ct,"dragend",this),be(Ct),Ct.style["will-change"]="",qt&&!Kt&&ot(Ct,jt?jt.options.ghostClass:this.options.ghostClass,!1),ot(Ct,this.options.chosenClass,!1),Dt({sortable:this,name:"unchoose",toEl:xt,newIndex:null,newDraggableIndex:null,originalEvent:t}),Pt!==xt?(Ft>=0&&(Dt({rootEl:xt,name:"add",toEl:xt,fromEl:Pt,originalEvent:t}),Dt({sortable:this,name:"remove",toEl:xt,originalEvent:t}),Dt({rootEl:xt,name:"sort",toEl:xt,fromEl:Pt,originalEvent:t}),Dt({sortable:this,name:"sort",toEl:xt,originalEvent:t})),jt&&jt.save()):Ft!==kt&&Ft>=0&&(Dt({sortable:this,name:"update",toEl:xt,originalEvent:t}),Dt({sortable:this,name:"sort",toEl:xt,originalEvent:t})),fe.active&&(null!=Ft&&-1!==Ft||(Ft=kt,Bt=Lt),Dt({sortable:this,name:"end",toEl:xt,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){Et("nulling",this),Pt=Ct=xt=Nt=Ot=Mt=It=At=Xt=Yt=qt=Ft=Bt=kt=Lt=zt=Vt=jt=Rt=fe.dragged=fe.ghost=fe.clone=fe.active=null,re.forEach((function(t){t.checked=!0})),re.length=Zt=Ht=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":Ct&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,o=0,r=n.length,a=this.options;o{const e=t.target;this.name(e.value),this.slug((0,$e.slug)(e.value))}})),50),t.add("slug",m("div",{className:"Form-group"},m("label",null,r().translator.trans("flarum-tags.admin.edit_tag.slug_label")),m("input",{className:"FormControl",bidi:this.slug})),40),t.add("description",m("div",{className:"Form-group"},m("label",null,r().translator.trans("flarum-tags.admin.edit_tag.description_label")),m("textarea",{className:"FormControl",bidi:this.description})),30),t.add("color",m("div",{className:"Form-group"},m("label",null,r().translator.trans("flarum-tags.admin.edit_tag.color_label")),m(ze(),{className:"FormControl",placeholder:"#aaaaaa",bidi:this.color})),20),t.add("icon",m("div",{className:"Form-group"},m("label",null,r().translator.trans("flarum-tags.admin.edit_tag.icon_label")),m("div",{className:"helpText"},r().translator.trans("flarum-tags.admin.edit_tag.icon_text",{a:m("a",{href:"https://fontawesome.com/icons?m=free",tabindex:"-1"})})),m("input",{className:"FormControl",placeholder:"fas fa-bolt",bidi:this.icon})),10),t.add("hidden",m("div",{className:"Form-group"},m("div",null,m("label",{className:"checkbox"},m("input",{type:"checkbox",bidi:this.isHidden}),r().translator.trans("flarum-tags.admin.edit_tag.hide_label")))),10),t.add("submit",m("div",{className:"Form-group Form-controls"},m(g(),{type:"submit",className:"Button Button--primary EditTagModal-save",loading:this.loading},r().translator.trans("flarum-tags.admin.edit_tag.submit_button")),this.tag.exists&&m("button",{type:"button",className:"Button EditTagModal-delete",onclick:this.delete.bind(this)},r().translator.trans("flarum-tags.admin.edit_tag.delete_tag_button"))),-10),t}submitData(){return{name:this.name(),slug:this.slug(),description:this.description(),color:this.color(),icon:this.icon(),isHidden:this.isHidden(),isPrimary:this.isPrimary()}}onsubmit(t){t.preventDefault(),this.loading=!0,this.tag.save(this.submitData()).then((()=>this.hide()),(()=>this.loading=!1))}delete(){if(confirm(tn()(r().translator.trans("flarum-tags.admin.edit_tag.delete_tag_confirmation")))){const t=r().store.all("tags").filter((t=>t.parent()===this.tag));this.tag.delete().then((()=>{t.forEach((t=>t.pushData({attributes:{isChild:!1}}))),m.redraw()})),this.hide()}}}flarum.reg.add("flarum-tags","admin/components/EditTagModal",en);class nn{constructor(){(0,C.Z)(this,"element",void 0),(0,C.Z)(this,"attrs",void 0),(0,C.Z)(this,"state",void 0)}oninit(t){this.setAttrs(t.attrs)}oncreate(t){this.element=t.dom}onbeforeupdate(t){this.setAttrs(t.attrs)}onupdate(t){}onbeforeremove(t){}onremove(t){}$(t){const e=$(this.element);return t?e.find(t):e}static component(t,e){void 0===t&&(t={}),void 0===e&&(e=null);const n={...t};return m(this,n,e)}setAttrs(t){if(void 0===t&&(t={}),this.constructor.initAttrs(t),t){if("children"in t)throw new Error("[".concat(this.constructor.name,'] The "children" attribute of attrs should never be used. Either pass children in as the vnode children or rename the attribute'));if("tag"in t)throw new Error("[".concat(this.constructor.name,'] You cannot use the "tag" attribute name with Mithril 2.'))}this.attrs=t}static initAttrs(t){}}function on(t){var e,n,o="";if("string"==typeof t||"number"==typeof t)o+=t;else if("object"==typeof t)if(Array.isArray(t))for(e=0;er().modal.show(en,{model:t})})),!t.isChild()&&null!==t.position()&&m("ol",{className:"TagListItem-children TagList"},(0,y.Z)(r().store.all("tags")).filter((e=>e.parent()===t)).map(cn)))}flarum.reg.add("flarum-tags","../../../../framework/core/js/src/admin/components/FormSectionGroup",sn);class un extends(je()){oninit(t){super.oninit(t),this.forcedRefreshKey=0,this.loading=!0,r().tagList.load(["parent"]).then((()=>{this.loading=!1,m.redraw()}))}content(){if(this.loading)return m(f(),null);const t=this.setting("flarum-tags.min_primary_tags",0),e=this.setting("flarum-tags.max_primary_tags",0),n=this.setting("flarum-tags.min_secondary_tags",0),o=this.setting("flarum-tags.max_secondary_tags",0),a=(0,y.Z)(r().store.all("tags").filter((t=>!t.parent())));return m("div",{className:"TagsContent"},m("div",{className:"TagsContent-list"},m("div",{className:"container",key:this.forcedRefreshKey,oncreate:this.onListOnCreate.bind(this)},m(sn,null,m(ln,{className:"TagGroup",label:r().translator.trans("flarum-tags.admin.tags.primary_heading")},m("ol",{className:"TagList TagList--primary"},a.filter((t=>null!==t.position()&&!t.isChild())).map(cn)),m(g(),{className:"Button TagList-button",icon:"fas fa-plus",onclick:()=>r().modal.show(en,{primary:!0})},r().translator.trans("flarum-tags.admin.tags.create_primary_tag_button"))),m(ln,{className:"TagGroup TagGroup--secondary",label:r().translator.trans("flarum-tags.admin.tags.secondary_heading")},m("ul",{className:"TagList"},a.filter((t=>null===t.position())).sort(((t,e)=>t.name().localeCompare(e.name()))).map(cn)),m(g(),{className:"Button TagList-button",icon:"fas fa-plus",onclick:()=>r().modal.show(en,{primary:!1})},r().translator.trans("flarum-tags.admin.tags.create_secondary_tag_button"))),m(ln,{label:r().translator.trans("flarum-tags.admin.tags.settings_heading")},m(He(),null,m("div",{className:"Form-group"},m("label",null,r().translator.trans("flarum-tags.admin.tag_settings.required_primary_heading")),m("div",{className:"helpText"},r().translator.trans("flarum-tags.admin.tag_settings.required_primary_text")),m("div",{className:"TagSettings-rangeInput"},m("input",{className:"FormControl",type:"number",min:"0",value:t(),oninput:Ye()("value",this.setMinTags.bind(this,t,e))}),r().translator.trans("flarum-tags.admin.tag_settings.range_separator_text"),m("input",{className:"FormControl",type:"number",min:t(),bidi:e}))),m("div",{className:"Form-group"},m("label",null,r().translator.trans("flarum-tags.admin.tag_settings.required_secondary_heading")),m("div",{className:"helpText"},r().translator.trans("flarum-tags.admin.tag_settings.required_secondary_text")),m("div",{className:"TagSettings-rangeInput"},m("input",{className:"FormControl",type:"number",min:"0",value:n(),oninput:Ye()("value",this.setMinTags.bind(this,n,o))}),r().translator.trans("flarum-tags.admin.tag_settings.range_separator_text"),m("input",{className:"FormControl",type:"number",min:n(),bidi:o}))),m("div",{className:"Form-group Form-controls"},this.submitButton())))),m("div",{className:"TagsContent-footer"},m("p",null,r().translator.trans("flarum-tags.admin.tags.about_tags_text"))))))}onListOnCreate(t){this.$(".TagList").get().map((t=>{Be.create(t,{group:"tags",delay:50,delayOnTouchOnly:!0,touchStartThreshold:5,animation:150,swapThreshold:.65,dragClass:"sortable-dragging",ghostClass:"sortable-placeholder",onSort:t=>this.onSortUpdate(t)})}))}setMinTags(t,e,n){t(n),e(Math.max(n,e()))}onSortUpdate(t){t.from instanceof HTMLOListElement&&t.to instanceof HTMLUListElement&&r().store.getById("tags",t.item.getAttribute("data-id")).pushData({attributes:{position:null,isChild:!1},relationships:{parent:null}});const e=this.$(".TagList--primary > li").map((function(){return{id:$(this).data("id"),children:$(this).find("li").map((function(){return $(this).data("id")})).get()}})).get();e.forEach(((t,e)=>{const n=r().store.getById("tags",t.id);n.pushData({attributes:{position:e,isChild:!1},relationships:{parent:null}}),t.children.forEach(((t,e)=>{r().store.getById("tags",t).pushData({attributes:{position:e,isChild:!0},relationships:{parent:n}})}))})),r().request({url:r().forum.attribute("apiUrl")+"/tags/order",method:"POST",body:{order:e}}),this.forcedRefreshKey++,m.redraw()}}flarum.reg.add("flarum-tags","admin/components/TagsPage",un);var dn=n(351),mn=n.n(dn);class hn{constructor(){(0,C.Z)(this,"loadedIncludes",void 0)}async load(t){if(void 0===t&&(t=[]),!this.loadedIncludes)return this.query(t);const e=t.filter((t=>!this.loadedIncludes.has(t)));return 0===e.length?Promise.resolve(mn().store.all("tags")):this.query(e)}async query(t){return void 0===t&&(t=[]),null!=this.loadedIncludes||(this.loadedIncludes=new Set),mn().store.find("tags",{include:t.join(",")}).then((e=>{const n=Array.isArray(e)?e:[e];return t.forEach((t=>this.loadedIncludes.add(t))),n}))}}flarum.reg.add("flarum-tags","common/states/TagListState",hn);const gn=flarum.reg.get("core","common/extenders");var pn=n.n(gn);const fn=flarum.reg.get("core","common/utils/computed");var vn=n.n(fn);const bn=flarum.reg.get("core","common/Model");var yn=n.n(bn);class wn extends(yn()){name(){return yn().attribute("name").call(this)}slug(){return yn().attribute("slug").call(this)}description(){return yn().attribute("description").call(this)}color(){return yn().attribute("color").call(this)}backgroundUrl(){return yn().attribute("backgroundUrl").call(this)}backgroundMode(){return yn().attribute("backgroundMode").call(this)}icon(){return yn().attribute("icon").call(this)}position(){return yn().attribute("position").call(this)}parent(){return yn().hasOne("parent").call(this)}children(){return yn().hasMany("children").call(this)}defaultSort(){return yn().attribute("defaultSort").call(this)}isChild(){return yn().attribute("isChild").call(this)}isHidden(){return yn().attribute("isHidden").call(this)}isPrimary(){return yn().attribute("isPrimary").call(this)}discussionCount(){return yn().attribute("discussionCount").call(this)}lastPostedAt(){return yn().attribute("lastPostedAt",yn().transformDate).call(this)}lastPostedDiscussion(){return yn().hasOne("lastPostedDiscussion").call(this)}isRestricted(){return yn().attribute("isRestricted").call(this)}canStartDiscussion(){return yn().attribute("canStartDiscussion").call(this)}canAddToDiscussion(){return yn().attribute("canAddToDiscussion").call(this)}isPrimaryParent(){return vn()("position","parent",((t,e)=>null!==t&&!1===e)).call(this)}}flarum.reg.add("flarum-tags","common/models/Tag",wn);const _n=flarum.reg.get("core","common/query/IGambit");class Tn extends _n.KeyValueGambit{constructor(){super(...arguments),(0,C.Z)(this,"predicates",!0)}key(){return mn().translator.trans("flarum-tags.lib.gambits.discussions.tag.key",{},!0)}hint(){return mn().translator.trans("flarum-tags.lib.gambits.discussions.tag.hint",{},!0)}filterKey(){return"tag"}gambitValueToFilterValue(t){return[t]}fromFilter(t,e){let n=[];return Array.isArray(t)?(n=t.map((t=>this.fromFilter(t.toString(),e))),n.join(" ")):"".concat(e?"-":"").concat(this.key(),":").concat(this.filterValueToGambitValue(t))}filterValueToGambitValue(t){return t}}flarum.reg.add("flarum-tags","common/query/discussions/TagGambit",Tn);const Sn=[(new(pn().Store)).add("tags",wn),(new(pn().Search)).gambit("discussions",Tn)];r().initializers.add("flarum-tags",(t=>{t.tagList=new hn,t.extensionData.for("flarum-tags").registerPage(un),(0,a.extend)(s().prototype,"oninit",(function(){this.loading=!0})),(0,a.extend)(s().prototype,"oncreate",(function(){r().tagList.load().then((()=>{this.loading=!1,m.redraw()}))})),(0,a.override)(s().prototype,"view",(function(t,e){return this.loading?m(f(),null):t(e)})),(0,a.override)(r(),"getRequiredPermissions",((t,e)=>{const n=e.match(/^tag\d+\./);return n?t(e.substr(n[0].length)).map((t=>n[0]+t)):t(e)})),(0,a.extend)(s().prototype,"scopeItems",(t=>{(0,y.Z)(r().store.all("tags")).filter((t=>t.isRestricted())).forEach((e=>t.add("tag"+e.id(),{label:(0,v.Z)(e),onremove:()=>e.save({isRestricted:!1}),render:t=>"setting"in t?null:"viewForum"===t.permission||"startDiscussion"===t.permission||t.permission.startsWith("discussion.")&&!1!==t.tagScoped||t.tagScoped?m(c(),{permission:"tag".concat(e.id(),".").concat(t.permission),allowGuest:t.allowGuest}):null})))})),(0,a.extend)(s().prototype,"scopeControlItems",(t=>{const e=(0,y.Z)(r().store.all("tags").filter((t=>!t.isRestricted())));e.length&&t.add("tag",m(d(),{className:"Dropdown--restrictByTag",buttonClassName:"Button Button--text",label:r().translator.trans("flarum-tags.admin.permissions.restrict_by_tag_heading"),icon:"fas fa-plus",caretIcon:null},e.map((t=>m(g(),{icon:!0,onclick:()=>t.save({isRestricted:!0})},[(0,b.Z)(t,{className:"Button-icon"})," ",t.name()])))))})),w(),S(),(0,a.extend)(s().prototype,"startItems",(t=>{t.add("allowTagChange",{icon:"fas fa-tag",label:r().translator.trans("flarum-tags.admin.permissions.allow_edit_tags_label"),setting:()=>{const t=parseInt(r().data.settings.allow_tag_change,10);return m(D(),{defaultLabel:t?r().translator.trans("core.admin.permissions_controls.allow_some_minutes_button",{count:t}):r().translator.trans("core.admin.permissions_controls.allow_indefinitely_button"),key:"allow_tag_change",options:[{value:"-1",label:r().translator.trans("core.admin.permissions_controls.allow_indefinitely_button")},{value:"10",label:r().translator.trans("core.admin.permissions_controls.allow_ten_minutes_button")},{value:"reply",label:r().translator.trans("core.admin.permissions_controls.allow_until_reply_button")}]})}},90)})),(0,a.extend)(k().prototype,"customFieldComponents",(function(t){t.add("flarum-tags.select-tags",(t=>m(M,Object.assign({},t,{settingValue:t.bidi}))))}))}))},974:(t,e,n)=>{"use strict";n.d(e,{Z:()=>a});var o=n(836),r=n.n(o);function a(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});const o=t&&t.icon(),{useColor:a=!0}=n;return e.className=r()([e.className,"icon text-colored",o?t.icon():"TagIcon"]),t&&a?(e.style=e.style||{},e.style["--color"]=t.color()):t||(e.className+=" untagged"),o?m("i",e):m("span",e)}flarum.reg.add("flarum-tags","common/helpers/tagIcon",a)},924:(t,e,n)=>{"use strict";n.d(e,{Z:()=>h});var o=n(780),r=n.n(o),a=n(678),i=n.n(a),s=n(836),l=n.n(s),c=n(679),u=n.n(c),d=n(974);function h(t,e){void 0===e&&(e={}),e.style=e.style||{},e.className="TagLabel "+(e.className||"");const n=r()(e,"link"),o=t?t.name():app.translator.trans("flarum-tags.lib.deleted_tag_text");if(t){const o=t.color();o&&(e.style["--tag-bg"]=o,e.className=l()(e.className,"colored",u()(o))),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?i():"span",e,m("span",{className:"TagLabel-text"},t&&t.icon()&&(0,d.Z)(t,{className:"TagLabel-icon"},{useColor:!1}),m("span",{className:"TagLabel-name"},o)))}flarum.reg.add("flarum-tags","common/helpers/tagLabel",h)},270:()=>{},648:(t,e,n)=>{"use strict";function o(t){return t.slice(0).sort(((t,e)=>{const n=t.position(),o=e.position();if(null===n&&null===o)return e.discussionCount()-t.discussionCount();if(null===o)return-1;if(null===n)return 1;const r=t.parent(),a=e.parent();return r===a?n-o:r&&a?r.position()-a.position():r?r===e?1:r.position()-o:a?a===t?-1:n-a.position():0}))}n.d(e,{Z:()=>o}),flarum.reg.add("flarum-tags","common/utils/sortTags",o)},433:t=>{"use strict";t.exports=flarum.reg.get("core","common/Component")},351:t=>{"use strict";t.exports=flarum.reg.get("core","common/app")},645:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/Button")},44:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/FormModal")},678:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/Link")},149:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/LoadingIndicator")},291:t=>{"use strict";t.exports=flarum.reg.get("core","common/helpers/highlight")},679:t=>{"use strict";t.exports=flarum.reg.get("core","common/helpers/textContrastClass")},657:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/KeyboardNavigatable")},636:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/Stream")},836:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/classList")},780:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/extract")},596:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/extractText")},905:(t,e,n)=>{"use strict";function o(t){return o="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},o(t)}function r(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==o(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!==o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"===o(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,{Z:()=>r})}},o={};function r(t){var e=o[t];if(void 0!==e)return e.exports;var a=o[t]={exports:{}};return n[t](a,a.exports,r),a.exports}r.m=n,r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.f={},r.e=t=>Promise.all(Object.keys(r.f).reduce(((e,n)=>(r.f[n](t,e),e)),[])),r.u=t=>"common/components/TagSelectionModal.js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t={},e="module.exports:",r.l=(n,o,a,i)=>{if(t[n])t[n].push(o);else{var s,l;if(void 0!==a)for(var c=document.getElementsByTagName("script"),u=0;u{s.onerror=s.onload=null,clearTimeout(h);var r=t[n];if(delete t[n],s.parentNode&&s.parentNode.removeChild(s),r&&r.forEach((t=>t(o))),e)return e(o)},h=setTimeout(m.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=m.bind(null,s.onerror),s.onload=m.bind(null,s.onload),l&&document.head.appendChild(s)}},r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;r.g.importScripts&&(t=r.g.location+"");var e=r.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var n=e.getElementsByTagName("script");n.length&&(t=n[n.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=t})(),r.f.compat=(t,e)=>{const n=r.l;r.l=flarum.reg.loadChunk.bind(flarum.reg,n)},(()=>{var t={328:0};r.f.j=(e,n)=>{var o=r.o(t,e)?t[e]:void 0;if(0!==o)if(o)n.push(o[2]);else{var a=new Promise(((n,r)=>o=t[e]=[n,r]));n.push(o[2]=a);var i=r.p+r.u(e),s=new Error;r.l(i,(n=>{if(r.o(t,e)&&(0!==(o=t[e])&&(t[e]=void 0),o)){var a=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;s.message="Loading chunk "+e+" failed.\n("+a+": "+i+")",s.name="ChunkLoadError",s.type=a,s.request=i,o[1](s)}}),"chunk-"+e,e)}};var e=(e,n)=>{var o,a,[i,s,l]=n,c=0;if(i.some((e=>0!==t[e]))){for(o in s)r.o(s,o)&&(r.m[o]=s[o]);l&&l(r)}for(e&&e(n);c{"use strict";r.r(a),r.d(a,{extend:()=>n.l});var t=r(270),e={};for(const n in t)"default"!==n&&(e[n]=()=>t[n]);r.d(a,e);var n=r(110)})(),module.exports=a})(); +(()=>{var t,e,n={396:(t,e,n)=>{"use strict";n.d(e,{l:()=>_n});const o=flarum.reg.get("core","admin/app");var a=n.n(o);const r=flarum.reg.get("core","common/extend"),i=flarum.reg.get("core","admin/components/PermissionGrid");var s=n.n(i);const l=flarum.reg.get("core","admin/components/PermissionDropdown");var c=n.n(l);const u=flarum.reg.get("core","common/components/Dropdown");var d=n.n(u),g=n(645),h=n.n(g),p=n(149),f=n.n(p),v=n(924),b=n(974),y=n(648);function w(){app.extensionData.for("flarum-tags").registerPermission({icon:"fas fa-tag",label:app.translator.trans("flarum-tags.admin.permissions.tag_discussions_label"),permission:"discussion.tag"},"moderate",95).registerPermission({icon:"fas fa-tags",label:app.translator.trans("flarum-tags.admin.permissions.bypass_tag_counts_label"),permission:"bypassTagCounts"},"start",89)}const _=flarum.reg.get("core","admin/components/BasicsPage");var T=n.n(_);function S(){(0,r.extend)(T().prototype,"homePageItems",(t=>{t.add("tags",{path:"/tags",label:app.translator.trans("flarum-tags.admin.basics.tags_label")})}))}const E=flarum.reg.get("core","admin/components/SettingDropdown");var D=n.n(E),C=n(905),x=n(433),N=n.n(x),P=(n(780),n(836)),O=n.n(P);function I(t,e){void 0===e&&(e={});const n=[],{link:o,...a}=e;return a.className=O()("TagsLabel",a.className),t?(0,y.Z)(t).forEach((e=>{(e||1===t.length)&&n.push((0,v.Z)(e,{link:o}))})):n.push((0,v.Z)()),m("span",a,n)}flarum.reg.add("flarum-tags","common/helpers/tagsLabel",I);class M extends(N()){constructor(){super(...arguments),(0,C.Z)(this,"tags",[]),(0,C.Z)(this,"loaded",!1)}view(){const t=JSON.parse(this.attrs.settingValue()||"[]");return this.loaded||a().tagList.load(["parent"]).then((e=>{this.tags=e.filter((e=>t.includes(e.id()))),this.loaded=!0,m.redraw()})),m("div",{className:"Form-group SelectTagsSettingComponent"},m("label",null,this.attrs.label),this.attrs.help&&m("p",{className:"helpText"},this.attrs.help),this.loaded?m(h(),{className:"Button Button--text",onclick:()=>a().modal.show((()=>n.e(162).then(n.bind(n,610))),{selectedTags:this.tags,onsubmit:t=>{this.tags=t,this.attrs.settingValue(JSON.stringify(t.map((t=>t.id()))))},...this.attrs.options})},this.tags.length?I(this.tags):m("span",{className:"TagLabel untagged"},a().translator.trans("flarum-tags.admin.settings.button_text"))):m(f(),{size:"small",display:"inline"}))}}flarum.reg.add("flarum-tags","admin/components/SelectTagsSettingComponent",M),flarum.reg.addChunkModule("162","610","flarum-tags","common/components/TagSelectionModal");const k=flarum.reg.get("core","common/components/FormGroup");var A=n.n(k);function F(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function L(t){for(var e=1;e=0||(a[n]=t[n]);return a}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(a[n]=t[n])}return a}function j(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var H=j(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Z=j(/Edge/i),G=j(/firefox/i),W=j(/safari/i)&&!j(/chrome/i)&&!j(/android/i),q=j(/iP(ad|od|hone)/i),z=j(/chrome/i)&&j(/android/i),V={capture:!1,passive:!1};function U(t,e,n){t.addEventListener(e,n,!H&&V)}function K(t,e,n){t.removeEventListener(e,n,!H&&V)}function J(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function Q(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function tt(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&J(t,e):J(t,e))||o&&t===n)return t;if(t===n)break}while(t=Q(t))}return null}var et,nt=/\s+/g;function ot(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(nt," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(nt," ")}}function at(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function rt(t,e){var n="";if("string"==typeof t)n=t;else do{var o=at(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var a=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return a&&new a(n)}function it(t,e,n){if(t){var o=t.getElementsByTagName(e),a=0,r=o.length;if(n)for(;a=r:a<=r))return o;if(o===st())break;o=ht(o,!1)}return!1}function ut(t,e,n,o){for(var a=0,r=0,i=t.children;r2&&void 0!==arguments[2]?arguments[2]:{},o=n.evt,a=Y(n,St);Tt.pluginEvent.bind(fe)(t,e,L({dragEl:Ct,parentEl:xt,ghostEl:Nt,rootEl:Pt,nextEl:Ot,lastDownEl:It,cloneEl:Mt,cloneHidden:kt,dragStarted:qt,putSortable:Xt,activeSortable:fe.active,originalEvent:o,oldIndex:At,oldDraggableIndex:Lt,newIndex:Ft,newDraggableIndex:Bt,hideGhostForTarget:me,unhideGhostForTarget:ge,cloneNowHidden:function(){kt=!0},cloneNowShown:function(){kt=!1},dispatchSortableEvent:function(t){Dt({sortable:e,name:t,originalEvent:o})}},a))};function Dt(t){!function(t){var e=t.sortable,n=t.rootEl,o=t.name,a=t.targetEl,r=t.cloneEl,i=t.toEl,s=t.fromEl,l=t.oldIndex,c=t.newIndex,u=t.oldDraggableIndex,d=t.newDraggableIndex,m=t.originalEvent,g=t.putSortable,h=t.extraEventProperties;if(e=e||n&&n[yt]){var p,f=e.options,v="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||H||Z?(p=document.createEvent("Event")).initEvent(o,!0,!0):p=new CustomEvent(o,{bubbles:!0,cancelable:!0}),p.to=i||n,p.from=s||n,p.item=a||n,p.clone=r,p.oldIndex=l,p.newIndex=c,p.oldDraggableIndex=u,p.newDraggableIndex=d,p.originalEvent=m,p.pullMode=g?g.lastPutMode:void 0;var b=L(L({},h),Tt.getEventProperties(o,e));for(var y in b)p[y]=b[y];n&&n.dispatchEvent(p),f[v]&&f[v].call(e,p)}}(L({putSortable:Xt,cloneEl:Mt,targetEl:Ct,rootEl:Pt,oldIndex:At,oldDraggableIndex:Lt,newIndex:Ft,newDraggableIndex:Bt},t))}var Ct,xt,Nt,Pt,Ot,It,Mt,kt,At,Ft,Lt,Bt,Rt,Xt,Yt,jt,Ht,Zt,Gt,Wt,qt,zt,Vt,Ut,$t,Kt=!1,Jt=!1,Qt=[],te=!1,ee=!1,ne=[],oe=!1,ae=[],re="undefined"!=typeof document,ie=q,se=Z||H?"cssFloat":"float",le=re&&!z&&!q&&"draggable"in document.createElement("div"),ce=function(){if(re){if(H)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),ue=function(t,e){var n=at(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),a=ut(t,0,e),r=ut(t,1,e),i=a&&at(a),s=r&&at(r),l=i&&parseInt(i.marginLeft)+parseInt(i.marginRight)+lt(a).width,c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+lt(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(a&&i.float&&"none"!==i.float){var u="left"===i.float?"left":"right";return!r||"both"!==s.clear&&s.clear!==u?"horizontal":"vertical"}return a&&("block"===i.display||"flex"===i.display||"table"===i.display||"grid"===i.display||l>=o&&"none"===n[se]||r&&"none"===n[se]&&l+c>o)?"vertical":"horizontal"},de=function(t){function e(t,n){return function(o,a,r,i){var s=o.options.group.name&&a.options.group.name&&o.options.group.name===a.options.group.name;if(null==t&&(n||s))return!0;if(null==t||!1===t)return!1;if(n&&"clone"===t)return t;if("function"==typeof t)return e(t(o,a,r,i),n)(o,a,r,i);var l=(n?o:a).options.group.name;return!0===t||"string"==typeof t&&t===l||t.join&&t.indexOf(l)>-1}}var n={},o=t.group;o&&"object"==B(o)||(o={name:o}),n.name=o.name,n.checkPull=e(o.pull,!0),n.checkPut=e(o.put),n.revertClone=o.revertClone,t.group=n},me=function(){!ce&&Nt&&at(Nt,"display","none")},ge=function(){!ce&&Nt&&at(Nt,"display","")};re&&!z&&document.addEventListener("click",(function(t){if(Jt)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Jt=!1,!1}),!0);var he=function(t){if(Ct){t=t.touches?t.touches[0]:t;var e=(a=t.clientX,r=t.clientY,Qt.some((function(t){var e=t[yt].options.emptyInsertThreshold;if(e&&!dt(t)){var n=lt(t),o=a>=n.left-e&&a<=n.right+e,s=r>=n.top-e&&r<=n.bottom+e;return o&&s?i=t:void 0}})),i);if(e){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[yt]._onDragOver(n)}}var a,r,i},pe=function(t){Ct&&Ct.parentNode[yt]._isOutsideThisEl(t.target)};function fe(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=X({},e),t[yt]=this;var n,o,a={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return ue(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==fe.supportPointer&&"PointerEvent"in window&&!W,emptyInsertThreshold:5};for(var r in Tt.initializePlugins(this,t,a),a)!(r in e)&&(e[r]=a[r]);for(var i in de(e),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!e.forceFallback&&le,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?U(t,"pointerdown",this._onTapStart):(U(t,"mousedown",this._onTapStart),U(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(U(t,"dragover",this),U(t,"dragenter",this)),Qt.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),X(this,(o=[],{captureAnimationState:function(){o=[],this.options.animation&&[].slice.call(this.el.children).forEach((function(t){if("none"!==at(t,"display")&&t!==fe.ghost){o.push({target:t,rect:lt(t)});var e=L({},o[o.length-1].rect);if(t.thisAnimationDuration){var n=rt(t,!0);n&&(e.top-=n.f,e.left-=n.e)}t.fromRect=e}}))},addAnimationState:function(t){o.push(t)},removeAnimationState:function(t){o.splice(function(t,e){for(var n in t)if(t.hasOwnProperty(n))for(var o in e)if(e.hasOwnProperty(o)&&e[o]===t[n][o])return Number(n);return-1}(o,{target:t}),1)},animateAll:function(t){var e=this;if(!this.options.animation)return clearTimeout(n),void("function"==typeof t&&t());var a=!1,r=0;o.forEach((function(t){var n=0,o=t.target,i=o.fromRect,s=lt(o),l=o.prevFromRect,c=o.prevToRect,u=t.rect,d=rt(o,!0);d&&(s.top-=d.f,s.left-=d.e),o.toRect=s,o.thisAnimationDuration&&pt(l,s)&&!pt(i,s)&&(u.top-s.top)/(u.left-s.left)==(i.top-s.top)/(i.left-s.left)&&(n=function(t,e,n,o){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*o.animation}(u,l,c,e.options)),pt(s,i)||(o.prevFromRect=i,o.prevToRect=s,n||(n=e.options.animation),e.animate(o,u,s,n)),n&&(a=!0,r=Math.max(r,n),clearTimeout(o.animationResetTimer),o.animationResetTimer=setTimeout((function(){o.animationTime=0,o.prevFromRect=null,o.fromRect=null,o.prevToRect=null,o.thisAnimationDuration=null}),n),o.thisAnimationDuration=n)})),clearTimeout(n),a?n=setTimeout((function(){"function"==typeof t&&t()}),r):"function"==typeof t&&t(),o=[]},animate:function(t,e,n,o){if(o){at(t,"transition",""),at(t,"transform","");var a=rt(this.el),r=a&&a.a,i=a&&a.d,s=(e.left-n.left)/(r||1),l=(e.top-n.top)/(i||1);t.animatingX=!!s,t.animatingY=!!l,at(t,"transform","translate3d("+s+"px,"+l+"px,0)"),this.forRepaintDummy=function(t){return t.offsetWidth}(t),at(t,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),at(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){at(t,"transition",""),at(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1}),o)}}}))}function ve(t,e,n,o,a,r,i,s){var l,c,u=t[yt],d=u.options.onMove;return!window.CustomEvent||H||Z?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=e,l.from=t,l.dragged=n,l.draggedRect=o,l.related=a||e,l.relatedRect=r||lt(e),l.willInsertAfter=s,l.originalEvent=i,t.dispatchEvent(l),d&&(c=d.call(u,l,i)),c}function be(t){t.draggable=!1}function ye(){oe=!1}function we(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function _e(t){return setTimeout(t,0)}function Te(t){return clearTimeout(t)}fe.prototype={constructor:fe,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(zt=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,Ct):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,o=this.options,a=o.preventOnFilter,r=t.type,i=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,s=(i||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||s,c=o.filter;if(function(t){ae.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var o=e[n];o.checked&&ae.push(o)}}(n),!Ct&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||o.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!W||!s||"SELECT"!==s.tagName.toUpperCase())&&!((s=tt(s,o.draggable,n,!1))&&s.animated||It===s)){if(At=mt(s),Lt=mt(s,o.draggable),"function"==typeof c){if(c.call(this,t,s,this))return Dt({sortable:e,rootEl:l,name:"filter",targetEl:s,toEl:n,fromEl:n}),Et("filter",e,{evt:t}),void(a&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(o){if(o=tt(l,o.trim(),n,!1))return Dt({sortable:e,rootEl:o,name:"filter",targetEl:s,fromEl:n,toEl:n}),Et("filter",e,{evt:t}),!0}))))return void(a&&t.cancelable&&t.preventDefault());o.handle&&!tt(l,o.handle,n,!1)||this._prepareDragStart(t,i,s)}}},_prepareDragStart:function(t,e,n){var o,a=this,r=a.el,i=a.options,s=r.ownerDocument;if(n&&!Ct&&n.parentNode===r){var l=lt(n);if(Pt=r,xt=(Ct=n).parentNode,Ot=Ct.nextSibling,It=n,Rt=i.group,fe.dragged=Ct,Yt={target:Ct,clientX:(e||t).clientX,clientY:(e||t).clientY},Gt=Yt.clientX-l.left,Wt=Yt.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,Ct.style["will-change"]="all",o=function(){Et("delayEnded",a,{evt:t}),fe.eventCanceled?a._onDrop():(a._disableDelayedDragEvents(),!G&&a.nativeDraggable&&(Ct.draggable=!0),a._triggerDragStart(t,e),Dt({sortable:a,name:"choose",originalEvent:t}),ot(Ct,i.chosenClass,!0))},i.ignore.split(",").forEach((function(t){it(Ct,t.trim(),be)})),U(s,"dragover",he),U(s,"mousemove",he),U(s,"touchmove",he),U(s,"mouseup",a._onDrop),U(s,"touchend",a._onDrop),U(s,"touchcancel",a._onDrop),G&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Ct.draggable=!0),Et("delayStart",this,{evt:t}),!i.delay||i.delayOnTouchOnly&&!e||this.nativeDraggable&&(Z||H))o();else{if(fe.eventCanceled)return void this._onDrop();U(s,"mouseup",a._disableDelayedDrag),U(s,"touchend",a._disableDelayedDrag),U(s,"touchcancel",a._disableDelayedDrag),U(s,"mousemove",a._delayedDragTouchMoveHandler),U(s,"touchmove",a._delayedDragTouchMoveHandler),i.supportPointer&&U(s,"pointermove",a._delayedDragTouchMoveHandler),a._dragStartTimer=setTimeout(o,i.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Ct&&be(Ct),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;K(t,"mouseup",this._disableDelayedDrag),K(t,"touchend",this._disableDelayedDrag),K(t,"touchcancel",this._disableDelayedDrag),K(t,"mousemove",this._delayedDragTouchMoveHandler),K(t,"touchmove",this._delayedDragTouchMoveHandler),K(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?U(document,"pointermove",this._onTouchMove):U(document,e?"touchmove":"mousemove",this._onTouchMove):(U(Ct,"dragend",this),U(Pt,"dragstart",this._onDragStart));try{document.selection?_e((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){if(Kt=!1,Pt&&Ct){Et("dragStarted",this,{evt:e}),this.nativeDraggable&&U(document,"dragover",pe);var n=this.options;!t&&ot(Ct,n.dragClass,!1),ot(Ct,n.ghostClass,!0),fe.active=this,t&&this._appendGhost(),Dt({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(jt){this._lastX=jt.clientX,this._lastY=jt.clientY,me();for(var t=document.elementFromPoint(jt.clientX,jt.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(jt.clientX,jt.clientY))!==e;)e=t;if(Ct.parentNode[yt]._isOutsideThisEl(t),e)do{if(e[yt]&&e[yt]._onDragOver({clientX:jt.clientX,clientY:jt.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break;t=e}while(e=e.parentNode);ge()}},_onTouchMove:function(t){if(Yt){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,a=t.touches?t.touches[0]:t,r=Nt&&rt(Nt,!0),i=Nt&&r&&r.a,s=Nt&&r&&r.d,l=ie&&$t&>($t),c=(a.clientX-Yt.clientX+o.x)/(i||1)+(l?l[0]-ne[0]:0)/(i||1),u=(a.clientY-Yt.clientY+o.y)/(s||1)+(l?l[1]-ne[1]:0)/(s||1);if(!fe.active&&!Kt){if(n&&Math.max(Math.abs(a.clientX-this._lastX),Math.abs(a.clientY-this._lastY))o.right+10||t.clientX<=o.right&&t.clientY>o.bottom&&t.clientX>=o.left:t.clientX>o.right&&t.clientY>o.top||t.clientX<=o.right&&t.clientY>o.bottom+10}(t,a,this)&&!p.animated){if(p===Ct)return I(!1);if(p&&r===t.target&&(i=p),i&&(n=lt(i)),!1!==ve(Pt,r,Ct,e,i,n,t,!!i))return O(),p&&p.nextSibling?r.insertBefore(Ct,p.nextSibling):r.appendChild(Ct),xt=r,M(),I(!0)}else if(p&&function(t,e,n){var o=lt(ut(n.el,0,n.options,!0));return e?t.clientXu+c*r/2:ld-Ut)return-Vt}else if(l>u+c*(1-a)/2&&ld-c*r/2)?l>u+c/2?1:-1:0}(t,i,n,a,_?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,ee,zt===i),0!==v){var D=mt(Ct);do{D-=v,y=xt.children[D]}while(y&&("none"===at(y,"display")||y===Nt))}if(0===v||y===i)return I(!1);zt=i,Vt=v;var C=i.nextElementSibling,x=!1,N=ve(Pt,r,Ct,e,i,n,t,x=1===v);if(!1!==N)return 1!==N&&-1!==N||(x=1===N),oe=!0,setTimeout(ye,30),O(),x&&!C?r.appendChild(Ct):i.parentNode.insertBefore(Ct,x?C:i),S&&vt(S,0,E-S.scrollTop),xt=Ct.parentNode,void 0===b||ee||(Ut=Math.abs(b-lt(i)[T])),M(),I(!0)}if(r.contains(Ct))return I(!1)}return!1}function P(s,l){Et(s,g,L({evt:t,isOwner:u,axis:a?"vertical":"horizontal",revert:o,dragRect:e,targetRect:n,canSort:d,fromSortable:m,target:i,completed:I,onMove:function(n,o){return ve(Pt,r,Ct,e,n,lt(n),t,o)},changed:M},l))}function O(){P("dragOverAnimationCapture"),g.captureAnimationState(),g!==m&&m.captureAnimationState()}function I(e){return P("dragOverCompleted",{insertion:e}),e&&(u?c._hideClone():c._showClone(g),g!==m&&(ot(Ct,Xt?Xt.options.ghostClass:c.options.ghostClass,!1),ot(Ct,s.ghostClass,!0)),Xt!==g&&g!==fe.active?Xt=g:g===fe.active&&Xt&&(Xt=null),m===g&&(g._ignoreWhileAnimating=i),g.animateAll((function(){P("dragOverAnimationComplete"),g._ignoreWhileAnimating=null})),g!==m&&(m.animateAll(),m._ignoreWhileAnimating=null)),(i===Ct&&!Ct.animated||i===r&&!i.animated)&&(zt=null),s.dragoverBubble||t.rootEl||i===document||(Ct.parentNode[yt]._isOutsideThisEl(t.target),!e&&he(t)),!s.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),h=!0}function M(){Ft=mt(Ct),Bt=mt(Ct,s.draggable),Dt({sortable:g,name:"change",toEl:r,newIndex:Ft,newDraggableIndex:Bt,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){K(document,"mousemove",this._onTouchMove),K(document,"touchmove",this._onTouchMove),K(document,"pointermove",this._onTouchMove),K(document,"dragover",he),K(document,"mousemove",he),K(document,"touchmove",he)},_offUpEvents:function(){var t=this.el.ownerDocument;K(t,"mouseup",this._onDrop),K(t,"touchend",this._onDrop),K(t,"pointerup",this._onDrop),K(t,"touchcancel",this._onDrop),K(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;Ft=mt(Ct),Bt=mt(Ct,n.draggable),Et("drop",this,{evt:t}),xt=Ct&&Ct.parentNode,Ft=mt(Ct),Bt=mt(Ct,n.draggable),fe.eventCanceled||(Kt=!1,ee=!1,te=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Te(this.cloneId),Te(this._dragStartId),this.nativeDraggable&&(K(document,"drop",this),K(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),W&&at(document.body,"user-select",""),at(Ct,"transform",""),t&&(qt&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),Nt&&Nt.parentNode&&Nt.parentNode.removeChild(Nt),(Pt===xt||Xt&&"clone"!==Xt.lastPutMode)&&Mt&&Mt.parentNode&&Mt.parentNode.removeChild(Mt),Ct&&(this.nativeDraggable&&K(Ct,"dragend",this),be(Ct),Ct.style["will-change"]="",qt&&!Kt&&ot(Ct,Xt?Xt.options.ghostClass:this.options.ghostClass,!1),ot(Ct,this.options.chosenClass,!1),Dt({sortable:this,name:"unchoose",toEl:xt,newIndex:null,newDraggableIndex:null,originalEvent:t}),Pt!==xt?(Ft>=0&&(Dt({rootEl:xt,name:"add",toEl:xt,fromEl:Pt,originalEvent:t}),Dt({sortable:this,name:"remove",toEl:xt,originalEvent:t}),Dt({rootEl:xt,name:"sort",toEl:xt,fromEl:Pt,originalEvent:t}),Dt({sortable:this,name:"sort",toEl:xt,originalEvent:t})),Xt&&Xt.save()):Ft!==At&&Ft>=0&&(Dt({sortable:this,name:"update",toEl:xt,originalEvent:t}),Dt({sortable:this,name:"sort",toEl:xt,originalEvent:t})),fe.active&&(null!=Ft&&-1!==Ft||(Ft=At,Bt=Lt),Dt({sortable:this,name:"end",toEl:xt,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){Et("nulling",this),Pt=Ct=xt=Nt=Ot=Mt=It=kt=Yt=jt=qt=Ft=Bt=At=Lt=zt=Vt=Xt=Rt=fe.dragged=fe.ghost=fe.clone=fe.active=null,ae.forEach((function(t){t.checked=!0})),ae.length=Ht=Zt=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":Ct&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,o=0,a=n.length,r=this.options;o{const e=t.target;this.name(e.value),this.slug((0,tn.slug)(e.value))}})),50),t.add("slug",m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.edit_tag.slug_label")),m("input",{className:"FormControl",bidi:this.slug})),40),t.add("description",m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.edit_tag.description_label")),m("textarea",{className:"FormControl",bidi:this.description})),30),t.add("color",m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.edit_tag.color_label")),m(Ke(),{className:"FormControl",placeholder:"#aaaaaa",bidi:this.color})),20),t.add("icon",m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.edit_tag.icon_label")),m("div",{className:"helpText"},a().translator.trans("flarum-tags.admin.edit_tag.icon_text",{a:m("a",{href:"https://fontawesome.com/icons?m=free",tabindex:"-1"})})),m("input",{className:"FormControl",placeholder:"fas fa-bolt",bidi:this.icon})),10),t.add("hidden",m("div",{className:"Form-group"},m("div",null,m("label",{className:"checkbox"},m("input",{type:"checkbox",bidi:this.isHidden}),a().translator.trans("flarum-tags.admin.edit_tag.hide_label")))),10),t.add("submit",m("div",{className:"Form-group Form-controls"},m(h(),{type:"submit",className:"Button Button--primary EditTagModal-save",loading:this.loading},a().translator.trans("flarum-tags.admin.edit_tag.submit_button")),this.tag.exists&&m("button",{type:"button",className:"Button EditTagModal-delete",onclick:this.delete.bind(this)},a().translator.trans("flarum-tags.admin.edit_tag.delete_tag_button"))),-10),t}submitData(){return{name:this.name(),slug:this.slug(),description:this.description(),color:this.color(),icon:this.icon(),isHidden:this.isHidden(),isPrimary:this.isPrimary()}}onsubmit(t){t.preventDefault(),this.loading=!0,this.tag.save(this.submitData()).then((()=>this.hide()),(()=>this.loading=!1))}delete(){if(confirm(an()(a().translator.trans("flarum-tags.admin.edit_tag.delete_tag_confirmation")))){const t=a().store.all("tags").filter((t=>t.parent()===this.tag));this.tag.delete().then((()=>{t.forEach((t=>t.pushData({attributes:{isChild:!1}}))),m.redraw()})),this.hide()}}}function sn(t){return m("li",{"data-id":t.id(),style:{color:t.color()}},m("div",{className:"TagListItem-info"},(0,b.Z)(t),m("span",{className:"TagListItem-name"},t.name()),m(h(),{className:"Button Button--link",icon:"fas fa-pencil-alt",onclick:()=>a().modal.show(rn,{model:t})})),!t.isChild()&&null!==t.position()&&m("ol",{className:"TagListItem-children TagList"},(0,y.Z)(a().store.all("tags")).filter((e=>e.parent()===t)).map(sn)))}flarum.reg.add("flarum-tags","admin/components/EditTagModal",rn);class ln extends(Xe()){oninit(t){super.oninit(t),this.forcedRefreshKey=0,this.loading=!0,a().tagList.load(["parent"]).then((()=>{this.loading=!1,m.redraw()}))}content(){if(this.loading)return m(f(),null);const t=this.setting("flarum-tags.min_primary_tags",0),e=this.setting("flarum-tags.max_primary_tags",0),n=this.setting("flarum-tags.min_secondary_tags",0),o=this.setting("flarum-tags.max_secondary_tags",0),r=(0,y.Z)(a().store.all("tags").filter((t=>!t.parent())));return m("div",{className:"TagsContent"},m("div",{className:"TagsContent-list"},m("div",{className:"container",key:this.forcedRefreshKey,oncreate:this.onListOnCreate.bind(this)},m(We(),null,m(ze(),{className:"TagGroup",label:a().translator.trans("flarum-tags.admin.tags.primary_heading")},m("ol",{className:"TagList TagList--primary"},r.filter((t=>null!==t.position()&&!t.isChild())).map(sn)),m(h(),{className:"Button TagList-button",icon:"fas fa-plus",onclick:()=>a().modal.show(rn,{primary:!0})},a().translator.trans("flarum-tags.admin.tags.create_primary_tag_button"))),m(ze(),{className:"TagGroup TagGroup--secondary",label:a().translator.trans("flarum-tags.admin.tags.secondary_heading")},m("ul",{className:"TagList"},r.filter((t=>null===t.position())).sort(((t,e)=>t.name().localeCompare(e.name()))).map(sn)),m(h(),{className:"Button TagList-button",icon:"fas fa-plus",onclick:()=>a().modal.show(rn,{primary:!1})},a().translator.trans("flarum-tags.admin.tags.create_secondary_tag_button"))),m(ze(),{label:a().translator.trans("flarum-tags.admin.tags.settings_heading")},m(Ze(),null,m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.tag_settings.required_primary_heading")),m("div",{className:"helpText"},a().translator.trans("flarum-tags.admin.tag_settings.required_primary_text")),m("div",{className:"TagSettings-rangeInput"},m("input",{className:"FormControl",type:"number",min:"0",value:t(),oninput:je()("value",this.setMinTags.bind(this,t,e))}),a().translator.trans("flarum-tags.admin.tag_settings.range_separator_text"),m("input",{className:"FormControl",type:"number",min:t(),bidi:e}))),m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.tag_settings.required_secondary_heading")),m("div",{className:"helpText"},a().translator.trans("flarum-tags.admin.tag_settings.required_secondary_text")),m("div",{className:"TagSettings-rangeInput"},m("input",{className:"FormControl",type:"number",min:"0",value:n(),oninput:je()("value",this.setMinTags.bind(this,n,o))}),a().translator.trans("flarum-tags.admin.tag_settings.range_separator_text"),m("input",{className:"FormControl",type:"number",min:n(),bidi:o}))),m("div",{className:"Form-group Form-controls"},this.submitButton())))),m("div",{className:"TagsContent-footer"},m("p",null,a().translator.trans("flarum-tags.admin.tags.about_tags_text"))))))}onListOnCreate(t){this.$(".TagList").get().map((t=>{Be.create(t,{group:"tags",delay:50,delayOnTouchOnly:!0,touchStartThreshold:5,animation:150,swapThreshold:.65,dragClass:"sortable-dragging",ghostClass:"sortable-placeholder",onSort:t=>this.onSortUpdate(t)})}))}setMinTags(t,e,n){t(n),e(Math.max(n,e()))}onSortUpdate(t){t.from instanceof HTMLOListElement&&t.to instanceof HTMLUListElement&&a().store.getById("tags",t.item.getAttribute("data-id")).pushData({attributes:{position:null,isChild:!1},relationships:{parent:null}});const e=this.$(".TagList--primary > li").map((function(){return{id:$(this).data("id"),children:$(this).find("li").map((function(){return $(this).data("id")})).get()}})).get();e.forEach(((t,e)=>{const n=a().store.getById("tags",t.id);n.pushData({attributes:{position:e,isChild:!1},relationships:{parent:null}}),t.children.forEach(((t,e)=>{a().store.getById("tags",t).pushData({attributes:{position:e,isChild:!0},relationships:{parent:n}})}))})),a().request({url:a().forum.attribute("apiUrl")+"/tags/order",method:"POST",body:{order:e}}),this.forcedRefreshKey++,m.redraw()}}flarum.reg.add("flarum-tags","admin/components/TagsPage",ln);var cn=n(351),un=n.n(cn);class dn{constructor(){(0,C.Z)(this,"loadedIncludes",void 0)}async load(t){if(void 0===t&&(t=[]),!this.loadedIncludes)return this.query(t);const e=t.filter((t=>!this.loadedIncludes.has(t)));return 0===e.length?Promise.resolve(un().store.all("tags")):this.query(e)}async query(t){return void 0===t&&(t=[]),null!=this.loadedIncludes||(this.loadedIncludes=new Set),un().store.find("tags",{include:t.join(",")}).then((e=>{const n=Array.isArray(e)?e:[e];return t.forEach((t=>this.loadedIncludes.add(t))),n}))}}flarum.reg.add("flarum-tags","common/states/TagListState",dn);const mn=flarum.reg.get("core","common/extenders");var gn=n.n(mn);const hn=flarum.reg.get("core","common/utils/computed");var pn=n.n(hn);const fn=flarum.reg.get("core","common/Model");var vn=n.n(fn);class bn extends(vn()){name(){return vn().attribute("name").call(this)}slug(){return vn().attribute("slug").call(this)}description(){return vn().attribute("description").call(this)}color(){return vn().attribute("color").call(this)}backgroundUrl(){return vn().attribute("backgroundUrl").call(this)}backgroundMode(){return vn().attribute("backgroundMode").call(this)}icon(){return vn().attribute("icon").call(this)}position(){return vn().attribute("position").call(this)}parent(){return vn().hasOne("parent").call(this)}children(){return vn().hasMany("children").call(this)}defaultSort(){return vn().attribute("defaultSort").call(this)}isChild(){return vn().attribute("isChild").call(this)}isHidden(){return vn().attribute("isHidden").call(this)}isPrimary(){return vn().attribute("isPrimary").call(this)}discussionCount(){return vn().attribute("discussionCount").call(this)}lastPostedAt(){return vn().attribute("lastPostedAt",vn().transformDate).call(this)}lastPostedDiscussion(){return vn().hasOne("lastPostedDiscussion").call(this)}isRestricted(){return vn().attribute("isRestricted").call(this)}canStartDiscussion(){return vn().attribute("canStartDiscussion").call(this)}canAddToDiscussion(){return vn().attribute("canAddToDiscussion").call(this)}isPrimaryParent(){return pn()("position","parent",((t,e)=>null!==t&&!1===e)).call(this)}}flarum.reg.add("flarum-tags","common/models/Tag",bn);const yn=flarum.reg.get("core","common/query/IGambit");class wn extends yn.KeyValueGambit{constructor(){super(...arguments),(0,C.Z)(this,"predicates",!0)}key(){return un().translator.trans("flarum-tags.lib.gambits.discussions.tag.key",{},!0)}hint(){return un().translator.trans("flarum-tags.lib.gambits.discussions.tag.hint",{},!0)}filterKey(){return"tag"}gambitValueToFilterValue(t){return[t]}fromFilter(t,e){let n=[];return Array.isArray(t)?(n=t.map((t=>this.fromFilter(t.toString(),e))),n.join(" ")):"".concat(e?"-":"").concat(this.key(),":").concat(this.filterValueToGambitValue(t))}filterValueToGambitValue(t){return t}}flarum.reg.add("flarum-tags","common/query/discussions/TagGambit",wn);const _n=[(new(gn().Store)).add("tags",bn),(new(gn().Search)).gambit("discussions",wn)];a().initializers.add("flarum-tags",(t=>{t.tagList=new dn,t.extensionData.for("flarum-tags").registerPage(ln),(0,r.extend)(s().prototype,"oninit",(function(){this.loading=!0})),(0,r.extend)(s().prototype,"oncreate",(function(){a().tagList.load().then((()=>{this.loading=!1,m.redraw()}))})),(0,r.override)(s().prototype,"view",(function(t,e){return this.loading?m(f(),null):t(e)})),(0,r.override)(a(),"getRequiredPermissions",((t,e)=>{const n=e.match(/^tag\d+\./);return n?t(e.substr(n[0].length)).map((t=>n[0]+t)):t(e)})),(0,r.extend)(s().prototype,"scopeItems",(t=>{(0,y.Z)(a().store.all("tags")).filter((t=>t.isRestricted())).forEach((e=>t.add("tag"+e.id(),{label:(0,v.Z)(e),onremove:()=>e.save({isRestricted:!1}),render:t=>"setting"in t?null:"viewForum"===t.permission||"startDiscussion"===t.permission||t.permission.startsWith("discussion.")&&!1!==t.tagScoped||t.tagScoped?m(c(),{permission:"tag".concat(e.id(),".").concat(t.permission),allowGuest:t.allowGuest}):null})))})),(0,r.extend)(s().prototype,"scopeControlItems",(t=>{const e=(0,y.Z)(a().store.all("tags").filter((t=>!t.isRestricted())));e.length&&t.add("tag",m(d(),{className:"Dropdown--restrictByTag",buttonClassName:"Button Button--text",label:a().translator.trans("flarum-tags.admin.permissions.restrict_by_tag_heading"),icon:"fas fa-plus",caretIcon:null},e.map((t=>m(h(),{icon:!0,onclick:()=>t.save({isRestricted:!0})},[(0,b.Z)(t,{className:"Button-icon"})," ",t.name()])))))})),w(),S(),(0,r.extend)(s().prototype,"startItems",(t=>{t.add("allowTagChange",{icon:"fas fa-tag",label:a().translator.trans("flarum-tags.admin.permissions.allow_edit_tags_label"),setting:()=>{const t=parseInt(a().data.settings.allow_tag_change,10);return m(D(),{defaultLabel:t?a().translator.trans("core.admin.permissions_controls.allow_some_minutes_button",{count:t}):a().translator.trans("core.admin.permissions_controls.allow_indefinitely_button"),key:"allow_tag_change",options:[{value:"-1",label:a().translator.trans("core.admin.permissions_controls.allow_indefinitely_button")},{value:"10",label:a().translator.trans("core.admin.permissions_controls.allow_ten_minutes_button")},{value:"reply",label:a().translator.trans("core.admin.permissions_controls.allow_until_reply_button")}]})}},90)})),(0,r.extend)(A().prototype,"customFieldComponents",(function(t){t.add("flarum-tags.select-tags",(t=>m(M,Object.assign({},t,{settingValue:t.bidi}))))}))}))},974:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});var o=n(836),a=n.n(o);function r(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});const o=t&&t.icon(),{useColor:r=!0}=n;return e.className=a()([e.className,"icon text-colored",o?t.icon():"TagIcon"]),t&&r?(e.style=e.style||{},e.style["--color"]=t.color()):t||(e.className+=" untagged"),o?m("i",e):m("span",e)}flarum.reg.add("flarum-tags","common/helpers/tagIcon",r)},924:(t,e,n)=>{"use strict";n.d(e,{Z:()=>g});var o=n(780),a=n.n(o),r=n(678),i=n.n(r),s=n(836),l=n.n(s),c=n(679),u=n.n(c),d=n(974);function g(t,e){void 0===e&&(e={}),e.style=e.style||{},e.className="TagLabel "+(e.className||"");const n=a()(e,"link"),o=t?t.name():app.translator.trans("flarum-tags.lib.deleted_tag_text");if(t){const o=t.color();o&&(e.style["--tag-bg"]=o,e.className=l()(e.className,"colored",u()(o))),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?i():"span",e,m("span",{className:"TagLabel-text"},t&&t.icon()&&(0,d.Z)(t,{className:"TagLabel-icon"},{useColor:!1}),m("span",{className:"TagLabel-name"},o)))}flarum.reg.add("flarum-tags","common/helpers/tagLabel",g)},270:()=>{},648:(t,e,n)=>{"use strict";function o(t){return t.slice(0).sort(((t,e)=>{const n=t.position(),o=e.position();if(null===n&&null===o)return e.discussionCount()-t.discussionCount();if(null===o)return-1;if(null===n)return 1;const a=t.parent(),r=e.parent();return a===r?n-o:a&&r?a.position()-r.position():a?a===e?1:a.position()-o:r?r===t?-1:n-r.position():0}))}n.d(e,{Z:()=>o}),flarum.reg.add("flarum-tags","common/utils/sortTags",o)},433:t=>{"use strict";t.exports=flarum.reg.get("core","common/Component")},351:t=>{"use strict";t.exports=flarum.reg.get("core","common/app")},645:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/Button")},44:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/FormModal")},678:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/Link")},149:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/LoadingIndicator")},291:t=>{"use strict";t.exports=flarum.reg.get("core","common/helpers/highlight")},679:t=>{"use strict";t.exports=flarum.reg.get("core","common/helpers/textContrastClass")},657:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/KeyboardNavigatable")},636:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/Stream")},836:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/classList")},780:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/extract")},596:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/extractText")},905:(t,e,n)=>{"use strict";function o(t){return o="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},o(t)}function a(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==o(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var a=n.call(t,e);if("object"!==o(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"===o(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,{Z:()=>a})}},o={};function a(t){var e=o[t];if(void 0!==e)return e.exports;var r=o[t]={exports:{}};return n[t](r,r.exports,a),r.exports}a.m=n,a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var n in e)a.o(e,n)&&!a.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},a.f={},a.e=t=>Promise.all(Object.keys(a.f).reduce(((e,n)=>(a.f[n](t,e),e)),[])),a.u=t=>"common/components/TagSelectionModal.js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t={},e="module.exports:",a.l=(n,o,r,i)=>{if(t[n])t[n].push(o);else{var s,l;if(void 0!==r)for(var c=document.getElementsByTagName("script"),u=0;u{s.onerror=s.onload=null,clearTimeout(g);var a=t[n];if(delete t[n],s.parentNode&&s.parentNode.removeChild(s),a&&a.forEach((t=>t(o))),e)return e(o)},g=setTimeout(m.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=m.bind(null,s.onerror),s.onload=m.bind(null,s.onload),l&&document.head.appendChild(s)}},a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;a.g.importScripts&&(t=a.g.location+"");var e=a.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var n=e.getElementsByTagName("script");n.length&&(t=n[n.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=t})(),a.f.compat=(t,e)=>{const n=a.l;a.l=flarum.reg.loadChunk.bind(flarum.reg,n)},(()=>{var t={328:0};a.f.j=(e,n)=>{var o=a.o(t,e)?t[e]:void 0;if(0!==o)if(o)n.push(o[2]);else{var r=new Promise(((n,a)=>o=t[e]=[n,a]));n.push(o[2]=r);var i=a.p+a.u(e),s=new Error;a.l(i,(n=>{if(a.o(t,e)&&(0!==(o=t[e])&&(t[e]=void 0),o)){var r=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;s.message="Loading chunk "+e+" failed.\n("+r+": "+i+")",s.name="ChunkLoadError",s.type=r,s.request=i,o[1](s)}}),"chunk-"+e,e)}};var e=(e,n)=>{var o,r,[i,s,l]=n,c=0;if(i.some((e=>0!==t[e]))){for(o in s)a.o(s,o)&&(a.m[o]=s[o]);l&&l(a)}for(e&&e(n);c{"use strict";a.r(r),a.d(r,{extend:()=>n.l});var t=a(270),e={};for(const n in t)"default"!==n&&(e[n]=()=>t[n]);a.d(r,e);var n=a(396)})(),module.exports=r})(); //# sourceMappingURL=admin.js.map \ No newline at end of file diff --git a/extensions/tags/js/dist/admin.js.map b/extensions/tags/js/dist/admin.js.map index 9728354b45..592d05f373 100644 --- a/extensions/tags/js/dist/admin.js.map +++ b/extensions/tags/js/dist/admin.js.map @@ -1 +1 @@ -{"version":3,"file":"admin.js","mappings":";UAAIA,EACAC,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UF,EAChBL,EAAmB,GAAGG,EACvB,CACD,GAEwC,SAAWpC,EAASA,EAE/D,CACD,EAcF,IAAIyC,EAAuB,CAACC,EAA4BjlB,KACvD,IAGIgiB,EAAUO,GAHT2C,EAAUC,EAAaC,GAAWplB,EAGhB7M,EAAI,EAC3B,GAAG+xB,EAAShe,MAAMxV,GAAgC,IAAxB6yB,EAAgB7yB,KAAa,CACtD,IAAIswB,KAAYmD,EACZpD,EAAoBO,EAAE6C,EAAanD,KACrCD,EAAoBpxB,EAAEqxB,GAAYmD,EAAYnD,IAG7CoD,GAAsBA,EAAQrD,EAClC,CAEA,IADGkD,GAA4BA,EAA2BjlB,GACrD7M,EAAI+xB,EAAS10B,OAAQ2C,IACzBovB,EAAU2C,EAAS/xB,GAChB4uB,EAAoBO,EAAEiC,EAAiBhC,IAAYgC,EAAgBhC,IACrEgC,EAAgBhC,GAAS,KAE1BgC,EAAgBhC,GAAW,CAC5B,EAIG8C,EAAqBC,KAAiC,2BAAIA,KAAiC,4BAAK,GACpGD,EAAmB/0B,QAAQ00B,EAAqB/kB,KAAK,KAAM,IAC3DolB,EAAmB50B,KAAOu0B,EAAqB/kB,KAAK,KAAMolB,EAAmB50B,KAAKwP,KAAKolB","sources":["webpack://@flarum/tags/webpack/runtime/load script","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/app')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/PermissionGrid')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/PermissionDropdown')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Dropdown')\"","webpack://@flarum/tags/./src/admin/addTagPermission.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/BasicsPage')\"","webpack://@flarum/tags/./src/admin/addTagsHomePageOption.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/SettingDropdown')\"","webpack://@flarum/tags/./src/common/helpers/tagsLabel.js","webpack://@flarum/tags/./src/admin/components/SelectTagsSettingComponent.tsx","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/FormGroup')\"","webpack://@flarum/tags/../../../node_modules/sortablejs/modular/sortable.esm.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/ExtensionPage')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/withAttr')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Form')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/ColorPreviewInput')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/ItemList')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/string')\"","webpack://@flarum/tags/./src/admin/components/EditTagModal.tsx","webpack://@flarum/tags/../../../framework/core/js/src/common/Component.ts","webpack://@flarum/tags/../../../node_modules/clsx/dist/clsx.m.js","webpack://@flarum/tags/../../../framework/core/js/src/common/utils/classList.ts","webpack://@flarum/tags/../../../framework/core/js/src/admin/components/FormSectionGroup.tsx","webpack://@flarum/tags/./src/admin/components/TagsPage.js","webpack://@flarum/tags/./src/common/states/TagListState.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/computed')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/Model')\"","webpack://@flarum/tags/./src/common/models/Tag.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/query/IGambit')\"","webpack://@flarum/tags/./src/common/query/discussions/TagGambit.ts","webpack://@flarum/tags/./src/common/extend.ts","webpack://@flarum/tags/./src/admin/index.ts","webpack://@flarum/tags/./src/admin/addTagsPermissionScope.tsx","webpack://@flarum/tags/./src/admin/addTagChangePermission.js","webpack://@flarum/tags/./src/admin/addTagSelectionSettingComponent.tsx","webpack://@flarum/tags/./src/common/helpers/tagIcon.js","webpack://@flarum/tags/./src/common/helpers/tagLabel.js","webpack://@flarum/tags/./src/common/utils/sortTags.tsx","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/Component')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/app')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/FormModal')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Link')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/LoadingIndicator')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/highlight')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/textContrastClass')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/KeyboardNavigatable')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/Stream')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/classList')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/extract')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/tags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/tags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/tags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/tags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPrimitive.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/ensure chunk","webpack://@flarum/tags/webpack/runtime/get javascript chunk filename","webpack://@flarum/tags/webpack/runtime/global","webpack://@flarum/tags/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/tags/webpack/runtime/make namespace object","webpack://@flarum/tags/webpack/runtime/publicPath","webpack://@flarum/tags/webpack/runtime/compat","webpack://@flarum/tags/webpack/runtime/jsonp chunk loading"],"sourcesContent":["var inProgress = {};\nvar dataWebpackPrefix = \"module.exports:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t};\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/PermissionGrid');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/PermissionDropdown');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Dropdown');","export default function () {\n app.extensionData.for('flarum-tags').registerPermission({\n icon: 'fas fa-tag',\n label: app.translator.trans('flarum-tags.admin.permissions.tag_discussions_label'),\n permission: 'discussion.tag'\n }, 'moderate', 95).registerPermission({\n icon: 'fas fa-tags',\n label: app.translator.trans('flarum-tags.admin.permissions.bypass_tag_counts_label'),\n permission: 'bypassTagCounts'\n }, 'start', 89);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/BasicsPage');","import { extend } from 'flarum/common/extend';\nimport BasicsPage from 'flarum/admin/components/BasicsPage';\nexport default function () {\n extend(BasicsPage.prototype, 'homePageItems', items => {\n items.add('tags', {\n path: '/tags',\n label: app.translator.trans('flarum-tags.admin.basics.tags_label')\n });\n });\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/SettingDropdown');","import extract from 'flarum/common/utils/extract';\nimport tagLabel from './tagLabel';\nimport sortTags from '../utils/sortTags';\nimport classList from 'flarum/common/utils/classList';\nexport default function tagsLabel(tags, attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n const children = [];\n const {\n link,\n ...otherAttrs\n } = attrs;\n otherAttrs.className = classList('TagsLabel', otherAttrs.className);\n if (tags) {\n sortTags(tags).forEach(tag => {\n if (tag || tags.length === 1) {\n children.push(tagLabel(tag, {\n link\n }));\n }\n });\n } else {\n children.push(tagLabel());\n }\n return m(\"span\", otherAttrs, children);\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagsLabel', tagsLabel);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport tagsLabel from '../../common/helpers/tagsLabel';\nexport default class SelectTagsSettingComponent extends Component {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"tags\", []);\n _defineProperty(this, \"loaded\", false);\n }\n view() {\n const value = JSON.parse(this.attrs.settingValue() || '[]');\n if (!this.loaded) {\n app.tagList.load(['parent']).then(tags => {\n this.tags = tags.filter(tag => value.includes(tag.id()));\n this.loaded = true;\n m.redraw();\n });\n }\n return m(\"div\", {\n className: \"Form-group SelectTagsSettingComponent\"\n }, m(\"label\", null, this.attrs.label), this.attrs.help && m(\"p\", {\n className: \"helpText\"\n }, this.attrs.help), !this.loaded ? m(LoadingIndicator, {\n size: \"small\",\n display: \"inline\"\n }) : m(Button, {\n className: \"Button Button--text\",\n onclick: () => app.modal.show(() => import(/* webpackChunkName: 'common/components/TagSelectionModal', webpackMode: 'lazy-once' */ '../../common/components/TagSelectionModal'), {\n selectedTags: this.tags,\n onsubmit: tags => {\n this.tags = tags;\n this.attrs.settingValue(JSON.stringify(tags.map(tag => tag.id())));\n },\n ...this.attrs.options\n })\n }, !!this.tags.length ? tagsLabel(this.tags) : m(\"span\", {\n className: \"TagLabel untagged\"\n }, app.translator.trans('flarum-tags.admin.settings.button_text'))));\n }\n}\nflarum.reg.add('flarum-tags', 'admin/components/SelectTagsSettingComponent', SelectTagsSettingComponent);flarum.reg.addChunkModule('162', '610', 'flarum-tags', 'common/components/TagSelectionModal');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/FormGroup');","/**!\n * Sortable 1.15.0\n * @author\tRubaXa \n * @author\towenm \n * @license MIT\n */\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\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\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\n\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar version = \"1.15.0\";\n\nfunction userAgent(pattern) {\n if (typeof window !== 'undefined' && window.navigator) {\n return !! /*@__PURE__*/navigator.userAgent.match(pattern);\n }\n}\n\nvar IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\\.|msie|iemobile|Windows Phone)/i);\nvar Edge = userAgent(/Edge/i);\nvar FireFox = userAgent(/firefox/i);\nvar Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);\nvar IOS = userAgent(/iP(ad|od|hone)/i);\nvar ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);\n\nvar captureMode = {\n capture: false,\n passive: false\n};\n\nfunction on(el, event, fn) {\n el.addEventListener(event, fn, !IE11OrLess && captureMode);\n}\n\nfunction off(el, event, fn) {\n el.removeEventListener(event, fn, !IE11OrLess && captureMode);\n}\n\nfunction matches(\n/**HTMLElement*/\nel,\n/**String*/\nselector) {\n if (!selector) return;\n selector[0] === '>' && (selector = selector.substring(1));\n\n if (el) {\n try {\n if (el.matches) {\n return el.matches(selector);\n } else if (el.msMatchesSelector) {\n return el.msMatchesSelector(selector);\n } else if (el.webkitMatchesSelector) {\n return el.webkitMatchesSelector(selector);\n }\n } catch (_) {\n return false;\n }\n }\n\n return false;\n}\n\nfunction getParentOrHost(el) {\n return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;\n}\n\nfunction closest(\n/**HTMLElement*/\nel,\n/**String*/\nselector,\n/**HTMLElement*/\nctx, includeCTX) {\n if (el) {\n ctx = ctx || document;\n\n do {\n if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {\n return el;\n }\n\n if (el === ctx) break;\n /* jshint boss:true */\n } while (el = getParentOrHost(el));\n }\n\n return null;\n}\n\nvar R_SPACE = /\\s+/g;\n\nfunction toggleClass(el, name, state) {\n if (el && name) {\n if (el.classList) {\n el.classList[state ? 'add' : 'remove'](name);\n } else {\n var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');\n el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');\n }\n }\n}\n\nfunction css(el, prop, val) {\n var style = el && el.style;\n\n if (style) {\n if (val === void 0) {\n if (document.defaultView && document.defaultView.getComputedStyle) {\n val = document.defaultView.getComputedStyle(el, '');\n } else if (el.currentStyle) {\n val = el.currentStyle;\n }\n\n return prop === void 0 ? val : val[prop];\n } else {\n if (!(prop in style) && prop.indexOf('webkit') === -1) {\n prop = '-webkit-' + prop;\n }\n\n style[prop] = val + (typeof val === 'string' ? '' : 'px');\n }\n }\n}\n\nfunction matrix(el, selfOnly) {\n var appliedTransforms = '';\n\n if (typeof el === 'string') {\n appliedTransforms = el;\n } else {\n do {\n var transform = css(el, 'transform');\n\n if (transform && transform !== 'none') {\n appliedTransforms = transform + ' ' + appliedTransforms;\n }\n /* jshint boss:true */\n\n } while (!selfOnly && (el = el.parentNode));\n }\n\n var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;\n /*jshint -W056 */\n\n return matrixFn && new matrixFn(appliedTransforms);\n}\n\nfunction find(ctx, tagName, iterator) {\n if (ctx) {\n var list = ctx.getElementsByTagName(tagName),\n i = 0,\n n = list.length;\n\n if (iterator) {\n for (; i < n; i++) {\n iterator(list[i], i);\n }\n }\n\n return list;\n }\n\n return [];\n}\n\nfunction getWindowScrollingElement() {\n var scrollingElement = document.scrollingElement;\n\n if (scrollingElement) {\n return scrollingElement;\n } else {\n return document.documentElement;\n }\n}\n/**\n * Returns the \"bounding client rect\" of given element\n * @param {HTMLElement} el The element whose boundingClientRect is wanted\n * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container\n * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr\n * @param {[Boolean]} undoScale Whether the container's scale() should be undone\n * @param {[HTMLElement]} container The parent the element will be placed in\n * @return {Object} The boundingClientRect of el, with specified adjustments\n */\n\n\nfunction getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {\n if (!el.getBoundingClientRect && el !== window) return;\n var elRect, top, left, bottom, right, height, width;\n\n if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {\n elRect = el.getBoundingClientRect();\n top = elRect.top;\n left = elRect.left;\n bottom = elRect.bottom;\n right = elRect.right;\n height = elRect.height;\n width = elRect.width;\n } else {\n top = 0;\n left = 0;\n bottom = window.innerHeight;\n right = window.innerWidth;\n height = window.innerHeight;\n width = window.innerWidth;\n }\n\n if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {\n // Adjust for translate()\n container = container || el.parentNode; // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)\n // Not needed on <= IE11\n\n if (!IE11OrLess) {\n do {\n if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {\n var containerRect = container.getBoundingClientRect(); // Set relative to edges of padding box of container\n\n top -= containerRect.top + parseInt(css(container, 'border-top-width'));\n left -= containerRect.left + parseInt(css(container, 'border-left-width'));\n bottom = top + elRect.height;\n right = left + elRect.width;\n break;\n }\n /* jshint boss:true */\n\n } while (container = container.parentNode);\n }\n }\n\n if (undoScale && el !== window) {\n // Adjust for scale()\n var elMatrix = matrix(container || el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d;\n\n if (elMatrix) {\n top /= scaleY;\n left /= scaleX;\n width /= scaleX;\n height /= scaleY;\n bottom = top + height;\n right = left + width;\n }\n }\n\n return {\n top: top,\n left: left,\n bottom: bottom,\n right: right,\n width: width,\n height: height\n };\n}\n/**\n * Checks if a side of an element is scrolled past a side of its parents\n * @param {HTMLElement} el The element who's side being scrolled out of view is in question\n * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')\n * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')\n * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element\n */\n\n\nfunction isScrolledPast(el, elSide, parentSide) {\n var parent = getParentAutoScrollElement(el, true),\n elSideVal = getRect(el)[elSide];\n /* jshint boss:true */\n\n while (parent) {\n var parentSideVal = getRect(parent)[parentSide],\n visible = void 0;\n\n if (parentSide === 'top' || parentSide === 'left') {\n visible = elSideVal >= parentSideVal;\n } else {\n visible = elSideVal <= parentSideVal;\n }\n\n if (!visible) return parent;\n if (parent === getWindowScrollingElement()) break;\n parent = getParentAutoScrollElement(parent, false);\n }\n\n return false;\n}\n/**\n * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)\n * and non-draggable elements\n * @param {HTMLElement} el The parent element\n * @param {Number} childNum The index of the child\n * @param {Object} options Parent Sortable's options\n * @return {HTMLElement} The child at index childNum, or null if not found\n */\n\n\nfunction getChild(el, childNum, options, includeDragEl) {\n var currentChild = 0,\n i = 0,\n children = el.children;\n\n while (i < children.length) {\n if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {\n if (currentChild === childNum) {\n return children[i];\n }\n\n currentChild++;\n }\n\n i++;\n }\n\n return null;\n}\n/**\n * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)\n * @param {HTMLElement} el Parent element\n * @param {selector} selector Any other elements that should be ignored\n * @return {HTMLElement} The last child, ignoring ghostEl\n */\n\n\nfunction lastChild(el, selector) {\n var last = el.lastElementChild;\n\n while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {\n last = last.previousElementSibling;\n }\n\n return last || null;\n}\n/**\n * Returns the index of an element within its parent for a selected set of\n * elements\n * @param {HTMLElement} el\n * @param {selector} selector\n * @return {number}\n */\n\n\nfunction index(el, selector) {\n var index = 0;\n\n if (!el || !el.parentNode) {\n return -1;\n }\n /* jshint boss:true */\n\n\n while (el = el.previousElementSibling) {\n if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {\n index++;\n }\n }\n\n return index;\n}\n/**\n * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.\n * The value is returned in real pixels.\n * @param {HTMLElement} el\n * @return {Array} Offsets in the format of [left, top]\n */\n\n\nfunction getRelativeScrollOffset(el) {\n var offsetLeft = 0,\n offsetTop = 0,\n winScroller = getWindowScrollingElement();\n\n if (el) {\n do {\n var elMatrix = matrix(el),\n scaleX = elMatrix.a,\n scaleY = elMatrix.d;\n offsetLeft += el.scrollLeft * scaleX;\n offsetTop += el.scrollTop * scaleY;\n } while (el !== winScroller && (el = el.parentNode));\n }\n\n return [offsetLeft, offsetTop];\n}\n/**\n * Returns the index of the object within the given array\n * @param {Array} arr Array that may or may not hold the object\n * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find\n * @return {Number} The index of the object in the array, or -1\n */\n\n\nfunction indexOfObject(arr, obj) {\n for (var i in arr) {\n if (!arr.hasOwnProperty(i)) continue;\n\n for (var key in obj) {\n if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);\n }\n }\n\n return -1;\n}\n\nfunction getParentAutoScrollElement(el, includeSelf) {\n // skip to window\n if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();\n var elem = el;\n var gotSelf = false;\n\n do {\n // we don't need to get elem css if it isn't even overflowing in the first place (performance)\n if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {\n var elemCSS = css(elem);\n\n if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {\n if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();\n if (gotSelf || includeSelf) return elem;\n gotSelf = true;\n }\n }\n /* jshint boss:true */\n\n } while (elem = elem.parentNode);\n\n return getWindowScrollingElement();\n}\n\nfunction extend(dst, src) {\n if (dst && src) {\n for (var key in src) {\n if (src.hasOwnProperty(key)) {\n dst[key] = src[key];\n }\n }\n }\n\n return dst;\n}\n\nfunction isRectEqual(rect1, rect2) {\n return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);\n}\n\nvar _throttleTimeout;\n\nfunction throttle(callback, ms) {\n return function () {\n if (!_throttleTimeout) {\n var args = arguments,\n _this = this;\n\n if (args.length === 1) {\n callback.call(_this, args[0]);\n } else {\n callback.apply(_this, args);\n }\n\n _throttleTimeout = setTimeout(function () {\n _throttleTimeout = void 0;\n }, ms);\n }\n };\n}\n\nfunction cancelThrottle() {\n clearTimeout(_throttleTimeout);\n _throttleTimeout = void 0;\n}\n\nfunction scrollBy(el, x, y) {\n el.scrollLeft += x;\n el.scrollTop += y;\n}\n\nfunction clone(el) {\n var Polymer = window.Polymer;\n var $ = window.jQuery || window.Zepto;\n\n if (Polymer && Polymer.dom) {\n return Polymer.dom(el).cloneNode(true);\n } else if ($) {\n return $(el).clone(true)[0];\n } else {\n return el.cloneNode(true);\n }\n}\n\nfunction setRect(el, rect) {\n css(el, 'position', 'absolute');\n css(el, 'top', rect.top);\n css(el, 'left', rect.left);\n css(el, 'width', rect.width);\n css(el, 'height', rect.height);\n}\n\nfunction unsetRect(el) {\n css(el, 'position', '');\n css(el, 'top', '');\n css(el, 'left', '');\n css(el, 'width', '');\n css(el, 'height', '');\n}\n\nvar expando = 'Sortable' + new Date().getTime();\n\nfunction AnimationStateManager() {\n var animationStates = [],\n animationCallbackId;\n return {\n captureAnimationState: function captureAnimationState() {\n animationStates = [];\n if (!this.options.animation) return;\n var children = [].slice.call(this.el.children);\n children.forEach(function (child) {\n if (css(child, 'display') === 'none' || child === Sortable.ghost) return;\n animationStates.push({\n target: child,\n rect: getRect(child)\n });\n\n var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect); // If animating: compensate for current animation\n\n\n if (child.thisAnimationDuration) {\n var childMatrix = matrix(child, true);\n\n if (childMatrix) {\n fromRect.top -= childMatrix.f;\n fromRect.left -= childMatrix.e;\n }\n }\n\n child.fromRect = fromRect;\n });\n },\n addAnimationState: function addAnimationState(state) {\n animationStates.push(state);\n },\n removeAnimationState: function removeAnimationState(target) {\n animationStates.splice(indexOfObject(animationStates, {\n target: target\n }), 1);\n },\n animateAll: function animateAll(callback) {\n var _this = this;\n\n if (!this.options.animation) {\n clearTimeout(animationCallbackId);\n if (typeof callback === 'function') callback();\n return;\n }\n\n var animating = false,\n animationTime = 0;\n animationStates.forEach(function (state) {\n var time = 0,\n target = state.target,\n fromRect = target.fromRect,\n toRect = getRect(target),\n prevFromRect = target.prevFromRect,\n prevToRect = target.prevToRect,\n animatingRect = state.rect,\n targetMatrix = matrix(target, true);\n\n if (targetMatrix) {\n // Compensate for current animation\n toRect.top -= targetMatrix.f;\n toRect.left -= targetMatrix.e;\n }\n\n target.toRect = toRect;\n\n if (target.thisAnimationDuration) {\n // Could also check if animatingRect is between fromRect and toRect\n if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) && // Make sure animatingRect is on line between toRect & fromRect\n (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {\n // If returning to same place as started from animation and on same axis\n time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);\n }\n } // if fromRect != toRect: animate\n\n\n if (!isRectEqual(toRect, fromRect)) {\n target.prevFromRect = fromRect;\n target.prevToRect = toRect;\n\n if (!time) {\n time = _this.options.animation;\n }\n\n _this.animate(target, animatingRect, toRect, time);\n }\n\n if (time) {\n animating = true;\n animationTime = Math.max(animationTime, time);\n clearTimeout(target.animationResetTimer);\n target.animationResetTimer = setTimeout(function () {\n target.animationTime = 0;\n target.prevFromRect = null;\n target.fromRect = null;\n target.prevToRect = null;\n target.thisAnimationDuration = null;\n }, time);\n target.thisAnimationDuration = time;\n }\n });\n clearTimeout(animationCallbackId);\n\n if (!animating) {\n if (typeof callback === 'function') callback();\n } else {\n animationCallbackId = setTimeout(function () {\n if (typeof callback === 'function') callback();\n }, animationTime);\n }\n\n animationStates = [];\n },\n animate: function animate(target, currentRect, toRect, duration) {\n if (duration) {\n css(target, 'transition', '');\n css(target, 'transform', '');\n var elMatrix = matrix(this.el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d,\n translateX = (currentRect.left - toRect.left) / (scaleX || 1),\n translateY = (currentRect.top - toRect.top) / (scaleY || 1);\n target.animatingX = !!translateX;\n target.animatingY = !!translateY;\n css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');\n this.forRepaintDummy = repaint(target); // repaint\n\n css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));\n css(target, 'transform', 'translate3d(0,0,0)');\n typeof target.animated === 'number' && clearTimeout(target.animated);\n target.animated = setTimeout(function () {\n css(target, 'transition', '');\n css(target, 'transform', '');\n target.animated = false;\n target.animatingX = false;\n target.animatingY = false;\n }, duration);\n }\n }\n };\n}\n\nfunction repaint(target) {\n return target.offsetWidth;\n}\n\nfunction calculateRealTime(animatingRect, fromRect, toRect, options) {\n return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;\n}\n\nvar plugins = [];\nvar defaults = {\n initializeByDefault: true\n};\nvar PluginManager = {\n mount: function mount(plugin) {\n // Set default static properties\n for (var option in defaults) {\n if (defaults.hasOwnProperty(option) && !(option in plugin)) {\n plugin[option] = defaults[option];\n }\n }\n\n plugins.forEach(function (p) {\n if (p.pluginName === plugin.pluginName) {\n throw \"Sortable: Cannot mount plugin \".concat(plugin.pluginName, \" more than once\");\n }\n });\n plugins.push(plugin);\n },\n pluginEvent: function pluginEvent(eventName, sortable, evt) {\n var _this = this;\n\n this.eventCanceled = false;\n\n evt.cancel = function () {\n _this.eventCanceled = true;\n };\n\n var eventNameGlobal = eventName + 'Global';\n plugins.forEach(function (plugin) {\n if (!sortable[plugin.pluginName]) return; // Fire global events if it exists in this sortable\n\n if (sortable[plugin.pluginName][eventNameGlobal]) {\n sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({\n sortable: sortable\n }, evt));\n } // Only fire plugin event if plugin is enabled in this sortable,\n // and plugin has event defined\n\n\n if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {\n sortable[plugin.pluginName][eventName](_objectSpread2({\n sortable: sortable\n }, evt));\n }\n });\n },\n initializePlugins: function initializePlugins(sortable, el, defaults, options) {\n plugins.forEach(function (plugin) {\n var pluginName = plugin.pluginName;\n if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;\n var initialized = new plugin(sortable, el, sortable.options);\n initialized.sortable = sortable;\n initialized.options = sortable.options;\n sortable[pluginName] = initialized; // Add default options from plugin\n\n _extends(defaults, initialized.defaults);\n });\n\n for (var option in sortable.options) {\n if (!sortable.options.hasOwnProperty(option)) continue;\n var modified = this.modifyOption(sortable, option, sortable.options[option]);\n\n if (typeof modified !== 'undefined') {\n sortable.options[option] = modified;\n }\n }\n },\n getEventProperties: function getEventProperties(name, sortable) {\n var eventProperties = {};\n plugins.forEach(function (plugin) {\n if (typeof plugin.eventProperties !== 'function') return;\n\n _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));\n });\n return eventProperties;\n },\n modifyOption: function modifyOption(sortable, name, value) {\n var modifiedValue;\n plugins.forEach(function (plugin) {\n // Plugin must exist on the Sortable\n if (!sortable[plugin.pluginName]) return; // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin\n\n if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {\n modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);\n }\n });\n return modifiedValue;\n }\n};\n\nfunction dispatchEvent(_ref) {\n var sortable = _ref.sortable,\n rootEl = _ref.rootEl,\n name = _ref.name,\n targetEl = _ref.targetEl,\n cloneEl = _ref.cloneEl,\n toEl = _ref.toEl,\n fromEl = _ref.fromEl,\n oldIndex = _ref.oldIndex,\n newIndex = _ref.newIndex,\n oldDraggableIndex = _ref.oldDraggableIndex,\n newDraggableIndex = _ref.newDraggableIndex,\n originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n extraEventProperties = _ref.extraEventProperties;\n sortable = sortable || rootEl && rootEl[expando];\n if (!sortable) return;\n var evt,\n options = sortable.options,\n onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1); // Support for new CustomEvent feature\n\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent(name, {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent(name, true, true);\n }\n\n evt.to = toEl || rootEl;\n evt.from = fromEl || rootEl;\n evt.item = targetEl || rootEl;\n evt.clone = cloneEl;\n evt.oldIndex = oldIndex;\n evt.newIndex = newIndex;\n evt.oldDraggableIndex = oldDraggableIndex;\n evt.newDraggableIndex = newDraggableIndex;\n evt.originalEvent = originalEvent;\n evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;\n\n var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));\n\n for (var option in allEventProperties) {\n evt[option] = allEventProperties[option];\n }\n\n if (rootEl) {\n rootEl.dispatchEvent(evt);\n }\n\n if (options[onName]) {\n options[onName].call(sortable, evt);\n }\n}\n\nvar _excluded = [\"evt\"];\n\nvar pluginEvent = function pluginEvent(eventName, sortable) {\n var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n originalEvent = _ref.evt,\n data = _objectWithoutProperties(_ref, _excluded);\n\n PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({\n dragEl: dragEl,\n parentEl: parentEl,\n ghostEl: ghostEl,\n rootEl: rootEl,\n nextEl: nextEl,\n lastDownEl: lastDownEl,\n cloneEl: cloneEl,\n cloneHidden: cloneHidden,\n dragStarted: moved,\n putSortable: putSortable,\n activeSortable: Sortable.active,\n originalEvent: originalEvent,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n hideGhostForTarget: _hideGhostForTarget,\n unhideGhostForTarget: _unhideGhostForTarget,\n cloneNowHidden: function cloneNowHidden() {\n cloneHidden = true;\n },\n cloneNowShown: function cloneNowShown() {\n cloneHidden = false;\n },\n dispatchSortableEvent: function dispatchSortableEvent(name) {\n _dispatchEvent({\n sortable: sortable,\n name: name,\n originalEvent: originalEvent\n });\n }\n }, data));\n};\n\nfunction _dispatchEvent(info) {\n dispatchEvent(_objectSpread2({\n putSortable: putSortable,\n cloneEl: cloneEl,\n targetEl: dragEl,\n rootEl: rootEl,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex\n }, info));\n}\n\nvar dragEl,\n parentEl,\n ghostEl,\n rootEl,\n nextEl,\n lastDownEl,\n cloneEl,\n cloneHidden,\n oldIndex,\n newIndex,\n oldDraggableIndex,\n newDraggableIndex,\n activeGroup,\n putSortable,\n awaitingDragStarted = false,\n ignoreNextClick = false,\n sortables = [],\n tapEvt,\n touchEvt,\n lastDx,\n lastDy,\n tapDistanceLeft,\n tapDistanceTop,\n moved,\n lastTarget,\n lastDirection,\n pastFirstInvertThresh = false,\n isCircumstantialInvert = false,\n targetMoveDistance,\n // For positioning ghost absolutely\nghostRelativeParent,\n ghostRelativeParentInitialScroll = [],\n // (left, top)\n_silent = false,\n savedInputChecked = [];\n/** @const */\n\nvar documentExists = typeof document !== 'undefined',\n PositionGhostAbsolutely = IOS,\n CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',\n // This will not pass for IE9, because IE9 DnD only works on anchors\nsupportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),\n supportCssPointerEvents = function () {\n if (!documentExists) return; // false when <= IE11\n\n if (IE11OrLess) {\n return false;\n }\n\n var el = document.createElement('x');\n el.style.cssText = 'pointer-events:auto';\n return el.style.pointerEvents === 'auto';\n}(),\n _detectDirection = function _detectDirection(el, options) {\n var elCSS = css(el),\n elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),\n child1 = getChild(el, 0, options),\n child2 = getChild(el, 1, options),\n firstChildCSS = child1 && css(child1),\n secondChildCSS = child2 && css(child2),\n firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,\n secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;\n\n if (elCSS.display === 'flex') {\n return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';\n }\n\n if (elCSS.display === 'grid') {\n return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';\n }\n\n if (child1 && firstChildCSS[\"float\"] && firstChildCSS[\"float\"] !== 'none') {\n var touchingSideChild2 = firstChildCSS[\"float\"] === 'left' ? 'left' : 'right';\n return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';\n }\n\n return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';\n},\n _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {\n var dragElS1Opp = vertical ? dragRect.left : dragRect.top,\n dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,\n dragElOppLength = vertical ? dragRect.width : dragRect.height,\n targetS1Opp = vertical ? targetRect.left : targetRect.top,\n targetS2Opp = vertical ? targetRect.right : targetRect.bottom,\n targetOppLength = vertical ? targetRect.width : targetRect.height;\n return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;\n},\n\n/**\r\n * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.\r\n * @param {Number} x X position\r\n * @param {Number} y Y position\r\n * @return {HTMLElement} Element of the first found nearest Sortable\r\n */\n_detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {\n var ret;\n sortables.some(function (sortable) {\n var threshold = sortable[expando].options.emptyInsertThreshold;\n if (!threshold || lastChild(sortable)) return;\n var rect = getRect(sortable),\n insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,\n insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;\n\n if (insideHorizontally && insideVertically) {\n return ret = sortable;\n }\n });\n return ret;\n},\n _prepareGroup = function _prepareGroup(options) {\n function toFn(value, pull) {\n return function (to, from, dragEl, evt) {\n var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;\n\n if (value == null && (pull || sameGroup)) {\n // Default pull value\n // Default pull and put value if same group\n return true;\n } else if (value == null || value === false) {\n return false;\n } else if (pull && value === 'clone') {\n return value;\n } else if (typeof value === 'function') {\n return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);\n } else {\n var otherGroup = (pull ? to : from).options.group.name;\n return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;\n }\n };\n }\n\n var group = {};\n var originalGroup = options.group;\n\n if (!originalGroup || _typeof(originalGroup) != 'object') {\n originalGroup = {\n name: originalGroup\n };\n }\n\n group.name = originalGroup.name;\n group.checkPull = toFn(originalGroup.pull, true);\n group.checkPut = toFn(originalGroup.put);\n group.revertClone = originalGroup.revertClone;\n options.group = group;\n},\n _hideGhostForTarget = function _hideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', 'none');\n }\n},\n _unhideGhostForTarget = function _unhideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', '');\n }\n}; // #1184 fix - Prevent click event on fallback if dragged but item not changed position\n\n\nif (documentExists && !ChromeForAndroid) {\n document.addEventListener('click', function (evt) {\n if (ignoreNextClick) {\n evt.preventDefault();\n evt.stopPropagation && evt.stopPropagation();\n evt.stopImmediatePropagation && evt.stopImmediatePropagation();\n ignoreNextClick = false;\n return false;\n }\n }, true);\n}\n\nvar nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {\n if (dragEl) {\n evt = evt.touches ? evt.touches[0] : evt;\n\n var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);\n\n if (nearest) {\n // Create imitation event\n var event = {};\n\n for (var i in evt) {\n if (evt.hasOwnProperty(i)) {\n event[i] = evt[i];\n }\n }\n\n event.target = event.rootEl = nearest;\n event.preventDefault = void 0;\n event.stopPropagation = void 0;\n\n nearest[expando]._onDragOver(event);\n }\n }\n};\n\nvar _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {\n if (dragEl) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n }\n};\n/**\r\n * @class Sortable\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */\n\n\nfunction Sortable(el, options) {\n if (!(el && el.nodeType && el.nodeType === 1)) {\n throw \"Sortable: `el` must be an HTMLElement, not \".concat({}.toString.call(el));\n }\n\n this.el = el; // root element\n\n this.options = options = _extends({}, options); // Export instance\n\n el[expando] = this;\n var defaults = {\n group: null,\n sort: true,\n disabled: false,\n store: null,\n handle: null,\n draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',\n swapThreshold: 1,\n // percentage; 0 <= x <= 1\n invertSwap: false,\n // invert always\n invertedSwapThreshold: null,\n // will be set to same as swapThreshold if default\n removeCloneOnHide: true,\n direction: function direction() {\n return _detectDirection(el, this.options);\n },\n ghostClass: 'sortable-ghost',\n chosenClass: 'sortable-chosen',\n dragClass: 'sortable-drag',\n ignore: 'a, img',\n filter: null,\n preventOnFilter: true,\n animation: 0,\n easing: null,\n setData: function setData(dataTransfer, dragEl) {\n dataTransfer.setData('Text', dragEl.textContent);\n },\n dropBubble: false,\n dragoverBubble: false,\n dataIdAttr: 'data-id',\n delay: 0,\n delayOnTouchOnly: false,\n touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,\n forceFallback: false,\n fallbackClass: 'sortable-fallback',\n fallbackOnBody: false,\n fallbackTolerance: 0,\n fallbackOffset: {\n x: 0,\n y: 0\n },\n supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari,\n emptyInsertThreshold: 5\n };\n PluginManager.initializePlugins(this, el, defaults); // Set default options\n\n for (var name in defaults) {\n !(name in options) && (options[name] = defaults[name]);\n }\n\n _prepareGroup(options); // Bind all private methods\n\n\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n } // Setup drag mode\n\n\n this.nativeDraggable = options.forceFallback ? false : supportDraggable;\n\n if (this.nativeDraggable) {\n // Touch start threshold cannot be greater than the native dragstart threshold\n this.options.touchStartThreshold = 1;\n } // Bind events\n\n\n if (options.supportPointer) {\n on(el, 'pointerdown', this._onTapStart);\n } else {\n on(el, 'mousedown', this._onTapStart);\n on(el, 'touchstart', this._onTapStart);\n }\n\n if (this.nativeDraggable) {\n on(el, 'dragover', this);\n on(el, 'dragenter', this);\n }\n\n sortables.push(this.el); // Restore sorting\n\n options.store && options.store.get && this.sort(options.store.get(this) || []); // Add animation state manager\n\n _extends(this, AnimationStateManager());\n}\n\nSortable.prototype =\n/** @lends Sortable.prototype */\n{\n constructor: Sortable,\n _isOutsideThisEl: function _isOutsideThisEl(target) {\n if (!this.el.contains(target) && target !== this.el) {\n lastTarget = null;\n }\n },\n _getDirection: function _getDirection(evt, target) {\n return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;\n },\n _onTapStart: function _onTapStart(\n /** Event|TouchEvent */\n evt) {\n if (!evt.cancelable) return;\n\n var _this = this,\n el = this.el,\n options = this.options,\n preventOnFilter = options.preventOnFilter,\n type = evt.type,\n touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,\n target = (touch || evt).target,\n originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,\n filter = options.filter;\n\n _saveInputCheckedState(el); // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.\n\n\n if (dragEl) {\n return;\n }\n\n if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {\n return; // only left button and enabled\n } // cancel dnd if original target is content editable\n\n\n if (originalTarget.isContentEditable) {\n return;\n } // Safari ignores further event handling after mousedown\n\n\n if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {\n return;\n }\n\n target = closest(target, options.draggable, el, false);\n\n if (target && target.animated) {\n return;\n }\n\n if (lastDownEl === target) {\n // Ignoring duplicate `down`\n return;\n } // Get the index of the dragged element within its parent\n\n\n oldIndex = index(target);\n oldDraggableIndex = index(target, options.draggable); // Check filter\n\n if (typeof filter === 'function') {\n if (filter.call(this, evt, target, this)) {\n _dispatchEvent({\n sortable: _this,\n rootEl: originalTarget,\n name: 'filter',\n targetEl: target,\n toEl: el,\n fromEl: el\n });\n\n pluginEvent('filter', _this, {\n evt: evt\n });\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n } else if (filter) {\n filter = filter.split(',').some(function (criteria) {\n criteria = closest(originalTarget, criteria.trim(), el, false);\n\n if (criteria) {\n _dispatchEvent({\n sortable: _this,\n rootEl: criteria,\n name: 'filter',\n targetEl: target,\n fromEl: el,\n toEl: el\n });\n\n pluginEvent('filter', _this, {\n evt: evt\n });\n return true;\n }\n });\n\n if (filter) {\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n }\n\n if (options.handle && !closest(originalTarget, options.handle, el, false)) {\n return;\n } // Prepare `dragstart`\n\n\n this._prepareDragStart(evt, touch, target);\n },\n _prepareDragStart: function _prepareDragStart(\n /** Event */\n evt,\n /** Touch */\n touch,\n /** HTMLElement */\n target) {\n var _this = this,\n el = _this.el,\n options = _this.options,\n ownerDocument = el.ownerDocument,\n dragStartFn;\n\n if (target && !dragEl && target.parentNode === el) {\n var dragRect = getRect(target);\n rootEl = el;\n dragEl = target;\n parentEl = dragEl.parentNode;\n nextEl = dragEl.nextSibling;\n lastDownEl = target;\n activeGroup = options.group;\n Sortable.dragged = dragEl;\n tapEvt = {\n target: dragEl,\n clientX: (touch || evt).clientX,\n clientY: (touch || evt).clientY\n };\n tapDistanceLeft = tapEvt.clientX - dragRect.left;\n tapDistanceTop = tapEvt.clientY - dragRect.top;\n this._lastX = (touch || evt).clientX;\n this._lastY = (touch || evt).clientY;\n dragEl.style['will-change'] = 'all';\n\n dragStartFn = function dragStartFn() {\n pluginEvent('delayEnded', _this, {\n evt: evt\n });\n\n if (Sortable.eventCanceled) {\n _this._onDrop();\n\n return;\n } // Delayed drag has been triggered\n // we can re-enable the events: touchmove/mousemove\n\n\n _this._disableDelayedDragEvents();\n\n if (!FireFox && _this.nativeDraggable) {\n dragEl.draggable = true;\n } // Bind the events: dragstart/dragend\n\n\n _this._triggerDragStart(evt, touch); // Drag start event\n\n\n _dispatchEvent({\n sortable: _this,\n name: 'choose',\n originalEvent: evt\n }); // Chosen item\n\n\n toggleClass(dragEl, options.chosenClass, true);\n }; // Disable \"draggable\"\n\n\n options.ignore.split(',').forEach(function (criteria) {\n find(dragEl, criteria.trim(), _disableDraggable);\n });\n on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mouseup', _this._onDrop);\n on(ownerDocument, 'touchend', _this._onDrop);\n on(ownerDocument, 'touchcancel', _this._onDrop); // Make dragEl draggable (must be before delay for FireFox)\n\n if (FireFox && this.nativeDraggable) {\n this.options.touchStartThreshold = 4;\n dragEl.draggable = true;\n }\n\n pluginEvent('delayStart', this, {\n evt: evt\n }); // Delay is impossible for native DnD in Edge or IE\n\n if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {\n if (Sortable.eventCanceled) {\n this._onDrop();\n\n return;\n } // If the user moves the pointer or let go the click or touch\n // before the delay has been reached:\n // disable the delayed drag\n\n\n on(ownerDocument, 'mouseup', _this._disableDelayedDrag);\n on(ownerDocument, 'touchend', _this._disableDelayedDrag);\n on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);\n on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);\n on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);\n options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);\n _this._dragStartTimer = setTimeout(dragStartFn, options.delay);\n } else {\n dragStartFn();\n }\n }\n },\n _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler(\n /** TouchEvent|PointerEvent **/\n e) {\n var touch = e.touches ? e.touches[0] : e;\n\n if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {\n this._disableDelayedDrag();\n }\n },\n _disableDelayedDrag: function _disableDelayedDrag() {\n dragEl && _disableDraggable(dragEl);\n clearTimeout(this._dragStartTimer);\n\n this._disableDelayedDragEvents();\n },\n _disableDelayedDragEvents: function _disableDelayedDragEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._disableDelayedDrag);\n off(ownerDocument, 'touchend', this._disableDelayedDrag);\n off(ownerDocument, 'touchcancel', this._disableDelayedDrag);\n off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);\n },\n _triggerDragStart: function _triggerDragStart(\n /** Event */\n evt,\n /** Touch */\n touch) {\n touch = touch || evt.pointerType == 'touch' && evt;\n\n if (!this.nativeDraggable || touch) {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._onTouchMove);\n } else if (touch) {\n on(document, 'touchmove', this._onTouchMove);\n } else {\n on(document, 'mousemove', this._onTouchMove);\n }\n } else {\n on(dragEl, 'dragend', this);\n on(rootEl, 'dragstart', this._onDragStart);\n }\n\n try {\n if (document.selection) {\n // Timeout neccessary for IE9\n _nextTick(function () {\n document.selection.empty();\n });\n } else {\n window.getSelection().removeAllRanges();\n }\n } catch (err) {}\n },\n _dragStarted: function _dragStarted(fallback, evt) {\n\n awaitingDragStarted = false;\n\n if (rootEl && dragEl) {\n pluginEvent('dragStarted', this, {\n evt: evt\n });\n\n if (this.nativeDraggable) {\n on(document, 'dragover', _checkOutsideTargetEl);\n }\n\n var options = this.options; // Apply effect\n\n !fallback && toggleClass(dragEl, options.dragClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n Sortable.active = this;\n fallback && this._appendGhost(); // Drag start event\n\n _dispatchEvent({\n sortable: this,\n name: 'start',\n originalEvent: evt\n });\n } else {\n this._nulling();\n }\n },\n _emulateDragOver: function _emulateDragOver() {\n if (touchEvt) {\n this._lastX = touchEvt.clientX;\n this._lastY = touchEvt.clientY;\n\n _hideGhostForTarget();\n\n var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n var parent = target;\n\n while (target && target.shadowRoot) {\n target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n if (target === parent) break;\n parent = target;\n }\n\n dragEl.parentNode[expando]._isOutsideThisEl(target);\n\n if (parent) {\n do {\n if (parent[expando]) {\n var inserted = void 0;\n inserted = parent[expando]._onDragOver({\n clientX: touchEvt.clientX,\n clientY: touchEvt.clientY,\n target: target,\n rootEl: parent\n });\n\n if (inserted && !this.options.dragoverBubble) {\n break;\n }\n }\n\n target = parent; // store last element\n }\n /* jshint boss:true */\n while (parent = parent.parentNode);\n }\n\n _unhideGhostForTarget();\n }\n },\n _onTouchMove: function _onTouchMove(\n /**TouchEvent*/\n evt) {\n if (tapEvt) {\n var options = this.options,\n fallbackTolerance = options.fallbackTolerance,\n fallbackOffset = options.fallbackOffset,\n touch = evt.touches ? evt.touches[0] : evt,\n ghostMatrix = ghostEl && matrix(ghostEl, true),\n scaleX = ghostEl && ghostMatrix && ghostMatrix.a,\n scaleY = ghostEl && ghostMatrix && ghostMatrix.d,\n relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),\n dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),\n dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1); // only set the status to dragging, when we are actually dragging\n\n if (!Sortable.active && !awaitingDragStarted) {\n if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {\n return;\n }\n\n this._onDragStart(evt, true);\n }\n\n if (ghostEl) {\n if (ghostMatrix) {\n ghostMatrix.e += dx - (lastDx || 0);\n ghostMatrix.f += dy - (lastDy || 0);\n } else {\n ghostMatrix = {\n a: 1,\n b: 0,\n c: 0,\n d: 1,\n e: dx,\n f: dy\n };\n }\n\n var cssMatrix = \"matrix(\".concat(ghostMatrix.a, \",\").concat(ghostMatrix.b, \",\").concat(ghostMatrix.c, \",\").concat(ghostMatrix.d, \",\").concat(ghostMatrix.e, \",\").concat(ghostMatrix.f, \")\");\n css(ghostEl, 'webkitTransform', cssMatrix);\n css(ghostEl, 'mozTransform', cssMatrix);\n css(ghostEl, 'msTransform', cssMatrix);\n css(ghostEl, 'transform', cssMatrix);\n lastDx = dx;\n lastDy = dy;\n touchEvt = touch;\n }\n\n evt.cancelable && evt.preventDefault();\n }\n },\n _appendGhost: function _appendGhost() {\n // Bug if using scale(): https://stackoverflow.com/questions/2637058\n // Not being adjusted for\n if (!ghostEl) {\n var container = this.options.fallbackOnBody ? document.body : rootEl,\n rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),\n options = this.options; // Position absolutely\n\n if (PositionGhostAbsolutely) {\n // Get relatively positioned parent\n ghostRelativeParent = container;\n\n while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {\n ghostRelativeParent = ghostRelativeParent.parentNode;\n }\n\n if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {\n if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();\n rect.top += ghostRelativeParent.scrollTop;\n rect.left += ghostRelativeParent.scrollLeft;\n } else {\n ghostRelativeParent = getWindowScrollingElement();\n }\n\n ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);\n }\n\n ghostEl = dragEl.cloneNode(true);\n toggleClass(ghostEl, options.ghostClass, false);\n toggleClass(ghostEl, options.fallbackClass, true);\n toggleClass(ghostEl, options.dragClass, true);\n css(ghostEl, 'transition', '');\n css(ghostEl, 'transform', '');\n css(ghostEl, 'box-sizing', 'border-box');\n css(ghostEl, 'margin', 0);\n css(ghostEl, 'top', rect.top);\n css(ghostEl, 'left', rect.left);\n css(ghostEl, 'width', rect.width);\n css(ghostEl, 'height', rect.height);\n css(ghostEl, 'opacity', '0.8');\n css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');\n css(ghostEl, 'zIndex', '100000');\n css(ghostEl, 'pointerEvents', 'none');\n Sortable.ghost = ghostEl;\n container.appendChild(ghostEl); // Set transform-origin\n\n css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');\n }\n },\n _onDragStart: function _onDragStart(\n /**Event*/\n evt,\n /**boolean*/\n fallback) {\n var _this = this;\n\n var dataTransfer = evt.dataTransfer;\n var options = _this.options;\n pluginEvent('dragStart', this, {\n evt: evt\n });\n\n if (Sortable.eventCanceled) {\n this._onDrop();\n\n return;\n }\n\n pluginEvent('setupClone', this);\n\n if (!Sortable.eventCanceled) {\n cloneEl = clone(dragEl);\n cloneEl.removeAttribute(\"id\");\n cloneEl.draggable = false;\n cloneEl.style['will-change'] = '';\n\n this._hideClone();\n\n toggleClass(cloneEl, this.options.chosenClass, false);\n Sortable.clone = cloneEl;\n } // #1143: IFrame support workaround\n\n\n _this.cloneId = _nextTick(function () {\n pluginEvent('clone', _this);\n if (Sortable.eventCanceled) return;\n\n if (!_this.options.removeCloneOnHide) {\n rootEl.insertBefore(cloneEl, dragEl);\n }\n\n _this._hideClone();\n\n _dispatchEvent({\n sortable: _this,\n name: 'clone'\n });\n });\n !fallback && toggleClass(dragEl, options.dragClass, true); // Set proper drop events\n\n if (fallback) {\n ignoreNextClick = true;\n _this._loopId = setInterval(_this._emulateDragOver, 50);\n } else {\n // Undo what was set in _prepareDragStart before drag started\n off(document, 'mouseup', _this._onDrop);\n off(document, 'touchend', _this._onDrop);\n off(document, 'touchcancel', _this._onDrop);\n\n if (dataTransfer) {\n dataTransfer.effectAllowed = 'move';\n options.setData && options.setData.call(_this, dataTransfer, dragEl);\n }\n\n on(document, 'drop', _this); // #1276 fix:\n\n css(dragEl, 'transform', 'translateZ(0)');\n }\n\n awaitingDragStarted = true;\n _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));\n on(document, 'selectstart', _this);\n moved = true;\n\n if (Safari) {\n css(document.body, 'user-select', 'none');\n }\n },\n // Returns true - if no further action is needed (either inserted or another condition)\n _onDragOver: function _onDragOver(\n /**Event*/\n evt) {\n var el = this.el,\n target = evt.target,\n dragRect,\n targetRect,\n revert,\n options = this.options,\n group = options.group,\n activeSortable = Sortable.active,\n isOwner = activeGroup === group,\n canSort = options.sort,\n fromSortable = putSortable || activeSortable,\n vertical,\n _this = this,\n completedFired = false;\n\n if (_silent) return;\n\n function dragOverEvent(name, extra) {\n pluginEvent(name, _this, _objectSpread2({\n evt: evt,\n isOwner: isOwner,\n axis: vertical ? 'vertical' : 'horizontal',\n revert: revert,\n dragRect: dragRect,\n targetRect: targetRect,\n canSort: canSort,\n fromSortable: fromSortable,\n target: target,\n completed: completed,\n onMove: function onMove(target, after) {\n return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);\n },\n changed: changed\n }, extra));\n } // Capture animation state\n\n\n function capture() {\n dragOverEvent('dragOverAnimationCapture');\n\n _this.captureAnimationState();\n\n if (_this !== fromSortable) {\n fromSortable.captureAnimationState();\n }\n } // Return invocation when dragEl is inserted (or completed)\n\n\n function completed(insertion) {\n dragOverEvent('dragOverCompleted', {\n insertion: insertion\n });\n\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n } else {\n activeSortable._showClone(_this);\n }\n\n if (_this !== fromSortable) {\n // Set ghost class to new sortable's ghost class\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n }\n\n if (putSortable !== _this && _this !== Sortable.active) {\n putSortable = _this;\n } else if (_this === Sortable.active && putSortable) {\n putSortable = null;\n } // Animation\n\n\n if (fromSortable === _this) {\n _this._ignoreWhileAnimating = target;\n }\n\n _this.animateAll(function () {\n dragOverEvent('dragOverAnimationComplete');\n _this._ignoreWhileAnimating = null;\n });\n\n if (_this !== fromSortable) {\n fromSortable.animateAll();\n fromSortable._ignoreWhileAnimating = null;\n }\n } // Null lastTarget if it is not inside a previously swapped element\n\n\n if (target === dragEl && !dragEl.animated || target === el && !target.animated) {\n lastTarget = null;\n } // no bubbling and not fallback\n\n\n if (!options.dragoverBubble && !evt.rootEl && target !== document) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target); // Do not detect for empty insert if already inserted\n\n\n !insertion && nearestEmptyInsertDetectEvent(evt);\n }\n\n !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();\n return completedFired = true;\n } // Call when dragEl has been inserted\n\n\n function changed() {\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n\n _dispatchEvent({\n sortable: _this,\n name: 'change',\n toEl: el,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n originalEvent: evt\n });\n }\n\n if (evt.preventDefault !== void 0) {\n evt.cancelable && evt.preventDefault();\n }\n\n target = closest(target, options.draggable, el, true);\n dragOverEvent('dragOver');\n if (Sortable.eventCanceled) return completedFired;\n\n if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {\n return completed(false);\n }\n\n ignoreNextClick = false;\n\n if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list\n : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {\n vertical = this._getDirection(evt, target) === 'vertical';\n dragRect = getRect(dragEl);\n dragOverEvent('dragOverValid');\n if (Sortable.eventCanceled) return completedFired;\n\n if (revert) {\n parentEl = rootEl; // actualization\n\n capture();\n\n this._hideClone();\n\n dragOverEvent('revert');\n\n if (!Sortable.eventCanceled) {\n if (nextEl) {\n rootEl.insertBefore(dragEl, nextEl);\n } else {\n rootEl.appendChild(dragEl);\n }\n }\n\n return completed(true);\n }\n\n var elLastChild = lastChild(el, options.draggable);\n\n if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {\n // Insert to end of list\n // If already at end of list: Do not insert\n if (elLastChild === dragEl) {\n return completed(false);\n } // if there is a last element, it is the target\n\n\n if (elLastChild && el === evt.target) {\n target = elLastChild;\n }\n\n if (target) {\n targetRect = getRect(target);\n }\n\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {\n capture();\n\n if (elLastChild && elLastChild.nextSibling) {\n // the last draggable element is not the last node\n el.insertBefore(dragEl, elLastChild.nextSibling);\n } else {\n el.appendChild(dragEl);\n }\n\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {\n // Insert to start of list\n var firstChild = getChild(el, 0, options, true);\n\n if (firstChild === dragEl) {\n return completed(false);\n }\n\n target = firstChild;\n targetRect = getRect(target);\n\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {\n capture();\n el.insertBefore(dragEl, firstChild);\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (target.parentNode === el) {\n targetRect = getRect(target);\n var direction = 0,\n targetBeforeFirstSwap,\n differentLevel = dragEl.parentNode !== el,\n differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),\n side1 = vertical ? 'top' : 'left',\n scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),\n scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;\n\n if (lastTarget !== target) {\n targetBeforeFirstSwap = targetRect[side1];\n pastFirstInvertThresh = false;\n isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;\n }\n\n direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);\n var sibling;\n\n if (direction !== 0) {\n // Check if target is beside dragEl in respective direction (ignoring hidden elements)\n var dragIndex = index(dragEl);\n\n do {\n dragIndex -= direction;\n sibling = parentEl.children[dragIndex];\n } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));\n } // If dragEl is already beside target: Do not insert\n\n\n if (direction === 0 || sibling === target) {\n return completed(false);\n }\n\n lastTarget = target;\n lastDirection = direction;\n var nextSibling = target.nextElementSibling,\n after = false;\n after = direction === 1;\n\n var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);\n\n if (moveVector !== false) {\n if (moveVector === 1 || moveVector === -1) {\n after = moveVector === 1;\n }\n\n _silent = true;\n setTimeout(_unsilent, 30);\n capture();\n\n if (after && !nextSibling) {\n el.appendChild(dragEl);\n } else {\n target.parentNode.insertBefore(dragEl, after ? nextSibling : target);\n } // Undo chrome's scroll adjustment (has no effect on other browsers)\n\n\n if (scrolledPastTop) {\n scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);\n }\n\n parentEl = dragEl.parentNode; // actualization\n // must be done before animation\n\n if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {\n targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);\n }\n\n changed();\n return completed(true);\n }\n }\n\n if (el.contains(dragEl)) {\n return completed(false);\n }\n }\n\n return false;\n },\n _ignoreWhileAnimating: null,\n _offMoveEvents: function _offMoveEvents() {\n off(document, 'mousemove', this._onTouchMove);\n off(document, 'touchmove', this._onTouchMove);\n off(document, 'pointermove', this._onTouchMove);\n off(document, 'dragover', nearestEmptyInsertDetectEvent);\n off(document, 'mousemove', nearestEmptyInsertDetectEvent);\n off(document, 'touchmove', nearestEmptyInsertDetectEvent);\n },\n _offUpEvents: function _offUpEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._onDrop);\n off(ownerDocument, 'touchend', this._onDrop);\n off(ownerDocument, 'pointerup', this._onDrop);\n off(ownerDocument, 'touchcancel', this._onDrop);\n off(document, 'selectstart', this);\n },\n _onDrop: function _onDrop(\n /**Event*/\n evt) {\n var el = this.el,\n options = this.options; // Get the index of the dragged element within its parent\n\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n pluginEvent('drop', this, {\n evt: evt\n });\n parentEl = dragEl && dragEl.parentNode; // Get again after plugin event\n\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n\n if (Sortable.eventCanceled) {\n this._nulling();\n\n return;\n }\n\n awaitingDragStarted = false;\n isCircumstantialInvert = false;\n pastFirstInvertThresh = false;\n clearInterval(this._loopId);\n clearTimeout(this._dragStartTimer);\n\n _cancelNextTick(this.cloneId);\n\n _cancelNextTick(this._dragStartId); // Unbind events\n\n\n if (this.nativeDraggable) {\n off(document, 'drop', this);\n off(el, 'dragstart', this._onDragStart);\n }\n\n this._offMoveEvents();\n\n this._offUpEvents();\n\n if (Safari) {\n css(document.body, 'user-select', '');\n }\n\n css(dragEl, 'transform', '');\n\n if (evt) {\n if (moved) {\n evt.cancelable && evt.preventDefault();\n !options.dropBubble && evt.stopPropagation();\n }\n\n ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);\n\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n // Remove clone(s)\n cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);\n }\n\n if (dragEl) {\n if (this.nativeDraggable) {\n off(dragEl, 'dragend', this);\n }\n\n _disableDraggable(dragEl);\n\n dragEl.style['will-change'] = ''; // Remove classes\n // ghostClass is added in dragStarted\n\n if (moved && !awaitingDragStarted) {\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);\n }\n\n toggleClass(dragEl, this.options.chosenClass, false); // Drag stop event\n\n _dispatchEvent({\n sortable: this,\n name: 'unchoose',\n toEl: parentEl,\n newIndex: null,\n newDraggableIndex: null,\n originalEvent: evt\n });\n\n if (rootEl !== parentEl) {\n if (newIndex >= 0) {\n // Add event\n _dispatchEvent({\n rootEl: parentEl,\n name: 'add',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n }); // Remove event\n\n\n _dispatchEvent({\n sortable: this,\n name: 'remove',\n toEl: parentEl,\n originalEvent: evt\n }); // drag from one list and drop into another\n\n\n _dispatchEvent({\n rootEl: parentEl,\n name: 'sort',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n });\n\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n\n putSortable && putSortable.save();\n } else {\n if (newIndex !== oldIndex) {\n if (newIndex >= 0) {\n // drag & drop within the same list\n _dispatchEvent({\n sortable: this,\n name: 'update',\n toEl: parentEl,\n originalEvent: evt\n });\n\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n }\n }\n\n if (Sortable.active) {\n /* jshint eqnull:true */\n if (newIndex == null || newIndex === -1) {\n newIndex = oldIndex;\n newDraggableIndex = oldDraggableIndex;\n }\n\n _dispatchEvent({\n sortable: this,\n name: 'end',\n toEl: parentEl,\n originalEvent: evt\n }); // Save sorting\n\n\n this.save();\n }\n }\n }\n\n this._nulling();\n },\n _nulling: function _nulling() {\n pluginEvent('nulling', this);\n rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;\n savedInputChecked.forEach(function (el) {\n el.checked = true;\n });\n savedInputChecked.length = lastDx = lastDy = 0;\n },\n handleEvent: function handleEvent(\n /**Event*/\n evt) {\n switch (evt.type) {\n case 'drop':\n case 'dragend':\n this._onDrop(evt);\n\n break;\n\n case 'dragenter':\n case 'dragover':\n if (dragEl) {\n this._onDragOver(evt);\n\n _globalDragOver(evt);\n }\n\n break;\n\n case 'selectstart':\n evt.preventDefault();\n break;\n }\n },\n\n /**\r\n * Serializes the item into an array of string.\r\n * @returns {String[]}\r\n */\n toArray: function toArray() {\n var order = [],\n el,\n children = this.el.children,\n i = 0,\n n = children.length,\n options = this.options;\n\n for (; i < n; i++) {\n el = children[i];\n\n if (closest(el, options.draggable, this.el, false)) {\n order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));\n }\n }\n\n return order;\n },\n\n /**\r\n * Sorts the elements according to the array.\r\n * @param {String[]} order order of the items\r\n */\n sort: function sort(order, useAnimation) {\n var items = {},\n rootEl = this.el;\n this.toArray().forEach(function (id, i) {\n var el = rootEl.children[i];\n\n if (closest(el, this.options.draggable, rootEl, false)) {\n items[id] = el;\n }\n }, this);\n useAnimation && this.captureAnimationState();\n order.forEach(function (id) {\n if (items[id]) {\n rootEl.removeChild(items[id]);\n rootEl.appendChild(items[id]);\n }\n });\n useAnimation && this.animateAll();\n },\n\n /**\r\n * Save the current sorting\r\n */\n save: function save() {\n var store = this.options.store;\n store && store.set && store.set(this);\n },\n\n /**\r\n * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.\r\n * @param {HTMLElement} el\r\n * @param {String} [selector] default: `options.draggable`\r\n * @returns {HTMLElement|null}\r\n */\n closest: function closest$1(el, selector) {\n return closest(el, selector || this.options.draggable, this.el, false);\n },\n\n /**\r\n * Set/get option\r\n * @param {string} name\r\n * @param {*} [value]\r\n * @returns {*}\r\n */\n option: function option(name, value) {\n var options = this.options;\n\n if (value === void 0) {\n return options[name];\n } else {\n var modifiedValue = PluginManager.modifyOption(this, name, value);\n\n if (typeof modifiedValue !== 'undefined') {\n options[name] = modifiedValue;\n } else {\n options[name] = value;\n }\n\n if (name === 'group') {\n _prepareGroup(options);\n }\n }\n },\n\n /**\r\n * Destroy\r\n */\n destroy: function destroy() {\n pluginEvent('destroy', this);\n var el = this.el;\n el[expando] = null;\n off(el, 'mousedown', this._onTapStart);\n off(el, 'touchstart', this._onTapStart);\n off(el, 'pointerdown', this._onTapStart);\n\n if (this.nativeDraggable) {\n off(el, 'dragover', this);\n off(el, 'dragenter', this);\n } // Remove draggable attributes\n\n\n Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {\n el.removeAttribute('draggable');\n });\n\n this._onDrop();\n\n this._disableDelayedDragEvents();\n\n sortables.splice(sortables.indexOf(this.el), 1);\n this.el = el = null;\n },\n _hideClone: function _hideClone() {\n if (!cloneHidden) {\n pluginEvent('hideClone', this);\n if (Sortable.eventCanceled) return;\n css(cloneEl, 'display', 'none');\n\n if (this.options.removeCloneOnHide && cloneEl.parentNode) {\n cloneEl.parentNode.removeChild(cloneEl);\n }\n\n cloneHidden = true;\n }\n },\n _showClone: function _showClone(putSortable) {\n if (putSortable.lastPutMode !== 'clone') {\n this._hideClone();\n\n return;\n }\n\n if (cloneHidden) {\n pluginEvent('showClone', this);\n if (Sortable.eventCanceled) return; // show clone at dragEl or original position\n\n if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {\n rootEl.insertBefore(cloneEl, dragEl);\n } else if (nextEl) {\n rootEl.insertBefore(cloneEl, nextEl);\n } else {\n rootEl.appendChild(cloneEl);\n }\n\n if (this.options.group.revertClone) {\n this.animate(dragEl, cloneEl);\n }\n\n css(cloneEl, 'display', '');\n cloneHidden = false;\n }\n }\n};\n\nfunction _globalDragOver(\n/**Event*/\nevt) {\n if (evt.dataTransfer) {\n evt.dataTransfer.dropEffect = 'move';\n }\n\n evt.cancelable && evt.preventDefault();\n}\n\nfunction _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {\n var evt,\n sortable = fromEl[expando],\n onMoveFn = sortable.options.onMove,\n retVal; // Support for new CustomEvent feature\n\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent('move', {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent('move', true, true);\n }\n\n evt.to = toEl;\n evt.from = fromEl;\n evt.dragged = dragEl;\n evt.draggedRect = dragRect;\n evt.related = targetEl || toEl;\n evt.relatedRect = targetRect || getRect(toEl);\n evt.willInsertAfter = willInsertAfter;\n evt.originalEvent = originalEvent;\n fromEl.dispatchEvent(evt);\n\n if (onMoveFn) {\n retVal = onMoveFn.call(sortable, evt, originalEvent);\n }\n\n return retVal;\n}\n\nfunction _disableDraggable(el) {\n el.draggable = false;\n}\n\nfunction _unsilent() {\n _silent = false;\n}\n\nfunction _ghostIsFirst(evt, vertical, sortable) {\n var rect = getRect(getChild(sortable.el, 0, sortable.options, true));\n var spacer = 10;\n return vertical ? evt.clientX < rect.left - spacer || evt.clientY < rect.top && evt.clientX < rect.right : evt.clientY < rect.top - spacer || evt.clientY < rect.bottom && evt.clientX < rect.left;\n}\n\nfunction _ghostIsLast(evt, vertical, sortable) {\n var rect = getRect(lastChild(sortable.el, sortable.options.draggable));\n var spacer = 10;\n return vertical ? evt.clientX > rect.right + spacer || evt.clientX <= rect.right && evt.clientY > rect.bottom && evt.clientX >= rect.left : evt.clientX > rect.right && evt.clientY > rect.top || evt.clientX <= rect.right && evt.clientY > rect.bottom + spacer;\n}\n\nfunction _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {\n var mouseOnAxis = vertical ? evt.clientY : evt.clientX,\n targetLength = vertical ? targetRect.height : targetRect.width,\n targetS1 = vertical ? targetRect.top : targetRect.left,\n targetS2 = vertical ? targetRect.bottom : targetRect.right,\n invert = false;\n\n if (!invertSwap) {\n // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold\n if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {\n // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2\n // check if past first invert threshold on side opposite of lastDirection\n if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {\n // past first invert threshold, do not restrict inverted threshold to dragEl shadow\n pastFirstInvertThresh = true;\n }\n\n if (!pastFirstInvertThresh) {\n // dragEl shadow (target move distance shadow)\n if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow\n : mouseOnAxis > targetS2 - targetMoveDistance) {\n return -lastDirection;\n }\n } else {\n invert = true;\n }\n } else {\n // Regular\n if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {\n return _getInsertDirection(target);\n }\n }\n }\n\n invert = invert || invertSwap;\n\n if (invert) {\n // Invert of regular\n if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {\n return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;\n }\n }\n\n return 0;\n}\n/**\r\n * Gets the direction dragEl must be swapped relative to target in order to make it\r\n * seem that dragEl has been \"inserted\" into that element's position\r\n * @param {HTMLElement} target The target whose position dragEl is being inserted at\r\n * @return {Number} Direction dragEl must be swapped\r\n */\n\n\nfunction _getInsertDirection(target) {\n if (index(dragEl) < index(target)) {\n return 1;\n } else {\n return -1;\n }\n}\n/**\r\n * Generate id\r\n * @param {HTMLElement} el\r\n * @returns {String}\r\n * @private\r\n */\n\n\nfunction _generateId(el) {\n var str = el.tagName + el.className + el.src + el.href + el.textContent,\n i = str.length,\n sum = 0;\n\n while (i--) {\n sum += str.charCodeAt(i);\n }\n\n return sum.toString(36);\n}\n\nfunction _saveInputCheckedState(root) {\n savedInputChecked.length = 0;\n var inputs = root.getElementsByTagName('input');\n var idx = inputs.length;\n\n while (idx--) {\n var el = inputs[idx];\n el.checked && savedInputChecked.push(el);\n }\n}\n\nfunction _nextTick(fn) {\n return setTimeout(fn, 0);\n}\n\nfunction _cancelNextTick(id) {\n return clearTimeout(id);\n} // Fixed #973:\n\n\nif (documentExists) {\n on(document, 'touchmove', function (evt) {\n if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {\n evt.preventDefault();\n }\n });\n} // Export utils\n\n\nSortable.utils = {\n on: on,\n off: off,\n css: css,\n find: find,\n is: function is(el, selector) {\n return !!closest(el, selector, el, false);\n },\n extend: extend,\n throttle: throttle,\n closest: closest,\n toggleClass: toggleClass,\n clone: clone,\n index: index,\n nextTick: _nextTick,\n cancelNextTick: _cancelNextTick,\n detectDirection: _detectDirection,\n getChild: getChild\n};\n/**\r\n * Get the Sortable instance of an element\r\n * @param {HTMLElement} element The element\r\n * @return {Sortable|undefined} The instance of Sortable\r\n */\n\nSortable.get = function (element) {\n return element[expando];\n};\n/**\r\n * Mount a plugin to Sortable\r\n * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted\r\n */\n\n\nSortable.mount = function () {\n for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {\n plugins[_key] = arguments[_key];\n }\n\n if (plugins[0].constructor === Array) plugins = plugins[0];\n plugins.forEach(function (plugin) {\n if (!plugin.prototype || !plugin.prototype.constructor) {\n throw \"Sortable: Mounted plugin must be a constructor function, not \".concat({}.toString.call(plugin));\n }\n\n if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);\n PluginManager.mount(plugin);\n });\n};\n/**\r\n * Create sortable instance\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */\n\n\nSortable.create = function (el, options) {\n return new Sortable(el, options);\n}; // Export\n\n\nSortable.version = version;\n\nvar autoScrolls = [],\n scrollEl,\n scrollRootEl,\n scrolling = false,\n lastAutoScrollX,\n lastAutoScrollY,\n touchEvt$1,\n pointerElemChangedInterval;\n\nfunction AutoScrollPlugin() {\n function AutoScroll() {\n this.defaults = {\n scroll: true,\n forceAutoScrollFallback: false,\n scrollSensitivity: 30,\n scrollSpeed: 10,\n bubbleScroll: true\n }; // Bind all private methods\n\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n }\n\n AutoScroll.prototype = {\n dragStarted: function dragStarted(_ref) {\n var originalEvent = _ref.originalEvent;\n\n if (this.sortable.nativeDraggable) {\n on(document, 'dragover', this._handleAutoScroll);\n } else {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._handleFallbackAutoScroll);\n } else if (originalEvent.touches) {\n on(document, 'touchmove', this._handleFallbackAutoScroll);\n } else {\n on(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref2) {\n var originalEvent = _ref2.originalEvent;\n\n // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)\n if (!this.options.dragOverBubble && !originalEvent.rootEl) {\n this._handleAutoScroll(originalEvent);\n }\n },\n drop: function drop() {\n if (this.sortable.nativeDraggable) {\n off(document, 'dragover', this._handleAutoScroll);\n } else {\n off(document, 'pointermove', this._handleFallbackAutoScroll);\n off(document, 'touchmove', this._handleFallbackAutoScroll);\n off(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n\n clearPointerElemChangedInterval();\n clearAutoScrolls();\n cancelThrottle();\n },\n nulling: function nulling() {\n touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;\n autoScrolls.length = 0;\n },\n _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {\n this._handleAutoScroll(evt, true);\n },\n _handleAutoScroll: function _handleAutoScroll(evt, fallback) {\n var _this = this;\n\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n elem = document.elementFromPoint(x, y);\n touchEvt$1 = evt; // IE does not seem to have native autoscroll,\n // Edge's autoscroll seems too conditional,\n // MACOS Safari does not have autoscroll,\n // Firefox and Chrome are good\n\n if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {\n autoScroll(evt, this.options, elem, fallback); // Listener for pointer element change\n\n var ogElemScroller = getParentAutoScrollElement(elem, true);\n\n if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {\n pointerElemChangedInterval && clearPointerElemChangedInterval(); // Detect for pointer elem change, emulating native DnD behaviour\n\n pointerElemChangedInterval = setInterval(function () {\n var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);\n\n if (newElem !== ogElemScroller) {\n ogElemScroller = newElem;\n clearAutoScrolls();\n }\n\n autoScroll(evt, _this.options, newElem, fallback);\n }, 10);\n lastAutoScrollX = x;\n lastAutoScrollY = y;\n }\n } else {\n // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll\n if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {\n clearAutoScrolls();\n return;\n }\n\n autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);\n }\n }\n };\n return _extends(AutoScroll, {\n pluginName: 'scroll',\n initializeByDefault: true\n });\n}\n\nfunction clearAutoScrolls() {\n autoScrolls.forEach(function (autoScroll) {\n clearInterval(autoScroll.pid);\n });\n autoScrolls = [];\n}\n\nfunction clearPointerElemChangedInterval() {\n clearInterval(pointerElemChangedInterval);\n}\n\nvar autoScroll = throttle(function (evt, options, rootEl, isFallback) {\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521\n if (!options.scroll) return;\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n sens = options.scrollSensitivity,\n speed = options.scrollSpeed,\n winScroller = getWindowScrollingElement();\n var scrollThisInstance = false,\n scrollCustomFn; // New scroll root, set scrollEl\n\n if (scrollRootEl !== rootEl) {\n scrollRootEl = rootEl;\n clearAutoScrolls();\n scrollEl = options.scroll;\n scrollCustomFn = options.scrollFn;\n\n if (scrollEl === true) {\n scrollEl = getParentAutoScrollElement(rootEl, true);\n }\n }\n\n var layersOut = 0;\n var currentParent = scrollEl;\n\n do {\n var el = currentParent,\n rect = getRect(el),\n top = rect.top,\n bottom = rect.bottom,\n left = rect.left,\n right = rect.right,\n width = rect.width,\n height = rect.height,\n canScrollX = void 0,\n canScrollY = void 0,\n scrollWidth = el.scrollWidth,\n scrollHeight = el.scrollHeight,\n elCSS = css(el),\n scrollPosX = el.scrollLeft,\n scrollPosY = el.scrollTop;\n\n if (el === winScroller) {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');\n } else {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');\n }\n\n var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);\n var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);\n\n if (!autoScrolls[layersOut]) {\n for (var i = 0; i <= layersOut; i++) {\n if (!autoScrolls[i]) {\n autoScrolls[i] = {};\n }\n }\n }\n\n if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {\n autoScrolls[layersOut].el = el;\n autoScrolls[layersOut].vx = vx;\n autoScrolls[layersOut].vy = vy;\n clearInterval(autoScrolls[layersOut].pid);\n\n if (vx != 0 || vy != 0) {\n scrollThisInstance = true;\n /* jshint loopfunc:true */\n\n autoScrolls[layersOut].pid = setInterval(function () {\n // emulate drag over during autoscroll (fallback), emulating native DnD behaviour\n if (isFallback && this.layer === 0) {\n Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely\n\n }\n\n var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;\n var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;\n\n if (typeof scrollCustomFn === 'function') {\n if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {\n return;\n }\n }\n\n scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);\n }.bind({\n layer: layersOut\n }), 24);\n }\n }\n\n layersOut++;\n } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));\n\n scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not\n}, 30);\n\nvar drop = function drop(_ref) {\n var originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n dragEl = _ref.dragEl,\n activeSortable = _ref.activeSortable,\n dispatchSortableEvent = _ref.dispatchSortableEvent,\n hideGhostForTarget = _ref.hideGhostForTarget,\n unhideGhostForTarget = _ref.unhideGhostForTarget;\n if (!originalEvent) return;\n var toSortable = putSortable || activeSortable;\n hideGhostForTarget();\n var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;\n var target = document.elementFromPoint(touch.clientX, touch.clientY);\n unhideGhostForTarget();\n\n if (toSortable && !toSortable.el.contains(target)) {\n dispatchSortableEvent('spill');\n this.onSpill({\n dragEl: dragEl,\n putSortable: putSortable\n });\n }\n};\n\nfunction Revert() {}\n\nRevert.prototype = {\n startIndex: null,\n dragStart: function dragStart(_ref2) {\n var oldDraggableIndex = _ref2.oldDraggableIndex;\n this.startIndex = oldDraggableIndex;\n },\n onSpill: function onSpill(_ref3) {\n var dragEl = _ref3.dragEl,\n putSortable = _ref3.putSortable;\n this.sortable.captureAnimationState();\n\n if (putSortable) {\n putSortable.captureAnimationState();\n }\n\n var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);\n\n if (nextSibling) {\n this.sortable.el.insertBefore(dragEl, nextSibling);\n } else {\n this.sortable.el.appendChild(dragEl);\n }\n\n this.sortable.animateAll();\n\n if (putSortable) {\n putSortable.animateAll();\n }\n },\n drop: drop\n};\n\n_extends(Revert, {\n pluginName: 'revertOnSpill'\n});\n\nfunction Remove() {}\n\nRemove.prototype = {\n onSpill: function onSpill(_ref4) {\n var dragEl = _ref4.dragEl,\n putSortable = _ref4.putSortable;\n var parentSortable = putSortable || this.sortable;\n parentSortable.captureAnimationState();\n dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);\n parentSortable.animateAll();\n },\n drop: drop\n};\n\n_extends(Remove, {\n pluginName: 'removeOnSpill'\n});\n\nvar lastSwapEl;\n\nfunction SwapPlugin() {\n function Swap() {\n this.defaults = {\n swapClass: 'sortable-swap-highlight'\n };\n }\n\n Swap.prototype = {\n dragStart: function dragStart(_ref) {\n var dragEl = _ref.dragEl;\n lastSwapEl = dragEl;\n },\n dragOverValid: function dragOverValid(_ref2) {\n var completed = _ref2.completed,\n target = _ref2.target,\n onMove = _ref2.onMove,\n activeSortable = _ref2.activeSortable,\n changed = _ref2.changed,\n cancel = _ref2.cancel;\n if (!activeSortable.options.swap) return;\n var el = this.sortable.el,\n options = this.options;\n\n if (target && target !== el) {\n var prevSwapEl = lastSwapEl;\n\n if (onMove(target) !== false) {\n toggleClass(target, options.swapClass, true);\n lastSwapEl = target;\n } else {\n lastSwapEl = null;\n }\n\n if (prevSwapEl && prevSwapEl !== lastSwapEl) {\n toggleClass(prevSwapEl, options.swapClass, false);\n }\n }\n\n changed();\n completed(true);\n cancel();\n },\n drop: function drop(_ref3) {\n var activeSortable = _ref3.activeSortable,\n putSortable = _ref3.putSortable,\n dragEl = _ref3.dragEl;\n var toSortable = putSortable || this.sortable;\n var options = this.options;\n lastSwapEl && toggleClass(lastSwapEl, options.swapClass, false);\n\n if (lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) {\n if (dragEl !== lastSwapEl) {\n toSortable.captureAnimationState();\n if (toSortable !== activeSortable) activeSortable.captureAnimationState();\n swapNodes(dragEl, lastSwapEl);\n toSortable.animateAll();\n if (toSortable !== activeSortable) activeSortable.animateAll();\n }\n }\n },\n nulling: function nulling() {\n lastSwapEl = null;\n }\n };\n return _extends(Swap, {\n pluginName: 'swap',\n eventProperties: function eventProperties() {\n return {\n swapItem: lastSwapEl\n };\n }\n });\n}\n\nfunction swapNodes(n1, n2) {\n var p1 = n1.parentNode,\n p2 = n2.parentNode,\n i1,\n i2;\n if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return;\n i1 = index(n1);\n i2 = index(n2);\n\n if (p1.isEqualNode(p2) && i1 < i2) {\n i2++;\n }\n\n p1.insertBefore(n2, p1.children[i1]);\n p2.insertBefore(n1, p2.children[i2]);\n}\n\nvar multiDragElements = [],\n multiDragClones = [],\n lastMultiDragSelect,\n // for selection with modifier key down (SHIFT)\nmultiDragSortable,\n initialFolding = false,\n // Initial multi-drag fold when drag started\nfolding = false,\n // Folding any other time\ndragStarted = false,\n dragEl$1,\n clonesFromRect,\n clonesHidden;\n\nfunction MultiDragPlugin() {\n function MultiDrag(sortable) {\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n\n if (!sortable.options.avoidImplicitDeselect) {\n if (sortable.options.supportPointer) {\n on(document, 'pointerup', this._deselectMultiDrag);\n } else {\n on(document, 'mouseup', this._deselectMultiDrag);\n on(document, 'touchend', this._deselectMultiDrag);\n }\n }\n\n on(document, 'keydown', this._checkKeyDown);\n on(document, 'keyup', this._checkKeyUp);\n this.defaults = {\n selectedClass: 'sortable-selected',\n multiDragKey: null,\n avoidImplicitDeselect: false,\n setData: function setData(dataTransfer, dragEl) {\n var data = '';\n\n if (multiDragElements.length && multiDragSortable === sortable) {\n multiDragElements.forEach(function (multiDragElement, i) {\n data += (!i ? '' : ', ') + multiDragElement.textContent;\n });\n } else {\n data = dragEl.textContent;\n }\n\n dataTransfer.setData('Text', data);\n }\n };\n }\n\n MultiDrag.prototype = {\n multiDragKeyDown: false,\n isMultiDrag: false,\n delayStartGlobal: function delayStartGlobal(_ref) {\n var dragged = _ref.dragEl;\n dragEl$1 = dragged;\n },\n delayEnded: function delayEnded() {\n this.isMultiDrag = ~multiDragElements.indexOf(dragEl$1);\n },\n setupClone: function setupClone(_ref2) {\n var sortable = _ref2.sortable,\n cancel = _ref2.cancel;\n if (!this.isMultiDrag) return;\n\n for (var i = 0; i < multiDragElements.length; i++) {\n multiDragClones.push(clone(multiDragElements[i]));\n multiDragClones[i].sortableIndex = multiDragElements[i].sortableIndex;\n multiDragClones[i].draggable = false;\n multiDragClones[i].style['will-change'] = '';\n toggleClass(multiDragClones[i], this.options.selectedClass, false);\n multiDragElements[i] === dragEl$1 && toggleClass(multiDragClones[i], this.options.chosenClass, false);\n }\n\n sortable._hideClone();\n\n cancel();\n },\n clone: function clone(_ref3) {\n var sortable = _ref3.sortable,\n rootEl = _ref3.rootEl,\n dispatchSortableEvent = _ref3.dispatchSortableEvent,\n cancel = _ref3.cancel;\n if (!this.isMultiDrag) return;\n\n if (!this.options.removeCloneOnHide) {\n if (multiDragElements.length && multiDragSortable === sortable) {\n insertMultiDragClones(true, rootEl);\n dispatchSortableEvent('clone');\n cancel();\n }\n }\n },\n showClone: function showClone(_ref4) {\n var cloneNowShown = _ref4.cloneNowShown,\n rootEl = _ref4.rootEl,\n cancel = _ref4.cancel;\n if (!this.isMultiDrag) return;\n insertMultiDragClones(false, rootEl);\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', '');\n });\n cloneNowShown();\n clonesHidden = false;\n cancel();\n },\n hideClone: function hideClone(_ref5) {\n var _this = this;\n\n var sortable = _ref5.sortable,\n cloneNowHidden = _ref5.cloneNowHidden,\n cancel = _ref5.cancel;\n if (!this.isMultiDrag) return;\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', 'none');\n\n if (_this.options.removeCloneOnHide && clone.parentNode) {\n clone.parentNode.removeChild(clone);\n }\n });\n cloneNowHidden();\n clonesHidden = true;\n cancel();\n },\n dragStartGlobal: function dragStartGlobal(_ref6) {\n var sortable = _ref6.sortable;\n\n if (!this.isMultiDrag && multiDragSortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n }\n\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.sortableIndex = index(multiDragElement);\n }); // Sort multi-drag elements\n\n multiDragElements = multiDragElements.sort(function (a, b) {\n return a.sortableIndex - b.sortableIndex;\n });\n dragStarted = true;\n },\n dragStarted: function dragStarted(_ref7) {\n var _this2 = this;\n\n var sortable = _ref7.sortable;\n if (!this.isMultiDrag) return;\n\n if (this.options.sort) {\n // Capture rects,\n // hide multi drag elements (by positioning them absolute),\n // set multi drag elements rects to dragRect,\n // show multi drag elements,\n // animate to rects,\n // unset rects & remove from DOM\n sortable.captureAnimationState();\n\n if (this.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n css(multiDragElement, 'position', 'absolute');\n });\n var dragRect = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRect);\n });\n folding = true;\n initialFolding = true;\n }\n }\n\n sortable.animateAll(function () {\n folding = false;\n initialFolding = false;\n\n if (_this2.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n } // Remove all auxiliary multidrag items from el, if sorting enabled\n\n\n if (_this2.options.sort) {\n removeMultiDragElements();\n }\n });\n },\n dragOver: function dragOver(_ref8) {\n var target = _ref8.target,\n completed = _ref8.completed,\n cancel = _ref8.cancel;\n\n if (folding && ~multiDragElements.indexOf(target)) {\n completed(false);\n cancel();\n }\n },\n revert: function revert(_ref9) {\n var fromSortable = _ref9.fromSortable,\n rootEl = _ref9.rootEl,\n sortable = _ref9.sortable,\n dragRect = _ref9.dragRect;\n\n if (multiDragElements.length > 1) {\n // Setup unfold animation\n multiDragElements.forEach(function (multiDragElement) {\n sortable.addAnimationState({\n target: multiDragElement,\n rect: folding ? getRect(multiDragElement) : dragRect\n });\n unsetRect(multiDragElement);\n multiDragElement.fromRect = dragRect;\n fromSortable.removeAnimationState(multiDragElement);\n });\n folding = false;\n insertMultiDragElements(!this.options.removeCloneOnHide, rootEl);\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref10) {\n var sortable = _ref10.sortable,\n isOwner = _ref10.isOwner,\n insertion = _ref10.insertion,\n activeSortable = _ref10.activeSortable,\n parentEl = _ref10.parentEl,\n putSortable = _ref10.putSortable;\n var options = this.options;\n\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n }\n\n initialFolding = false; // If leaving sort:false root, or already folding - Fold to new location\n\n if (options.animation && multiDragElements.length > 1 && (folding || !isOwner && !activeSortable.options.sort && !putSortable)) {\n // Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible\n var dragRectAbsolute = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRectAbsolute); // Move element(s) to end of parentEl so that it does not interfere with multi-drag clones insertion if they are inserted\n // while folding, and so that we can capture them again because old sortable will no longer be fromSortable\n\n parentEl.appendChild(multiDragElement);\n });\n folding = true;\n } // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out\n\n\n if (!isOwner) {\n // Only remove if not folding (folding will remove them anyways)\n if (!folding) {\n removeMultiDragElements();\n }\n\n if (multiDragElements.length > 1) {\n var clonesHiddenBefore = clonesHidden;\n\n activeSortable._showClone(sortable); // Unfold animation for clones if showing from hidden\n\n\n if (activeSortable.options.animation && !clonesHidden && clonesHiddenBefore) {\n multiDragClones.forEach(function (clone) {\n activeSortable.addAnimationState({\n target: clone,\n rect: clonesFromRect\n });\n clone.fromRect = clonesFromRect;\n clone.thisAnimationDuration = null;\n });\n }\n } else {\n activeSortable._showClone(sortable);\n }\n }\n }\n },\n dragOverAnimationCapture: function dragOverAnimationCapture(_ref11) {\n var dragRect = _ref11.dragRect,\n isOwner = _ref11.isOwner,\n activeSortable = _ref11.activeSortable;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n });\n\n if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) {\n clonesFromRect = _extends({}, dragRect);\n var dragMatrix = matrix(dragEl$1, true);\n clonesFromRect.top -= dragMatrix.f;\n clonesFromRect.left -= dragMatrix.e;\n }\n },\n dragOverAnimationComplete: function dragOverAnimationComplete() {\n if (folding) {\n folding = false;\n removeMultiDragElements();\n }\n },\n drop: function drop(_ref12) {\n var evt = _ref12.originalEvent,\n rootEl = _ref12.rootEl,\n parentEl = _ref12.parentEl,\n sortable = _ref12.sortable,\n dispatchSortableEvent = _ref12.dispatchSortableEvent,\n oldIndex = _ref12.oldIndex,\n putSortable = _ref12.putSortable;\n var toSortable = putSortable || this.sortable;\n if (!evt) return;\n var options = this.options,\n children = parentEl.children; // Multi-drag selection\n\n if (!dragStarted) {\n if (options.multiDragKey && !this.multiDragKeyDown) {\n this._deselectMultiDrag();\n }\n\n toggleClass(dragEl$1, options.selectedClass, !~multiDragElements.indexOf(dragEl$1));\n\n if (!~multiDragElements.indexOf(dragEl$1)) {\n multiDragElements.push(dragEl$1);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: dragEl$1,\n originalEvent: evt\n }); // Modifier activated, select from last to dragEl\n\n if (evt.shiftKey && lastMultiDragSelect && sortable.el.contains(lastMultiDragSelect)) {\n var lastIndex = index(lastMultiDragSelect),\n currentIndex = index(dragEl$1);\n\n if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {\n // Must include lastMultiDragSelect (select it), in case modified selection from no selection\n // (but previous selection existed)\n var n, i;\n\n if (currentIndex > lastIndex) {\n i = lastIndex;\n n = currentIndex;\n } else {\n i = currentIndex;\n n = lastIndex + 1;\n }\n\n for (; i < n; i++) {\n if (~multiDragElements.indexOf(children[i])) continue;\n toggleClass(children[i], options.selectedClass, true);\n multiDragElements.push(children[i]);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: children[i],\n originalEvent: evt\n });\n }\n }\n } else {\n lastMultiDragSelect = dragEl$1;\n }\n\n multiDragSortable = toSortable;\n } else {\n multiDragElements.splice(multiDragElements.indexOf(dragEl$1), 1);\n lastMultiDragSelect = null;\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'deselect',\n targetEl: dragEl$1,\n originalEvent: evt\n });\n }\n } // Multi-drag drop\n\n\n if (dragStarted && this.isMultiDrag) {\n folding = false; // Do not \"unfold\" after around dragEl if reverted\n\n if ((parentEl[expando].options.sort || parentEl !== rootEl) && multiDragElements.length > 1) {\n var dragRect = getRect(dragEl$1),\n multiDragIndex = index(dragEl$1, ':not(.' + this.options.selectedClass + ')');\n if (!initialFolding && options.animation) dragEl$1.thisAnimationDuration = null;\n toSortable.captureAnimationState();\n\n if (!initialFolding) {\n if (options.animation) {\n dragEl$1.fromRect = dragRect;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n\n if (multiDragElement !== dragEl$1) {\n var rect = folding ? getRect(multiDragElement) : dragRect;\n multiDragElement.fromRect = rect; // Prepare unfold animation\n\n toSortable.addAnimationState({\n target: multiDragElement,\n rect: rect\n });\n }\n });\n } // Multi drag elements are not necessarily removed from the DOM on drop, so to reinsert\n // properly they must all be removed\n\n\n removeMultiDragElements();\n multiDragElements.forEach(function (multiDragElement) {\n if (children[multiDragIndex]) {\n parentEl.insertBefore(multiDragElement, children[multiDragIndex]);\n } else {\n parentEl.appendChild(multiDragElement);\n }\n\n multiDragIndex++;\n }); // If initial folding is done, the elements may have changed position because they are now\n // unfolding around dragEl, even though dragEl may not have his index changed, so update event\n // must be fired here as Sortable will not.\n\n if (oldIndex === index(dragEl$1)) {\n var update = false;\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement.sortableIndex !== index(multiDragElement)) {\n update = true;\n return;\n }\n });\n\n if (update) {\n dispatchSortableEvent('update');\n }\n }\n } // Must be done after capturing individual rects (scroll bar)\n\n\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n toSortable.animateAll();\n }\n\n multiDragSortable = toSortable;\n } // Remove clones if necessary\n\n\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n multiDragClones.forEach(function (clone) {\n clone.parentNode && clone.parentNode.removeChild(clone);\n });\n }\n },\n nullingGlobal: function nullingGlobal() {\n this.isMultiDrag = dragStarted = false;\n multiDragClones.length = 0;\n },\n destroyGlobal: function destroyGlobal() {\n this._deselectMultiDrag();\n\n off(document, 'pointerup', this._deselectMultiDrag);\n off(document, 'mouseup', this._deselectMultiDrag);\n off(document, 'touchend', this._deselectMultiDrag);\n off(document, 'keydown', this._checkKeyDown);\n off(document, 'keyup', this._checkKeyUp);\n },\n _deselectMultiDrag: function _deselectMultiDrag(evt) {\n if (typeof dragStarted !== \"undefined\" && dragStarted) return; // Only deselect if selection is in this sortable\n\n if (multiDragSortable !== this.sortable) return; // Only deselect if target is not item in this sortable\n\n if (evt && closest(evt.target, this.options.draggable, this.sortable.el, false)) return; // Only deselect if left click\n\n if (evt && evt.button !== 0) return;\n\n while (multiDragElements.length) {\n var el = multiDragElements[0];\n toggleClass(el, this.options.selectedClass, false);\n multiDragElements.shift();\n dispatchEvent({\n sortable: this.sortable,\n rootEl: this.sortable.el,\n name: 'deselect',\n targetEl: el,\n originalEvent: evt\n });\n }\n },\n _checkKeyDown: function _checkKeyDown(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = true;\n }\n },\n _checkKeyUp: function _checkKeyUp(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = false;\n }\n }\n };\n return _extends(MultiDrag, {\n // Static methods & properties\n pluginName: 'multiDrag',\n utils: {\n /**\r\n * Selects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be selected\r\n */\n select: function select(el) {\n var sortable = el.parentNode[expando];\n if (!sortable || !sortable.options.multiDrag || ~multiDragElements.indexOf(el)) return;\n\n if (multiDragSortable && multiDragSortable !== sortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n\n multiDragSortable = sortable;\n }\n\n toggleClass(el, sortable.options.selectedClass, true);\n multiDragElements.push(el);\n },\n\n /**\r\n * Deselects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be deselected\r\n */\n deselect: function deselect(el) {\n var sortable = el.parentNode[expando],\n index = multiDragElements.indexOf(el);\n if (!sortable || !sortable.options.multiDrag || !~index) return;\n toggleClass(el, sortable.options.selectedClass, false);\n multiDragElements.splice(index, 1);\n }\n },\n eventProperties: function eventProperties() {\n var _this3 = this;\n\n var oldIndicies = [],\n newIndicies = [];\n multiDragElements.forEach(function (multiDragElement) {\n oldIndicies.push({\n multiDragElement: multiDragElement,\n index: multiDragElement.sortableIndex\n }); // multiDragElements will already be sorted if folding\n\n var newIndex;\n\n if (folding && multiDragElement !== dragEl$1) {\n newIndex = -1;\n } else if (folding) {\n newIndex = index(multiDragElement, ':not(.' + _this3.options.selectedClass + ')');\n } else {\n newIndex = index(multiDragElement);\n }\n\n newIndicies.push({\n multiDragElement: multiDragElement,\n index: newIndex\n });\n });\n return {\n items: _toConsumableArray(multiDragElements),\n clones: [].concat(multiDragClones),\n oldIndicies: oldIndicies,\n newIndicies: newIndicies\n };\n },\n optionListeners: {\n multiDragKey: function multiDragKey(key) {\n key = key.toLowerCase();\n\n if (key === 'ctrl') {\n key = 'Control';\n } else if (key.length > 1) {\n key = key.charAt(0).toUpperCase() + key.substr(1);\n }\n\n return key;\n }\n }\n });\n}\n\nfunction insertMultiDragElements(clonesInserted, rootEl) {\n multiDragElements.forEach(function (multiDragElement, i) {\n var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)];\n\n if (target) {\n rootEl.insertBefore(multiDragElement, target);\n } else {\n rootEl.appendChild(multiDragElement);\n }\n });\n}\n/**\r\n * Insert multi-drag clones\r\n * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted\r\n * @param {HTMLElement} rootEl\r\n */\n\n\nfunction insertMultiDragClones(elementsInserted, rootEl) {\n multiDragClones.forEach(function (clone, i) {\n var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)];\n\n if (target) {\n rootEl.insertBefore(clone, target);\n } else {\n rootEl.appendChild(clone);\n }\n });\n}\n\nfunction removeMultiDragElements() {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n multiDragElement.parentNode && multiDragElement.parentNode.removeChild(multiDragElement);\n });\n}\n\nSortable.mount(new AutoScrollPlugin());\nSortable.mount(Remove, Revert);\n\nexport default Sortable;\nexport { MultiDragPlugin as MultiDrag, Sortable, SwapPlugin as Swap };\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/ExtensionPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/withAttr');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Form');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/ColorPreviewInput');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/ItemList');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/string');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport FormModal from 'flarum/common/components/FormModal';\nimport Button from 'flarum/common/components/Button';\nimport ColorPreviewInput from 'flarum/common/components/ColorPreviewInput';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport { slug } from 'flarum/common/utils/string';\nimport Stream from 'flarum/common/utils/Stream';\nimport extractText from 'flarum/common/utils/extractText';\nimport Form from 'flarum/common/components/Form';\nimport tagLabel from '../../common/helpers/tagLabel';\n/**\n * The `EditTagModal` component shows a modal dialog which allows the user\n * to create or edit a tag.\n */\nexport default class EditTagModal extends FormModal {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"tag\", void 0);\n _defineProperty(this, \"name\", void 0);\n _defineProperty(this, \"slug\", void 0);\n _defineProperty(this, \"description\", void 0);\n _defineProperty(this, \"color\", void 0);\n _defineProperty(this, \"icon\", void 0);\n _defineProperty(this, \"isHidden\", void 0);\n _defineProperty(this, \"isPrimary\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n this.tag = this.attrs.model || app.store.createRecord('tags');\n this.name = Stream(this.tag.name() || '');\n this.slug = Stream(this.tag.slug() || '');\n this.description = Stream(this.tag.description() || '');\n this.color = Stream(this.tag.color() || '');\n this.icon = Stream(this.tag.icon() || '');\n this.isHidden = Stream(this.tag.isHidden() || false);\n this.isPrimary = Stream(this.attrs.primary || false);\n }\n className() {\n return 'EditTagModal Modal--small';\n }\n title() {\n return this.name() ? tagLabel(app.store.createRecord('tags', {\n attributes: this.submitData()\n })) : app.translator.trans('flarum-tags.admin.edit_tag.title');\n }\n content() {\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(Form, null, this.fields().toArray()));\n }\n fields() {\n const items = new ItemList();\n items.add('name', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.name_label')), m(\"input\", {\n className: \"FormControl\",\n placeholder: app.translator.trans('flarum-tags.admin.edit_tag.name_placeholder'),\n value: this.name(),\n oninput: e => {\n const target = e.target;\n this.name(target.value);\n this.slug(slug(target.value));\n }\n })), 50);\n items.add('slug', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.slug_label')), m(\"input\", {\n className: \"FormControl\",\n bidi: this.slug\n })), 40);\n items.add('description', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.description_label')), m(\"textarea\", {\n className: \"FormControl\",\n bidi: this.description\n })), 30);\n items.add('color', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.color_label')), m(ColorPreviewInput, {\n className: \"FormControl\",\n placeholder: \"#aaaaaa\",\n bidi: this.color\n })), 20);\n items.add('icon', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.icon_label')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-tags.admin.edit_tag.icon_text', {\n a: m(\"a\", {\n href: \"https://fontawesome.com/icons?m=free\",\n tabindex: \"-1\"\n })\n })), m(\"input\", {\n className: \"FormControl\",\n placeholder: \"fas fa-bolt\",\n bidi: this.icon\n })), 10);\n items.add('hidden', m(\"div\", {\n className: \"Form-group\"\n }, m(\"div\", null, m(\"label\", {\n className: \"checkbox\"\n }, m(\"input\", {\n type: \"checkbox\",\n bidi: this.isHidden\n }), app.translator.trans('flarum-tags.admin.edit_tag.hide_label')))), 10);\n items.add('submit', m(\"div\", {\n className: \"Form-group Form-controls\"\n }, m(Button, {\n type: \"submit\",\n className: \"Button Button--primary EditTagModal-save\",\n loading: this.loading\n }, app.translator.trans('flarum-tags.admin.edit_tag.submit_button')), this.tag.exists && m(\"button\", {\n type: \"button\",\n className: \"Button EditTagModal-delete\",\n onclick: this.delete.bind(this)\n }, app.translator.trans('flarum-tags.admin.edit_tag.delete_tag_button'))), -10);\n return items;\n }\n submitData() {\n return {\n name: this.name(),\n slug: this.slug(),\n description: this.description(),\n color: this.color(),\n icon: this.icon(),\n isHidden: this.isHidden(),\n isPrimary: this.isPrimary()\n };\n }\n onsubmit(e) {\n e.preventDefault();\n this.loading = true;\n\n // Errors aren't passed to the modal onerror handler here.\n // This is done for better error visibility on smaller screen heights.\n this.tag.save(this.submitData()).then(() => this.hide(), () => this.loading = false);\n }\n delete() {\n if (confirm(extractText(app.translator.trans('flarum-tags.admin.edit_tag.delete_tag_confirmation')))) {\n const children = app.store.all('tags').filter(tag => tag.parent() === this.tag);\n this.tag.delete().then(() => {\n children.forEach(tag => tag.pushData({\n attributes: {\n isChild: false\n }\n }));\n m.redraw();\n });\n this.hide();\n }\n }\n}\nflarum.reg.add('flarum-tags', 'admin/components/EditTagModal', EditTagModal);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\n/**\n * The `Component` class defines a user interface 'building block'. A component\n * generates a virtual DOM to be rendered on each redraw.\n *\n * Essentially, this is a wrapper for Mithril's components that adds several useful features:\n *\n * - In the `oninit` and `onbeforeupdate` lifecycle hooks, we store vnode attrs in `this.attrs.\n * This allows us to use attrs across components without having to pass the vnode to every single\n * method.\n * - The static `initAttrs` method allows a convenient way to provide defaults (or to otherwise modify)\n * the attrs that have been passed into a component.\n * - When the component is created in the DOM, we store its DOM element under `this.element`; this lets\n * us use jQuery to modify child DOM state from internal methods via the `this.$()` method.\n * - A convenience `component` method, which serves as an alternative to hyperscript and JSX.\n *\n * As with other Mithril components, components extending Component can be initialized\n * and nested using JSX, hyperscript, or a combination of both. The `component` method can also\n * be used.\n *\n * @example\n * return m('div',

Hello World

);\n *\n * @example\n * return m('div', MyComponent.component({foo: 'bar'), m('p', 'Hello World!'));\n *\n * @see https://mithril.js.org/components.html\n */\nexport default class Component {\n constructor() {\n /**\n * The root DOM element for the component.\n */\n _defineProperty(this, \"element\", void 0);\n /**\n * The attributes passed into the component.\n *\n * @see https://mithril.js.org/components.html#passing-data-to-components\n */\n _defineProperty(this, \"attrs\", void 0);\n /**\n * Class component state that is persisted between redraws.\n *\n * Updating this will **not** automatically trigger a redraw, unlike\n * other frameworks.\n *\n * This is different to Vnode state, which is always an instance of your\n * class component.\n *\n * This is `undefined` by default.\n */\n _defineProperty(this, \"state\", void 0);\n }\n /**\n * @inheritdoc\n */\n /**\n * @inheritdoc\n */\n oninit(vnode) {\n this.setAttrs(vnode.attrs);\n }\n\n /**\n * @inheritdoc\n */\n oncreate(vnode) {\n this.element = vnode.dom;\n }\n\n /**\n * @inheritdoc\n */\n onbeforeupdate(vnode) {\n this.setAttrs(vnode.attrs);\n }\n\n /**\n * @inheritdoc\n */\n onupdate(vnode) {}\n\n /**\n * @inheritdoc\n */\n onbeforeremove(vnode) {}\n\n /**\n * @inheritdoc\n */\n onremove(vnode) {}\n\n /**\n * Returns a jQuery object for this component's element. If you pass in a\n * selector string, this method will return a jQuery object, using the current\n * element as its buffer.\n *\n * For example, calling `component.$('li')` will return a jQuery object\n * containing all of the `li` elements inside the DOM element of this\n * component.\n *\n * @param [selector] a jQuery-compatible selector string\n * @returns the jQuery object for the DOM node\n * @final\n */\n $(selector) {\n const $element = $(this.element);\n return selector ? $element.find(selector) : $element;\n }\n\n /**\n * Convenience method to attach a component without JSX.\n * Has the same effect as calling `m(THIS_CLASS, attrs, children)`.\n *\n * @see https://mithril.js.org/hyperscript.html#mselector,-attributes,-children\n */\n static component(attrs, children) {\n if (attrs === void 0) {\n attrs = {};\n }\n if (children === void 0) {\n children = null;\n }\n const componentAttrs = {\n ...attrs\n };\n return m(this, componentAttrs, children);\n }\n\n /**\n * Saves a reference to the vnode attrs after running them through initAttrs,\n * and checking for common issues.\n */\n setAttrs(attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n this.constructor.initAttrs(attrs);\n if (attrs) {\n if ('children' in attrs) {\n throw new Error(\"[\".concat(this.constructor.name, \"] The \\\"children\\\" attribute of attrs should never be used. Either pass children in as the vnode children or rename the attribute\"));\n }\n if ('tag' in attrs) {\n throw new Error(\"[\".concat(this.constructor.name, \"] You cannot use the \\\"tag\\\" attribute name with Mithril 2.\"));\n }\n }\n this.attrs = attrs;\n }\n\n /**\n * Initialize the component's attrs.\n *\n * This can be used to assign default values for missing, optional attrs.\n */\n static initAttrs(attrs) {}\n}\nflarum.reg.add('flarum-tags', '../../../../framework/core/js/src/common/Component', Component);","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e))for(t=0;t app.modal.show(EditTagModal, {\n model: tag\n })\n })), !tag.isChild() && tag.position() !== null && m(\"ol\", {\n className: \"TagListItem-children TagList\"\n }, sortTags(app.store.all('tags')).filter(child => child.parent() === tag).map(tagItem)));\n}\nexport default class TagsPage extends ExtensionPage {\n oninit(vnode) {\n super.oninit(vnode);\n\n // A regular redraw won't work here, because sortable has mucked around\n // with the DOM which will confuse Mithril's diffing algorithm. Instead\n // we force a full reconstruction of the DOM by changing the key, which\n // makes mithril completely re-render the component on redraw.\n this.forcedRefreshKey = 0;\n this.loading = true;\n app.tagList.load(['parent']).then(() => {\n this.loading = false;\n m.redraw();\n });\n }\n content() {\n if (this.loading) {\n return m(LoadingIndicator, null);\n }\n const minPrimaryTags = this.setting('flarum-tags.min_primary_tags', 0);\n const maxPrimaryTags = this.setting('flarum-tags.max_primary_tags', 0);\n const minSecondaryTags = this.setting('flarum-tags.min_secondary_tags', 0);\n const maxSecondaryTags = this.setting('flarum-tags.max_secondary_tags', 0);\n const tags = sortTags(app.store.all('tags').filter(tag => !tag.parent()));\n return m(\"div\", {\n className: \"TagsContent\"\n }, m(\"div\", {\n className: \"TagsContent-list\"\n }, m(\"div\", {\n className: \"container\",\n key: this.forcedRefreshKey,\n oncreate: this.onListOnCreate.bind(this)\n }, m(FormSectionGroup, null, m(FormSection, {\n className: \"TagGroup\",\n label: app.translator.trans('flarum-tags.admin.tags.primary_heading')\n }, m(\"ol\", {\n className: \"TagList TagList--primary\"\n }, tags.filter(tag => tag.position() !== null && !tag.isChild()).map(tagItem)), m(Button, {\n className: \"Button TagList-button\",\n icon: \"fas fa-plus\",\n onclick: () => app.modal.show(EditTagModal, {\n primary: true\n })\n }, app.translator.trans('flarum-tags.admin.tags.create_primary_tag_button'))), m(FormSection, {\n className: \"TagGroup TagGroup--secondary\",\n label: app.translator.trans('flarum-tags.admin.tags.secondary_heading')\n }, m(\"ul\", {\n className: \"TagList\"\n }, tags.filter(tag => tag.position() === null).sort((a, b) => a.name().localeCompare(b.name())).map(tagItem)), m(Button, {\n className: \"Button TagList-button\",\n icon: \"fas fa-plus\",\n onclick: () => app.modal.show(EditTagModal, {\n primary: false\n })\n }, app.translator.trans('flarum-tags.admin.tags.create_secondary_tag_button'))), m(FormSection, {\n label: app.translator.trans('flarum-tags.admin.tags.settings_heading')\n }, m(Form, null, m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.tag_settings.required_primary_heading')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-tags.admin.tag_settings.required_primary_text')), m(\"div\", {\n className: \"TagSettings-rangeInput\"\n }, m(\"input\", {\n className: \"FormControl\",\n type: \"number\",\n min: \"0\",\n value: minPrimaryTags(),\n oninput: withAttr('value', this.setMinTags.bind(this, minPrimaryTags, maxPrimaryTags))\n }), app.translator.trans('flarum-tags.admin.tag_settings.range_separator_text'), m(\"input\", {\n className: \"FormControl\",\n type: \"number\",\n min: minPrimaryTags(),\n bidi: maxPrimaryTags\n }))), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.tag_settings.required_secondary_heading')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-tags.admin.tag_settings.required_secondary_text')), m(\"div\", {\n className: \"TagSettings-rangeInput\"\n }, m(\"input\", {\n className: \"FormControl\",\n type: \"number\",\n min: \"0\",\n value: minSecondaryTags(),\n oninput: withAttr('value', this.setMinTags.bind(this, minSecondaryTags, maxSecondaryTags))\n }), app.translator.trans('flarum-tags.admin.tag_settings.range_separator_text'), m(\"input\", {\n className: \"FormControl\",\n type: \"number\",\n min: minSecondaryTags(),\n bidi: maxSecondaryTags\n }))), m(\"div\", {\n className: \"Form-group Form-controls\"\n }, this.submitButton())))), m(\"div\", {\n className: \"TagsContent-footer\"\n }, m(\"p\", null, app.translator.trans('flarum-tags.admin.tags.about_tags_text'))))));\n }\n onListOnCreate(vnode) {\n this.$('.TagList').get().map(e => {\n sortable.create(e, {\n group: 'tags',\n delay: 50,\n delayOnTouchOnly: true,\n touchStartThreshold: 5,\n animation: 150,\n swapThreshold: 0.65,\n dragClass: 'sortable-dragging',\n ghostClass: 'sortable-placeholder',\n onSort: e => this.onSortUpdate(e)\n });\n });\n }\n setMinTags(minTags, maxTags, value) {\n minTags(value);\n maxTags(Math.max(value, maxTags()));\n }\n onSortUpdate(e) {\n // If we've moved a tag from 'primary' to 'secondary', then we'll update\n // its attributes in our local store so that when we redraw the change\n // will be made.\n if (e.from instanceof HTMLOListElement && e.to instanceof HTMLUListElement) {\n app.store.getById('tags', e.item.getAttribute('data-id')).pushData({\n attributes: {\n position: null,\n isChild: false\n },\n relationships: {\n parent: null\n }\n });\n }\n\n // Construct an array of primary tag IDs and their children, in the same\n // order that they have been arranged in.\n const order = this.$('.TagList--primary > li').map(function () {\n return {\n id: $(this).data('id'),\n children: $(this).find('li').map(function () {\n return $(this).data('id');\n }).get()\n };\n }).get();\n\n // Now that we have an accurate representation of the order which the\n // primary tags are in, we will update the tag attributes in our local\n // store to reflect this order.\n order.forEach((tag, i) => {\n const parent = app.store.getById('tags', tag.id);\n parent.pushData({\n attributes: {\n position: i,\n isChild: false\n },\n relationships: {\n parent: null\n }\n });\n tag.children.forEach((child, j) => {\n app.store.getById('tags', child).pushData({\n attributes: {\n position: j,\n isChild: true\n },\n relationships: {\n parent\n }\n });\n });\n });\n app.request({\n url: app.forum.attribute('apiUrl') + '/tags/order',\n method: 'POST',\n body: {\n order\n }\n });\n this.forcedRefreshKey++;\n m.redraw();\n }\n}\nflarum.reg.add('flarum-tags', 'admin/components/TagsPage', TagsPage);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/common/app';\nexport default class TagListState {\n constructor() {\n _defineProperty(this, \"loadedIncludes\", void 0);\n }\n async load(includes) {\n if (includes === void 0) {\n includes = [];\n }\n if (!this.loadedIncludes) {\n return this.query(includes);\n }\n const unloadedIncludes = includes.filter(include => !this.loadedIncludes.has(include));\n if (unloadedIncludes.length === 0) {\n return Promise.resolve(app.store.all('tags'));\n }\n return this.query(unloadedIncludes);\n }\n async query(includes) {\n var _this$loadedIncludes;\n if (includes === void 0) {\n includes = [];\n }\n (_this$loadedIncludes = this.loadedIncludes) != null ? _this$loadedIncludes : this.loadedIncludes = new Set();\n return app.store.find('tags', {\n include: includes.join(',')\n }).then(val => {\n const tags = Array.isArray(val) ? val : [val];\n includes.forEach(include => this.loadedIncludes.add(include));\n return tags;\n });\n }\n}\nflarum.reg.add('flarum-tags', 'common/states/TagListState', TagListState);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/computed');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Model');","import computed from 'flarum/common/utils/computed';\nimport Model from 'flarum/common/Model';\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 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 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 isPrimary() {\n return Model.attribute('isPrimary').call(this);\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 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 isPrimaryParent() {\n return computed('position', 'parent', (position, parent) => position !== null && parent === false).call(this);\n }\n}\nflarum.reg.add('flarum-tags', 'common/models/Tag', Tag);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/query/IGambit');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/common/app';\nimport { KeyValueGambit } from 'flarum/common/query/IGambit';\nexport default class TagGambit extends KeyValueGambit {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"predicates\", true);\n }\n key() {\n return app.translator.trans('flarum-tags.lib.gambits.discussions.tag.key', {}, true);\n }\n hint() {\n return app.translator.trans('flarum-tags.lib.gambits.discussions.tag.hint', {}, true);\n }\n filterKey() {\n return 'tag';\n }\n gambitValueToFilterValue(value) {\n return [value];\n }\n fromFilter(value, negate) {\n let gambits = [];\n if (Array.isArray(value)) {\n gambits = value.map(value => this.fromFilter(value.toString(), negate));\n } else {\n return \"\".concat(negate ? '-' : '').concat(this.key(), \":\").concat(this.filterValueToGambitValue(value));\n }\n return gambits.join(' ');\n }\n filterValueToGambitValue(value) {\n return value;\n }\n}\nflarum.reg.add('flarum-tags', 'common/query/discussions/TagGambit', TagGambit);","import Extend from 'flarum/common/extenders';\nimport Tag from './models/Tag';\nimport TagGambit from './query/discussions/TagGambit';\nexport default [new Extend.Store() //\n.add('tags', Tag), new Extend.Search() //\n.gambit('discussions', TagGambit)];","import app from 'flarum/admin/app';\nimport addTagsPermissionScope from './addTagsPermissionScope';\nimport addTagPermission from './addTagPermission';\nimport addTagsHomePageOption from './addTagsHomePageOption';\nimport addTagChangePermission from './addTagChangePermission';\nimport addTagSelectionSettingComponent from './addTagSelectionSettingComponent';\nimport TagsPage from './components/TagsPage';\nimport TagListState from '../common/states/TagListState';\nexport { default as extend } from '../common/extend';\napp.initializers.add('flarum-tags', app => {\n app.tagList = new TagListState();\n app.extensionData.for('flarum-tags').registerPage(TagsPage);\n addTagsPermissionScope();\n addTagPermission();\n addTagsHomePageOption();\n addTagChangePermission();\n addTagSelectionSettingComponent();\n});\nimport './admin';","import app from 'flarum/admin/app';\nimport { extend, override } from 'flarum/common/extend';\nimport PermissionGrid from 'flarum/admin/components/PermissionGrid';\nimport PermissionDropdown from 'flarum/admin/components/PermissionDropdown';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport tagLabel from '../common/helpers/tagLabel';\nimport tagIcon from '../common/helpers/tagIcon';\nimport sortTags from '../common/utils/sortTags';\nexport default function () {\n extend(PermissionGrid.prototype, 'oninit', function () {\n this.loading = true;\n });\n extend(PermissionGrid.prototype, 'oncreate', function () {\n app.tagList.load().then(() => {\n this.loading = false;\n m.redraw();\n });\n });\n override(PermissionGrid.prototype, 'view', function (original, vnode) {\n if (this.loading) {\n return m(LoadingIndicator, null);\n }\n return original(vnode);\n });\n override(app, 'getRequiredPermissions', (original, permission) => {\n const tagPrefix = permission.match(/^tag\\d+\\./);\n if (tagPrefix) {\n const globalPermission = permission.substr(tagPrefix[0].length);\n const required = original(globalPermission);\n return required.map(required => tagPrefix[0] + required);\n }\n return original(permission);\n });\n extend(PermissionGrid.prototype, 'scopeItems', items => {\n sortTags(app.store.all('tags')).filter(tag => tag.isRestricted()).forEach(tag => items.add('tag' + tag.id(), {\n label: tagLabel(tag),\n onremove: () => tag.save({\n isRestricted: false\n }),\n render: item => {\n if ('setting' in item) return null;\n if (item.permission === 'viewForum' || item.permission === 'startDiscussion' || item.permission.startsWith('discussion.') && item.tagScoped !== false || item.tagScoped) {\n return m(PermissionDropdown, {\n permission: \"tag\".concat(tag.id(), \".\").concat(item.permission),\n allowGuest: item.allowGuest\n });\n }\n return null;\n }\n }));\n });\n extend(PermissionGrid.prototype, 'scopeControlItems', items => {\n const tags = sortTags(app.store.all('tags').filter(tag => !tag.isRestricted()));\n if (tags.length) {\n items.add('tag', m(Dropdown, {\n className: \"Dropdown--restrictByTag\",\n buttonClassName: \"Button Button--text\",\n label: app.translator.trans('flarum-tags.admin.permissions.restrict_by_tag_heading'),\n icon: \"fas fa-plus\",\n caretIcon: null\n }, tags.map(tag => m(Button, {\n icon: true,\n onclick: () => tag.save({\n isRestricted: true\n })\n }, [tagIcon(tag, {\n className: 'Button-icon'\n }), ' ', tag.name()]))));\n }\n });\n}","import app from 'flarum/admin/app';\nimport { extend } from 'flarum/common/extend';\nimport PermissionGrid from 'flarum/admin/components/PermissionGrid';\nimport SettingDropdown from 'flarum/admin/components/SettingDropdown';\nexport default function () {\n extend(PermissionGrid.prototype, 'startItems', items => {\n items.add('allowTagChange', {\n icon: 'fas fa-tag',\n label: app.translator.trans('flarum-tags.admin.permissions.allow_edit_tags_label'),\n setting: () => {\n const minutes = parseInt(app.data.settings.allow_tag_change, 10);\n return m(SettingDropdown, {\n defaultLabel: minutes ? app.translator.trans('core.admin.permissions_controls.allow_some_minutes_button', {\n count: minutes\n }) : app.translator.trans('core.admin.permissions_controls.allow_indefinitely_button'),\n key: \"allow_tag_change\",\n options: [{\n value: '-1',\n label: app.translator.trans('core.admin.permissions_controls.allow_indefinitely_button')\n }, {\n value: '10',\n label: app.translator.trans('core.admin.permissions_controls.allow_ten_minutes_button')\n }, {\n value: 'reply',\n label: app.translator.trans('core.admin.permissions_controls.allow_until_reply_button')\n }]\n });\n }\n }, 90);\n });\n}","import { extend } from 'flarum/common/extend';\nimport SelectTagsSettingComponent from './components/SelectTagsSettingComponent';\nimport FormGroup from 'flarum/common/components/FormGroup';\nexport default function () {\n extend(FormGroup.prototype, 'customFieldComponents', function (items) {\n items.add('flarum-tags.select-tags', attrs => {\n return m(SelectTagsSettingComponent, Object.assign({}, attrs, {\n settingValue: attrs.bidi\n }));\n });\n });\n}","import classList from 'flarum/common/utils/classList';\nexport default function tagIcon(tag, attrs, settings) {\n if (attrs === void 0) {\n attrs = {};\n }\n if (settings === void 0) {\n settings = {};\n }\n const hasIcon = tag && tag.icon();\n const {\n useColor = true\n } = settings;\n attrs.className = classList([attrs.className, 'icon text-colored', hasIcon ? tag.icon() : 'TagIcon']);\n if (tag && useColor) {\n attrs.style = attrs.style || {};\n attrs.style['--color'] = tag.color();\n } else if (!tag) {\n attrs.className += ' untagged';\n }\n return hasIcon ? m(\"i\", attrs) : m(\"span\", attrs);\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagIcon', tagIcon);","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';\nexport default function tagLabel(tag, attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n attrs.style = attrs.style || {};\n attrs.className = 'TagLabel ' + (attrs.className || '');\n const link = extract(attrs, 'link');\n const tagText = tag ? tag.name() : app.translator.trans('flarum-tags.lib.deleted_tag_text');\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 if (link) {\n attrs.title = tag.description() || '';\n attrs.href = app.route('tag', {\n tags: tag.slug()\n });\n }\n if (tag.isChild()) {\n attrs.className += ' TagLabel--child';\n }\n } else {\n attrs.className += ' untagged';\n }\n return m(link ? Link : 'span', attrs, m(\"span\", {\n className: \"TagLabel-text\"\n }, tag && tag.icon() && tagIcon(tag, {\n className: 'TagLabel-icon'\n }, {\n useColor: false\n }), m(\"span\", {\n className: \"TagLabel-name\"\n }, tagText)));\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagLabel', tagLabel);","export default function sortTags(tags) {\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;else if (bParent) return bParent === a ? -1 : aPos - bParent.position();\n return 0;\n });\n}\nflarum.reg.add('flarum-tags', 'common/utils/sortTags', sortTags);","module.exports = flarum.reg.get('core', 'common/Component');","module.exports = flarum.reg.get('core', 'common/app');","module.exports = flarum.reg.get('core', 'common/components/Button');","module.exports = flarum.reg.get('core', 'common/components/FormModal');","module.exports = flarum.reg.get('core', 'common/components/Link');","module.exports = flarum.reg.get('core', 'common/components/LoadingIndicator');","module.exports = flarum.reg.get('core', 'common/helpers/highlight');","module.exports = flarum.reg.get('core', 'common/helpers/textContrastClass');","module.exports = flarum.reg.get('core', 'common/utils/KeyboardNavigatable');","module.exports = flarum.reg.get('core', 'common/utils/Stream');","module.exports = flarum.reg.get('core', 'common/utils/classList');","module.exports = flarum.reg.get('core', 'common/utils/extract');","module.exports = flarum.reg.get('core', 'common/utils/extractText');","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _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 }, _typeof(obj);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\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// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\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__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + \"common/components/TagSelectionModal\" + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\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};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.f.compat = (chunkId, promises) => {\n\n\tconst originalLoadChunk = __webpack_require__.l;\n\t__webpack_require__.l = flarum.reg.loadChunk.bind(flarum.reg, originalLoadChunk);\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t328: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkmodule_exports\"] = self[\"webpackChunkmodule_exports\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));"],"names":["inProgress","dataWebpackPrefix","flarum","reg","get","app","extensionData","for","registerPermission","icon","label","translator","trans","permission","extend","items","add","path","tagsLabel","tags","attrs","children","link","otherAttrs","className","sortTags","forEach","tag","length","push","tagLabel","m","SelectTagsSettingComponent","constructor","super","arguments","this","view","value","JSON","parse","settingValue","loaded","then","filter","includes","id","redraw","help","onclick","selectedTags","onsubmit","stringify","map","options","size","display","addChunkModule","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","sym","getOwnPropertyDescriptor","enumerable","apply","_objectSpread2","target","i","source","key","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_typeof","obj","Symbol","iterator","prototype","configurable","writable","_extends","assign","hasOwnProperty","call","_objectWithoutProperties","excluded","sourceKeys","indexOf","_objectWithoutPropertiesLoose","sourceSymbolKeys","propertyIsEnumerable","userAgent","pattern","window","navigator","match","IE11OrLess","Edge","FireFox","Safari","IOS","ChromeForAndroid","captureMode","capture","passive","on","el","event","fn","addEventListener","off","removeEventListener","matches","selector","substring","msMatchesSelector","webkitMatchesSelector","_","getParentOrHost","host","document","nodeType","parentNode","closest","ctx","includeCTX","_throttleTimeout","R_SPACE","toggleClass","name","state","classList","replace","css","prop","val","style","defaultView","getComputedStyle","currentStyle","matrix","selfOnly","appliedTransforms","transform","matrixFn","DOMMatrix","WebKitCSSMatrix","CSSMatrix","MSCSSMatrix","find","tagName","list","getElementsByTagName","n","getWindowScrollingElement","scrollingElement","documentElement","getRect","relativeToContainingBlock","relativeToNonStaticParent","undoScale","container","getBoundingClientRect","elRect","top","left","bottom","right","height","width","innerHeight","innerWidth","containerRect","parseInt","elMatrix","scaleX","a","scaleY","d","isScrolledPast","elSide","parentSide","parent","getParentAutoScrollElement","elSideVal","parentSideVal","getChild","childNum","includeDragEl","currentChild","Sortable","ghost","dragged","draggable","lastChild","last","lastElementChild","previousElementSibling","index","nodeName","toUpperCase","clone","getRelativeScrollOffset","offsetLeft","offsetTop","winScroller","scrollLeft","scrollTop","includeSelf","elem","gotSelf","clientWidth","scrollWidth","clientHeight","scrollHeight","elemCSS","overflowX","overflowY","body","isRectEqual","rect1","rect2","Math","round","throttle","callback","ms","args","_this","setTimeout","scrollBy","x","y","Polymer","$","jQuery","Zepto","dom","cloneNode","expando","Date","getTime","plugins","defaults","initializeByDefault","PluginManager","mount","plugin","option","p","pluginName","concat","pluginEvent","eventName","sortable","evt","eventCanceled","cancel","eventNameGlobal","initializePlugins","initialized","modified","modifyOption","getEventProperties","eventProperties","modifiedValue","optionListeners","_excluded","_ref","undefined","originalEvent","data","bind","dragEl","parentEl","ghostEl","rootEl","nextEl","lastDownEl","cloneEl","cloneHidden","dragStarted","moved","putSortable","activeSortable","active","oldIndex","oldDraggableIndex","newIndex","newDraggableIndex","hideGhostForTarget","_hideGhostForTarget","unhideGhostForTarget","_unhideGhostForTarget","cloneNowHidden","cloneNowShown","dispatchSortableEvent","_dispatchEvent","info","targetEl","toEl","fromEl","extraEventProperties","onName","charAt","substr","CustomEvent","createEvent","initEvent","bubbles","cancelable","to","from","item","pullMode","lastPutMode","allEventProperties","dispatchEvent","activeGroup","tapEvt","touchEvt","lastDx","lastDy","tapDistanceLeft","tapDistanceTop","lastTarget","lastDirection","targetMoveDistance","ghostRelativeParent","awaitingDragStarted","ignoreNextClick","sortables","pastFirstInvertThresh","isCircumstantialInvert","ghostRelativeParentInitialScroll","_silent","savedInputChecked","documentExists","PositionGhostAbsolutely","CSSFloatProperty","supportDraggable","createElement","supportCssPointerEvents","cssText","pointerEvents","_detectDirection","elCSS","elWidth","paddingLeft","paddingRight","borderLeftWidth","borderRightWidth","child1","child2","firstChildCSS","secondChildCSS","firstChildWidth","marginLeft","marginRight","secondChildWidth","flexDirection","gridTemplateColumns","split","touchingSideChild2","clear","_prepareGroup","toFn","pull","sameGroup","group","otherGroup","join","originalGroup","checkPull","checkPut","put","revertClone","preventDefault","stopPropagation","stopImmediatePropagation","nearestEmptyInsertDetectEvent","touches","nearest","clientX","clientY","some","threshold","emptyInsertThreshold","rect","insideHorizontally","insideVertically","ret","_onDragOver","_checkOutsideTargetEl","_isOutsideThisEl","toString","animationCallbackId","animationStates","sort","disabled","store","handle","test","swapThreshold","invertSwap","invertedSwapThreshold","removeCloneOnHide","direction","ghostClass","chosenClass","dragClass","ignore","preventOnFilter","animation","easing","setData","dataTransfer","textContent","dropBubble","dragoverBubble","dataIdAttr","delay","delayOnTouchOnly","touchStartThreshold","Number","devicePixelRatio","forceFallback","fallbackClass","fallbackOnBody","fallbackTolerance","fallbackOffset","supportPointer","nativeDraggable","_onTapStart","captureAnimationState","slice","child","fromRect","thisAnimationDuration","childMatrix","f","e","addAnimationState","removeAnimationState","splice","arr","indexOfObject","animateAll","clearTimeout","animating","animationTime","time","toRect","prevFromRect","prevToRect","animatingRect","targetMatrix","sqrt","pow","calculateRealTime","animate","max","animationResetTimer","currentRect","duration","translateX","translateY","animatingX","animatingY","forRepaintDummy","offsetWidth","repaint","animated","_onMove","dragRect","targetRect","willInsertAfter","retVal","onMoveFn","onMove","draggedRect","related","relatedRect","_disableDraggable","_unsilent","_generateId","str","src","href","sum","charCodeAt","_nextTick","_cancelNextTick","contains","_getDirection","type","touch","pointerType","originalTarget","shadowRoot","composedPath","root","inputs","idx","checked","_saveInputCheckedState","button","isContentEditable","criteria","trim","_prepareDragStart","dragStartFn","ownerDocument","nextSibling","_lastX","_lastY","_onDrop","_disableDelayedDragEvents","_triggerDragStart","_disableDelayedDrag","_delayedDragTouchMoveHandler","_dragStartTimer","abs","floor","_onTouchMove","_onDragStart","selection","empty","getSelection","removeAllRanges","err","_dragStarted","fallback","_appendGhost","_nulling","_emulateDragOver","elementFromPoint","ghostMatrix","relativeScrollOffset","dx","dy","b","c","cssMatrix","appendChild","removeAttribute","_hideClone","cloneId","insertBefore","_loopId","setInterval","effectAllowed","_dragStartId","revert","vertical","isOwner","canSort","fromSortable","completedFired","dragOverEvent","_ignoreWhileAnimating","completed","elLastChild","_ghostIsLast","changed","_ghostIsFirst","firstChild","targetBeforeFirstSwap","sibling","differentLevel","differentRowCol","dragElS1Opp","dragElS2Opp","dragElOppLength","targetS1Opp","targetS2Opp","targetOppLength","_dragElInRowColumn","side1","scrolledPastTop","scrollBefore","isLastTarget","mouseOnAxis","targetLength","targetS1","targetS2","invert","_getInsertDirection","_getSwapDirection","dragIndex","nextElementSibling","after","moveVector","extra","axis","insertion","_showClone","_offMoveEvents","_offUpEvents","clearInterval","removeChild","save","handleEvent","dropEffect","_globalDragOver","toArray","order","getAttribute","useAnimation","set","destroy","Array","querySelectorAll","utils","is","dst","nextTick","cancelNextTick","detectDirection","element","_len","_key","create","version","scrollEl","scrollRootEl","lastAutoScrollX","lastAutoScrollY","touchEvt$1","pointerElemChangedInterval","autoScrolls","scrolling","clearAutoScrolls","autoScroll","pid","clearPointerElemChangedInterval","isFallback","scroll","scrollCustomFn","sens","scrollSensitivity","speed","scrollSpeed","scrollThisInstance","scrollFn","layersOut","currentParent","canScrollX","canScrollY","scrollPosX","scrollPosY","vx","vy","layer","scrollOffsetY","scrollOffsetX","bubbleScroll","drop","toSortable","changedTouches","onSpill","Revert","Remove","startIndex","dragStart","_ref2","_ref3","_ref4","parentSortable","AutoScroll","forceAutoScrollFallback","_handleAutoScroll","_handleFallbackAutoScroll","dragOverCompleted","dragOverBubble","nulling","ogElemScroller","newElem","EditTagModal","oninit","vnode","model","slug","description","color","isHidden","isPrimary","primary","title","attributes","submitData","content","fields","placeholder","oninput","bidi","tabindex","loading","exists","delete","hide","confirm","pushData","isChild","Component","setAttrs","oncreate","onbeforeupdate","onupdate","onbeforeremove","onremove","$element","static","componentAttrs","initAttrs","Error","r","t","isArray","FormSectionGroup","FormSection","tagItem","tagIcon","position","TagsPage","forcedRefreshKey","minPrimaryTags","setting","maxPrimaryTags","minSecondaryTags","maxSecondaryTags","onListOnCreate","localeCompare","min","setMinTags","submitButton","onSort","onSortUpdate","minTags","maxTags","HTMLOListElement","HTMLUListElement","relationships","j","url","method","TagListState","async","loadedIncludes","query","unloadedIncludes","include","has","Promise","resolve","Set","Tag","backgroundUrl","backgroundMode","defaultSort","discussionCount","lastPostedAt","lastPostedDiscussion","isRestricted","canStartDiscussion","canAddToDiscussion","isPrimaryParent","TagGambit","KeyValueGambit","hint","filterKey","gambitValueToFilterValue","fromFilter","negate","gambits","filterValueToGambitValue","gambit","tagList","registerPage","override","original","tagPrefix","required","render","startsWith","tagScoped","allowGuest","buttonClassName","caretIcon","addTagPermission","addTagsHomePageOption","minutes","defaultLabel","count","settings","hasIcon","useColor","tagText","route","aPos","bPos","aParent","bParent","module","exports","arg","input","prim","toPrimitive","res","TypeError","String","toPropertyKey","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","definition","o","chunkId","all","reduce","promises","u","g","globalThis","Function","l","done","script","needAttach","scripts","s","charset","timeout","nc","setAttribute","onScriptComplete","prev","onerror","onload","doneFns","head","toStringTag","scriptUrl","importScripts","location","currentScript","compat","originalLoadChunk","loadChunk","installedChunks","installedChunkData","promise","reject","error","errorType","realSrc","message","request","webpackJsonpCallback","parentChunkLoadingFunction","chunkIds","moreModules","runtime","chunkLoadingGlobal","self"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"admin.js","mappings":";UAAIA,EAC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MACRkC,EAAgBlC,QAAW3hB,GACrD8jB,GAAoB,CACtB,IAAII,EAAYpuB,IAAyB,SAAfA,EAAMoY,KAAkB,UAAYpY,EAAMoY,MAChEiW,EAAUruB,GAASA,EAAM1C,QAAU0C,EAAM1C,OAAOsa,IACpDuW,EAAMG,QAAU,iBAAmBzC,EAAU,cAAgBuC,EAAY,KAAOC,EAAU,IAC1FF,EAAM7sB,KAAO,iBACb6sB,EAAM/V,KAAOgW,EACbD,EAAMI,QAAUF,EAChBL,EAAmB,GAAGG,EACvB,CACD,GAEwC,SAAWtC,EAASA,EAE/D,CACD,EAcF,IAAI2C,EAAuB,CAACC,EAA4BrkB,KACvD,IAGIkhB,EAAUO,GAHT6C,EAAUC,EAAaC,GAAWxkB,EAGhB7M,EAAI,EAC3B,GAAGmxB,EAASpd,MAAMxV,GAAgC,IAAxBiyB,EAAgBjyB,KAAa,CACtD,IAAIwvB,KAAYqD,EACZtD,EAAoBO,EAAE+C,EAAarD,KACrCD,EAAoBtwB,EAAEuwB,GAAYqD,EAAYrD,IAG7CsD,GAAsBA,EAAQvD,EAClC,CAEA,IADGoD,GAA4BA,EAA2BrkB,GACrD7M,EAAImxB,EAAS9zB,OAAQ2C,IACzBsuB,EAAU6C,EAASnxB,GAChB8tB,EAAoBO,EAAEmC,EAAiBlC,IAAYkC,EAAgBlC,IACrEkC,EAAgBlC,GAAS,KAE1BkC,EAAgBlC,GAAW,CAC5B,EAIGgD,EAAqBC,KAAiC,2BAAIA,KAAiC,4BAAK,GACpGD,EAAmBn0B,QAAQ8zB,EAAqBnkB,KAAK,KAAM,IAC3DwkB,EAAmBh0B,KAAO2zB,EAAqBnkB,KAAK,KAAMwkB,EAAmBh0B,KAAKwP,KAAKwkB","sources":["webpack://@flarum/tags/webpack/runtime/load script","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/app')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/PermissionGrid')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/PermissionDropdown')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Dropdown')\"","webpack://@flarum/tags/./src/admin/addTagPermission.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/BasicsPage')\"","webpack://@flarum/tags/./src/admin/addTagsHomePageOption.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/SettingDropdown')\"","webpack://@flarum/tags/./src/common/helpers/tagsLabel.js","webpack://@flarum/tags/./src/admin/components/SelectTagsSettingComponent.tsx","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/FormGroup')\"","webpack://@flarum/tags/../../../node_modules/sortablejs/modular/sortable.esm.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/ExtensionPage')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/withAttr')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Form')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/FormSectionGroup')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/FormSection')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/ColorPreviewInput')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/ItemList')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/string')\"","webpack://@flarum/tags/./src/admin/components/EditTagModal.tsx","webpack://@flarum/tags/./src/admin/components/TagsPage.js","webpack://@flarum/tags/./src/common/states/TagListState.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/computed')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/Model')\"","webpack://@flarum/tags/./src/common/models/Tag.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/query/IGambit')\"","webpack://@flarum/tags/./src/common/query/discussions/TagGambit.ts","webpack://@flarum/tags/./src/common/extend.ts","webpack://@flarum/tags/./src/admin/index.ts","webpack://@flarum/tags/./src/admin/addTagsPermissionScope.tsx","webpack://@flarum/tags/./src/admin/addTagChangePermission.js","webpack://@flarum/tags/./src/admin/addTagSelectionSettingComponent.tsx","webpack://@flarum/tags/./src/common/helpers/tagIcon.js","webpack://@flarum/tags/./src/common/helpers/tagLabel.js","webpack://@flarum/tags/./src/common/utils/sortTags.tsx","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/Component')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/app')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/FormModal')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Link')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/LoadingIndicator')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/highlight')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/textContrastClass')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/KeyboardNavigatable')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/Stream')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/classList')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/extract')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/tags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/tags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/tags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/tags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPrimitive.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/ensure chunk","webpack://@flarum/tags/webpack/runtime/get javascript chunk filename","webpack://@flarum/tags/webpack/runtime/global","webpack://@flarum/tags/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/tags/webpack/runtime/make namespace object","webpack://@flarum/tags/webpack/runtime/publicPath","webpack://@flarum/tags/webpack/runtime/compat","webpack://@flarum/tags/webpack/runtime/jsonp chunk loading"],"sourcesContent":["var inProgress = {};\nvar dataWebpackPrefix = \"module.exports:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t};\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/PermissionGrid');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/PermissionDropdown');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Dropdown');","export default function () {\n app.extensionData.for('flarum-tags').registerPermission({\n icon: 'fas fa-tag',\n label: app.translator.trans('flarum-tags.admin.permissions.tag_discussions_label'),\n permission: 'discussion.tag'\n }, 'moderate', 95).registerPermission({\n icon: 'fas fa-tags',\n label: app.translator.trans('flarum-tags.admin.permissions.bypass_tag_counts_label'),\n permission: 'bypassTagCounts'\n }, 'start', 89);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/BasicsPage');","import { extend } from 'flarum/common/extend';\nimport BasicsPage from 'flarum/admin/components/BasicsPage';\nexport default function () {\n extend(BasicsPage.prototype, 'homePageItems', items => {\n items.add('tags', {\n path: '/tags',\n label: app.translator.trans('flarum-tags.admin.basics.tags_label')\n });\n });\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/SettingDropdown');","import extract from 'flarum/common/utils/extract';\nimport tagLabel from './tagLabel';\nimport sortTags from '../utils/sortTags';\nimport classList from 'flarum/common/utils/classList';\nexport default function tagsLabel(tags, attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n const children = [];\n const {\n link,\n ...otherAttrs\n } = attrs;\n otherAttrs.className = classList('TagsLabel', otherAttrs.className);\n if (tags) {\n sortTags(tags).forEach(tag => {\n if (tag || tags.length === 1) {\n children.push(tagLabel(tag, {\n link\n }));\n }\n });\n } else {\n children.push(tagLabel());\n }\n return m(\"span\", otherAttrs, children);\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagsLabel', tagsLabel);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport tagsLabel from '../../common/helpers/tagsLabel';\nexport default class SelectTagsSettingComponent extends Component {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"tags\", []);\n _defineProperty(this, \"loaded\", false);\n }\n view() {\n const value = JSON.parse(this.attrs.settingValue() || '[]');\n if (!this.loaded) {\n app.tagList.load(['parent']).then(tags => {\n this.tags = tags.filter(tag => value.includes(tag.id()));\n this.loaded = true;\n m.redraw();\n });\n }\n return m(\"div\", {\n className: \"Form-group SelectTagsSettingComponent\"\n }, m(\"label\", null, this.attrs.label), this.attrs.help && m(\"p\", {\n className: \"helpText\"\n }, this.attrs.help), !this.loaded ? m(LoadingIndicator, {\n size: \"small\",\n display: \"inline\"\n }) : m(Button, {\n className: \"Button Button--text\",\n onclick: () => app.modal.show(() => import(/* webpackChunkName: 'common/components/TagSelectionModal', webpackMode: 'lazy-once' */ '../../common/components/TagSelectionModal'), {\n selectedTags: this.tags,\n onsubmit: tags => {\n this.tags = tags;\n this.attrs.settingValue(JSON.stringify(tags.map(tag => tag.id())));\n },\n ...this.attrs.options\n })\n }, !!this.tags.length ? tagsLabel(this.tags) : m(\"span\", {\n className: \"TagLabel untagged\"\n }, app.translator.trans('flarum-tags.admin.settings.button_text'))));\n }\n}\nflarum.reg.add('flarum-tags', 'admin/components/SelectTagsSettingComponent', SelectTagsSettingComponent);flarum.reg.addChunkModule('162', '610', 'flarum-tags', 'common/components/TagSelectionModal');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/FormGroup');","/**!\n * Sortable 1.15.0\n * @author\tRubaXa \n * @author\towenm \n * @license MIT\n */\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\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\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\n\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar version = \"1.15.0\";\n\nfunction userAgent(pattern) {\n if (typeof window !== 'undefined' && window.navigator) {\n return !! /*@__PURE__*/navigator.userAgent.match(pattern);\n }\n}\n\nvar IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\\.|msie|iemobile|Windows Phone)/i);\nvar Edge = userAgent(/Edge/i);\nvar FireFox = userAgent(/firefox/i);\nvar Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);\nvar IOS = userAgent(/iP(ad|od|hone)/i);\nvar ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);\n\nvar captureMode = {\n capture: false,\n passive: false\n};\n\nfunction on(el, event, fn) {\n el.addEventListener(event, fn, !IE11OrLess && captureMode);\n}\n\nfunction off(el, event, fn) {\n el.removeEventListener(event, fn, !IE11OrLess && captureMode);\n}\n\nfunction matches(\n/**HTMLElement*/\nel,\n/**String*/\nselector) {\n if (!selector) return;\n selector[0] === '>' && (selector = selector.substring(1));\n\n if (el) {\n try {\n if (el.matches) {\n return el.matches(selector);\n } else if (el.msMatchesSelector) {\n return el.msMatchesSelector(selector);\n } else if (el.webkitMatchesSelector) {\n return el.webkitMatchesSelector(selector);\n }\n } catch (_) {\n return false;\n }\n }\n\n return false;\n}\n\nfunction getParentOrHost(el) {\n return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;\n}\n\nfunction closest(\n/**HTMLElement*/\nel,\n/**String*/\nselector,\n/**HTMLElement*/\nctx, includeCTX) {\n if (el) {\n ctx = ctx || document;\n\n do {\n if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {\n return el;\n }\n\n if (el === ctx) break;\n /* jshint boss:true */\n } while (el = getParentOrHost(el));\n }\n\n return null;\n}\n\nvar R_SPACE = /\\s+/g;\n\nfunction toggleClass(el, name, state) {\n if (el && name) {\n if (el.classList) {\n el.classList[state ? 'add' : 'remove'](name);\n } else {\n var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');\n el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');\n }\n }\n}\n\nfunction css(el, prop, val) {\n var style = el && el.style;\n\n if (style) {\n if (val === void 0) {\n if (document.defaultView && document.defaultView.getComputedStyle) {\n val = document.defaultView.getComputedStyle(el, '');\n } else if (el.currentStyle) {\n val = el.currentStyle;\n }\n\n return prop === void 0 ? val : val[prop];\n } else {\n if (!(prop in style) && prop.indexOf('webkit') === -1) {\n prop = '-webkit-' + prop;\n }\n\n style[prop] = val + (typeof val === 'string' ? '' : 'px');\n }\n }\n}\n\nfunction matrix(el, selfOnly) {\n var appliedTransforms = '';\n\n if (typeof el === 'string') {\n appliedTransforms = el;\n } else {\n do {\n var transform = css(el, 'transform');\n\n if (transform && transform !== 'none') {\n appliedTransforms = transform + ' ' + appliedTransforms;\n }\n /* jshint boss:true */\n\n } while (!selfOnly && (el = el.parentNode));\n }\n\n var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;\n /*jshint -W056 */\n\n return matrixFn && new matrixFn(appliedTransforms);\n}\n\nfunction find(ctx, tagName, iterator) {\n if (ctx) {\n var list = ctx.getElementsByTagName(tagName),\n i = 0,\n n = list.length;\n\n if (iterator) {\n for (; i < n; i++) {\n iterator(list[i], i);\n }\n }\n\n return list;\n }\n\n return [];\n}\n\nfunction getWindowScrollingElement() {\n var scrollingElement = document.scrollingElement;\n\n if (scrollingElement) {\n return scrollingElement;\n } else {\n return document.documentElement;\n }\n}\n/**\n * Returns the \"bounding client rect\" of given element\n * @param {HTMLElement} el The element whose boundingClientRect is wanted\n * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container\n * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr\n * @param {[Boolean]} undoScale Whether the container's scale() should be undone\n * @param {[HTMLElement]} container The parent the element will be placed in\n * @return {Object} The boundingClientRect of el, with specified adjustments\n */\n\n\nfunction getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {\n if (!el.getBoundingClientRect && el !== window) return;\n var elRect, top, left, bottom, right, height, width;\n\n if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {\n elRect = el.getBoundingClientRect();\n top = elRect.top;\n left = elRect.left;\n bottom = elRect.bottom;\n right = elRect.right;\n height = elRect.height;\n width = elRect.width;\n } else {\n top = 0;\n left = 0;\n bottom = window.innerHeight;\n right = window.innerWidth;\n height = window.innerHeight;\n width = window.innerWidth;\n }\n\n if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {\n // Adjust for translate()\n container = container || el.parentNode; // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)\n // Not needed on <= IE11\n\n if (!IE11OrLess) {\n do {\n if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {\n var containerRect = container.getBoundingClientRect(); // Set relative to edges of padding box of container\n\n top -= containerRect.top + parseInt(css(container, 'border-top-width'));\n left -= containerRect.left + parseInt(css(container, 'border-left-width'));\n bottom = top + elRect.height;\n right = left + elRect.width;\n break;\n }\n /* jshint boss:true */\n\n } while (container = container.parentNode);\n }\n }\n\n if (undoScale && el !== window) {\n // Adjust for scale()\n var elMatrix = matrix(container || el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d;\n\n if (elMatrix) {\n top /= scaleY;\n left /= scaleX;\n width /= scaleX;\n height /= scaleY;\n bottom = top + height;\n right = left + width;\n }\n }\n\n return {\n top: top,\n left: left,\n bottom: bottom,\n right: right,\n width: width,\n height: height\n };\n}\n/**\n * Checks if a side of an element is scrolled past a side of its parents\n * @param {HTMLElement} el The element who's side being scrolled out of view is in question\n * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')\n * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')\n * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element\n */\n\n\nfunction isScrolledPast(el, elSide, parentSide) {\n var parent = getParentAutoScrollElement(el, true),\n elSideVal = getRect(el)[elSide];\n /* jshint boss:true */\n\n while (parent) {\n var parentSideVal = getRect(parent)[parentSide],\n visible = void 0;\n\n if (parentSide === 'top' || parentSide === 'left') {\n visible = elSideVal >= parentSideVal;\n } else {\n visible = elSideVal <= parentSideVal;\n }\n\n if (!visible) return parent;\n if (parent === getWindowScrollingElement()) break;\n parent = getParentAutoScrollElement(parent, false);\n }\n\n return false;\n}\n/**\n * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)\n * and non-draggable elements\n * @param {HTMLElement} el The parent element\n * @param {Number} childNum The index of the child\n * @param {Object} options Parent Sortable's options\n * @return {HTMLElement} The child at index childNum, or null if not found\n */\n\n\nfunction getChild(el, childNum, options, includeDragEl) {\n var currentChild = 0,\n i = 0,\n children = el.children;\n\n while (i < children.length) {\n if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {\n if (currentChild === childNum) {\n return children[i];\n }\n\n currentChild++;\n }\n\n i++;\n }\n\n return null;\n}\n/**\n * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)\n * @param {HTMLElement} el Parent element\n * @param {selector} selector Any other elements that should be ignored\n * @return {HTMLElement} The last child, ignoring ghostEl\n */\n\n\nfunction lastChild(el, selector) {\n var last = el.lastElementChild;\n\n while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {\n last = last.previousElementSibling;\n }\n\n return last || null;\n}\n/**\n * Returns the index of an element within its parent for a selected set of\n * elements\n * @param {HTMLElement} el\n * @param {selector} selector\n * @return {number}\n */\n\n\nfunction index(el, selector) {\n var index = 0;\n\n if (!el || !el.parentNode) {\n return -1;\n }\n /* jshint boss:true */\n\n\n while (el = el.previousElementSibling) {\n if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {\n index++;\n }\n }\n\n return index;\n}\n/**\n * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.\n * The value is returned in real pixels.\n * @param {HTMLElement} el\n * @return {Array} Offsets in the format of [left, top]\n */\n\n\nfunction getRelativeScrollOffset(el) {\n var offsetLeft = 0,\n offsetTop = 0,\n winScroller = getWindowScrollingElement();\n\n if (el) {\n do {\n var elMatrix = matrix(el),\n scaleX = elMatrix.a,\n scaleY = elMatrix.d;\n offsetLeft += el.scrollLeft * scaleX;\n offsetTop += el.scrollTop * scaleY;\n } while (el !== winScroller && (el = el.parentNode));\n }\n\n return [offsetLeft, offsetTop];\n}\n/**\n * Returns the index of the object within the given array\n * @param {Array} arr Array that may or may not hold the object\n * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find\n * @return {Number} The index of the object in the array, or -1\n */\n\n\nfunction indexOfObject(arr, obj) {\n for (var i in arr) {\n if (!arr.hasOwnProperty(i)) continue;\n\n for (var key in obj) {\n if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);\n }\n }\n\n return -1;\n}\n\nfunction getParentAutoScrollElement(el, includeSelf) {\n // skip to window\n if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();\n var elem = el;\n var gotSelf = false;\n\n do {\n // we don't need to get elem css if it isn't even overflowing in the first place (performance)\n if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {\n var elemCSS = css(elem);\n\n if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {\n if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();\n if (gotSelf || includeSelf) return elem;\n gotSelf = true;\n }\n }\n /* jshint boss:true */\n\n } while (elem = elem.parentNode);\n\n return getWindowScrollingElement();\n}\n\nfunction extend(dst, src) {\n if (dst && src) {\n for (var key in src) {\n if (src.hasOwnProperty(key)) {\n dst[key] = src[key];\n }\n }\n }\n\n return dst;\n}\n\nfunction isRectEqual(rect1, rect2) {\n return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);\n}\n\nvar _throttleTimeout;\n\nfunction throttle(callback, ms) {\n return function () {\n if (!_throttleTimeout) {\n var args = arguments,\n _this = this;\n\n if (args.length === 1) {\n callback.call(_this, args[0]);\n } else {\n callback.apply(_this, args);\n }\n\n _throttleTimeout = setTimeout(function () {\n _throttleTimeout = void 0;\n }, ms);\n }\n };\n}\n\nfunction cancelThrottle() {\n clearTimeout(_throttleTimeout);\n _throttleTimeout = void 0;\n}\n\nfunction scrollBy(el, x, y) {\n el.scrollLeft += x;\n el.scrollTop += y;\n}\n\nfunction clone(el) {\n var Polymer = window.Polymer;\n var $ = window.jQuery || window.Zepto;\n\n if (Polymer && Polymer.dom) {\n return Polymer.dom(el).cloneNode(true);\n } else if ($) {\n return $(el).clone(true)[0];\n } else {\n return el.cloneNode(true);\n }\n}\n\nfunction setRect(el, rect) {\n css(el, 'position', 'absolute');\n css(el, 'top', rect.top);\n css(el, 'left', rect.left);\n css(el, 'width', rect.width);\n css(el, 'height', rect.height);\n}\n\nfunction unsetRect(el) {\n css(el, 'position', '');\n css(el, 'top', '');\n css(el, 'left', '');\n css(el, 'width', '');\n css(el, 'height', '');\n}\n\nvar expando = 'Sortable' + new Date().getTime();\n\nfunction AnimationStateManager() {\n var animationStates = [],\n animationCallbackId;\n return {\n captureAnimationState: function captureAnimationState() {\n animationStates = [];\n if (!this.options.animation) return;\n var children = [].slice.call(this.el.children);\n children.forEach(function (child) {\n if (css(child, 'display') === 'none' || child === Sortable.ghost) return;\n animationStates.push({\n target: child,\n rect: getRect(child)\n });\n\n var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect); // If animating: compensate for current animation\n\n\n if (child.thisAnimationDuration) {\n var childMatrix = matrix(child, true);\n\n if (childMatrix) {\n fromRect.top -= childMatrix.f;\n fromRect.left -= childMatrix.e;\n }\n }\n\n child.fromRect = fromRect;\n });\n },\n addAnimationState: function addAnimationState(state) {\n animationStates.push(state);\n },\n removeAnimationState: function removeAnimationState(target) {\n animationStates.splice(indexOfObject(animationStates, {\n target: target\n }), 1);\n },\n animateAll: function animateAll(callback) {\n var _this = this;\n\n if (!this.options.animation) {\n clearTimeout(animationCallbackId);\n if (typeof callback === 'function') callback();\n return;\n }\n\n var animating = false,\n animationTime = 0;\n animationStates.forEach(function (state) {\n var time = 0,\n target = state.target,\n fromRect = target.fromRect,\n toRect = getRect(target),\n prevFromRect = target.prevFromRect,\n prevToRect = target.prevToRect,\n animatingRect = state.rect,\n targetMatrix = matrix(target, true);\n\n if (targetMatrix) {\n // Compensate for current animation\n toRect.top -= targetMatrix.f;\n toRect.left -= targetMatrix.e;\n }\n\n target.toRect = toRect;\n\n if (target.thisAnimationDuration) {\n // Could also check if animatingRect is between fromRect and toRect\n if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) && // Make sure animatingRect is on line between toRect & fromRect\n (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {\n // If returning to same place as started from animation and on same axis\n time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);\n }\n } // if fromRect != toRect: animate\n\n\n if (!isRectEqual(toRect, fromRect)) {\n target.prevFromRect = fromRect;\n target.prevToRect = toRect;\n\n if (!time) {\n time = _this.options.animation;\n }\n\n _this.animate(target, animatingRect, toRect, time);\n }\n\n if (time) {\n animating = true;\n animationTime = Math.max(animationTime, time);\n clearTimeout(target.animationResetTimer);\n target.animationResetTimer = setTimeout(function () {\n target.animationTime = 0;\n target.prevFromRect = null;\n target.fromRect = null;\n target.prevToRect = null;\n target.thisAnimationDuration = null;\n }, time);\n target.thisAnimationDuration = time;\n }\n });\n clearTimeout(animationCallbackId);\n\n if (!animating) {\n if (typeof callback === 'function') callback();\n } else {\n animationCallbackId = setTimeout(function () {\n if (typeof callback === 'function') callback();\n }, animationTime);\n }\n\n animationStates = [];\n },\n animate: function animate(target, currentRect, toRect, duration) {\n if (duration) {\n css(target, 'transition', '');\n css(target, 'transform', '');\n var elMatrix = matrix(this.el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d,\n translateX = (currentRect.left - toRect.left) / (scaleX || 1),\n translateY = (currentRect.top - toRect.top) / (scaleY || 1);\n target.animatingX = !!translateX;\n target.animatingY = !!translateY;\n css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');\n this.forRepaintDummy = repaint(target); // repaint\n\n css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));\n css(target, 'transform', 'translate3d(0,0,0)');\n typeof target.animated === 'number' && clearTimeout(target.animated);\n target.animated = setTimeout(function () {\n css(target, 'transition', '');\n css(target, 'transform', '');\n target.animated = false;\n target.animatingX = false;\n target.animatingY = false;\n }, duration);\n }\n }\n };\n}\n\nfunction repaint(target) {\n return target.offsetWidth;\n}\n\nfunction calculateRealTime(animatingRect, fromRect, toRect, options) {\n return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;\n}\n\nvar plugins = [];\nvar defaults = {\n initializeByDefault: true\n};\nvar PluginManager = {\n mount: function mount(plugin) {\n // Set default static properties\n for (var option in defaults) {\n if (defaults.hasOwnProperty(option) && !(option in plugin)) {\n plugin[option] = defaults[option];\n }\n }\n\n plugins.forEach(function (p) {\n if (p.pluginName === plugin.pluginName) {\n throw \"Sortable: Cannot mount plugin \".concat(plugin.pluginName, \" more than once\");\n }\n });\n plugins.push(plugin);\n },\n pluginEvent: function pluginEvent(eventName, sortable, evt) {\n var _this = this;\n\n this.eventCanceled = false;\n\n evt.cancel = function () {\n _this.eventCanceled = true;\n };\n\n var eventNameGlobal = eventName + 'Global';\n plugins.forEach(function (plugin) {\n if (!sortable[plugin.pluginName]) return; // Fire global events if it exists in this sortable\n\n if (sortable[plugin.pluginName][eventNameGlobal]) {\n sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({\n sortable: sortable\n }, evt));\n } // Only fire plugin event if plugin is enabled in this sortable,\n // and plugin has event defined\n\n\n if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {\n sortable[plugin.pluginName][eventName](_objectSpread2({\n sortable: sortable\n }, evt));\n }\n });\n },\n initializePlugins: function initializePlugins(sortable, el, defaults, options) {\n plugins.forEach(function (plugin) {\n var pluginName = plugin.pluginName;\n if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;\n var initialized = new plugin(sortable, el, sortable.options);\n initialized.sortable = sortable;\n initialized.options = sortable.options;\n sortable[pluginName] = initialized; // Add default options from plugin\n\n _extends(defaults, initialized.defaults);\n });\n\n for (var option in sortable.options) {\n if (!sortable.options.hasOwnProperty(option)) continue;\n var modified = this.modifyOption(sortable, option, sortable.options[option]);\n\n if (typeof modified !== 'undefined') {\n sortable.options[option] = modified;\n }\n }\n },\n getEventProperties: function getEventProperties(name, sortable) {\n var eventProperties = {};\n plugins.forEach(function (plugin) {\n if (typeof plugin.eventProperties !== 'function') return;\n\n _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));\n });\n return eventProperties;\n },\n modifyOption: function modifyOption(sortable, name, value) {\n var modifiedValue;\n plugins.forEach(function (plugin) {\n // Plugin must exist on the Sortable\n if (!sortable[plugin.pluginName]) return; // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin\n\n if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {\n modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);\n }\n });\n return modifiedValue;\n }\n};\n\nfunction dispatchEvent(_ref) {\n var sortable = _ref.sortable,\n rootEl = _ref.rootEl,\n name = _ref.name,\n targetEl = _ref.targetEl,\n cloneEl = _ref.cloneEl,\n toEl = _ref.toEl,\n fromEl = _ref.fromEl,\n oldIndex = _ref.oldIndex,\n newIndex = _ref.newIndex,\n oldDraggableIndex = _ref.oldDraggableIndex,\n newDraggableIndex = _ref.newDraggableIndex,\n originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n extraEventProperties = _ref.extraEventProperties;\n sortable = sortable || rootEl && rootEl[expando];\n if (!sortable) return;\n var evt,\n options = sortable.options,\n onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1); // Support for new CustomEvent feature\n\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent(name, {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent(name, true, true);\n }\n\n evt.to = toEl || rootEl;\n evt.from = fromEl || rootEl;\n evt.item = targetEl || rootEl;\n evt.clone = cloneEl;\n evt.oldIndex = oldIndex;\n evt.newIndex = newIndex;\n evt.oldDraggableIndex = oldDraggableIndex;\n evt.newDraggableIndex = newDraggableIndex;\n evt.originalEvent = originalEvent;\n evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;\n\n var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));\n\n for (var option in allEventProperties) {\n evt[option] = allEventProperties[option];\n }\n\n if (rootEl) {\n rootEl.dispatchEvent(evt);\n }\n\n if (options[onName]) {\n options[onName].call(sortable, evt);\n }\n}\n\nvar _excluded = [\"evt\"];\n\nvar pluginEvent = function pluginEvent(eventName, sortable) {\n var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n originalEvent = _ref.evt,\n data = _objectWithoutProperties(_ref, _excluded);\n\n PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({\n dragEl: dragEl,\n parentEl: parentEl,\n ghostEl: ghostEl,\n rootEl: rootEl,\n nextEl: nextEl,\n lastDownEl: lastDownEl,\n cloneEl: cloneEl,\n cloneHidden: cloneHidden,\n dragStarted: moved,\n putSortable: putSortable,\n activeSortable: Sortable.active,\n originalEvent: originalEvent,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n hideGhostForTarget: _hideGhostForTarget,\n unhideGhostForTarget: _unhideGhostForTarget,\n cloneNowHidden: function cloneNowHidden() {\n cloneHidden = true;\n },\n cloneNowShown: function cloneNowShown() {\n cloneHidden = false;\n },\n dispatchSortableEvent: function dispatchSortableEvent(name) {\n _dispatchEvent({\n sortable: sortable,\n name: name,\n originalEvent: originalEvent\n });\n }\n }, data));\n};\n\nfunction _dispatchEvent(info) {\n dispatchEvent(_objectSpread2({\n putSortable: putSortable,\n cloneEl: cloneEl,\n targetEl: dragEl,\n rootEl: rootEl,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex\n }, info));\n}\n\nvar dragEl,\n parentEl,\n ghostEl,\n rootEl,\n nextEl,\n lastDownEl,\n cloneEl,\n cloneHidden,\n oldIndex,\n newIndex,\n oldDraggableIndex,\n newDraggableIndex,\n activeGroup,\n putSortable,\n awaitingDragStarted = false,\n ignoreNextClick = false,\n sortables = [],\n tapEvt,\n touchEvt,\n lastDx,\n lastDy,\n tapDistanceLeft,\n tapDistanceTop,\n moved,\n lastTarget,\n lastDirection,\n pastFirstInvertThresh = false,\n isCircumstantialInvert = false,\n targetMoveDistance,\n // For positioning ghost absolutely\nghostRelativeParent,\n ghostRelativeParentInitialScroll = [],\n // (left, top)\n_silent = false,\n savedInputChecked = [];\n/** @const */\n\nvar documentExists = typeof document !== 'undefined',\n PositionGhostAbsolutely = IOS,\n CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',\n // This will not pass for IE9, because IE9 DnD only works on anchors\nsupportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),\n supportCssPointerEvents = function () {\n if (!documentExists) return; // false when <= IE11\n\n if (IE11OrLess) {\n return false;\n }\n\n var el = document.createElement('x');\n el.style.cssText = 'pointer-events:auto';\n return el.style.pointerEvents === 'auto';\n}(),\n _detectDirection = function _detectDirection(el, options) {\n var elCSS = css(el),\n elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),\n child1 = getChild(el, 0, options),\n child2 = getChild(el, 1, options),\n firstChildCSS = child1 && css(child1),\n secondChildCSS = child2 && css(child2),\n firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,\n secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;\n\n if (elCSS.display === 'flex') {\n return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';\n }\n\n if (elCSS.display === 'grid') {\n return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';\n }\n\n if (child1 && firstChildCSS[\"float\"] && firstChildCSS[\"float\"] !== 'none') {\n var touchingSideChild2 = firstChildCSS[\"float\"] === 'left' ? 'left' : 'right';\n return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';\n }\n\n return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';\n},\n _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {\n var dragElS1Opp = vertical ? dragRect.left : dragRect.top,\n dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,\n dragElOppLength = vertical ? dragRect.width : dragRect.height,\n targetS1Opp = vertical ? targetRect.left : targetRect.top,\n targetS2Opp = vertical ? targetRect.right : targetRect.bottom,\n targetOppLength = vertical ? targetRect.width : targetRect.height;\n return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;\n},\n\n/**\r\n * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.\r\n * @param {Number} x X position\r\n * @param {Number} y Y position\r\n * @return {HTMLElement} Element of the first found nearest Sortable\r\n */\n_detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {\n var ret;\n sortables.some(function (sortable) {\n var threshold = sortable[expando].options.emptyInsertThreshold;\n if (!threshold || lastChild(sortable)) return;\n var rect = getRect(sortable),\n insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,\n insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;\n\n if (insideHorizontally && insideVertically) {\n return ret = sortable;\n }\n });\n return ret;\n},\n _prepareGroup = function _prepareGroup(options) {\n function toFn(value, pull) {\n return function (to, from, dragEl, evt) {\n var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;\n\n if (value == null && (pull || sameGroup)) {\n // Default pull value\n // Default pull and put value if same group\n return true;\n } else if (value == null || value === false) {\n return false;\n } else if (pull && value === 'clone') {\n return value;\n } else if (typeof value === 'function') {\n return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);\n } else {\n var otherGroup = (pull ? to : from).options.group.name;\n return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;\n }\n };\n }\n\n var group = {};\n var originalGroup = options.group;\n\n if (!originalGroup || _typeof(originalGroup) != 'object') {\n originalGroup = {\n name: originalGroup\n };\n }\n\n group.name = originalGroup.name;\n group.checkPull = toFn(originalGroup.pull, true);\n group.checkPut = toFn(originalGroup.put);\n group.revertClone = originalGroup.revertClone;\n options.group = group;\n},\n _hideGhostForTarget = function _hideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', 'none');\n }\n},\n _unhideGhostForTarget = function _unhideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', '');\n }\n}; // #1184 fix - Prevent click event on fallback if dragged but item not changed position\n\n\nif (documentExists && !ChromeForAndroid) {\n document.addEventListener('click', function (evt) {\n if (ignoreNextClick) {\n evt.preventDefault();\n evt.stopPropagation && evt.stopPropagation();\n evt.stopImmediatePropagation && evt.stopImmediatePropagation();\n ignoreNextClick = false;\n return false;\n }\n }, true);\n}\n\nvar nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {\n if (dragEl) {\n evt = evt.touches ? evt.touches[0] : evt;\n\n var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);\n\n if (nearest) {\n // Create imitation event\n var event = {};\n\n for (var i in evt) {\n if (evt.hasOwnProperty(i)) {\n event[i] = evt[i];\n }\n }\n\n event.target = event.rootEl = nearest;\n event.preventDefault = void 0;\n event.stopPropagation = void 0;\n\n nearest[expando]._onDragOver(event);\n }\n }\n};\n\nvar _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {\n if (dragEl) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n }\n};\n/**\r\n * @class Sortable\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */\n\n\nfunction Sortable(el, options) {\n if (!(el && el.nodeType && el.nodeType === 1)) {\n throw \"Sortable: `el` must be an HTMLElement, not \".concat({}.toString.call(el));\n }\n\n this.el = el; // root element\n\n this.options = options = _extends({}, options); // Export instance\n\n el[expando] = this;\n var defaults = {\n group: null,\n sort: true,\n disabled: false,\n store: null,\n handle: null,\n draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',\n swapThreshold: 1,\n // percentage; 0 <= x <= 1\n invertSwap: false,\n // invert always\n invertedSwapThreshold: null,\n // will be set to same as swapThreshold if default\n removeCloneOnHide: true,\n direction: function direction() {\n return _detectDirection(el, this.options);\n },\n ghostClass: 'sortable-ghost',\n chosenClass: 'sortable-chosen',\n dragClass: 'sortable-drag',\n ignore: 'a, img',\n filter: null,\n preventOnFilter: true,\n animation: 0,\n easing: null,\n setData: function setData(dataTransfer, dragEl) {\n dataTransfer.setData('Text', dragEl.textContent);\n },\n dropBubble: false,\n dragoverBubble: false,\n dataIdAttr: 'data-id',\n delay: 0,\n delayOnTouchOnly: false,\n touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,\n forceFallback: false,\n fallbackClass: 'sortable-fallback',\n fallbackOnBody: false,\n fallbackTolerance: 0,\n fallbackOffset: {\n x: 0,\n y: 0\n },\n supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari,\n emptyInsertThreshold: 5\n };\n PluginManager.initializePlugins(this, el, defaults); // Set default options\n\n for (var name in defaults) {\n !(name in options) && (options[name] = defaults[name]);\n }\n\n _prepareGroup(options); // Bind all private methods\n\n\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n } // Setup drag mode\n\n\n this.nativeDraggable = options.forceFallback ? false : supportDraggable;\n\n if (this.nativeDraggable) {\n // Touch start threshold cannot be greater than the native dragstart threshold\n this.options.touchStartThreshold = 1;\n } // Bind events\n\n\n if (options.supportPointer) {\n on(el, 'pointerdown', this._onTapStart);\n } else {\n on(el, 'mousedown', this._onTapStart);\n on(el, 'touchstart', this._onTapStart);\n }\n\n if (this.nativeDraggable) {\n on(el, 'dragover', this);\n on(el, 'dragenter', this);\n }\n\n sortables.push(this.el); // Restore sorting\n\n options.store && options.store.get && this.sort(options.store.get(this) || []); // Add animation state manager\n\n _extends(this, AnimationStateManager());\n}\n\nSortable.prototype =\n/** @lends Sortable.prototype */\n{\n constructor: Sortable,\n _isOutsideThisEl: function _isOutsideThisEl(target) {\n if (!this.el.contains(target) && target !== this.el) {\n lastTarget = null;\n }\n },\n _getDirection: function _getDirection(evt, target) {\n return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;\n },\n _onTapStart: function _onTapStart(\n /** Event|TouchEvent */\n evt) {\n if (!evt.cancelable) return;\n\n var _this = this,\n el = this.el,\n options = this.options,\n preventOnFilter = options.preventOnFilter,\n type = evt.type,\n touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,\n target = (touch || evt).target,\n originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,\n filter = options.filter;\n\n _saveInputCheckedState(el); // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.\n\n\n if (dragEl) {\n return;\n }\n\n if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {\n return; // only left button and enabled\n } // cancel dnd if original target is content editable\n\n\n if (originalTarget.isContentEditable) {\n return;\n } // Safari ignores further event handling after mousedown\n\n\n if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {\n return;\n }\n\n target = closest(target, options.draggable, el, false);\n\n if (target && target.animated) {\n return;\n }\n\n if (lastDownEl === target) {\n // Ignoring duplicate `down`\n return;\n } // Get the index of the dragged element within its parent\n\n\n oldIndex = index(target);\n oldDraggableIndex = index(target, options.draggable); // Check filter\n\n if (typeof filter === 'function') {\n if (filter.call(this, evt, target, this)) {\n _dispatchEvent({\n sortable: _this,\n rootEl: originalTarget,\n name: 'filter',\n targetEl: target,\n toEl: el,\n fromEl: el\n });\n\n pluginEvent('filter', _this, {\n evt: evt\n });\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n } else if (filter) {\n filter = filter.split(',').some(function (criteria) {\n criteria = closest(originalTarget, criteria.trim(), el, false);\n\n if (criteria) {\n _dispatchEvent({\n sortable: _this,\n rootEl: criteria,\n name: 'filter',\n targetEl: target,\n fromEl: el,\n toEl: el\n });\n\n pluginEvent('filter', _this, {\n evt: evt\n });\n return true;\n }\n });\n\n if (filter) {\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n }\n\n if (options.handle && !closest(originalTarget, options.handle, el, false)) {\n return;\n } // Prepare `dragstart`\n\n\n this._prepareDragStart(evt, touch, target);\n },\n _prepareDragStart: function _prepareDragStart(\n /** Event */\n evt,\n /** Touch */\n touch,\n /** HTMLElement */\n target) {\n var _this = this,\n el = _this.el,\n options = _this.options,\n ownerDocument = el.ownerDocument,\n dragStartFn;\n\n if (target && !dragEl && target.parentNode === el) {\n var dragRect = getRect(target);\n rootEl = el;\n dragEl = target;\n parentEl = dragEl.parentNode;\n nextEl = dragEl.nextSibling;\n lastDownEl = target;\n activeGroup = options.group;\n Sortable.dragged = dragEl;\n tapEvt = {\n target: dragEl,\n clientX: (touch || evt).clientX,\n clientY: (touch || evt).clientY\n };\n tapDistanceLeft = tapEvt.clientX - dragRect.left;\n tapDistanceTop = tapEvt.clientY - dragRect.top;\n this._lastX = (touch || evt).clientX;\n this._lastY = (touch || evt).clientY;\n dragEl.style['will-change'] = 'all';\n\n dragStartFn = function dragStartFn() {\n pluginEvent('delayEnded', _this, {\n evt: evt\n });\n\n if (Sortable.eventCanceled) {\n _this._onDrop();\n\n return;\n } // Delayed drag has been triggered\n // we can re-enable the events: touchmove/mousemove\n\n\n _this._disableDelayedDragEvents();\n\n if (!FireFox && _this.nativeDraggable) {\n dragEl.draggable = true;\n } // Bind the events: dragstart/dragend\n\n\n _this._triggerDragStart(evt, touch); // Drag start event\n\n\n _dispatchEvent({\n sortable: _this,\n name: 'choose',\n originalEvent: evt\n }); // Chosen item\n\n\n toggleClass(dragEl, options.chosenClass, true);\n }; // Disable \"draggable\"\n\n\n options.ignore.split(',').forEach(function (criteria) {\n find(dragEl, criteria.trim(), _disableDraggable);\n });\n on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mouseup', _this._onDrop);\n on(ownerDocument, 'touchend', _this._onDrop);\n on(ownerDocument, 'touchcancel', _this._onDrop); // Make dragEl draggable (must be before delay for FireFox)\n\n if (FireFox && this.nativeDraggable) {\n this.options.touchStartThreshold = 4;\n dragEl.draggable = true;\n }\n\n pluginEvent('delayStart', this, {\n evt: evt\n }); // Delay is impossible for native DnD in Edge or IE\n\n if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {\n if (Sortable.eventCanceled) {\n this._onDrop();\n\n return;\n } // If the user moves the pointer or let go the click or touch\n // before the delay has been reached:\n // disable the delayed drag\n\n\n on(ownerDocument, 'mouseup', _this._disableDelayedDrag);\n on(ownerDocument, 'touchend', _this._disableDelayedDrag);\n on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);\n on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);\n on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);\n options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);\n _this._dragStartTimer = setTimeout(dragStartFn, options.delay);\n } else {\n dragStartFn();\n }\n }\n },\n _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler(\n /** TouchEvent|PointerEvent **/\n e) {\n var touch = e.touches ? e.touches[0] : e;\n\n if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {\n this._disableDelayedDrag();\n }\n },\n _disableDelayedDrag: function _disableDelayedDrag() {\n dragEl && _disableDraggable(dragEl);\n clearTimeout(this._dragStartTimer);\n\n this._disableDelayedDragEvents();\n },\n _disableDelayedDragEvents: function _disableDelayedDragEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._disableDelayedDrag);\n off(ownerDocument, 'touchend', this._disableDelayedDrag);\n off(ownerDocument, 'touchcancel', this._disableDelayedDrag);\n off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);\n },\n _triggerDragStart: function _triggerDragStart(\n /** Event */\n evt,\n /** Touch */\n touch) {\n touch = touch || evt.pointerType == 'touch' && evt;\n\n if (!this.nativeDraggable || touch) {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._onTouchMove);\n } else if (touch) {\n on(document, 'touchmove', this._onTouchMove);\n } else {\n on(document, 'mousemove', this._onTouchMove);\n }\n } else {\n on(dragEl, 'dragend', this);\n on(rootEl, 'dragstart', this._onDragStart);\n }\n\n try {\n if (document.selection) {\n // Timeout neccessary for IE9\n _nextTick(function () {\n document.selection.empty();\n });\n } else {\n window.getSelection().removeAllRanges();\n }\n } catch (err) {}\n },\n _dragStarted: function _dragStarted(fallback, evt) {\n\n awaitingDragStarted = false;\n\n if (rootEl && dragEl) {\n pluginEvent('dragStarted', this, {\n evt: evt\n });\n\n if (this.nativeDraggable) {\n on(document, 'dragover', _checkOutsideTargetEl);\n }\n\n var options = this.options; // Apply effect\n\n !fallback && toggleClass(dragEl, options.dragClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n Sortable.active = this;\n fallback && this._appendGhost(); // Drag start event\n\n _dispatchEvent({\n sortable: this,\n name: 'start',\n originalEvent: evt\n });\n } else {\n this._nulling();\n }\n },\n _emulateDragOver: function _emulateDragOver() {\n if (touchEvt) {\n this._lastX = touchEvt.clientX;\n this._lastY = touchEvt.clientY;\n\n _hideGhostForTarget();\n\n var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n var parent = target;\n\n while (target && target.shadowRoot) {\n target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n if (target === parent) break;\n parent = target;\n }\n\n dragEl.parentNode[expando]._isOutsideThisEl(target);\n\n if (parent) {\n do {\n if (parent[expando]) {\n var inserted = void 0;\n inserted = parent[expando]._onDragOver({\n clientX: touchEvt.clientX,\n clientY: touchEvt.clientY,\n target: target,\n rootEl: parent\n });\n\n if (inserted && !this.options.dragoverBubble) {\n break;\n }\n }\n\n target = parent; // store last element\n }\n /* jshint boss:true */\n while (parent = parent.parentNode);\n }\n\n _unhideGhostForTarget();\n }\n },\n _onTouchMove: function _onTouchMove(\n /**TouchEvent*/\n evt) {\n if (tapEvt) {\n var options = this.options,\n fallbackTolerance = options.fallbackTolerance,\n fallbackOffset = options.fallbackOffset,\n touch = evt.touches ? evt.touches[0] : evt,\n ghostMatrix = ghostEl && matrix(ghostEl, true),\n scaleX = ghostEl && ghostMatrix && ghostMatrix.a,\n scaleY = ghostEl && ghostMatrix && ghostMatrix.d,\n relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),\n dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),\n dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1); // only set the status to dragging, when we are actually dragging\n\n if (!Sortable.active && !awaitingDragStarted) {\n if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {\n return;\n }\n\n this._onDragStart(evt, true);\n }\n\n if (ghostEl) {\n if (ghostMatrix) {\n ghostMatrix.e += dx - (lastDx || 0);\n ghostMatrix.f += dy - (lastDy || 0);\n } else {\n ghostMatrix = {\n a: 1,\n b: 0,\n c: 0,\n d: 1,\n e: dx,\n f: dy\n };\n }\n\n var cssMatrix = \"matrix(\".concat(ghostMatrix.a, \",\").concat(ghostMatrix.b, \",\").concat(ghostMatrix.c, \",\").concat(ghostMatrix.d, \",\").concat(ghostMatrix.e, \",\").concat(ghostMatrix.f, \")\");\n css(ghostEl, 'webkitTransform', cssMatrix);\n css(ghostEl, 'mozTransform', cssMatrix);\n css(ghostEl, 'msTransform', cssMatrix);\n css(ghostEl, 'transform', cssMatrix);\n lastDx = dx;\n lastDy = dy;\n touchEvt = touch;\n }\n\n evt.cancelable && evt.preventDefault();\n }\n },\n _appendGhost: function _appendGhost() {\n // Bug if using scale(): https://stackoverflow.com/questions/2637058\n // Not being adjusted for\n if (!ghostEl) {\n var container = this.options.fallbackOnBody ? document.body : rootEl,\n rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),\n options = this.options; // Position absolutely\n\n if (PositionGhostAbsolutely) {\n // Get relatively positioned parent\n ghostRelativeParent = container;\n\n while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {\n ghostRelativeParent = ghostRelativeParent.parentNode;\n }\n\n if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {\n if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();\n rect.top += ghostRelativeParent.scrollTop;\n rect.left += ghostRelativeParent.scrollLeft;\n } else {\n ghostRelativeParent = getWindowScrollingElement();\n }\n\n ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);\n }\n\n ghostEl = dragEl.cloneNode(true);\n toggleClass(ghostEl, options.ghostClass, false);\n toggleClass(ghostEl, options.fallbackClass, true);\n toggleClass(ghostEl, options.dragClass, true);\n css(ghostEl, 'transition', '');\n css(ghostEl, 'transform', '');\n css(ghostEl, 'box-sizing', 'border-box');\n css(ghostEl, 'margin', 0);\n css(ghostEl, 'top', rect.top);\n css(ghostEl, 'left', rect.left);\n css(ghostEl, 'width', rect.width);\n css(ghostEl, 'height', rect.height);\n css(ghostEl, 'opacity', '0.8');\n css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');\n css(ghostEl, 'zIndex', '100000');\n css(ghostEl, 'pointerEvents', 'none');\n Sortable.ghost = ghostEl;\n container.appendChild(ghostEl); // Set transform-origin\n\n css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');\n }\n },\n _onDragStart: function _onDragStart(\n /**Event*/\n evt,\n /**boolean*/\n fallback) {\n var _this = this;\n\n var dataTransfer = evt.dataTransfer;\n var options = _this.options;\n pluginEvent('dragStart', this, {\n evt: evt\n });\n\n if (Sortable.eventCanceled) {\n this._onDrop();\n\n return;\n }\n\n pluginEvent('setupClone', this);\n\n if (!Sortable.eventCanceled) {\n cloneEl = clone(dragEl);\n cloneEl.removeAttribute(\"id\");\n cloneEl.draggable = false;\n cloneEl.style['will-change'] = '';\n\n this._hideClone();\n\n toggleClass(cloneEl, this.options.chosenClass, false);\n Sortable.clone = cloneEl;\n } // #1143: IFrame support workaround\n\n\n _this.cloneId = _nextTick(function () {\n pluginEvent('clone', _this);\n if (Sortable.eventCanceled) return;\n\n if (!_this.options.removeCloneOnHide) {\n rootEl.insertBefore(cloneEl, dragEl);\n }\n\n _this._hideClone();\n\n _dispatchEvent({\n sortable: _this,\n name: 'clone'\n });\n });\n !fallback && toggleClass(dragEl, options.dragClass, true); // Set proper drop events\n\n if (fallback) {\n ignoreNextClick = true;\n _this._loopId = setInterval(_this._emulateDragOver, 50);\n } else {\n // Undo what was set in _prepareDragStart before drag started\n off(document, 'mouseup', _this._onDrop);\n off(document, 'touchend', _this._onDrop);\n off(document, 'touchcancel', _this._onDrop);\n\n if (dataTransfer) {\n dataTransfer.effectAllowed = 'move';\n options.setData && options.setData.call(_this, dataTransfer, dragEl);\n }\n\n on(document, 'drop', _this); // #1276 fix:\n\n css(dragEl, 'transform', 'translateZ(0)');\n }\n\n awaitingDragStarted = true;\n _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));\n on(document, 'selectstart', _this);\n moved = true;\n\n if (Safari) {\n css(document.body, 'user-select', 'none');\n }\n },\n // Returns true - if no further action is needed (either inserted or another condition)\n _onDragOver: function _onDragOver(\n /**Event*/\n evt) {\n var el = this.el,\n target = evt.target,\n dragRect,\n targetRect,\n revert,\n options = this.options,\n group = options.group,\n activeSortable = Sortable.active,\n isOwner = activeGroup === group,\n canSort = options.sort,\n fromSortable = putSortable || activeSortable,\n vertical,\n _this = this,\n completedFired = false;\n\n if (_silent) return;\n\n function dragOverEvent(name, extra) {\n pluginEvent(name, _this, _objectSpread2({\n evt: evt,\n isOwner: isOwner,\n axis: vertical ? 'vertical' : 'horizontal',\n revert: revert,\n dragRect: dragRect,\n targetRect: targetRect,\n canSort: canSort,\n fromSortable: fromSortable,\n target: target,\n completed: completed,\n onMove: function onMove(target, after) {\n return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);\n },\n changed: changed\n }, extra));\n } // Capture animation state\n\n\n function capture() {\n dragOverEvent('dragOverAnimationCapture');\n\n _this.captureAnimationState();\n\n if (_this !== fromSortable) {\n fromSortable.captureAnimationState();\n }\n } // Return invocation when dragEl is inserted (or completed)\n\n\n function completed(insertion) {\n dragOverEvent('dragOverCompleted', {\n insertion: insertion\n });\n\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n } else {\n activeSortable._showClone(_this);\n }\n\n if (_this !== fromSortable) {\n // Set ghost class to new sortable's ghost class\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n }\n\n if (putSortable !== _this && _this !== Sortable.active) {\n putSortable = _this;\n } else if (_this === Sortable.active && putSortable) {\n putSortable = null;\n } // Animation\n\n\n if (fromSortable === _this) {\n _this._ignoreWhileAnimating = target;\n }\n\n _this.animateAll(function () {\n dragOverEvent('dragOverAnimationComplete');\n _this._ignoreWhileAnimating = null;\n });\n\n if (_this !== fromSortable) {\n fromSortable.animateAll();\n fromSortable._ignoreWhileAnimating = null;\n }\n } // Null lastTarget if it is not inside a previously swapped element\n\n\n if (target === dragEl && !dragEl.animated || target === el && !target.animated) {\n lastTarget = null;\n } // no bubbling and not fallback\n\n\n if (!options.dragoverBubble && !evt.rootEl && target !== document) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target); // Do not detect for empty insert if already inserted\n\n\n !insertion && nearestEmptyInsertDetectEvent(evt);\n }\n\n !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();\n return completedFired = true;\n } // Call when dragEl has been inserted\n\n\n function changed() {\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n\n _dispatchEvent({\n sortable: _this,\n name: 'change',\n toEl: el,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n originalEvent: evt\n });\n }\n\n if (evt.preventDefault !== void 0) {\n evt.cancelable && evt.preventDefault();\n }\n\n target = closest(target, options.draggable, el, true);\n dragOverEvent('dragOver');\n if (Sortable.eventCanceled) return completedFired;\n\n if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {\n return completed(false);\n }\n\n ignoreNextClick = false;\n\n if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list\n : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {\n vertical = this._getDirection(evt, target) === 'vertical';\n dragRect = getRect(dragEl);\n dragOverEvent('dragOverValid');\n if (Sortable.eventCanceled) return completedFired;\n\n if (revert) {\n parentEl = rootEl; // actualization\n\n capture();\n\n this._hideClone();\n\n dragOverEvent('revert');\n\n if (!Sortable.eventCanceled) {\n if (nextEl) {\n rootEl.insertBefore(dragEl, nextEl);\n } else {\n rootEl.appendChild(dragEl);\n }\n }\n\n return completed(true);\n }\n\n var elLastChild = lastChild(el, options.draggable);\n\n if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {\n // Insert to end of list\n // If already at end of list: Do not insert\n if (elLastChild === dragEl) {\n return completed(false);\n } // if there is a last element, it is the target\n\n\n if (elLastChild && el === evt.target) {\n target = elLastChild;\n }\n\n if (target) {\n targetRect = getRect(target);\n }\n\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {\n capture();\n\n if (elLastChild && elLastChild.nextSibling) {\n // the last draggable element is not the last node\n el.insertBefore(dragEl, elLastChild.nextSibling);\n } else {\n el.appendChild(dragEl);\n }\n\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {\n // Insert to start of list\n var firstChild = getChild(el, 0, options, true);\n\n if (firstChild === dragEl) {\n return completed(false);\n }\n\n target = firstChild;\n targetRect = getRect(target);\n\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {\n capture();\n el.insertBefore(dragEl, firstChild);\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (target.parentNode === el) {\n targetRect = getRect(target);\n var direction = 0,\n targetBeforeFirstSwap,\n differentLevel = dragEl.parentNode !== el,\n differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),\n side1 = vertical ? 'top' : 'left',\n scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),\n scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;\n\n if (lastTarget !== target) {\n targetBeforeFirstSwap = targetRect[side1];\n pastFirstInvertThresh = false;\n isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;\n }\n\n direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);\n var sibling;\n\n if (direction !== 0) {\n // Check if target is beside dragEl in respective direction (ignoring hidden elements)\n var dragIndex = index(dragEl);\n\n do {\n dragIndex -= direction;\n sibling = parentEl.children[dragIndex];\n } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));\n } // If dragEl is already beside target: Do not insert\n\n\n if (direction === 0 || sibling === target) {\n return completed(false);\n }\n\n lastTarget = target;\n lastDirection = direction;\n var nextSibling = target.nextElementSibling,\n after = false;\n after = direction === 1;\n\n var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);\n\n if (moveVector !== false) {\n if (moveVector === 1 || moveVector === -1) {\n after = moveVector === 1;\n }\n\n _silent = true;\n setTimeout(_unsilent, 30);\n capture();\n\n if (after && !nextSibling) {\n el.appendChild(dragEl);\n } else {\n target.parentNode.insertBefore(dragEl, after ? nextSibling : target);\n } // Undo chrome's scroll adjustment (has no effect on other browsers)\n\n\n if (scrolledPastTop) {\n scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);\n }\n\n parentEl = dragEl.parentNode; // actualization\n // must be done before animation\n\n if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {\n targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);\n }\n\n changed();\n return completed(true);\n }\n }\n\n if (el.contains(dragEl)) {\n return completed(false);\n }\n }\n\n return false;\n },\n _ignoreWhileAnimating: null,\n _offMoveEvents: function _offMoveEvents() {\n off(document, 'mousemove', this._onTouchMove);\n off(document, 'touchmove', this._onTouchMove);\n off(document, 'pointermove', this._onTouchMove);\n off(document, 'dragover', nearestEmptyInsertDetectEvent);\n off(document, 'mousemove', nearestEmptyInsertDetectEvent);\n off(document, 'touchmove', nearestEmptyInsertDetectEvent);\n },\n _offUpEvents: function _offUpEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._onDrop);\n off(ownerDocument, 'touchend', this._onDrop);\n off(ownerDocument, 'pointerup', this._onDrop);\n off(ownerDocument, 'touchcancel', this._onDrop);\n off(document, 'selectstart', this);\n },\n _onDrop: function _onDrop(\n /**Event*/\n evt) {\n var el = this.el,\n options = this.options; // Get the index of the dragged element within its parent\n\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n pluginEvent('drop', this, {\n evt: evt\n });\n parentEl = dragEl && dragEl.parentNode; // Get again after plugin event\n\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n\n if (Sortable.eventCanceled) {\n this._nulling();\n\n return;\n }\n\n awaitingDragStarted = false;\n isCircumstantialInvert = false;\n pastFirstInvertThresh = false;\n clearInterval(this._loopId);\n clearTimeout(this._dragStartTimer);\n\n _cancelNextTick(this.cloneId);\n\n _cancelNextTick(this._dragStartId); // Unbind events\n\n\n if (this.nativeDraggable) {\n off(document, 'drop', this);\n off(el, 'dragstart', this._onDragStart);\n }\n\n this._offMoveEvents();\n\n this._offUpEvents();\n\n if (Safari) {\n css(document.body, 'user-select', '');\n }\n\n css(dragEl, 'transform', '');\n\n if (evt) {\n if (moved) {\n evt.cancelable && evt.preventDefault();\n !options.dropBubble && evt.stopPropagation();\n }\n\n ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);\n\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n // Remove clone(s)\n cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);\n }\n\n if (dragEl) {\n if (this.nativeDraggable) {\n off(dragEl, 'dragend', this);\n }\n\n _disableDraggable(dragEl);\n\n dragEl.style['will-change'] = ''; // Remove classes\n // ghostClass is added in dragStarted\n\n if (moved && !awaitingDragStarted) {\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);\n }\n\n toggleClass(dragEl, this.options.chosenClass, false); // Drag stop event\n\n _dispatchEvent({\n sortable: this,\n name: 'unchoose',\n toEl: parentEl,\n newIndex: null,\n newDraggableIndex: null,\n originalEvent: evt\n });\n\n if (rootEl !== parentEl) {\n if (newIndex >= 0) {\n // Add event\n _dispatchEvent({\n rootEl: parentEl,\n name: 'add',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n }); // Remove event\n\n\n _dispatchEvent({\n sortable: this,\n name: 'remove',\n toEl: parentEl,\n originalEvent: evt\n }); // drag from one list and drop into another\n\n\n _dispatchEvent({\n rootEl: parentEl,\n name: 'sort',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n });\n\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n\n putSortable && putSortable.save();\n } else {\n if (newIndex !== oldIndex) {\n if (newIndex >= 0) {\n // drag & drop within the same list\n _dispatchEvent({\n sortable: this,\n name: 'update',\n toEl: parentEl,\n originalEvent: evt\n });\n\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n }\n }\n\n if (Sortable.active) {\n /* jshint eqnull:true */\n if (newIndex == null || newIndex === -1) {\n newIndex = oldIndex;\n newDraggableIndex = oldDraggableIndex;\n }\n\n _dispatchEvent({\n sortable: this,\n name: 'end',\n toEl: parentEl,\n originalEvent: evt\n }); // Save sorting\n\n\n this.save();\n }\n }\n }\n\n this._nulling();\n },\n _nulling: function _nulling() {\n pluginEvent('nulling', this);\n rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;\n savedInputChecked.forEach(function (el) {\n el.checked = true;\n });\n savedInputChecked.length = lastDx = lastDy = 0;\n },\n handleEvent: function handleEvent(\n /**Event*/\n evt) {\n switch (evt.type) {\n case 'drop':\n case 'dragend':\n this._onDrop(evt);\n\n break;\n\n case 'dragenter':\n case 'dragover':\n if (dragEl) {\n this._onDragOver(evt);\n\n _globalDragOver(evt);\n }\n\n break;\n\n case 'selectstart':\n evt.preventDefault();\n break;\n }\n },\n\n /**\r\n * Serializes the item into an array of string.\r\n * @returns {String[]}\r\n */\n toArray: function toArray() {\n var order = [],\n el,\n children = this.el.children,\n i = 0,\n n = children.length,\n options = this.options;\n\n for (; i < n; i++) {\n el = children[i];\n\n if (closest(el, options.draggable, this.el, false)) {\n order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));\n }\n }\n\n return order;\n },\n\n /**\r\n * Sorts the elements according to the array.\r\n * @param {String[]} order order of the items\r\n */\n sort: function sort(order, useAnimation) {\n var items = {},\n rootEl = this.el;\n this.toArray().forEach(function (id, i) {\n var el = rootEl.children[i];\n\n if (closest(el, this.options.draggable, rootEl, false)) {\n items[id] = el;\n }\n }, this);\n useAnimation && this.captureAnimationState();\n order.forEach(function (id) {\n if (items[id]) {\n rootEl.removeChild(items[id]);\n rootEl.appendChild(items[id]);\n }\n });\n useAnimation && this.animateAll();\n },\n\n /**\r\n * Save the current sorting\r\n */\n save: function save() {\n var store = this.options.store;\n store && store.set && store.set(this);\n },\n\n /**\r\n * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.\r\n * @param {HTMLElement} el\r\n * @param {String} [selector] default: `options.draggable`\r\n * @returns {HTMLElement|null}\r\n */\n closest: function closest$1(el, selector) {\n return closest(el, selector || this.options.draggable, this.el, false);\n },\n\n /**\r\n * Set/get option\r\n * @param {string} name\r\n * @param {*} [value]\r\n * @returns {*}\r\n */\n option: function option(name, value) {\n var options = this.options;\n\n if (value === void 0) {\n return options[name];\n } else {\n var modifiedValue = PluginManager.modifyOption(this, name, value);\n\n if (typeof modifiedValue !== 'undefined') {\n options[name] = modifiedValue;\n } else {\n options[name] = value;\n }\n\n if (name === 'group') {\n _prepareGroup(options);\n }\n }\n },\n\n /**\r\n * Destroy\r\n */\n destroy: function destroy() {\n pluginEvent('destroy', this);\n var el = this.el;\n el[expando] = null;\n off(el, 'mousedown', this._onTapStart);\n off(el, 'touchstart', this._onTapStart);\n off(el, 'pointerdown', this._onTapStart);\n\n if (this.nativeDraggable) {\n off(el, 'dragover', this);\n off(el, 'dragenter', this);\n } // Remove draggable attributes\n\n\n Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {\n el.removeAttribute('draggable');\n });\n\n this._onDrop();\n\n this._disableDelayedDragEvents();\n\n sortables.splice(sortables.indexOf(this.el), 1);\n this.el = el = null;\n },\n _hideClone: function _hideClone() {\n if (!cloneHidden) {\n pluginEvent('hideClone', this);\n if (Sortable.eventCanceled) return;\n css(cloneEl, 'display', 'none');\n\n if (this.options.removeCloneOnHide && cloneEl.parentNode) {\n cloneEl.parentNode.removeChild(cloneEl);\n }\n\n cloneHidden = true;\n }\n },\n _showClone: function _showClone(putSortable) {\n if (putSortable.lastPutMode !== 'clone') {\n this._hideClone();\n\n return;\n }\n\n if (cloneHidden) {\n pluginEvent('showClone', this);\n if (Sortable.eventCanceled) return; // show clone at dragEl or original position\n\n if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {\n rootEl.insertBefore(cloneEl, dragEl);\n } else if (nextEl) {\n rootEl.insertBefore(cloneEl, nextEl);\n } else {\n rootEl.appendChild(cloneEl);\n }\n\n if (this.options.group.revertClone) {\n this.animate(dragEl, cloneEl);\n }\n\n css(cloneEl, 'display', '');\n cloneHidden = false;\n }\n }\n};\n\nfunction _globalDragOver(\n/**Event*/\nevt) {\n if (evt.dataTransfer) {\n evt.dataTransfer.dropEffect = 'move';\n }\n\n evt.cancelable && evt.preventDefault();\n}\n\nfunction _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {\n var evt,\n sortable = fromEl[expando],\n onMoveFn = sortable.options.onMove,\n retVal; // Support for new CustomEvent feature\n\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent('move', {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent('move', true, true);\n }\n\n evt.to = toEl;\n evt.from = fromEl;\n evt.dragged = dragEl;\n evt.draggedRect = dragRect;\n evt.related = targetEl || toEl;\n evt.relatedRect = targetRect || getRect(toEl);\n evt.willInsertAfter = willInsertAfter;\n evt.originalEvent = originalEvent;\n fromEl.dispatchEvent(evt);\n\n if (onMoveFn) {\n retVal = onMoveFn.call(sortable, evt, originalEvent);\n }\n\n return retVal;\n}\n\nfunction _disableDraggable(el) {\n el.draggable = false;\n}\n\nfunction _unsilent() {\n _silent = false;\n}\n\nfunction _ghostIsFirst(evt, vertical, sortable) {\n var rect = getRect(getChild(sortable.el, 0, sortable.options, true));\n var spacer = 10;\n return vertical ? evt.clientX < rect.left - spacer || evt.clientY < rect.top && evt.clientX < rect.right : evt.clientY < rect.top - spacer || evt.clientY < rect.bottom && evt.clientX < rect.left;\n}\n\nfunction _ghostIsLast(evt, vertical, sortable) {\n var rect = getRect(lastChild(sortable.el, sortable.options.draggable));\n var spacer = 10;\n return vertical ? evt.clientX > rect.right + spacer || evt.clientX <= rect.right && evt.clientY > rect.bottom && evt.clientX >= rect.left : evt.clientX > rect.right && evt.clientY > rect.top || evt.clientX <= rect.right && evt.clientY > rect.bottom + spacer;\n}\n\nfunction _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {\n var mouseOnAxis = vertical ? evt.clientY : evt.clientX,\n targetLength = vertical ? targetRect.height : targetRect.width,\n targetS1 = vertical ? targetRect.top : targetRect.left,\n targetS2 = vertical ? targetRect.bottom : targetRect.right,\n invert = false;\n\n if (!invertSwap) {\n // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold\n if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {\n // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2\n // check if past first invert threshold on side opposite of lastDirection\n if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {\n // past first invert threshold, do not restrict inverted threshold to dragEl shadow\n pastFirstInvertThresh = true;\n }\n\n if (!pastFirstInvertThresh) {\n // dragEl shadow (target move distance shadow)\n if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow\n : mouseOnAxis > targetS2 - targetMoveDistance) {\n return -lastDirection;\n }\n } else {\n invert = true;\n }\n } else {\n // Regular\n if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {\n return _getInsertDirection(target);\n }\n }\n }\n\n invert = invert || invertSwap;\n\n if (invert) {\n // Invert of regular\n if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {\n return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;\n }\n }\n\n return 0;\n}\n/**\r\n * Gets the direction dragEl must be swapped relative to target in order to make it\r\n * seem that dragEl has been \"inserted\" into that element's position\r\n * @param {HTMLElement} target The target whose position dragEl is being inserted at\r\n * @return {Number} Direction dragEl must be swapped\r\n */\n\n\nfunction _getInsertDirection(target) {\n if (index(dragEl) < index(target)) {\n return 1;\n } else {\n return -1;\n }\n}\n/**\r\n * Generate id\r\n * @param {HTMLElement} el\r\n * @returns {String}\r\n * @private\r\n */\n\n\nfunction _generateId(el) {\n var str = el.tagName + el.className + el.src + el.href + el.textContent,\n i = str.length,\n sum = 0;\n\n while (i--) {\n sum += str.charCodeAt(i);\n }\n\n return sum.toString(36);\n}\n\nfunction _saveInputCheckedState(root) {\n savedInputChecked.length = 0;\n var inputs = root.getElementsByTagName('input');\n var idx = inputs.length;\n\n while (idx--) {\n var el = inputs[idx];\n el.checked && savedInputChecked.push(el);\n }\n}\n\nfunction _nextTick(fn) {\n return setTimeout(fn, 0);\n}\n\nfunction _cancelNextTick(id) {\n return clearTimeout(id);\n} // Fixed #973:\n\n\nif (documentExists) {\n on(document, 'touchmove', function (evt) {\n if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {\n evt.preventDefault();\n }\n });\n} // Export utils\n\n\nSortable.utils = {\n on: on,\n off: off,\n css: css,\n find: find,\n is: function is(el, selector) {\n return !!closest(el, selector, el, false);\n },\n extend: extend,\n throttle: throttle,\n closest: closest,\n toggleClass: toggleClass,\n clone: clone,\n index: index,\n nextTick: _nextTick,\n cancelNextTick: _cancelNextTick,\n detectDirection: _detectDirection,\n getChild: getChild\n};\n/**\r\n * Get the Sortable instance of an element\r\n * @param {HTMLElement} element The element\r\n * @return {Sortable|undefined} The instance of Sortable\r\n */\n\nSortable.get = function (element) {\n return element[expando];\n};\n/**\r\n * Mount a plugin to Sortable\r\n * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted\r\n */\n\n\nSortable.mount = function () {\n for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {\n plugins[_key] = arguments[_key];\n }\n\n if (plugins[0].constructor === Array) plugins = plugins[0];\n plugins.forEach(function (plugin) {\n if (!plugin.prototype || !plugin.prototype.constructor) {\n throw \"Sortable: Mounted plugin must be a constructor function, not \".concat({}.toString.call(plugin));\n }\n\n if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);\n PluginManager.mount(plugin);\n });\n};\n/**\r\n * Create sortable instance\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */\n\n\nSortable.create = function (el, options) {\n return new Sortable(el, options);\n}; // Export\n\n\nSortable.version = version;\n\nvar autoScrolls = [],\n scrollEl,\n scrollRootEl,\n scrolling = false,\n lastAutoScrollX,\n lastAutoScrollY,\n touchEvt$1,\n pointerElemChangedInterval;\n\nfunction AutoScrollPlugin() {\n function AutoScroll() {\n this.defaults = {\n scroll: true,\n forceAutoScrollFallback: false,\n scrollSensitivity: 30,\n scrollSpeed: 10,\n bubbleScroll: true\n }; // Bind all private methods\n\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n }\n\n AutoScroll.prototype = {\n dragStarted: function dragStarted(_ref) {\n var originalEvent = _ref.originalEvent;\n\n if (this.sortable.nativeDraggable) {\n on(document, 'dragover', this._handleAutoScroll);\n } else {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._handleFallbackAutoScroll);\n } else if (originalEvent.touches) {\n on(document, 'touchmove', this._handleFallbackAutoScroll);\n } else {\n on(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref2) {\n var originalEvent = _ref2.originalEvent;\n\n // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)\n if (!this.options.dragOverBubble && !originalEvent.rootEl) {\n this._handleAutoScroll(originalEvent);\n }\n },\n drop: function drop() {\n if (this.sortable.nativeDraggable) {\n off(document, 'dragover', this._handleAutoScroll);\n } else {\n off(document, 'pointermove', this._handleFallbackAutoScroll);\n off(document, 'touchmove', this._handleFallbackAutoScroll);\n off(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n\n clearPointerElemChangedInterval();\n clearAutoScrolls();\n cancelThrottle();\n },\n nulling: function nulling() {\n touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;\n autoScrolls.length = 0;\n },\n _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {\n this._handleAutoScroll(evt, true);\n },\n _handleAutoScroll: function _handleAutoScroll(evt, fallback) {\n var _this = this;\n\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n elem = document.elementFromPoint(x, y);\n touchEvt$1 = evt; // IE does not seem to have native autoscroll,\n // Edge's autoscroll seems too conditional,\n // MACOS Safari does not have autoscroll,\n // Firefox and Chrome are good\n\n if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {\n autoScroll(evt, this.options, elem, fallback); // Listener for pointer element change\n\n var ogElemScroller = getParentAutoScrollElement(elem, true);\n\n if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {\n pointerElemChangedInterval && clearPointerElemChangedInterval(); // Detect for pointer elem change, emulating native DnD behaviour\n\n pointerElemChangedInterval = setInterval(function () {\n var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);\n\n if (newElem !== ogElemScroller) {\n ogElemScroller = newElem;\n clearAutoScrolls();\n }\n\n autoScroll(evt, _this.options, newElem, fallback);\n }, 10);\n lastAutoScrollX = x;\n lastAutoScrollY = y;\n }\n } else {\n // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll\n if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {\n clearAutoScrolls();\n return;\n }\n\n autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);\n }\n }\n };\n return _extends(AutoScroll, {\n pluginName: 'scroll',\n initializeByDefault: true\n });\n}\n\nfunction clearAutoScrolls() {\n autoScrolls.forEach(function (autoScroll) {\n clearInterval(autoScroll.pid);\n });\n autoScrolls = [];\n}\n\nfunction clearPointerElemChangedInterval() {\n clearInterval(pointerElemChangedInterval);\n}\n\nvar autoScroll = throttle(function (evt, options, rootEl, isFallback) {\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521\n if (!options.scroll) return;\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n sens = options.scrollSensitivity,\n speed = options.scrollSpeed,\n winScroller = getWindowScrollingElement();\n var scrollThisInstance = false,\n scrollCustomFn; // New scroll root, set scrollEl\n\n if (scrollRootEl !== rootEl) {\n scrollRootEl = rootEl;\n clearAutoScrolls();\n scrollEl = options.scroll;\n scrollCustomFn = options.scrollFn;\n\n if (scrollEl === true) {\n scrollEl = getParentAutoScrollElement(rootEl, true);\n }\n }\n\n var layersOut = 0;\n var currentParent = scrollEl;\n\n do {\n var el = currentParent,\n rect = getRect(el),\n top = rect.top,\n bottom = rect.bottom,\n left = rect.left,\n right = rect.right,\n width = rect.width,\n height = rect.height,\n canScrollX = void 0,\n canScrollY = void 0,\n scrollWidth = el.scrollWidth,\n scrollHeight = el.scrollHeight,\n elCSS = css(el),\n scrollPosX = el.scrollLeft,\n scrollPosY = el.scrollTop;\n\n if (el === winScroller) {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');\n } else {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');\n }\n\n var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);\n var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);\n\n if (!autoScrolls[layersOut]) {\n for (var i = 0; i <= layersOut; i++) {\n if (!autoScrolls[i]) {\n autoScrolls[i] = {};\n }\n }\n }\n\n if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {\n autoScrolls[layersOut].el = el;\n autoScrolls[layersOut].vx = vx;\n autoScrolls[layersOut].vy = vy;\n clearInterval(autoScrolls[layersOut].pid);\n\n if (vx != 0 || vy != 0) {\n scrollThisInstance = true;\n /* jshint loopfunc:true */\n\n autoScrolls[layersOut].pid = setInterval(function () {\n // emulate drag over during autoscroll (fallback), emulating native DnD behaviour\n if (isFallback && this.layer === 0) {\n Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely\n\n }\n\n var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;\n var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;\n\n if (typeof scrollCustomFn === 'function') {\n if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {\n return;\n }\n }\n\n scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);\n }.bind({\n layer: layersOut\n }), 24);\n }\n }\n\n layersOut++;\n } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));\n\n scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not\n}, 30);\n\nvar drop = function drop(_ref) {\n var originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n dragEl = _ref.dragEl,\n activeSortable = _ref.activeSortable,\n dispatchSortableEvent = _ref.dispatchSortableEvent,\n hideGhostForTarget = _ref.hideGhostForTarget,\n unhideGhostForTarget = _ref.unhideGhostForTarget;\n if (!originalEvent) return;\n var toSortable = putSortable || activeSortable;\n hideGhostForTarget();\n var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;\n var target = document.elementFromPoint(touch.clientX, touch.clientY);\n unhideGhostForTarget();\n\n if (toSortable && !toSortable.el.contains(target)) {\n dispatchSortableEvent('spill');\n this.onSpill({\n dragEl: dragEl,\n putSortable: putSortable\n });\n }\n};\n\nfunction Revert() {}\n\nRevert.prototype = {\n startIndex: null,\n dragStart: function dragStart(_ref2) {\n var oldDraggableIndex = _ref2.oldDraggableIndex;\n this.startIndex = oldDraggableIndex;\n },\n onSpill: function onSpill(_ref3) {\n var dragEl = _ref3.dragEl,\n putSortable = _ref3.putSortable;\n this.sortable.captureAnimationState();\n\n if (putSortable) {\n putSortable.captureAnimationState();\n }\n\n var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);\n\n if (nextSibling) {\n this.sortable.el.insertBefore(dragEl, nextSibling);\n } else {\n this.sortable.el.appendChild(dragEl);\n }\n\n this.sortable.animateAll();\n\n if (putSortable) {\n putSortable.animateAll();\n }\n },\n drop: drop\n};\n\n_extends(Revert, {\n pluginName: 'revertOnSpill'\n});\n\nfunction Remove() {}\n\nRemove.prototype = {\n onSpill: function onSpill(_ref4) {\n var dragEl = _ref4.dragEl,\n putSortable = _ref4.putSortable;\n var parentSortable = putSortable || this.sortable;\n parentSortable.captureAnimationState();\n dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);\n parentSortable.animateAll();\n },\n drop: drop\n};\n\n_extends(Remove, {\n pluginName: 'removeOnSpill'\n});\n\nvar lastSwapEl;\n\nfunction SwapPlugin() {\n function Swap() {\n this.defaults = {\n swapClass: 'sortable-swap-highlight'\n };\n }\n\n Swap.prototype = {\n dragStart: function dragStart(_ref) {\n var dragEl = _ref.dragEl;\n lastSwapEl = dragEl;\n },\n dragOverValid: function dragOverValid(_ref2) {\n var completed = _ref2.completed,\n target = _ref2.target,\n onMove = _ref2.onMove,\n activeSortable = _ref2.activeSortable,\n changed = _ref2.changed,\n cancel = _ref2.cancel;\n if (!activeSortable.options.swap) return;\n var el = this.sortable.el,\n options = this.options;\n\n if (target && target !== el) {\n var prevSwapEl = lastSwapEl;\n\n if (onMove(target) !== false) {\n toggleClass(target, options.swapClass, true);\n lastSwapEl = target;\n } else {\n lastSwapEl = null;\n }\n\n if (prevSwapEl && prevSwapEl !== lastSwapEl) {\n toggleClass(prevSwapEl, options.swapClass, false);\n }\n }\n\n changed();\n completed(true);\n cancel();\n },\n drop: function drop(_ref3) {\n var activeSortable = _ref3.activeSortable,\n putSortable = _ref3.putSortable,\n dragEl = _ref3.dragEl;\n var toSortable = putSortable || this.sortable;\n var options = this.options;\n lastSwapEl && toggleClass(lastSwapEl, options.swapClass, false);\n\n if (lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) {\n if (dragEl !== lastSwapEl) {\n toSortable.captureAnimationState();\n if (toSortable !== activeSortable) activeSortable.captureAnimationState();\n swapNodes(dragEl, lastSwapEl);\n toSortable.animateAll();\n if (toSortable !== activeSortable) activeSortable.animateAll();\n }\n }\n },\n nulling: function nulling() {\n lastSwapEl = null;\n }\n };\n return _extends(Swap, {\n pluginName: 'swap',\n eventProperties: function eventProperties() {\n return {\n swapItem: lastSwapEl\n };\n }\n });\n}\n\nfunction swapNodes(n1, n2) {\n var p1 = n1.parentNode,\n p2 = n2.parentNode,\n i1,\n i2;\n if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return;\n i1 = index(n1);\n i2 = index(n2);\n\n if (p1.isEqualNode(p2) && i1 < i2) {\n i2++;\n }\n\n p1.insertBefore(n2, p1.children[i1]);\n p2.insertBefore(n1, p2.children[i2]);\n}\n\nvar multiDragElements = [],\n multiDragClones = [],\n lastMultiDragSelect,\n // for selection with modifier key down (SHIFT)\nmultiDragSortable,\n initialFolding = false,\n // Initial multi-drag fold when drag started\nfolding = false,\n // Folding any other time\ndragStarted = false,\n dragEl$1,\n clonesFromRect,\n clonesHidden;\n\nfunction MultiDragPlugin() {\n function MultiDrag(sortable) {\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n\n if (!sortable.options.avoidImplicitDeselect) {\n if (sortable.options.supportPointer) {\n on(document, 'pointerup', this._deselectMultiDrag);\n } else {\n on(document, 'mouseup', this._deselectMultiDrag);\n on(document, 'touchend', this._deselectMultiDrag);\n }\n }\n\n on(document, 'keydown', this._checkKeyDown);\n on(document, 'keyup', this._checkKeyUp);\n this.defaults = {\n selectedClass: 'sortable-selected',\n multiDragKey: null,\n avoidImplicitDeselect: false,\n setData: function setData(dataTransfer, dragEl) {\n var data = '';\n\n if (multiDragElements.length && multiDragSortable === sortable) {\n multiDragElements.forEach(function (multiDragElement, i) {\n data += (!i ? '' : ', ') + multiDragElement.textContent;\n });\n } else {\n data = dragEl.textContent;\n }\n\n dataTransfer.setData('Text', data);\n }\n };\n }\n\n MultiDrag.prototype = {\n multiDragKeyDown: false,\n isMultiDrag: false,\n delayStartGlobal: function delayStartGlobal(_ref) {\n var dragged = _ref.dragEl;\n dragEl$1 = dragged;\n },\n delayEnded: function delayEnded() {\n this.isMultiDrag = ~multiDragElements.indexOf(dragEl$1);\n },\n setupClone: function setupClone(_ref2) {\n var sortable = _ref2.sortable,\n cancel = _ref2.cancel;\n if (!this.isMultiDrag) return;\n\n for (var i = 0; i < multiDragElements.length; i++) {\n multiDragClones.push(clone(multiDragElements[i]));\n multiDragClones[i].sortableIndex = multiDragElements[i].sortableIndex;\n multiDragClones[i].draggable = false;\n multiDragClones[i].style['will-change'] = '';\n toggleClass(multiDragClones[i], this.options.selectedClass, false);\n multiDragElements[i] === dragEl$1 && toggleClass(multiDragClones[i], this.options.chosenClass, false);\n }\n\n sortable._hideClone();\n\n cancel();\n },\n clone: function clone(_ref3) {\n var sortable = _ref3.sortable,\n rootEl = _ref3.rootEl,\n dispatchSortableEvent = _ref3.dispatchSortableEvent,\n cancel = _ref3.cancel;\n if (!this.isMultiDrag) return;\n\n if (!this.options.removeCloneOnHide) {\n if (multiDragElements.length && multiDragSortable === sortable) {\n insertMultiDragClones(true, rootEl);\n dispatchSortableEvent('clone');\n cancel();\n }\n }\n },\n showClone: function showClone(_ref4) {\n var cloneNowShown = _ref4.cloneNowShown,\n rootEl = _ref4.rootEl,\n cancel = _ref4.cancel;\n if (!this.isMultiDrag) return;\n insertMultiDragClones(false, rootEl);\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', '');\n });\n cloneNowShown();\n clonesHidden = false;\n cancel();\n },\n hideClone: function hideClone(_ref5) {\n var _this = this;\n\n var sortable = _ref5.sortable,\n cloneNowHidden = _ref5.cloneNowHidden,\n cancel = _ref5.cancel;\n if (!this.isMultiDrag) return;\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', 'none');\n\n if (_this.options.removeCloneOnHide && clone.parentNode) {\n clone.parentNode.removeChild(clone);\n }\n });\n cloneNowHidden();\n clonesHidden = true;\n cancel();\n },\n dragStartGlobal: function dragStartGlobal(_ref6) {\n var sortable = _ref6.sortable;\n\n if (!this.isMultiDrag && multiDragSortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n }\n\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.sortableIndex = index(multiDragElement);\n }); // Sort multi-drag elements\n\n multiDragElements = multiDragElements.sort(function (a, b) {\n return a.sortableIndex - b.sortableIndex;\n });\n dragStarted = true;\n },\n dragStarted: function dragStarted(_ref7) {\n var _this2 = this;\n\n var sortable = _ref7.sortable;\n if (!this.isMultiDrag) return;\n\n if (this.options.sort) {\n // Capture rects,\n // hide multi drag elements (by positioning them absolute),\n // set multi drag elements rects to dragRect,\n // show multi drag elements,\n // animate to rects,\n // unset rects & remove from DOM\n sortable.captureAnimationState();\n\n if (this.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n css(multiDragElement, 'position', 'absolute');\n });\n var dragRect = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRect);\n });\n folding = true;\n initialFolding = true;\n }\n }\n\n sortable.animateAll(function () {\n folding = false;\n initialFolding = false;\n\n if (_this2.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n } // Remove all auxiliary multidrag items from el, if sorting enabled\n\n\n if (_this2.options.sort) {\n removeMultiDragElements();\n }\n });\n },\n dragOver: function dragOver(_ref8) {\n var target = _ref8.target,\n completed = _ref8.completed,\n cancel = _ref8.cancel;\n\n if (folding && ~multiDragElements.indexOf(target)) {\n completed(false);\n cancel();\n }\n },\n revert: function revert(_ref9) {\n var fromSortable = _ref9.fromSortable,\n rootEl = _ref9.rootEl,\n sortable = _ref9.sortable,\n dragRect = _ref9.dragRect;\n\n if (multiDragElements.length > 1) {\n // Setup unfold animation\n multiDragElements.forEach(function (multiDragElement) {\n sortable.addAnimationState({\n target: multiDragElement,\n rect: folding ? getRect(multiDragElement) : dragRect\n });\n unsetRect(multiDragElement);\n multiDragElement.fromRect = dragRect;\n fromSortable.removeAnimationState(multiDragElement);\n });\n folding = false;\n insertMultiDragElements(!this.options.removeCloneOnHide, rootEl);\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref10) {\n var sortable = _ref10.sortable,\n isOwner = _ref10.isOwner,\n insertion = _ref10.insertion,\n activeSortable = _ref10.activeSortable,\n parentEl = _ref10.parentEl,\n putSortable = _ref10.putSortable;\n var options = this.options;\n\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n }\n\n initialFolding = false; // If leaving sort:false root, or already folding - Fold to new location\n\n if (options.animation && multiDragElements.length > 1 && (folding || !isOwner && !activeSortable.options.sort && !putSortable)) {\n // Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible\n var dragRectAbsolute = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRectAbsolute); // Move element(s) to end of parentEl so that it does not interfere with multi-drag clones insertion if they are inserted\n // while folding, and so that we can capture them again because old sortable will no longer be fromSortable\n\n parentEl.appendChild(multiDragElement);\n });\n folding = true;\n } // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out\n\n\n if (!isOwner) {\n // Only remove if not folding (folding will remove them anyways)\n if (!folding) {\n removeMultiDragElements();\n }\n\n if (multiDragElements.length > 1) {\n var clonesHiddenBefore = clonesHidden;\n\n activeSortable._showClone(sortable); // Unfold animation for clones if showing from hidden\n\n\n if (activeSortable.options.animation && !clonesHidden && clonesHiddenBefore) {\n multiDragClones.forEach(function (clone) {\n activeSortable.addAnimationState({\n target: clone,\n rect: clonesFromRect\n });\n clone.fromRect = clonesFromRect;\n clone.thisAnimationDuration = null;\n });\n }\n } else {\n activeSortable._showClone(sortable);\n }\n }\n }\n },\n dragOverAnimationCapture: function dragOverAnimationCapture(_ref11) {\n var dragRect = _ref11.dragRect,\n isOwner = _ref11.isOwner,\n activeSortable = _ref11.activeSortable;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n });\n\n if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) {\n clonesFromRect = _extends({}, dragRect);\n var dragMatrix = matrix(dragEl$1, true);\n clonesFromRect.top -= dragMatrix.f;\n clonesFromRect.left -= dragMatrix.e;\n }\n },\n dragOverAnimationComplete: function dragOverAnimationComplete() {\n if (folding) {\n folding = false;\n removeMultiDragElements();\n }\n },\n drop: function drop(_ref12) {\n var evt = _ref12.originalEvent,\n rootEl = _ref12.rootEl,\n parentEl = _ref12.parentEl,\n sortable = _ref12.sortable,\n dispatchSortableEvent = _ref12.dispatchSortableEvent,\n oldIndex = _ref12.oldIndex,\n putSortable = _ref12.putSortable;\n var toSortable = putSortable || this.sortable;\n if (!evt) return;\n var options = this.options,\n children = parentEl.children; // Multi-drag selection\n\n if (!dragStarted) {\n if (options.multiDragKey && !this.multiDragKeyDown) {\n this._deselectMultiDrag();\n }\n\n toggleClass(dragEl$1, options.selectedClass, !~multiDragElements.indexOf(dragEl$1));\n\n if (!~multiDragElements.indexOf(dragEl$1)) {\n multiDragElements.push(dragEl$1);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: dragEl$1,\n originalEvent: evt\n }); // Modifier activated, select from last to dragEl\n\n if (evt.shiftKey && lastMultiDragSelect && sortable.el.contains(lastMultiDragSelect)) {\n var lastIndex = index(lastMultiDragSelect),\n currentIndex = index(dragEl$1);\n\n if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {\n // Must include lastMultiDragSelect (select it), in case modified selection from no selection\n // (but previous selection existed)\n var n, i;\n\n if (currentIndex > lastIndex) {\n i = lastIndex;\n n = currentIndex;\n } else {\n i = currentIndex;\n n = lastIndex + 1;\n }\n\n for (; i < n; i++) {\n if (~multiDragElements.indexOf(children[i])) continue;\n toggleClass(children[i], options.selectedClass, true);\n multiDragElements.push(children[i]);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: children[i],\n originalEvent: evt\n });\n }\n }\n } else {\n lastMultiDragSelect = dragEl$1;\n }\n\n multiDragSortable = toSortable;\n } else {\n multiDragElements.splice(multiDragElements.indexOf(dragEl$1), 1);\n lastMultiDragSelect = null;\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'deselect',\n targetEl: dragEl$1,\n originalEvent: evt\n });\n }\n } // Multi-drag drop\n\n\n if (dragStarted && this.isMultiDrag) {\n folding = false; // Do not \"unfold\" after around dragEl if reverted\n\n if ((parentEl[expando].options.sort || parentEl !== rootEl) && multiDragElements.length > 1) {\n var dragRect = getRect(dragEl$1),\n multiDragIndex = index(dragEl$1, ':not(.' + this.options.selectedClass + ')');\n if (!initialFolding && options.animation) dragEl$1.thisAnimationDuration = null;\n toSortable.captureAnimationState();\n\n if (!initialFolding) {\n if (options.animation) {\n dragEl$1.fromRect = dragRect;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n\n if (multiDragElement !== dragEl$1) {\n var rect = folding ? getRect(multiDragElement) : dragRect;\n multiDragElement.fromRect = rect; // Prepare unfold animation\n\n toSortable.addAnimationState({\n target: multiDragElement,\n rect: rect\n });\n }\n });\n } // Multi drag elements are not necessarily removed from the DOM on drop, so to reinsert\n // properly they must all be removed\n\n\n removeMultiDragElements();\n multiDragElements.forEach(function (multiDragElement) {\n if (children[multiDragIndex]) {\n parentEl.insertBefore(multiDragElement, children[multiDragIndex]);\n } else {\n parentEl.appendChild(multiDragElement);\n }\n\n multiDragIndex++;\n }); // If initial folding is done, the elements may have changed position because they are now\n // unfolding around dragEl, even though dragEl may not have his index changed, so update event\n // must be fired here as Sortable will not.\n\n if (oldIndex === index(dragEl$1)) {\n var update = false;\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement.sortableIndex !== index(multiDragElement)) {\n update = true;\n return;\n }\n });\n\n if (update) {\n dispatchSortableEvent('update');\n }\n }\n } // Must be done after capturing individual rects (scroll bar)\n\n\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n toSortable.animateAll();\n }\n\n multiDragSortable = toSortable;\n } // Remove clones if necessary\n\n\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n multiDragClones.forEach(function (clone) {\n clone.parentNode && clone.parentNode.removeChild(clone);\n });\n }\n },\n nullingGlobal: function nullingGlobal() {\n this.isMultiDrag = dragStarted = false;\n multiDragClones.length = 0;\n },\n destroyGlobal: function destroyGlobal() {\n this._deselectMultiDrag();\n\n off(document, 'pointerup', this._deselectMultiDrag);\n off(document, 'mouseup', this._deselectMultiDrag);\n off(document, 'touchend', this._deselectMultiDrag);\n off(document, 'keydown', this._checkKeyDown);\n off(document, 'keyup', this._checkKeyUp);\n },\n _deselectMultiDrag: function _deselectMultiDrag(evt) {\n if (typeof dragStarted !== \"undefined\" && dragStarted) return; // Only deselect if selection is in this sortable\n\n if (multiDragSortable !== this.sortable) return; // Only deselect if target is not item in this sortable\n\n if (evt && closest(evt.target, this.options.draggable, this.sortable.el, false)) return; // Only deselect if left click\n\n if (evt && evt.button !== 0) return;\n\n while (multiDragElements.length) {\n var el = multiDragElements[0];\n toggleClass(el, this.options.selectedClass, false);\n multiDragElements.shift();\n dispatchEvent({\n sortable: this.sortable,\n rootEl: this.sortable.el,\n name: 'deselect',\n targetEl: el,\n originalEvent: evt\n });\n }\n },\n _checkKeyDown: function _checkKeyDown(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = true;\n }\n },\n _checkKeyUp: function _checkKeyUp(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = false;\n }\n }\n };\n return _extends(MultiDrag, {\n // Static methods & properties\n pluginName: 'multiDrag',\n utils: {\n /**\r\n * Selects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be selected\r\n */\n select: function select(el) {\n var sortable = el.parentNode[expando];\n if (!sortable || !sortable.options.multiDrag || ~multiDragElements.indexOf(el)) return;\n\n if (multiDragSortable && multiDragSortable !== sortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n\n multiDragSortable = sortable;\n }\n\n toggleClass(el, sortable.options.selectedClass, true);\n multiDragElements.push(el);\n },\n\n /**\r\n * Deselects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be deselected\r\n */\n deselect: function deselect(el) {\n var sortable = el.parentNode[expando],\n index = multiDragElements.indexOf(el);\n if (!sortable || !sortable.options.multiDrag || !~index) return;\n toggleClass(el, sortable.options.selectedClass, false);\n multiDragElements.splice(index, 1);\n }\n },\n eventProperties: function eventProperties() {\n var _this3 = this;\n\n var oldIndicies = [],\n newIndicies = [];\n multiDragElements.forEach(function (multiDragElement) {\n oldIndicies.push({\n multiDragElement: multiDragElement,\n index: multiDragElement.sortableIndex\n }); // multiDragElements will already be sorted if folding\n\n var newIndex;\n\n if (folding && multiDragElement !== dragEl$1) {\n newIndex = -1;\n } else if (folding) {\n newIndex = index(multiDragElement, ':not(.' + _this3.options.selectedClass + ')');\n } else {\n newIndex = index(multiDragElement);\n }\n\n newIndicies.push({\n multiDragElement: multiDragElement,\n index: newIndex\n });\n });\n return {\n items: _toConsumableArray(multiDragElements),\n clones: [].concat(multiDragClones),\n oldIndicies: oldIndicies,\n newIndicies: newIndicies\n };\n },\n optionListeners: {\n multiDragKey: function multiDragKey(key) {\n key = key.toLowerCase();\n\n if (key === 'ctrl') {\n key = 'Control';\n } else if (key.length > 1) {\n key = key.charAt(0).toUpperCase() + key.substr(1);\n }\n\n return key;\n }\n }\n });\n}\n\nfunction insertMultiDragElements(clonesInserted, rootEl) {\n multiDragElements.forEach(function (multiDragElement, i) {\n var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)];\n\n if (target) {\n rootEl.insertBefore(multiDragElement, target);\n } else {\n rootEl.appendChild(multiDragElement);\n }\n });\n}\n/**\r\n * Insert multi-drag clones\r\n * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted\r\n * @param {HTMLElement} rootEl\r\n */\n\n\nfunction insertMultiDragClones(elementsInserted, rootEl) {\n multiDragClones.forEach(function (clone, i) {\n var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)];\n\n if (target) {\n rootEl.insertBefore(clone, target);\n } else {\n rootEl.appendChild(clone);\n }\n });\n}\n\nfunction removeMultiDragElements() {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n multiDragElement.parentNode && multiDragElement.parentNode.removeChild(multiDragElement);\n });\n}\n\nSortable.mount(new AutoScrollPlugin());\nSortable.mount(Remove, Revert);\n\nexport default Sortable;\nexport { MultiDragPlugin as MultiDrag, Sortable, SwapPlugin as Swap };\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/ExtensionPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/withAttr');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Form');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/FormSectionGroup');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/FormSection');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/ColorPreviewInput');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/ItemList');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/string');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport FormModal from 'flarum/common/components/FormModal';\nimport Button from 'flarum/common/components/Button';\nimport ColorPreviewInput from 'flarum/common/components/ColorPreviewInput';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport { slug } from 'flarum/common/utils/string';\nimport Stream from 'flarum/common/utils/Stream';\nimport extractText from 'flarum/common/utils/extractText';\nimport Form from 'flarum/common/components/Form';\nimport tagLabel from '../../common/helpers/tagLabel';\n/**\n * The `EditTagModal` component shows a modal dialog which allows the user\n * to create or edit a tag.\n */\nexport default class EditTagModal extends FormModal {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"tag\", void 0);\n _defineProperty(this, \"name\", void 0);\n _defineProperty(this, \"slug\", void 0);\n _defineProperty(this, \"description\", void 0);\n _defineProperty(this, \"color\", void 0);\n _defineProperty(this, \"icon\", void 0);\n _defineProperty(this, \"isHidden\", void 0);\n _defineProperty(this, \"isPrimary\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n this.tag = this.attrs.model || app.store.createRecord('tags');\n this.name = Stream(this.tag.name() || '');\n this.slug = Stream(this.tag.slug() || '');\n this.description = Stream(this.tag.description() || '');\n this.color = Stream(this.tag.color() || '');\n this.icon = Stream(this.tag.icon() || '');\n this.isHidden = Stream(this.tag.isHidden() || false);\n this.isPrimary = Stream(this.attrs.primary || false);\n }\n className() {\n return 'EditTagModal Modal--small';\n }\n title() {\n return this.name() ? tagLabel(app.store.createRecord('tags', {\n attributes: this.submitData()\n })) : app.translator.trans('flarum-tags.admin.edit_tag.title');\n }\n content() {\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(Form, null, this.fields().toArray()));\n }\n fields() {\n const items = new ItemList();\n items.add('name', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.name_label')), m(\"input\", {\n className: \"FormControl\",\n placeholder: app.translator.trans('flarum-tags.admin.edit_tag.name_placeholder'),\n value: this.name(),\n oninput: e => {\n const target = e.target;\n this.name(target.value);\n this.slug(slug(target.value));\n }\n })), 50);\n items.add('slug', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.slug_label')), m(\"input\", {\n className: \"FormControl\",\n bidi: this.slug\n })), 40);\n items.add('description', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.description_label')), m(\"textarea\", {\n className: \"FormControl\",\n bidi: this.description\n })), 30);\n items.add('color', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.color_label')), m(ColorPreviewInput, {\n className: \"FormControl\",\n placeholder: \"#aaaaaa\",\n bidi: this.color\n })), 20);\n items.add('icon', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.icon_label')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-tags.admin.edit_tag.icon_text', {\n a: m(\"a\", {\n href: \"https://fontawesome.com/icons?m=free\",\n tabindex: \"-1\"\n })\n })), m(\"input\", {\n className: \"FormControl\",\n placeholder: \"fas fa-bolt\",\n bidi: this.icon\n })), 10);\n items.add('hidden', m(\"div\", {\n className: \"Form-group\"\n }, m(\"div\", null, m(\"label\", {\n className: \"checkbox\"\n }, m(\"input\", {\n type: \"checkbox\",\n bidi: this.isHidden\n }), app.translator.trans('flarum-tags.admin.edit_tag.hide_label')))), 10);\n items.add('submit', m(\"div\", {\n className: \"Form-group Form-controls\"\n }, m(Button, {\n type: \"submit\",\n className: \"Button Button--primary EditTagModal-save\",\n loading: this.loading\n }, app.translator.trans('flarum-tags.admin.edit_tag.submit_button')), this.tag.exists && m(\"button\", {\n type: \"button\",\n className: \"Button EditTagModal-delete\",\n onclick: this.delete.bind(this)\n }, app.translator.trans('flarum-tags.admin.edit_tag.delete_tag_button'))), -10);\n return items;\n }\n submitData() {\n return {\n name: this.name(),\n slug: this.slug(),\n description: this.description(),\n color: this.color(),\n icon: this.icon(),\n isHidden: this.isHidden(),\n isPrimary: this.isPrimary()\n };\n }\n onsubmit(e) {\n e.preventDefault();\n this.loading = true;\n\n // Errors aren't passed to the modal onerror handler here.\n // This is done for better error visibility on smaller screen heights.\n this.tag.save(this.submitData()).then(() => this.hide(), () => this.loading = false);\n }\n delete() {\n if (confirm(extractText(app.translator.trans('flarum-tags.admin.edit_tag.delete_tag_confirmation')))) {\n const children = app.store.all('tags').filter(tag => tag.parent() === this.tag);\n this.tag.delete().then(() => {\n children.forEach(tag => tag.pushData({\n attributes: {\n isChild: false\n }\n }));\n m.redraw();\n });\n this.hide();\n }\n }\n}\nflarum.reg.add('flarum-tags', 'admin/components/EditTagModal', EditTagModal);","import sortable from 'sortablejs';\nimport app from 'flarum/admin/app';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport withAttr from 'flarum/common/utils/withAttr';\nimport Form from 'flarum/common/components/Form';\nimport FormSectionGroup from 'flarum/admin/components/FormSectionGroup';\nimport FormSection from 'flarum/admin/components/FormSection';\nimport EditTagModal from './EditTagModal';\nimport tagIcon from '../../common/helpers/tagIcon';\nimport sortTags from '../../common/utils/sortTags';\nfunction tagItem(tag) {\n return m(\"li\", {\n \"data-id\": tag.id(),\n style: {\n color: tag.color()\n }\n }, m(\"div\", {\n className: \"TagListItem-info\"\n }, tagIcon(tag), m(\"span\", {\n className: \"TagListItem-name\"\n }, tag.name()), m(Button, {\n className: \"Button Button--link\",\n icon: \"fas fa-pencil-alt\",\n onclick: () => app.modal.show(EditTagModal, {\n model: tag\n })\n })), !tag.isChild() && tag.position() !== null && m(\"ol\", {\n className: \"TagListItem-children TagList\"\n }, sortTags(app.store.all('tags')).filter(child => child.parent() === tag).map(tagItem)));\n}\nexport default class TagsPage extends ExtensionPage {\n oninit(vnode) {\n super.oninit(vnode);\n\n // A regular redraw won't work here, because sortable has mucked around\n // with the DOM which will confuse Mithril's diffing algorithm. Instead\n // we force a full reconstruction of the DOM by changing the key, which\n // makes mithril completely re-render the component on redraw.\n this.forcedRefreshKey = 0;\n this.loading = true;\n app.tagList.load(['parent']).then(() => {\n this.loading = false;\n m.redraw();\n });\n }\n content() {\n if (this.loading) {\n return m(LoadingIndicator, null);\n }\n const minPrimaryTags = this.setting('flarum-tags.min_primary_tags', 0);\n const maxPrimaryTags = this.setting('flarum-tags.max_primary_tags', 0);\n const minSecondaryTags = this.setting('flarum-tags.min_secondary_tags', 0);\n const maxSecondaryTags = this.setting('flarum-tags.max_secondary_tags', 0);\n const tags = sortTags(app.store.all('tags').filter(tag => !tag.parent()));\n return m(\"div\", {\n className: \"TagsContent\"\n }, m(\"div\", {\n className: \"TagsContent-list\"\n }, m(\"div\", {\n className: \"container\",\n key: this.forcedRefreshKey,\n oncreate: this.onListOnCreate.bind(this)\n }, m(FormSectionGroup, null, m(FormSection, {\n className: \"TagGroup\",\n label: app.translator.trans('flarum-tags.admin.tags.primary_heading')\n }, m(\"ol\", {\n className: \"TagList TagList--primary\"\n }, tags.filter(tag => tag.position() !== null && !tag.isChild()).map(tagItem)), m(Button, {\n className: \"Button TagList-button\",\n icon: \"fas fa-plus\",\n onclick: () => app.modal.show(EditTagModal, {\n primary: true\n })\n }, app.translator.trans('flarum-tags.admin.tags.create_primary_tag_button'))), m(FormSection, {\n className: \"TagGroup TagGroup--secondary\",\n label: app.translator.trans('flarum-tags.admin.tags.secondary_heading')\n }, m(\"ul\", {\n className: \"TagList\"\n }, tags.filter(tag => tag.position() === null).sort((a, b) => a.name().localeCompare(b.name())).map(tagItem)), m(Button, {\n className: \"Button TagList-button\",\n icon: \"fas fa-plus\",\n onclick: () => app.modal.show(EditTagModal, {\n primary: false\n })\n }, app.translator.trans('flarum-tags.admin.tags.create_secondary_tag_button'))), m(FormSection, {\n label: app.translator.trans('flarum-tags.admin.tags.settings_heading')\n }, m(Form, null, m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.tag_settings.required_primary_heading')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-tags.admin.tag_settings.required_primary_text')), m(\"div\", {\n className: \"TagSettings-rangeInput\"\n }, m(\"input\", {\n className: \"FormControl\",\n type: \"number\",\n min: \"0\",\n value: minPrimaryTags(),\n oninput: withAttr('value', this.setMinTags.bind(this, minPrimaryTags, maxPrimaryTags))\n }), app.translator.trans('flarum-tags.admin.tag_settings.range_separator_text'), m(\"input\", {\n className: \"FormControl\",\n type: \"number\",\n min: minPrimaryTags(),\n bidi: maxPrimaryTags\n }))), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.tag_settings.required_secondary_heading')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-tags.admin.tag_settings.required_secondary_text')), m(\"div\", {\n className: \"TagSettings-rangeInput\"\n }, m(\"input\", {\n className: \"FormControl\",\n type: \"number\",\n min: \"0\",\n value: minSecondaryTags(),\n oninput: withAttr('value', this.setMinTags.bind(this, minSecondaryTags, maxSecondaryTags))\n }), app.translator.trans('flarum-tags.admin.tag_settings.range_separator_text'), m(\"input\", {\n className: \"FormControl\",\n type: \"number\",\n min: minSecondaryTags(),\n bidi: maxSecondaryTags\n }))), m(\"div\", {\n className: \"Form-group Form-controls\"\n }, this.submitButton())))), m(\"div\", {\n className: \"TagsContent-footer\"\n }, m(\"p\", null, app.translator.trans('flarum-tags.admin.tags.about_tags_text'))))));\n }\n onListOnCreate(vnode) {\n this.$('.TagList').get().map(e => {\n sortable.create(e, {\n group: 'tags',\n delay: 50,\n delayOnTouchOnly: true,\n touchStartThreshold: 5,\n animation: 150,\n swapThreshold: 0.65,\n dragClass: 'sortable-dragging',\n ghostClass: 'sortable-placeholder',\n onSort: e => this.onSortUpdate(e)\n });\n });\n }\n setMinTags(minTags, maxTags, value) {\n minTags(value);\n maxTags(Math.max(value, maxTags()));\n }\n onSortUpdate(e) {\n // If we've moved a tag from 'primary' to 'secondary', then we'll update\n // its attributes in our local store so that when we redraw the change\n // will be made.\n if (e.from instanceof HTMLOListElement && e.to instanceof HTMLUListElement) {\n app.store.getById('tags', e.item.getAttribute('data-id')).pushData({\n attributes: {\n position: null,\n isChild: false\n },\n relationships: {\n parent: null\n }\n });\n }\n\n // Construct an array of primary tag IDs and their children, in the same\n // order that they have been arranged in.\n const order = this.$('.TagList--primary > li').map(function () {\n return {\n id: $(this).data('id'),\n children: $(this).find('li').map(function () {\n return $(this).data('id');\n }).get()\n };\n }).get();\n\n // Now that we have an accurate representation of the order which the\n // primary tags are in, we will update the tag attributes in our local\n // store to reflect this order.\n order.forEach((tag, i) => {\n const parent = app.store.getById('tags', tag.id);\n parent.pushData({\n attributes: {\n position: i,\n isChild: false\n },\n relationships: {\n parent: null\n }\n });\n tag.children.forEach((child, j) => {\n app.store.getById('tags', child).pushData({\n attributes: {\n position: j,\n isChild: true\n },\n relationships: {\n parent\n }\n });\n });\n });\n app.request({\n url: app.forum.attribute('apiUrl') + '/tags/order',\n method: 'POST',\n body: {\n order\n }\n });\n this.forcedRefreshKey++;\n m.redraw();\n }\n}\nflarum.reg.add('flarum-tags', 'admin/components/TagsPage', TagsPage);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/common/app';\nexport default class TagListState {\n constructor() {\n _defineProperty(this, \"loadedIncludes\", void 0);\n }\n async load(includes) {\n if (includes === void 0) {\n includes = [];\n }\n if (!this.loadedIncludes) {\n return this.query(includes);\n }\n const unloadedIncludes = includes.filter(include => !this.loadedIncludes.has(include));\n if (unloadedIncludes.length === 0) {\n return Promise.resolve(app.store.all('tags'));\n }\n return this.query(unloadedIncludes);\n }\n async query(includes) {\n var _this$loadedIncludes;\n if (includes === void 0) {\n includes = [];\n }\n (_this$loadedIncludes = this.loadedIncludes) != null ? _this$loadedIncludes : this.loadedIncludes = new Set();\n return app.store.find('tags', {\n include: includes.join(',')\n }).then(val => {\n const tags = Array.isArray(val) ? val : [val];\n includes.forEach(include => this.loadedIncludes.add(include));\n return tags;\n });\n }\n}\nflarum.reg.add('flarum-tags', 'common/states/TagListState', TagListState);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/computed');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Model');","import computed from 'flarum/common/utils/computed';\nimport Model from 'flarum/common/Model';\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 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 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 isPrimary() {\n return Model.attribute('isPrimary').call(this);\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 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 isPrimaryParent() {\n return computed('position', 'parent', (position, parent) => position !== null && parent === false).call(this);\n }\n}\nflarum.reg.add('flarum-tags', 'common/models/Tag', Tag);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/query/IGambit');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/common/app';\nimport { KeyValueGambit } from 'flarum/common/query/IGambit';\nexport default class TagGambit extends KeyValueGambit {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"predicates\", true);\n }\n key() {\n return app.translator.trans('flarum-tags.lib.gambits.discussions.tag.key', {}, true);\n }\n hint() {\n return app.translator.trans('flarum-tags.lib.gambits.discussions.tag.hint', {}, true);\n }\n filterKey() {\n return 'tag';\n }\n gambitValueToFilterValue(value) {\n return [value];\n }\n fromFilter(value, negate) {\n let gambits = [];\n if (Array.isArray(value)) {\n gambits = value.map(value => this.fromFilter(value.toString(), negate));\n } else {\n return \"\".concat(negate ? '-' : '').concat(this.key(), \":\").concat(this.filterValueToGambitValue(value));\n }\n return gambits.join(' ');\n }\n filterValueToGambitValue(value) {\n return value;\n }\n}\nflarum.reg.add('flarum-tags', 'common/query/discussions/TagGambit', TagGambit);","import Extend from 'flarum/common/extenders';\nimport Tag from './models/Tag';\nimport TagGambit from './query/discussions/TagGambit';\nexport default [new Extend.Store() //\n.add('tags', Tag), new Extend.Search() //\n.gambit('discussions', TagGambit)];","import app from 'flarum/admin/app';\nimport addTagsPermissionScope from './addTagsPermissionScope';\nimport addTagPermission from './addTagPermission';\nimport addTagsHomePageOption from './addTagsHomePageOption';\nimport addTagChangePermission from './addTagChangePermission';\nimport addTagSelectionSettingComponent from './addTagSelectionSettingComponent';\nimport TagsPage from './components/TagsPage';\nimport TagListState from '../common/states/TagListState';\nexport { default as extend } from '../common/extend';\napp.initializers.add('flarum-tags', app => {\n app.tagList = new TagListState();\n app.extensionData.for('flarum-tags').registerPage(TagsPage);\n addTagsPermissionScope();\n addTagPermission();\n addTagsHomePageOption();\n addTagChangePermission();\n addTagSelectionSettingComponent();\n});\nimport './admin';","import app from 'flarum/admin/app';\nimport { extend, override } from 'flarum/common/extend';\nimport PermissionGrid from 'flarum/admin/components/PermissionGrid';\nimport PermissionDropdown from 'flarum/admin/components/PermissionDropdown';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport tagLabel from '../common/helpers/tagLabel';\nimport tagIcon from '../common/helpers/tagIcon';\nimport sortTags from '../common/utils/sortTags';\nexport default function () {\n extend(PermissionGrid.prototype, 'oninit', function () {\n this.loading = true;\n });\n extend(PermissionGrid.prototype, 'oncreate', function () {\n app.tagList.load().then(() => {\n this.loading = false;\n m.redraw();\n });\n });\n override(PermissionGrid.prototype, 'view', function (original, vnode) {\n if (this.loading) {\n return m(LoadingIndicator, null);\n }\n return original(vnode);\n });\n override(app, 'getRequiredPermissions', (original, permission) => {\n const tagPrefix = permission.match(/^tag\\d+\\./);\n if (tagPrefix) {\n const globalPermission = permission.substr(tagPrefix[0].length);\n const required = original(globalPermission);\n return required.map(required => tagPrefix[0] + required);\n }\n return original(permission);\n });\n extend(PermissionGrid.prototype, 'scopeItems', items => {\n sortTags(app.store.all('tags')).filter(tag => tag.isRestricted()).forEach(tag => items.add('tag' + tag.id(), {\n label: tagLabel(tag),\n onremove: () => tag.save({\n isRestricted: false\n }),\n render: item => {\n if ('setting' in item) return null;\n if (item.permission === 'viewForum' || item.permission === 'startDiscussion' || item.permission.startsWith('discussion.') && item.tagScoped !== false || item.tagScoped) {\n return m(PermissionDropdown, {\n permission: \"tag\".concat(tag.id(), \".\").concat(item.permission),\n allowGuest: item.allowGuest\n });\n }\n return null;\n }\n }));\n });\n extend(PermissionGrid.prototype, 'scopeControlItems', items => {\n const tags = sortTags(app.store.all('tags').filter(tag => !tag.isRestricted()));\n if (tags.length) {\n items.add('tag', m(Dropdown, {\n className: \"Dropdown--restrictByTag\",\n buttonClassName: \"Button Button--text\",\n label: app.translator.trans('flarum-tags.admin.permissions.restrict_by_tag_heading'),\n icon: \"fas fa-plus\",\n caretIcon: null\n }, tags.map(tag => m(Button, {\n icon: true,\n onclick: () => tag.save({\n isRestricted: true\n })\n }, [tagIcon(tag, {\n className: 'Button-icon'\n }), ' ', tag.name()]))));\n }\n });\n}","import app from 'flarum/admin/app';\nimport { extend } from 'flarum/common/extend';\nimport PermissionGrid from 'flarum/admin/components/PermissionGrid';\nimport SettingDropdown from 'flarum/admin/components/SettingDropdown';\nexport default function () {\n extend(PermissionGrid.prototype, 'startItems', items => {\n items.add('allowTagChange', {\n icon: 'fas fa-tag',\n label: app.translator.trans('flarum-tags.admin.permissions.allow_edit_tags_label'),\n setting: () => {\n const minutes = parseInt(app.data.settings.allow_tag_change, 10);\n return m(SettingDropdown, {\n defaultLabel: minutes ? app.translator.trans('core.admin.permissions_controls.allow_some_minutes_button', {\n count: minutes\n }) : app.translator.trans('core.admin.permissions_controls.allow_indefinitely_button'),\n key: \"allow_tag_change\",\n options: [{\n value: '-1',\n label: app.translator.trans('core.admin.permissions_controls.allow_indefinitely_button')\n }, {\n value: '10',\n label: app.translator.trans('core.admin.permissions_controls.allow_ten_minutes_button')\n }, {\n value: 'reply',\n label: app.translator.trans('core.admin.permissions_controls.allow_until_reply_button')\n }]\n });\n }\n }, 90);\n });\n}","import { extend } from 'flarum/common/extend';\nimport SelectTagsSettingComponent from './components/SelectTagsSettingComponent';\nimport FormGroup from 'flarum/common/components/FormGroup';\nexport default function () {\n extend(FormGroup.prototype, 'customFieldComponents', function (items) {\n items.add('flarum-tags.select-tags', attrs => {\n return m(SelectTagsSettingComponent, Object.assign({}, attrs, {\n settingValue: attrs.bidi\n }));\n });\n });\n}","import classList from 'flarum/common/utils/classList';\nexport default function tagIcon(tag, attrs, settings) {\n if (attrs === void 0) {\n attrs = {};\n }\n if (settings === void 0) {\n settings = {};\n }\n const hasIcon = tag && tag.icon();\n const {\n useColor = true\n } = settings;\n attrs.className = classList([attrs.className, 'icon text-colored', hasIcon ? tag.icon() : 'TagIcon']);\n if (tag && useColor) {\n attrs.style = attrs.style || {};\n attrs.style['--color'] = tag.color();\n } else if (!tag) {\n attrs.className += ' untagged';\n }\n return hasIcon ? m(\"i\", attrs) : m(\"span\", attrs);\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagIcon', tagIcon);","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';\nexport default function tagLabel(tag, attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n attrs.style = attrs.style || {};\n attrs.className = 'TagLabel ' + (attrs.className || '');\n const link = extract(attrs, 'link');\n const tagText = tag ? tag.name() : app.translator.trans('flarum-tags.lib.deleted_tag_text');\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 if (link) {\n attrs.title = tag.description() || '';\n attrs.href = app.route('tag', {\n tags: tag.slug()\n });\n }\n if (tag.isChild()) {\n attrs.className += ' TagLabel--child';\n }\n } else {\n attrs.className += ' untagged';\n }\n return m(link ? Link : 'span', attrs, m(\"span\", {\n className: \"TagLabel-text\"\n }, tag && tag.icon() && tagIcon(tag, {\n className: 'TagLabel-icon'\n }, {\n useColor: false\n }), m(\"span\", {\n className: \"TagLabel-name\"\n }, tagText)));\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagLabel', tagLabel);","export default function sortTags(tags) {\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;else if (bParent) return bParent === a ? -1 : aPos - bParent.position();\n return 0;\n });\n}\nflarum.reg.add('flarum-tags', 'common/utils/sortTags', sortTags);","module.exports = flarum.reg.get('core', 'common/Component');","module.exports = flarum.reg.get('core', 'common/app');","module.exports = flarum.reg.get('core', 'common/components/Button');","module.exports = flarum.reg.get('core', 'common/components/FormModal');","module.exports = flarum.reg.get('core', 'common/components/Link');","module.exports = flarum.reg.get('core', 'common/components/LoadingIndicator');","module.exports = flarum.reg.get('core', 'common/helpers/highlight');","module.exports = flarum.reg.get('core', 'common/helpers/textContrastClass');","module.exports = flarum.reg.get('core', 'common/utils/KeyboardNavigatable');","module.exports = flarum.reg.get('core', 'common/utils/Stream');","module.exports = flarum.reg.get('core', 'common/utils/classList');","module.exports = flarum.reg.get('core', 'common/utils/extract');","module.exports = flarum.reg.get('core', 'common/utils/extractText');","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _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 }, _typeof(obj);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\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// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\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__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + \"common/components/TagSelectionModal\" + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\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};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.f.compat = (chunkId, promises) => {\n\n\tconst originalLoadChunk = __webpack_require__.l;\n\t__webpack_require__.l = flarum.reg.loadChunk.bind(flarum.reg, originalLoadChunk);\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t328: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkmodule_exports\"] = self[\"webpackChunkmodule_exports\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));"],"names":["inProgress","dataWebpackPrefix","flarum","reg","get","app","extensionData","for","registerPermission","icon","label","translator","trans","permission","extend","items","add","path","tagsLabel","tags","attrs","children","link","otherAttrs","className","sortTags","forEach","tag","length","push","tagLabel","m","SelectTagsSettingComponent","constructor","super","arguments","this","view","value","JSON","parse","settingValue","loaded","then","filter","includes","id","redraw","help","onclick","selectedTags","onsubmit","stringify","map","options","size","display","addChunkModule","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","sym","getOwnPropertyDescriptor","enumerable","apply","_objectSpread2","target","i","source","key","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_typeof","obj","Symbol","iterator","prototype","configurable","writable","_extends","assign","hasOwnProperty","call","_objectWithoutProperties","excluded","sourceKeys","indexOf","_objectWithoutPropertiesLoose","sourceSymbolKeys","propertyIsEnumerable","userAgent","pattern","window","navigator","match","IE11OrLess","Edge","FireFox","Safari","IOS","ChromeForAndroid","captureMode","capture","passive","on","el","event","fn","addEventListener","off","removeEventListener","matches","selector","substring","msMatchesSelector","webkitMatchesSelector","_","getParentOrHost","host","document","nodeType","parentNode","closest","ctx","includeCTX","_throttleTimeout","R_SPACE","toggleClass","name","state","classList","replace","css","prop","val","style","defaultView","getComputedStyle","currentStyle","matrix","selfOnly","appliedTransforms","transform","matrixFn","DOMMatrix","WebKitCSSMatrix","CSSMatrix","MSCSSMatrix","find","tagName","list","getElementsByTagName","n","getWindowScrollingElement","scrollingElement","documentElement","getRect","relativeToContainingBlock","relativeToNonStaticParent","undoScale","container","getBoundingClientRect","elRect","top","left","bottom","right","height","width","innerHeight","innerWidth","containerRect","parseInt","elMatrix","scaleX","a","scaleY","d","isScrolledPast","elSide","parentSide","parent","getParentAutoScrollElement","elSideVal","parentSideVal","getChild","childNum","includeDragEl","currentChild","Sortable","ghost","dragged","draggable","lastChild","last","lastElementChild","previousElementSibling","index","nodeName","toUpperCase","clone","getRelativeScrollOffset","offsetLeft","offsetTop","winScroller","scrollLeft","scrollTop","includeSelf","elem","gotSelf","clientWidth","scrollWidth","clientHeight","scrollHeight","elemCSS","overflowX","overflowY","body","isRectEqual","rect1","rect2","Math","round","throttle","callback","ms","args","_this","setTimeout","scrollBy","x","y","Polymer","$","jQuery","Zepto","dom","cloneNode","expando","Date","getTime","plugins","defaults","initializeByDefault","PluginManager","mount","plugin","option","p","pluginName","concat","pluginEvent","eventName","sortable","evt","eventCanceled","cancel","eventNameGlobal","initializePlugins","initialized","modified","modifyOption","getEventProperties","eventProperties","modifiedValue","optionListeners","_excluded","_ref","undefined","originalEvent","data","bind","dragEl","parentEl","ghostEl","rootEl","nextEl","lastDownEl","cloneEl","cloneHidden","dragStarted","moved","putSortable","activeSortable","active","oldIndex","oldDraggableIndex","newIndex","newDraggableIndex","hideGhostForTarget","_hideGhostForTarget","unhideGhostForTarget","_unhideGhostForTarget","cloneNowHidden","cloneNowShown","dispatchSortableEvent","_dispatchEvent","info","targetEl","toEl","fromEl","extraEventProperties","onName","charAt","substr","CustomEvent","createEvent","initEvent","bubbles","cancelable","to","from","item","pullMode","lastPutMode","allEventProperties","dispatchEvent","activeGroup","tapEvt","touchEvt","lastDx","lastDy","tapDistanceLeft","tapDistanceTop","lastTarget","lastDirection","targetMoveDistance","ghostRelativeParent","awaitingDragStarted","ignoreNextClick","sortables","pastFirstInvertThresh","isCircumstantialInvert","ghostRelativeParentInitialScroll","_silent","savedInputChecked","documentExists","PositionGhostAbsolutely","CSSFloatProperty","supportDraggable","createElement","supportCssPointerEvents","cssText","pointerEvents","_detectDirection","elCSS","elWidth","paddingLeft","paddingRight","borderLeftWidth","borderRightWidth","child1","child2","firstChildCSS","secondChildCSS","firstChildWidth","marginLeft","marginRight","secondChildWidth","flexDirection","gridTemplateColumns","split","touchingSideChild2","clear","_prepareGroup","toFn","pull","sameGroup","group","otherGroup","join","originalGroup","checkPull","checkPut","put","revertClone","preventDefault","stopPropagation","stopImmediatePropagation","nearestEmptyInsertDetectEvent","touches","nearest","clientX","clientY","some","threshold","emptyInsertThreshold","rect","insideHorizontally","insideVertically","ret","_onDragOver","_checkOutsideTargetEl","_isOutsideThisEl","toString","animationCallbackId","animationStates","sort","disabled","store","handle","test","swapThreshold","invertSwap","invertedSwapThreshold","removeCloneOnHide","direction","ghostClass","chosenClass","dragClass","ignore","preventOnFilter","animation","easing","setData","dataTransfer","textContent","dropBubble","dragoverBubble","dataIdAttr","delay","delayOnTouchOnly","touchStartThreshold","Number","devicePixelRatio","forceFallback","fallbackClass","fallbackOnBody","fallbackTolerance","fallbackOffset","supportPointer","nativeDraggable","_onTapStart","captureAnimationState","slice","child","fromRect","thisAnimationDuration","childMatrix","f","e","addAnimationState","removeAnimationState","splice","arr","indexOfObject","animateAll","clearTimeout","animating","animationTime","time","toRect","prevFromRect","prevToRect","animatingRect","targetMatrix","sqrt","pow","calculateRealTime","animate","max","animationResetTimer","currentRect","duration","translateX","translateY","animatingX","animatingY","forRepaintDummy","offsetWidth","repaint","animated","_onMove","dragRect","targetRect","willInsertAfter","retVal","onMoveFn","onMove","draggedRect","related","relatedRect","_disableDraggable","_unsilent","_generateId","str","src","href","sum","charCodeAt","_nextTick","_cancelNextTick","contains","_getDirection","type","touch","pointerType","originalTarget","shadowRoot","composedPath","root","inputs","idx","checked","_saveInputCheckedState","button","isContentEditable","criteria","trim","_prepareDragStart","dragStartFn","ownerDocument","nextSibling","_lastX","_lastY","_onDrop","_disableDelayedDragEvents","_triggerDragStart","_disableDelayedDrag","_delayedDragTouchMoveHandler","_dragStartTimer","abs","floor","_onTouchMove","_onDragStart","selection","empty","getSelection","removeAllRanges","err","_dragStarted","fallback","_appendGhost","_nulling","_emulateDragOver","elementFromPoint","ghostMatrix","relativeScrollOffset","dx","dy","b","c","cssMatrix","appendChild","removeAttribute","_hideClone","cloneId","insertBefore","_loopId","setInterval","effectAllowed","_dragStartId","revert","vertical","isOwner","canSort","fromSortable","completedFired","dragOverEvent","_ignoreWhileAnimating","completed","elLastChild","_ghostIsLast","changed","_ghostIsFirst","firstChild","targetBeforeFirstSwap","sibling","differentLevel","differentRowCol","dragElS1Opp","dragElS2Opp","dragElOppLength","targetS1Opp","targetS2Opp","targetOppLength","_dragElInRowColumn","side1","scrolledPastTop","scrollBefore","isLastTarget","mouseOnAxis","targetLength","targetS1","targetS2","invert","_getInsertDirection","_getSwapDirection","dragIndex","nextElementSibling","after","moveVector","extra","axis","insertion","_showClone","_offMoveEvents","_offUpEvents","clearInterval","removeChild","save","handleEvent","dropEffect","_globalDragOver","toArray","order","getAttribute","useAnimation","set","destroy","Array","querySelectorAll","utils","is","dst","nextTick","cancelNextTick","detectDirection","element","_len","_key","create","version","scrollEl","scrollRootEl","lastAutoScrollX","lastAutoScrollY","touchEvt$1","pointerElemChangedInterval","autoScrolls","scrolling","clearAutoScrolls","autoScroll","pid","clearPointerElemChangedInterval","isFallback","scroll","scrollCustomFn","sens","scrollSensitivity","speed","scrollSpeed","scrollThisInstance","scrollFn","layersOut","currentParent","canScrollX","canScrollY","scrollPosX","scrollPosY","vx","vy","layer","scrollOffsetY","scrollOffsetX","bubbleScroll","drop","toSortable","changedTouches","onSpill","Revert","Remove","startIndex","dragStart","_ref2","_ref3","_ref4","parentSortable","AutoScroll","forceAutoScrollFallback","_handleAutoScroll","_handleFallbackAutoScroll","dragOverCompleted","dragOverBubble","nulling","ogElemScroller","newElem","EditTagModal","oninit","vnode","model","slug","description","color","isHidden","isPrimary","primary","title","attributes","submitData","content","fields","placeholder","oninput","bidi","tabindex","loading","exists","delete","hide","confirm","pushData","isChild","tagItem","tagIcon","position","TagsPage","forcedRefreshKey","minPrimaryTags","setting","maxPrimaryTags","minSecondaryTags","maxSecondaryTags","oncreate","onListOnCreate","localeCompare","min","setMinTags","submitButton","onSort","onSortUpdate","minTags","maxTags","HTMLOListElement","HTMLUListElement","relationships","j","url","method","TagListState","async","loadedIncludes","query","unloadedIncludes","include","has","Promise","resolve","Set","isArray","Tag","backgroundUrl","backgroundMode","defaultSort","discussionCount","lastPostedAt","lastPostedDiscussion","isRestricted","canStartDiscussion","canAddToDiscussion","isPrimaryParent","TagGambit","KeyValueGambit","hint","filterKey","gambitValueToFilterValue","fromFilter","negate","gambits","filterValueToGambitValue","gambit","tagList","registerPage","override","original","tagPrefix","required","onremove","render","startsWith","tagScoped","allowGuest","buttonClassName","caretIcon","addTagPermission","addTagsHomePageOption","minutes","defaultLabel","count","settings","hasIcon","useColor","tagText","route","aPos","bPos","aParent","bParent","module","exports","arg","input","prim","toPrimitive","res","TypeError","String","toPropertyKey","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","definition","o","chunkId","all","reduce","promises","u","g","globalThis","Function","l","done","script","needAttach","scripts","s","charset","timeout","nc","setAttribute","onScriptComplete","prev","onerror","onload","doneFns","head","r","toStringTag","scriptUrl","importScripts","location","currentScript","Error","compat","originalLoadChunk","loadChunk","installedChunks","installedChunkData","promise","reject","error","errorType","realSrc","message","request","webpackJsonpCallback","parentChunkLoadingFunction","chunkIds","moreModules","runtime","chunkLoadingGlobal","self"],"sourceRoot":""} \ No newline at end of file diff --git a/extensions/tags/js/dist/forum.js b/extensions/tags/js/dist/forum.js index b7b0736d09..b7aec5423f 100644 --- a/extensions/tags/js/dist/forum.js +++ b/extensions/tags/js/dist/forum.js @@ -1,2 +1,2 @@ -(()=>{var t,e,s={974:(t,e,s)=>{"use strict";s.d(e,{Z:()=>o});var r=s(836),a=s.n(r);function o(t,e,s){void 0===e&&(e={}),void 0===s&&(s={});const r=t&&t.icon(),{useColor:o=!0}=s;return e.className=a()([e.className,"icon text-colored",r?t.icon():"TagIcon"]),t&&o?(e.style=e.style||{},e.style["--color"]=t.color()):t||(e.className+=" untagged"),r?m("i",e):m("span",e)}flarum.reg.add("flarum-tags","common/helpers/tagIcon",o)},924:(t,e,s)=>{"use strict";s.d(e,{Z:()=>g});var r=s(780),a=s.n(r),o=s(678),n=s.n(o),i=s(836),l=s.n(i),c=s(679),u=s.n(c),d=s(974);function g(t,e){void 0===e&&(e={}),e.style=e.style||{},e.className="TagLabel "+(e.className||"");const s=a()(e,"link"),r=t?t.name():app.translator.trans("flarum-tags.lib.deleted_tag_text");if(t){const r=t.color();r&&(e.style["--tag-bg"]=r,e.className=l()(e.className,"colored",u()(r))),s&&(e.title=t.description()||"",e.href=app.route("tag",{tags:t.slug()})),t.isChild()&&(e.className+=" TagLabel--child")}else e.className+=" untagged";return m(s?n():"span",e,m("span",{className:"TagLabel-text"},t&&t.icon()&&(0,d.Z)(t,{className:"TagLabel-icon"},{useColor:!1}),m("span",{className:"TagLabel-name"},r)))}flarum.reg.add("flarum-tags","common/helpers/tagLabel",g)},270:()=>{},648:(t,e,s)=>{"use strict";function r(t){return t.slice(0).sort(((t,e)=>{const s=t.position(),r=e.position();if(null===s&&null===r)return e.discussionCount()-t.discussionCount();if(null===r)return-1;if(null===s)return 1;const a=t.parent(),o=e.parent();return a===o?s-r:a&&o?a.position()-o.position():a?a===e?1:a.position()-r:o?o===t?-1:s-o.position():0}))}s.d(e,{Z:()=>r}),flarum.reg.add("flarum-tags","common/utils/sortTags",r)},664:(t,e,s)=>{"use strict";s.d(e,{l:()=>wt});var r=s(892),a=s.n(r),o=s(905),n=s(351),i=s.n(n);class l{constructor(){(0,o.Z)(this,"loadedIncludes",void 0)}async load(t){if(void 0===t&&(t=[]),!this.loadedIncludes)return this.query(t);const e=t.filter((t=>!this.loadedIncludes.has(t)));return 0===e.length?Promise.resolve(i().store.all("tags")):this.query(e)}async query(t){return void 0===t&&(t=[]),null!=this.loadedIncludes||(this.loadedIncludes=new Set),i().store.find("tags",{include:t.join(",")}).then((e=>{const s=Array.isArray(e)?e:[e];return t.forEach((t=>this.loadedIncludes.add(t))),s}))}}flarum.reg.add("flarum-tags","common/states/TagListState",l);const c=flarum.reg.get("core","common/extend"),u=flarum.reg.get("core","forum/components/IndexSidebar");var d=s.n(u);const g=flarum.reg.get("core","common/components/Separator");var f=s.n(g);const p=flarum.reg.get("core","common/components/LinkButton");var h=s.n(p),b=s(678),v=s.n(b),T=s(836),y=s.n(T),x=s(974);class w extends(h()){view(t){const e=this.attrs.model,s=e&&e.description(),r=y()("TagLinkButton hasIcon",{child:e.isChild()},this.attrs.className);return m(v(),{className:r,href:this.attrs.route,style:e?{"--color":e.color()}:void 0,title:s||void 0},(0,x.Z)(e,{className:"Button-icon"}),m("span",{className:"Button-label"},e?e.name():app.translator.trans("flarum-tags.forum.index.untagged_link")))}static initAttrs(t){super.initAttrs(t);const e=t.model;t.params.tags=e?e.slug():"untagged",t.route=app.route("tag",t.params)}}flarum.reg.add("flarum-tags","forum/components/TagLinkButton",w);const k=flarum.reg.get("core","common/components/Page");var N=s.n(k);const C=flarum.reg.get("core","forum/components/PageStructure");var _=s.n(C);const P=flarum.reg.get("core","forum/components/WelcomeHero");var S=s.n(P),D=s(149),A=s.n(D);const L=flarum.reg.get("core","common/utils/ItemList");var I=s.n(L);const Z=flarum.reg.get("core","common/helpers/humanTime");var j=s.n(Z),M=s(679),E=s.n(M),V=s(596),B=s.n(V),H=s(924),O=s(648);class R extends(N()){constructor(){super(...arguments),(0,o.Z)(this,"tags",void 0),(0,o.Z)(this,"loading",void 0)}oninit(t){super.oninit(t),a().history.push("tags",B()(a().translator.trans("flarum-tags.forum.header.back_to_tags_tooltip"))),this.tags=[];const e=a().preloadedApiDocument();e?this.tags=(0,O.Z)(e.filter((t=>!t.isChild()))):(this.loading=!0,a().tagList.load(["children","lastPostedDiscussion","parent"]).then((()=>{this.tags=(0,O.Z)(a().store.all("tags").filter((t=>!t.isChild()))),this.loading=!1,m.redraw()})))}oncreate(t){super.oncreate(t),a().setTitle(B()(a().translator.trans("flarum-tags.forum.all_tags.meta_title_text"))),a().setTitleCount(0)}view(){return m(_(),{className:"TagsPage",hero:this.hero.bind(this),sidebar:this.sidebar.bind(this)},this.contentItems().toArray())}contentItems(){const t=new(I());if(this.loading)t.add("loading",m(A(),null));else{const e=this.tags.filter((t=>null!==t.position())),s=this.tags.filter((t=>null===t.position()));t.add("tagTiles",this.tagTileListView(e),100),s.length&&t.add("cloud",this.cloudView(s),10)}return t}hero(){return m(S(),null)}sidebar(){return m(d(),null)}tagTileListView(t){return m("ul",{className:"TagTiles"},t.map(this.tagTileView.bind(this)))}tagTileView(t){const e=t.lastPostedDiscussion(),s=(0,O.Z)(t.children()||[]);return m("li",{className:y()("TagTile",{colored:t.color()},E()(t.color())),style:{"--tag-bg":t.color()}},m(v(),{className:"TagTile-info",href:a().route.tag(t)},m("div",{className:"TagTile-heading"},t.icon()&&(0,x.Z)(t,{},{useColor:!1}),m("h3",{className:"TagTile-name"},t.name())),m("p",{className:"TagTile-description"},t.description()),!!s&&m("div",{className:"TagTile-children"},s.map((t=>[m(v(),{href:a().route.tag(t)},t.name())," "])))),e?m(v(),{className:"TagTile-lastPostedDiscussion",href:a().route.discussion(e,e.lastPostNumber())},m("span",{className:"TagTile-lastPostedDiscussion-title"},e.title()),j()(e.lastPostedAt())):m("span",{className:"TagTile-lastPostedDiscussion"}))}cloudView(t){return m("div",{className:"TagCloud"},t.map((t=>[(0,H.Z)(t,{link:!0})," "])))}}flarum.reg.add("flarum-tags","forum/components/TagsPage",R);const q=flarum.reg.get("core","forum/components/IndexPage");var G=s.n(q);const F=flarum.reg.get("core","forum/states/DiscussionListState");var K=s.n(F);const $=flarum.reg.get("core","forum/states/GlobalSearchState");var U=s.n($),z=s(433),W=s.n(z);class J extends(W()){view(){const t=this.attrs.model,e=t.color();return m("header",{className:y()("Hero","TagHero",{"TagHero--colored":e,[E()(e)]:e}),style:e?{"--hero-bg":e}:void 0},m("div",{className:"container"},m("div",{className:"containerNarrow"},m("h1",{className:"Hero-title"},t.icon()&&(0,x.Z)(t,{},{useColor:!1})," ",t.name()),m("div",{className:"Hero-subtitle"},t.description()))))}}flarum.reg.add("flarum-tags","forum/components/TagHero",J);const Q=t=>a().store.all("tags").find((e=>0===e.slug().localeCompare(t,void 0,{sensitivity:"base"}))),X=flarum.reg.get("core","forum/components/DiscussionListItem");var Y=s.n(X);const tt=flarum.reg.get("core","forum/components/DiscussionHero");var et=s.n(tt);function st(t,e){void 0===e&&(e={});const s=[],{link:r,...a}=e;return a.className=y()("TagsLabel",a.className),t?(0,O.Z)(t).forEach((e=>{(e||1===t.length)&&s.push((0,H.Z)(e,{link:r}))})):s.push((0,H.Z)()),m("span",a,s)}s(780),flarum.reg.add("flarum-tags","common/helpers/tagsLabel",st);const rt=flarum.reg.get("core","forum/utils/DiscussionControls");var at=s.n(rt),ot=s(645),nt=s.n(ot);flarum.reg.addChunkModule("642","884","flarum-tags","forum/components/TagDiscussionModal"),flarum.reg.addChunkModule("642","884","flarum-tags","/home/runner/work/framework/framework/extensions/tags/js/src/forum/components/TagDiscussionModal.tsx"),flarum.reg.addChunkModule("642","884","flarum-tags","/home/runner/work/framework/framework/extensions/tags/js/src/common/components/TagSelectionModal.tsx"),flarum.reg.addChunkModule("642","884","flarum-tags","/home/runner/work/framework/framework/extensions/tags/js/src/forum/components/ToggleButton.js");var it=s(490);const lt=flarum.reg.get("core","common/extenders");var ct=s.n(lt);const ut=flarum.reg.get("core","common/models/Discussion");var mt=s.n(ut);const dt=flarum.reg.get("core","forum/components/EventPost");var gt=s.n(dt);class ft extends(gt()){static initAttrs(t){super.initAttrs(t);const e=t.post.content()[0],s=t.post.content()[1];function r(t,e){return t.filter((t=>-1===e.indexOf(t))).map((t=>app.store.getById("tags",t)))}t.tagsAdded=r(s,e),t.tagsRemoved=r(e,s)}icon(){return"fas fa-tag"}descriptionKey(){return this.attrs.tagsAdded.length?this.attrs.tagsRemoved.length?"flarum-tags.forum.post_stream.added_and_removed_tags_text":"flarum-tags.forum.post_stream.added_tags_text":"flarum-tags.forum.post_stream.removed_tags_text"}descriptionData(){const t={};return this.attrs.tagsAdded.length&&(t.tagsAdded=app.translator.trans("flarum-tags.forum.post_stream.tags_text",{tags:st(this.attrs.tagsAdded,{link:!0}),count:this.attrs.tagsAdded.length})),this.attrs.tagsRemoved.length&&(t.tagsRemoved=app.translator.trans("flarum-tags.forum.post_stream.tags_text",{tags:st(this.attrs.tagsRemoved,{link:!0}),count:this.attrs.tagsRemoved.length})),t}}flarum.reg.add("flarum-tags","forum/components/DiscussionTaggedPost",ft);const pt=flarum.reg.get("core","common/utils/computed");var ht=s.n(pt);const bt=flarum.reg.get("core","common/Model");var vt=s.n(bt);class Tt extends(vt()){name(){return vt().attribute("name").call(this)}slug(){return vt().attribute("slug").call(this)}description(){return vt().attribute("description").call(this)}color(){return vt().attribute("color").call(this)}backgroundUrl(){return vt().attribute("backgroundUrl").call(this)}backgroundMode(){return vt().attribute("backgroundMode").call(this)}icon(){return vt().attribute("icon").call(this)}position(){return vt().attribute("position").call(this)}parent(){return vt().hasOne("parent").call(this)}children(){return vt().hasMany("children").call(this)}defaultSort(){return vt().attribute("defaultSort").call(this)}isChild(){return vt().attribute("isChild").call(this)}isHidden(){return vt().attribute("isHidden").call(this)}isPrimary(){return vt().attribute("isPrimary").call(this)}discussionCount(){return vt().attribute("discussionCount").call(this)}lastPostedAt(){return vt().attribute("lastPostedAt",vt().transformDate).call(this)}lastPostedDiscussion(){return vt().hasOne("lastPostedDiscussion").call(this)}isRestricted(){return vt().attribute("isRestricted").call(this)}canStartDiscussion(){return vt().attribute("canStartDiscussion").call(this)}canAddToDiscussion(){return vt().attribute("canAddToDiscussion").call(this)}isPrimaryParent(){return ht()("position","parent",((t,e)=>null!==t&&!1===e)).call(this)}}flarum.reg.add("flarum-tags","common/models/Tag",Tt);const yt=flarum.reg.get("core","common/query/IGambit");class xt extends yt.KeyValueGambit{constructor(){super(...arguments),(0,o.Z)(this,"predicates",!0)}key(){return i().translator.trans("flarum-tags.lib.gambits.discussions.tag.key",{},!0)}hint(){return i().translator.trans("flarum-tags.lib.gambits.discussions.tag.hint",{},!0)}filterKey(){return"tag"}gambitValueToFilterValue(t){return[t]}fromFilter(t,e){let s=[];return Array.isArray(t)?(s=t.map((t=>this.fromFilter(t.toString(),e))),s.join(" ")):"".concat(e?"-":"").concat(this.key(),":").concat(this.filterValueToGambitValue(t))}filterValueToGambitValue(t){return t}}flarum.reg.add("flarum-tags","common/query/discussions/TagGambit",xt);const wt=[(new(ct().Store)).add("tags",Tt),(new(ct().Search)).gambit("discussions",xt),(new(ct().Routes)).add("tags","/tags",R).add("tag","/t/:tags",G()).helper("tag",(t=>a().route("tag",{tags:t.slug()}))),(new(ct().PostTypes)).add("discussionTagged",ft),new(ct().Model)(mt()).hasMany("tags").attribute("canTag")];a().initializers.add("flarum-tags",(()=>{a().tagList=new l,(0,c.extend)(d().prototype,"navItems",(function(t){if(t.add("tags",m(h(),{icon:"fas fa-th-large",href:a().route("tags")},a().translator.trans("flarum-tags.forum.index.tags_link")),-10),a().current.matches(R))return;t.add("separator",m(f(),null),-12);const e=a().search.state.stickyParams(),s=a().store.all("tags"),r=a().currentTag(),o=s=>{let a=r===s;!a&&r&&(a=r.parent()===s),t.add("tag"+s.id(),m(w,{model:s,params:e,active:a},null==s?void 0:s.name()),-14)};(0,O.Z)(s).filter((t=>null!==t.position()&&(!t.isChild()||r&&(t.parent()===r||t.parent()===r.parent())))).forEach(o);const n=s.filter((t=>null===t.position())).sort(((t,e)=>e.discussionCount()-t.discussionCount()));n.splice(0,3).forEach(o),n.length&&t.add("moreTags",m(h(),{href:a().route("tags")},a().translator.trans("flarum-tags.forum.index.more_link")),-16)})),a().currentTag=function(t){if(this.currentActiveTag&&!t)return this.currentActiveTag;const e=this.search.state.params().tags;let s=null;if(e&&(s=Q(e)),e&&!s||s&&!s.isChild()&&!s.children()){if(this.currentTagLoading)return;this.currentTagLoading=!0,this.store.find("tags",e,{include:"children,children.parent,parent"}).then((()=>{this.currentActiveTag=Q(e),m.redraw()})).finally((()=>{this.currentTagLoading=!1}))}if(s)return this.currentActiveTag=s,this.currentActiveTag;this.currentActiveTag=void 0},(0,c.extend)(G().prototype,"view",(function(t){a().currentTag(!0)})),(0,c.override)(G().prototype,"hero",(function(t){const e=a().currentTag();return e?m(J,{model:e}):t()})),(0,c.extend)(G().prototype,"view",(function(t){const e=a().currentTag();e&&(t.attrs.className+=" IndexPage--tag"+e.id())})),(0,c.extend)(G().prototype,"setTitle",(function(){const t=a().currentTag();t&&a().setTitle(t.name())})),(0,c.extend)(d().prototype,"items",(function(t){const e=a().currentTag();if(e){const s=e.color(),r=e.canStartDiscussion()||!a().session.user,o=t.get("newDiscussion");s&&(o.attrs.className=y()([o.attrs.className,"Button--tagColored",E()(s)]),o.attrs.style={"--color":s}),o.attrs.disabled=!r,o.children=a().translator.trans(r?"core.forum.index.start_discussion_button":"core.forum.index.cannot_start_discussion_button")}})),(0,c.extend)(U().prototype,"params",(function(t){t.tags=m.route.param("tags")})),(0,c.extend)(K().prototype,"requestParams",(function(t){var e;"string"==typeof t.include?t.include=[t.include]:null==(e=t.include)||e.push("tags","tags.parent"),this.params.tags&&(t.filter||(t.filter={}),t.filter.tag=this.params.tags)})),(0,c.extend)(Y().prototype,"infoItems",(function(t){const e=this.attrs.discussion.tags();e&&e.length&&t.add("tags",st(e),10)})),(0,c.extend)(et().prototype,"view",(function(t){const e=(0,O.Z)(this.attrs.discussion.tags());if(e&&e.length){const s=e[0].color();s&&(t.attrs.style={"--hero-bg":s},t.attrs.className=y()(t.attrs.className,"DiscussionHero--colored",E()(s)))}})),(0,c.extend)(et().prototype,"items",(function(t){const e=this.attrs.discussion.tags();e&&e.length&&t.add("tags",st(e,{link:!0}),5)})),(0,c.extend)(at(),"moderationControls",(function(t,e){e.canTag()&&t.add("tags",m(nt(),{icon:"fas fa-tag",onclick:()=>app.modal.show((()=>s.e(642).then(s.bind(s,884))),{discussion:e})},app.translator.trans("flarum-tags.forum.discussion_controls.edit_tags_button")))})),(0,c.extend)(d().prototype,"newDiscussionAction",(function(t){const e=a().currentTag();if(e){const s=e.parent(),r=s?[s,e]:[e];t.then((t=>t.fields.tags=r))}else a().composer.fields.tags=[]})),(0,c.extend)("flarum/forum/components/DiscussionComposer","oninit",(function(){a().tagList.load(["parent"]).then((()=>m.redraw())),this.constructor.prototype.chooseTags=function(){(0,it.Z)().length&&a().modal.show((()=>s.e(642).then(s.bind(s,884))),{selectedTags:(this.composer.fields.tags||[]).slice(0),onsubmit:t=>{this.composer.fields.tags=t,this.$("textarea").focus()}})}})),(0,c.extend)("flarum/forum/components/DiscussionComposer","headerItems",(function(t){const e=this.composer.fields.tags||[],s=(0,it.Z)();t.add("tags",m("a",{className:y()(["DiscussionComposer-changeTags",!s.length&&"disabled"]),onclick:this.chooseTags.bind(this)},e.length?st(e):m("span",{className:"TagLabel untagged"},a().translator.trans("flarum-tags.forum.composer_discussion.choose_tags_link"))),10)})),(0,c.override)("flarum/forum/components/DiscussionComposer","onsubmit",(function(t){const e=this.composer.fields.tags||[],r=e.filter((t=>null!==t.position()&&!t.isChild())),o=e.filter((t=>null===t.position())),n=(0,it.Z)(),i=parseInt(a().forum.attribute("minPrimaryTags")),l=parseInt(a().forum.attribute("minSecondaryTags")),c=parseInt(a().forum.attribute("maxPrimaryTags")),u=parseInt(a().forum.attribute("maxSecondaryTags"));(!e.length&&0!==c&&0!==u||r.lengths.e(642).then(s.bind(s,884))),{selectedTags:e,onsubmit:e=>{this.composer.fields.tags=e,t()}}):t()})),(0,c.extend)("flarum/forum/components/DiscussionComposer","data",(function(t){t.relationships=t.relationships||{},t.relationships.tags=this.composer.fields.tags}))}))},490:(t,e,s)=>{"use strict";function r(t){let e=app.store.all("tags");if(t){const s=t.tags()||[];e=e.filter((t=>t.canAddToDiscussion()||s.includes(t)))}else e=e.filter((t=>t.canStartDiscussion()));return e}s.d(e,{Z:()=>r}),flarum.reg.add("flarum-tags","forum/utils/getSelectableTags",r)},433:t=>{"use strict";t.exports=flarum.reg.get("core","common/Component")},351:t=>{"use strict";t.exports=flarum.reg.get("core","common/app")},645:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/Button")},44:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/FormModal")},678:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/Link")},149:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/LoadingIndicator")},291:t=>{"use strict";t.exports=flarum.reg.get("core","common/helpers/highlight")},679:t=>{"use strict";t.exports=flarum.reg.get("core","common/helpers/textContrastClass")},657:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/KeyboardNavigatable")},636:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/Stream")},836:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/classList")},780:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/extract")},596:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/extractText")},892:t=>{"use strict";t.exports=flarum.reg.get("core","forum/app")},232:t=>{"use strict";t.exports=flarum.reg.get("core","forum/components/DiscussionPage")},905:(t,e,s)=>{"use strict";function r(t){return r="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},r(t)}function a(t,e,s){return(e=function(t){var e=function(t,e){if("object"!==r(t)||null===t)return t;var s=t[Symbol.toPrimitive];if(void 0!==s){var a=s.call(t,e);if("object"!==r(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"===r(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}s.d(e,{Z:()=>a})}},r={};function a(t){var e=r[t];if(void 0!==e)return e.exports;var o=r[t]={exports:{}};return s[t](o,o.exports,a),o.exports}a.m=s,a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var s in e)a.o(e,s)&&!a.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},a.f={},a.e=t=>Promise.all(Object.keys(a.f).reduce(((e,s)=>(a.f[s](t,e),e)),[])),a.u=t=>"forum/components/TagDiscussionModal.js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t={},e="module.exports:",a.l=(s,r,o,n)=>{if(t[s])t[s].push(r);else{var i,l;if(void 0!==o)for(var c=document.getElementsByTagName("script"),u=0;u{i.onerror=i.onload=null,clearTimeout(g);var a=t[s];if(delete t[s],i.parentNode&&i.parentNode.removeChild(i),a&&a.forEach((t=>t(r))),e)return e(r)},g=setTimeout(d.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),l&&document.head.appendChild(i)}},a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;a.g.importScripts&&(t=a.g.location+"");var e=a.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var s=e.getElementsByTagName("script");s.length&&(t=s[s.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=t})(),a.f.compat=(t,e)=>{const s=a.l;a.l=flarum.reg.loadChunk.bind(flarum.reg,s)},(()=>{var t={315:0};a.f.j=(e,s)=>{var r=a.o(t,e)?t[e]:void 0;if(0!==r)if(r)s.push(r[2]);else{var o=new Promise(((s,a)=>r=t[e]=[s,a]));s.push(r[2]=o);var n=a.p+a.u(e),i=new Error;a.l(n,(s=>{if(a.o(t,e)&&(0!==(r=t[e])&&(t[e]=void 0),r)){var o=s&&("load"===s.type?"missing":s.type),n=s&&s.target&&s.target.src;i.message="Loading chunk "+e+" failed.\n("+o+": "+n+")",i.name="ChunkLoadError",i.type=o,i.request=n,r[1](i)}}),"chunk-"+e,e)}};var e=(e,s)=>{var r,o,[n,i,l]=s,c=0;if(n.some((e=>0!==t[e]))){for(r in i)a.o(i,r)&&(a.m[r]=i[r]);l&&l(a)}for(e&&e(s);c{"use strict";a.r(o),a.d(o,{extend:()=>s.l});var t=a(270),e={};for(const s in t)"default"!==s&&(e[s]=()=>t[s]);a.d(o,e);var s=a(664)})(),module.exports=o})(); +(()=>{var t,e,s={974:(t,e,s)=>{"use strict";s.d(e,{Z:()=>o});var r=s(836),a=s.n(r);function o(t,e,s){void 0===e&&(e={}),void 0===s&&(s={});const r=t&&t.icon(),{useColor:o=!0}=s;return e.className=a()([e.className,"icon text-colored",r?t.icon():"TagIcon"]),t&&o?(e.style=e.style||{},e.style["--color"]=t.color()):t||(e.className+=" untagged"),r?m("i",e):m("span",e)}flarum.reg.add("flarum-tags","common/helpers/tagIcon",o)},924:(t,e,s)=>{"use strict";s.d(e,{Z:()=>g});var r=s(780),a=s.n(r),o=s(678),n=s.n(o),i=s(836),l=s.n(i),c=s(679),u=s.n(c),d=s(974);function g(t,e){void 0===e&&(e={}),e.style=e.style||{},e.className="TagLabel "+(e.className||"");const s=a()(e,"link"),r=t?t.name():app.translator.trans("flarum-tags.lib.deleted_tag_text");if(t){const r=t.color();r&&(e.style["--tag-bg"]=r,e.className=l()(e.className,"colored",u()(r))),s&&(e.title=t.description()||"",e.href=app.route("tag",{tags:t.slug()})),t.isChild()&&(e.className+=" TagLabel--child")}else e.className+=" untagged";return m(s?n():"span",e,m("span",{className:"TagLabel-text"},t&&t.icon()&&(0,d.Z)(t,{className:"TagLabel-icon"},{useColor:!1}),m("span",{className:"TagLabel-name"},r)))}flarum.reg.add("flarum-tags","common/helpers/tagLabel",g)},270:()=>{},648:(t,e,s)=>{"use strict";function r(t){return t.slice(0).sort(((t,e)=>{const s=t.position(),r=e.position();if(null===s&&null===r)return e.discussionCount()-t.discussionCount();if(null===r)return-1;if(null===s)return 1;const a=t.parent(),o=e.parent();return a===o?s-r:a&&o?a.position()-o.position():a?a===e?1:a.position()-r:o?o===t?-1:s-o.position():0}))}s.d(e,{Z:()=>r}),flarum.reg.add("flarum-tags","common/utils/sortTags",r)},664:(t,e,s)=>{"use strict";s.d(e,{l:()=>Nt});var r=s(892),a=s.n(r),o=s(905),n=s(351),i=s.n(n);class l{constructor(){(0,o.Z)(this,"loadedIncludes",void 0)}async load(t){if(void 0===t&&(t=[]),!this.loadedIncludes)return this.query(t);const e=t.filter((t=>!this.loadedIncludes.has(t)));return 0===e.length?Promise.resolve(i().store.all("tags")):this.query(e)}async query(t){return void 0===t&&(t=[]),null!=this.loadedIncludes||(this.loadedIncludes=new Set),i().store.find("tags",{include:t.join(",")}).then((e=>{const s=Array.isArray(e)?e:[e];return t.forEach((t=>this.loadedIncludes.add(t))),s}))}}flarum.reg.add("flarum-tags","common/states/TagListState",l);const c=flarum.reg.get("core","common/extend"),u=flarum.reg.get("core","forum/components/IndexSidebar");var d=s.n(u);const g=flarum.reg.get("core","common/components/Separator");var f=s.n(g);const p=flarum.reg.get("core","common/components/LinkButton");var h=s.n(p),b=s(678),v=s.n(b),T=s(836),y=s.n(T),x=s(974);class N extends(h()){view(t){const e=this.attrs.model,s=e&&e.description(),r=y()("TagLinkButton hasIcon",{child:e.isChild()},this.attrs.className);return m(v(),{className:r,href:this.attrs.route,style:e?{"--color":e.color()}:void 0,title:s||void 0},(0,x.Z)(e,{className:"Button-icon"}),m("span",{className:"Button-label"},e?e.name():app.translator.trans("flarum-tags.forum.index.untagged_link")))}static initAttrs(t){super.initAttrs(t);const e=t.model;t.params.tags=e?e.slug():"untagged",t.route=app.route("tag",t.params)}}flarum.reg.add("flarum-tags","forum/components/TagLinkButton",N);const w=flarum.reg.get("core","common/components/Page");var _=s.n(w);const C=flarum.reg.get("core","forum/components/PageStructure");var k=s.n(C);const P=flarum.reg.get("core","forum/components/WelcomeHero");var S=s.n(P),A=s(149),D=s.n(A);const L=flarum.reg.get("core","common/utils/ItemList");var I=s.n(L);const Z=flarum.reg.get("core","common/helpers/humanTime");var M=s.n(Z),j=s(679),E=s.n(j),V=s(596),B=s.n(V),H=s(924),O=s(648);class R extends(_()){constructor(){super(...arguments),(0,o.Z)(this,"tags",void 0),(0,o.Z)(this,"loading",void 0)}oninit(t){super.oninit(t),a().history.push("tags",B()(a().translator.trans("flarum-tags.forum.header.back_to_tags_tooltip"))),this.tags=[];const e=a().preloadedApiDocument();e?this.tags=(0,O.Z)(e.filter((t=>!t.isChild()))):(this.loading=!0,a().tagList.load(["children","lastPostedDiscussion","parent"]).then((()=>{this.tags=(0,O.Z)(a().store.all("tags").filter((t=>!t.isChild()))),this.loading=!1,m.redraw()})))}oncreate(t){super.oncreate(t),a().setTitle(B()(a().translator.trans("flarum-tags.forum.all_tags.meta_title_text"))),a().setTitleCount(0)}view(){return m(k(),{className:"TagsPage",hero:this.hero.bind(this),sidebar:this.sidebar.bind(this)},this.contentItems().toArray())}contentItems(){const t=new(I());if(this.loading)t.add("loading",m(D(),null));else{const e=this.tags.filter((t=>null!==t.position())),s=this.tags.filter((t=>null===t.position()));t.add("tagTiles",this.tagTileListView(e),100),s.length&&t.add("cloud",this.cloudView(s),10)}return t}hero(){return m(S(),null)}sidebar(){return m(d(),null)}tagTileListView(t){return m("ul",{className:"TagTiles"},t.map(this.tagTileView.bind(this)))}tagTileView(t){const e=t.lastPostedDiscussion(),s=(0,O.Z)(t.children()||[]);return m("li",{className:y()("TagTile",{colored:t.color()},E()(t.color())),style:{"--tag-bg":t.color()}},m(v(),{className:"TagTile-info",href:a().route.tag(t)},m("div",{className:"TagTile-heading"},t.icon()&&(0,x.Z)(t,{},{useColor:!1}),m("h3",{className:"TagTile-name"},t.name())),m("p",{className:"TagTile-description"},t.description()),!!s&&m("div",{className:"TagTile-children"},s.map((t=>[m(v(),{href:a().route.tag(t)},t.name())," "])))),e?m(v(),{className:"TagTile-lastPostedDiscussion",href:a().route.discussion(e,e.lastPostNumber())},m("span",{className:"TagTile-lastPostedDiscussion-title"},e.title()),M()(e.lastPostedAt())):m("span",{className:"TagTile-lastPostedDiscussion"}))}cloudView(t){return m("div",{className:"TagCloud"},t.map((t=>[(0,H.Z)(t,{link:!0})," "])))}}flarum.reg.add("flarum-tags","forum/components/TagsPage",R);const q=flarum.reg.get("core","forum/components/IndexPage");var G=s.n(q);const F=flarum.reg.get("core","forum/states/DiscussionListState");var K=s.n(F);const $=flarum.reg.get("core","forum/states/GlobalSearchState");var U=s.n($),z=s(433),W=s.n(z);class J extends(W()){view(){const t=this.attrs.model,e=t.color();return m("header",{className:y()("Hero","TagHero",{"TagHero--colored":e,[E()(e)]:e}),style:e?{"--hero-bg":e}:void 0},m("div",{className:"container"},m("div",{className:"containerNarrow"},m("h1",{className:"Hero-title"},t.icon()&&(0,x.Z)(t,{},{useColor:!1})," ",t.name()),m("div",{className:"Hero-subtitle"},t.description()))))}}flarum.reg.add("flarum-tags","forum/components/TagHero",J);const Q=t=>a().store.all("tags").find((e=>0===e.slug().localeCompare(t,void 0,{sensitivity:"base"}))),X=flarum.reg.get("core","forum/components/DiscussionListItem");var Y=s.n(X);const tt=flarum.reg.get("core","forum/components/DiscussionHero");var et=s.n(tt);function st(t,e){void 0===e&&(e={});const s=[],{link:r,...a}=e;return a.className=y()("TagsLabel",a.className),t?(0,O.Z)(t).forEach((e=>{(e||1===t.length)&&s.push((0,H.Z)(e,{link:r}))})):s.push((0,H.Z)()),m("span",a,s)}s(780),flarum.reg.add("flarum-tags","common/helpers/tagsLabel",st);const rt=flarum.reg.get("core","forum/utils/DiscussionControls");var at=s.n(rt),ot=s(645),nt=s.n(ot);flarum.reg.addChunkModule("642","884","flarum-tags","forum/components/TagDiscussionModal"),flarum.reg.addChunkModule("642","884","flarum-tags","common/components/TagSelectionModal"),flarum.reg.addChunkModule("642","884","flarum-tags","forum/components/ToggleButton");var it=s(490);const lt=flarum.reg.get("core","common/extenders");var ct=s.n(lt);const ut=flarum.reg.get("core","common/models/Discussion");var mt=s.n(ut);const dt=flarum.reg.get("core","forum/components/EventPost");var gt=s.n(dt);class ft extends(gt()){static initAttrs(t){super.initAttrs(t);const e=t.post.content()[0],s=t.post.content()[1];function r(t,e){return t.filter((t=>-1===e.indexOf(t))).map((t=>app.store.getById("tags",t)))}t.tagsAdded=r(s,e),t.tagsRemoved=r(e,s)}icon(){return"fas fa-tag"}descriptionKey(){return this.attrs.tagsAdded.length?this.attrs.tagsRemoved.length?"flarum-tags.forum.post_stream.added_and_removed_tags_text":"flarum-tags.forum.post_stream.added_tags_text":"flarum-tags.forum.post_stream.removed_tags_text"}descriptionData(){const t={};return this.attrs.tagsAdded.length&&(t.tagsAdded=app.translator.trans("flarum-tags.forum.post_stream.tags_text",{tags:st(this.attrs.tagsAdded,{link:!0}),count:this.attrs.tagsAdded.length})),this.attrs.tagsRemoved.length&&(t.tagsRemoved=app.translator.trans("flarum-tags.forum.post_stream.tags_text",{tags:st(this.attrs.tagsRemoved,{link:!0}),count:this.attrs.tagsRemoved.length})),t}}flarum.reg.add("flarum-tags","forum/components/DiscussionTaggedPost",ft);const pt=flarum.reg.get("core","common/utils/computed");var ht=s.n(pt);const bt=flarum.reg.get("core","common/Model");var vt=s.n(bt);class Tt extends(vt()){name(){return vt().attribute("name").call(this)}slug(){return vt().attribute("slug").call(this)}description(){return vt().attribute("description").call(this)}color(){return vt().attribute("color").call(this)}backgroundUrl(){return vt().attribute("backgroundUrl").call(this)}backgroundMode(){return vt().attribute("backgroundMode").call(this)}icon(){return vt().attribute("icon").call(this)}position(){return vt().attribute("position").call(this)}parent(){return vt().hasOne("parent").call(this)}children(){return vt().hasMany("children").call(this)}defaultSort(){return vt().attribute("defaultSort").call(this)}isChild(){return vt().attribute("isChild").call(this)}isHidden(){return vt().attribute("isHidden").call(this)}isPrimary(){return vt().attribute("isPrimary").call(this)}discussionCount(){return vt().attribute("discussionCount").call(this)}lastPostedAt(){return vt().attribute("lastPostedAt",vt().transformDate).call(this)}lastPostedDiscussion(){return vt().hasOne("lastPostedDiscussion").call(this)}isRestricted(){return vt().attribute("isRestricted").call(this)}canStartDiscussion(){return vt().attribute("canStartDiscussion").call(this)}canAddToDiscussion(){return vt().attribute("canAddToDiscussion").call(this)}isPrimaryParent(){return ht()("position","parent",((t,e)=>null!==t&&!1===e)).call(this)}}flarum.reg.add("flarum-tags","common/models/Tag",Tt);const yt=flarum.reg.get("core","common/query/IGambit");class xt extends yt.KeyValueGambit{constructor(){super(...arguments),(0,o.Z)(this,"predicates",!0)}key(){return i().translator.trans("flarum-tags.lib.gambits.discussions.tag.key",{},!0)}hint(){return i().translator.trans("flarum-tags.lib.gambits.discussions.tag.hint",{},!0)}filterKey(){return"tag"}gambitValueToFilterValue(t){return[t]}fromFilter(t,e){let s=[];return Array.isArray(t)?(s=t.map((t=>this.fromFilter(t.toString(),e))),s.join(" ")):"".concat(e?"-":"").concat(this.key(),":").concat(this.filterValueToGambitValue(t))}filterValueToGambitValue(t){return t}}flarum.reg.add("flarum-tags","common/query/discussions/TagGambit",xt);const Nt=[(new(ct().Store)).add("tags",Tt),(new(ct().Search)).gambit("discussions",xt),(new(ct().Routes)).add("tags","/tags",R).add("tag","/t/:tags",G()).helper("tag",(t=>a().route("tag",{tags:t.slug()}))),(new(ct().PostTypes)).add("discussionTagged",ft),new(ct().Model)(mt()).hasMany("tags").attribute("canTag")];a().initializers.add("flarum-tags",(()=>{a().tagList=new l,(0,c.extend)(d().prototype,"navItems",(function(t){if(t.add("tags",m(h(),{icon:"fas fa-th-large",href:a().route("tags")},a().translator.trans("flarum-tags.forum.index.tags_link")),-10),a().current.matches(R))return;t.add("separator",m(f(),null),-12);const e=a().search.state.stickyParams(),s=a().store.all("tags"),r=a().currentTag(),o=s=>{let a=r===s;!a&&r&&(a=r.parent()===s),t.add("tag"+s.id(),m(N,{model:s,params:e,active:a},null==s?void 0:s.name()),-14)};(0,O.Z)(s).filter((t=>null!==t.position()&&(!t.isChild()||r&&(t.parent()===r||t.parent()===r.parent())))).forEach(o);const n=s.filter((t=>null===t.position())).sort(((t,e)=>e.discussionCount()-t.discussionCount()));n.splice(0,3).forEach(o),n.length&&t.add("moreTags",m(h(),{href:a().route("tags")},a().translator.trans("flarum-tags.forum.index.more_link")),-16)})),a().currentTag=function(t){if(this.currentActiveTag&&!t)return this.currentActiveTag;const e=this.search.state.params().tags;let s=null;if(e&&(s=Q(e)),e&&!s||s&&!s.isChild()&&!s.children()){if(this.currentTagLoading)return;this.currentTagLoading=!0,this.store.find("tags",e,{include:"children,children.parent,parent"}).then((()=>{this.currentActiveTag=Q(e),m.redraw()})).finally((()=>{this.currentTagLoading=!1}))}if(s)return this.currentActiveTag=s,this.currentActiveTag;this.currentActiveTag=void 0},(0,c.extend)(G().prototype,"view",(function(t){a().currentTag(!0)})),(0,c.override)(G().prototype,"hero",(function(t){const e=a().currentTag();return e?m(J,{model:e}):t()})),(0,c.extend)(G().prototype,"view",(function(t){const e=a().currentTag();e&&(t.attrs.className+=" IndexPage--tag"+e.id())})),(0,c.extend)(G().prototype,"setTitle",(function(){const t=a().currentTag();t&&a().setTitle(t.name())})),(0,c.extend)(d().prototype,"items",(function(t){const e=a().currentTag();if(e){const s=e.color(),r=e.canStartDiscussion()||!a().session.user,o=t.get("newDiscussion");s&&(o.attrs.className=y()([o.attrs.className,"Button--tagColored",E()(s)]),o.attrs.style={"--color":s}),o.attrs.disabled=!r,o.children=a().translator.trans(r?"core.forum.index.start_discussion_button":"core.forum.index.cannot_start_discussion_button")}})),(0,c.extend)(U().prototype,"params",(function(t){t.tags=m.route.param("tags")})),(0,c.extend)(K().prototype,"requestParams",(function(t){var e;"string"==typeof t.include?t.include=[t.include]:null==(e=t.include)||e.push("tags","tags.parent"),this.params.tags&&(t.filter||(t.filter={}),t.filter.tag=this.params.tags)})),(0,c.extend)(Y().prototype,"infoItems",(function(t){const e=this.attrs.discussion.tags();e&&e.length&&t.add("tags",st(e),10)})),(0,c.extend)(et().prototype,"view",(function(t){const e=(0,O.Z)(this.attrs.discussion.tags());if(e&&e.length){const s=e[0].color();s&&(t.attrs.style={"--hero-bg":s},t.attrs.className=y()(t.attrs.className,"DiscussionHero--colored",E()(s)))}})),(0,c.extend)(et().prototype,"items",(function(t){const e=this.attrs.discussion.tags();e&&e.length&&t.add("tags",st(e,{link:!0}),5)})),(0,c.extend)(at(),"moderationControls",(function(t,e){e.canTag()&&t.add("tags",m(nt(),{icon:"fas fa-tag",onclick:()=>app.modal.show((()=>s.e(642).then(s.bind(s,884))),{discussion:e})},app.translator.trans("flarum-tags.forum.discussion_controls.edit_tags_button")))})),(0,c.extend)(d().prototype,"newDiscussionAction",(function(t){const e=a().currentTag();if(e){const s=e.parent(),r=s?[s,e]:[e];t.then((t=>t.fields.tags=r))}else a().composer.fields.tags=[]})),(0,c.extend)("flarum/forum/components/DiscussionComposer","oninit",(function(){a().tagList.load(["parent"]).then((()=>m.redraw())),this.constructor.prototype.chooseTags=function(){(0,it.Z)().length&&a().modal.show((()=>s.e(642).then(s.bind(s,884))),{selectedTags:(this.composer.fields.tags||[]).slice(0),onsubmit:t=>{this.composer.fields.tags=t,this.$("textarea").focus()}})}})),(0,c.extend)("flarum/forum/components/DiscussionComposer","headerItems",(function(t){const e=this.composer.fields.tags||[],s=(0,it.Z)();t.add("tags",m("a",{className:y()(["DiscussionComposer-changeTags",!s.length&&"disabled"]),onclick:this.chooseTags.bind(this)},e.length?st(e):m("span",{className:"TagLabel untagged"},a().translator.trans("flarum-tags.forum.composer_discussion.choose_tags_link"))),10)})),(0,c.override)("flarum/forum/components/DiscussionComposer","onsubmit",(function(t){const e=this.composer.fields.tags||[],r=e.filter((t=>null!==t.position()&&!t.isChild())),o=e.filter((t=>null===t.position())),n=(0,it.Z)(),i=parseInt(a().forum.attribute("minPrimaryTags")),l=parseInt(a().forum.attribute("minSecondaryTags")),c=parseInt(a().forum.attribute("maxPrimaryTags")),u=parseInt(a().forum.attribute("maxSecondaryTags"));(!e.length&&0!==c&&0!==u||r.lengths.e(642).then(s.bind(s,884))),{selectedTags:e,onsubmit:e=>{this.composer.fields.tags=e,t()}}):t()})),(0,c.extend)("flarum/forum/components/DiscussionComposer","data",(function(t){t.relationships=t.relationships||{},t.relationships.tags=this.composer.fields.tags}))}))},490:(t,e,s)=>{"use strict";function r(t){let e=app.store.all("tags");if(t){const s=t.tags()||[];e=e.filter((t=>t.canAddToDiscussion()||s.includes(t)))}else e=e.filter((t=>t.canStartDiscussion()));return e}s.d(e,{Z:()=>r}),flarum.reg.add("flarum-tags","forum/utils/getSelectableTags",r)},433:t=>{"use strict";t.exports=flarum.reg.get("core","common/Component")},351:t=>{"use strict";t.exports=flarum.reg.get("core","common/app")},645:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/Button")},44:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/FormModal")},678:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/Link")},149:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/LoadingIndicator")},291:t=>{"use strict";t.exports=flarum.reg.get("core","common/helpers/highlight")},679:t=>{"use strict";t.exports=flarum.reg.get("core","common/helpers/textContrastClass")},657:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/KeyboardNavigatable")},636:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/Stream")},836:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/classList")},780:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/extract")},596:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/extractText")},892:t=>{"use strict";t.exports=flarum.reg.get("core","forum/app")},232:t=>{"use strict";t.exports=flarum.reg.get("core","forum/components/DiscussionPage")},905:(t,e,s)=>{"use strict";function r(t){return r="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},r(t)}function a(t,e,s){return(e=function(t){var e=function(t,e){if("object"!==r(t)||null===t)return t;var s=t[Symbol.toPrimitive];if(void 0!==s){var a=s.call(t,e);if("object"!==r(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"===r(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}s.d(e,{Z:()=>a})}},r={};function a(t){var e=r[t];if(void 0!==e)return e.exports;var o=r[t]={exports:{}};return s[t](o,o.exports,a),o.exports}a.m=s,a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var s in e)a.o(e,s)&&!a.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},a.f={},a.e=t=>Promise.all(Object.keys(a.f).reduce(((e,s)=>(a.f[s](t,e),e)),[])),a.u=t=>"forum/components/TagDiscussionModal.js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t={},e="module.exports:",a.l=(s,r,o,n)=>{if(t[s])t[s].push(r);else{var i,l;if(void 0!==o)for(var c=document.getElementsByTagName("script"),u=0;u{i.onerror=i.onload=null,clearTimeout(g);var a=t[s];if(delete t[s],i.parentNode&&i.parentNode.removeChild(i),a&&a.forEach((t=>t(r))),e)return e(r)},g=setTimeout(d.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),l&&document.head.appendChild(i)}},a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;a.g.importScripts&&(t=a.g.location+"");var e=a.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var s=e.getElementsByTagName("script");s.length&&(t=s[s.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=t})(),a.f.compat=(t,e)=>{const s=a.l;a.l=flarum.reg.loadChunk.bind(flarum.reg,s)},(()=>{var t={315:0};a.f.j=(e,s)=>{var r=a.o(t,e)?t[e]:void 0;if(0!==r)if(r)s.push(r[2]);else{var o=new Promise(((s,a)=>r=t[e]=[s,a]));s.push(r[2]=o);var n=a.p+a.u(e),i=new Error;a.l(n,(s=>{if(a.o(t,e)&&(0!==(r=t[e])&&(t[e]=void 0),r)){var o=s&&("load"===s.type?"missing":s.type),n=s&&s.target&&s.target.src;i.message="Loading chunk "+e+" failed.\n("+o+": "+n+")",i.name="ChunkLoadError",i.type=o,i.request=n,r[1](i)}}),"chunk-"+e,e)}};var e=(e,s)=>{var r,o,[n,i,l]=s,c=0;if(n.some((e=>0!==t[e]))){for(r in i)a.o(i,r)&&(a.m[r]=i[r]);l&&l(a)}for(e&&e(s);c{"use strict";a.r(o),a.d(o,{extend:()=>s.l});var t=a(270),e={};for(const s in t)"default"!==s&&(e[s]=()=>t[s]);a.d(o,e);var s=a(664)})(),module.exports=o})(); //# 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 6fb97a0c15..9d10560ba6 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":"UAAIA,EACAC,E,qECAW,SAASC,EAAQC,EAAKC,EAAOC,QAC5B,IAAVD,IACFA,EAAQ,CAAC,QAEM,IAAbC,IACFA,EAAW,CAAC,GAEd,MAAMC,EAAUH,GAAOA,EAAII,QACrB,SACJC,GAAW,GACTH,EAQJ,OAPAD,EAAMK,UAAY,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D,EAAY,KAAOC,EAAU,IAC1FF,EAAMhR,KAAO,iBACbgR,EAAMpB,KAAOqB,EACbD,EAAMI,QAAUF,EAChBJ,EAAmB,GAAGE,EACvB,CACD,GAEwC,SAAW3D,EAASA,EAE/D,CACD,EAcF,IAAIgE,EAAuB,CAACC,EAA4B9K,KACvD,IAGIkG,EAAUW,GAHTkE,EAAUC,EAAaC,GAAWjL,EAGhBgI,EAAI,EAC3B,GAAG+C,EAASG,MAAMzL,GAAgC,IAAxB2K,EAAgB3K,KAAa,CACtD,IAAIyG,KAAY8E,EACZ/E,EAAoBS,EAAEsE,EAAa9E,KACrCD,EAAoBhN,EAAEiN,GAAY8E,EAAY9E,IAG7C+E,GAAsBA,EAAQhF,EAClC,CAEA,IADG6E,GAA4BA,EAA2B9K,GACrDgI,EAAI+C,EAASrP,OAAQsM,IACzBnB,EAAUkE,EAAS/C,GAChB/B,EAAoBS,EAAE0D,EAAiBvD,IAAYuD,EAAgBvD,IACrEuD,EAAgBvD,GAAS,KAE1BuD,EAAgBvD,GAAW,CAC5B,EAIGsE,EAAqBC,KAAiC,2BAAIA,KAAiC,4BAAK,GACpGD,EAAmBhP,QAAQ0O,EAAqBtN,KAAK,KAAM,IAC3D4N,EAAmBrM,KAAO+L,EAAqBtN,KAAK,KAAM4N,EAAmBrM,KAAKvB,KAAK4N,G","sources":["webpack://@flarum/tags/webpack/runtime/load script","webpack://@flarum/tags/./src/common/helpers/tagIcon.js","webpack://@flarum/tags/./src/common/helpers/tagLabel.js","webpack://@flarum/tags/./src/common/utils/sortTags.tsx","webpack://@flarum/tags/./src/common/states/TagListState.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/IndexSidebar')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Separator')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/LinkButton')\"","webpack://@flarum/tags/./src/forum/components/TagLinkButton.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Page')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/PageStructure')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/WelcomeHero')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/ItemList')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/humanTime')\"","webpack://@flarum/tags/./src/forum/components/TagsPage.tsx","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/IndexPage')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/states/DiscussionListState')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/states/GlobalSearchState')\"","webpack://@flarum/tags/./src/forum/components/TagHero.js","webpack://@flarum/tags/./src/forum/addTagFilter.tsx","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/DiscussionListItem')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/DiscussionHero')\"","webpack://@flarum/tags/./src/common/helpers/tagsLabel.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/utils/DiscussionControls')\"","webpack://@flarum/tags/./src/forum/addTagControl.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/models/Discussion')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/EventPost')\"","webpack://@flarum/tags/./src/forum/components/DiscussionTaggedPost.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/computed')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/Model')\"","webpack://@flarum/tags/./src/common/models/Tag.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/query/IGambit')\"","webpack://@flarum/tags/./src/common/query/discussions/TagGambit.ts","webpack://@flarum/tags/./src/common/extend.ts","webpack://@flarum/tags/./src/forum/extend.ts","webpack://@flarum/tags/./src/forum/index.ts","webpack://@flarum/tags/./src/forum/addTagList.js","webpack://@flarum/tags/./src/forum/addTagLabels.js","webpack://@flarum/tags/./src/forum/addTagComposer.js","webpack://@flarum/tags/./src/forum/utils/getSelectableTags.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/Component')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/app')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/FormModal')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Link')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/LoadingIndicator')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/highlight')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/textContrastClass')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/KeyboardNavigatable')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/Stream')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/classList')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/extract')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/DiscussionPage')\"","webpack://@flarum/tags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/tags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/tags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/tags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPrimitive.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/ensure chunk","webpack://@flarum/tags/webpack/runtime/get javascript chunk filename","webpack://@flarum/tags/webpack/runtime/global","webpack://@flarum/tags/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/tags/webpack/runtime/make namespace object","webpack://@flarum/tags/webpack/runtime/publicPath","webpack://@flarum/tags/webpack/runtime/compat","webpack://@flarum/tags/webpack/runtime/jsonp chunk loading"],"sourcesContent":["var inProgress = {};\nvar dataWebpackPrefix = \"module.exports:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t};\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","import classList from 'flarum/common/utils/classList';\nexport default function tagIcon(tag, attrs, settings) {\n if (attrs === void 0) {\n attrs = {};\n }\n if (settings === void 0) {\n settings = {};\n }\n const hasIcon = tag && tag.icon();\n const {\n useColor = true\n } = settings;\n attrs.className = classList([attrs.className, 'icon text-colored', hasIcon ? tag.icon() : 'TagIcon']);\n if (tag && useColor) {\n attrs.style = attrs.style || {};\n attrs.style['--color'] = tag.color();\n } else if (!tag) {\n attrs.className += ' untagged';\n }\n return hasIcon ? m(\"i\", attrs) : m(\"span\", attrs);\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagIcon', tagIcon);","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';\nexport default function tagLabel(tag, attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n attrs.style = attrs.style || {};\n attrs.className = 'TagLabel ' + (attrs.className || '');\n const link = extract(attrs, 'link');\n const tagText = tag ? tag.name() : app.translator.trans('flarum-tags.lib.deleted_tag_text');\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 if (link) {\n attrs.title = tag.description() || '';\n attrs.href = app.route('tag', {\n tags: tag.slug()\n });\n }\n if (tag.isChild()) {\n attrs.className += ' TagLabel--child';\n }\n } else {\n attrs.className += ' untagged';\n }\n return m(link ? Link : 'span', attrs, m(\"span\", {\n className: \"TagLabel-text\"\n }, tag && tag.icon() && tagIcon(tag, {\n className: 'TagLabel-icon'\n }, {\n useColor: false\n }), m(\"span\", {\n className: \"TagLabel-name\"\n }, tagText)));\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagLabel', tagLabel);","export default function sortTags(tags) {\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;else if (bParent) return bParent === a ? -1 : aPos - bParent.position();\n return 0;\n });\n}\nflarum.reg.add('flarum-tags', 'common/utils/sortTags', sortTags);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/common/app';\nexport default class TagListState {\n constructor() {\n _defineProperty(this, \"loadedIncludes\", void 0);\n }\n async load(includes) {\n if (includes === void 0) {\n includes = [];\n }\n if (!this.loadedIncludes) {\n return this.query(includes);\n }\n const unloadedIncludes = includes.filter(include => !this.loadedIncludes.has(include));\n if (unloadedIncludes.length === 0) {\n return Promise.resolve(app.store.all('tags'));\n }\n return this.query(unloadedIncludes);\n }\n async query(includes) {\n var _this$loadedIncludes;\n if (includes === void 0) {\n includes = [];\n }\n (_this$loadedIncludes = this.loadedIncludes) != null ? _this$loadedIncludes : this.loadedIncludes = new Set();\n return app.store.find('tags', {\n include: includes.join(',')\n }).then(val => {\n const tags = Array.isArray(val) ? val : [val];\n includes.forEach(include => this.loadedIncludes.add(include));\n return tags;\n });\n }\n}\nflarum.reg.add('flarum-tags', 'common/states/TagListState', TagListState);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/IndexSidebar');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Separator');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/LinkButton');","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';\nexport default class TagLinkButton extends LinkButton {\n view(vnode) {\n const tag = this.attrs.model;\n const description = tag && tag.description();\n const className = classList('TagLinkButton hasIcon', {\n child: tag.isChild()\n }, this.attrs.className);\n return m(Link, {\n className: className,\n href: this.attrs.route,\n style: tag ? {\n '--color': tag.color()\n } : undefined,\n title: description || undefined\n }, tagIcon(tag, {\n className: 'Button-icon'\n }), m(\"span\", {\n className: \"Button-label\"\n }, tag ? tag.name() : app.translator.trans('flarum-tags.forum.index.untagged_link')));\n }\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n const tag = attrs.model;\n attrs.params.tags = tag ? tag.slug() : 'untagged';\n attrs.route = app.route('tag', attrs.params);\n }\n}\nflarum.reg.add('flarum-tags', 'forum/components/TagLinkButton', TagLinkButton);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Page');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/PageStructure');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/WelcomeHero');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/ItemList');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/humanTime');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/forum/app';\nimport Page from 'flarum/common/components/Page';\nimport PageStructure from 'flarum/forum/components/PageStructure';\nimport WelcomeHero from 'flarum/forum/components/WelcomeHero';\nimport IndexSidebar from 'flarum/forum/components/IndexSidebar';\nimport Link from 'flarum/common/components/Link';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport humanTime from 'flarum/common/helpers/humanTime';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport classList from 'flarum/common/utils/classList';\nimport extractText from 'flarum/common/utils/extractText';\nimport tagIcon from '../../common/helpers/tagIcon';\nimport tagLabel from '../../common/helpers/tagLabel';\nimport sortTags from '../../common/utils/sortTags';\nexport default class TagsPage extends Page {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"tags\", void 0);\n _defineProperty(this, \"loading\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n app.history.push('tags', extractText(app.translator.trans('flarum-tags.forum.header.back_to_tags_tooltip')));\n this.tags = [];\n const preloaded = app.preloadedApiDocument();\n if (preloaded) {\n this.tags = sortTags(preloaded.filter(tag => !tag.isChild()));\n return;\n }\n this.loading = true;\n app.tagList.load(['children', 'lastPostedDiscussion', 'parent']).then(() => {\n this.tags = sortTags(app.store.all('tags').filter(tag => !tag.isChild()));\n this.loading = false;\n m.redraw();\n });\n }\n oncreate(vnode) {\n super.oncreate(vnode);\n app.setTitle(extractText(app.translator.trans('flarum-tags.forum.all_tags.meta_title_text')));\n app.setTitleCount(0);\n }\n view() {\n return m(PageStructure, {\n className: \"TagsPage\",\n hero: this.hero.bind(this),\n sidebar: this.sidebar.bind(this)\n }, this.contentItems().toArray());\n }\n contentItems() {\n const items = new ItemList();\n if (this.loading) {\n items.add('loading', m(LoadingIndicator, null));\n } else {\n const pinned = this.tags.filter(tag => tag.position() !== null);\n const cloud = this.tags.filter(tag => tag.position() === null);\n items.add('tagTiles', this.tagTileListView(pinned), 100);\n if (cloud.length) {\n items.add('cloud', this.cloudView(cloud), 10);\n }\n }\n return items;\n }\n hero() {\n return m(WelcomeHero, null);\n }\n sidebar() {\n return m(IndexSidebar, null);\n }\n tagTileListView(pinned) {\n return m(\"ul\", {\n className: \"TagTiles\"\n }, pinned.map(this.tagTileView.bind(this)));\n }\n tagTileView(tag) {\n const lastPostedDiscussion = tag.lastPostedDiscussion();\n const children = sortTags(tag.children() || []);\n return m(\"li\", {\n className: classList('TagTile', {\n colored: tag.color()\n }, textContrastClass(tag.color())),\n style: {\n '--tag-bg': tag.color()\n }\n }, m(Link, {\n className: \"TagTile-info\",\n href: app.route.tag(tag)\n }, m(\"div\", {\n className: \"TagTile-heading\"\n }, tag.icon() && tagIcon(tag, {}, {\n useColor: false\n }), m(\"h3\", {\n className: \"TagTile-name\"\n }, tag.name())), m(\"p\", {\n className: \"TagTile-description\"\n }, tag.description()), !!children && m(\"div\", {\n className: \"TagTile-children\"\n }, children.map(child => [m(Link, {\n href: app.route.tag(child)\n }, child.name()), ' ']))), lastPostedDiscussion ? m(Link, {\n className: \"TagTile-lastPostedDiscussion\",\n href: app.route.discussion(lastPostedDiscussion, lastPostedDiscussion.lastPostNumber())\n }, m(\"span\", {\n className: \"TagTile-lastPostedDiscussion-title\"\n }, lastPostedDiscussion.title()), humanTime(lastPostedDiscussion.lastPostedAt())) : m(\"span\", {\n className: \"TagTile-lastPostedDiscussion\"\n }));\n }\n cloudView(cloud) {\n return m(\"div\", {\n className: \"TagCloud\"\n }, cloud.map(tag => [tagLabel(tag, {\n link: true\n }), ' ']));\n }\n}\nflarum.reg.add('flarum-tags', 'forum/components/TagsPage', TagsPage);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/IndexPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/states/DiscussionListState');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/states/GlobalSearchState');","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';\nexport default class TagHero extends Component {\n view() {\n const tag = this.attrs.model;\n const color = tag.color();\n return m(\"header\", {\n className: classList('Hero', 'TagHero', {\n 'TagHero--colored': color,\n [textContrastClass(color)]: color\n }),\n style: color ? {\n '--hero-bg': color\n } : undefined\n }, m(\"div\", {\n className: \"container\"\n }, m(\"div\", {\n className: \"containerNarrow\"\n }, m(\"h1\", {\n className: \"Hero-title\"\n }, tag.icon() && tagIcon(tag, {}, {\n useColor: false\n }), \" \", tag.name()), m(\"div\", {\n className: \"Hero-subtitle\"\n }, tag.description()))));\n }\n}\nflarum.reg.add('flarum-tags', 'forum/components/TagHero', TagHero);","import app from 'flarum/forum/app';\nimport { extend, override } from 'flarum/common/extend';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport IndexSidebar from 'flarum/forum/components/IndexSidebar';\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';\nimport TagHero from './components/TagHero';\nconst findTag = slug => app.store.all('tags').find(tag => tag.slug().localeCompare(slug, undefined, {\n sensitivity: 'base'\n}) === 0);\nexport default function addTagFilter() {\n app.currentTag = function (reload) {\n if (this.currentActiveTag && !reload) {\n return this.currentActiveTag;\n }\n const slug = this.search.state.params().tags;\n let tag = null;\n if (slug) {\n tag = findTag(slug);\n }\n if (slug && !tag || tag && !tag.isChild() && !tag.children()) {\n if (this.currentTagLoading) {\n return;\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 this.store.find('tags', slug, {\n include: 'children,children.parent,parent'\n }).then(() => {\n this.currentActiveTag = findTag(slug);\n m.redraw();\n }).finally(() => {\n this.currentTagLoading = false;\n });\n }\n if (tag) {\n this.currentActiveTag = tag;\n return this.currentActiveTag;\n }\n this.currentActiveTag = undefined;\n return;\n };\n extend(IndexPage.prototype, 'view', function (vdom) {\n app.currentTag(true);\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 = app.currentTag();\n if (tag) return m(TagHero, {\n model: tag\n });\n return original();\n });\n extend(IndexPage.prototype, 'view', function (vdom) {\n const tag = app.currentTag();\n if (tag) vdom.attrs.className += ' IndexPage--tag' + tag.id();\n });\n extend(IndexPage.prototype, 'setTitle', function () {\n const tag = app.currentTag();\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(IndexSidebar.prototype, 'items', function (items) {\n const tag = app.currentTag();\n if (tag) {\n const color = tag.color();\n const canStartDiscussion = tag.canStartDiscussion() || !app.session.user;\n const newDiscussion = items.get('newDiscussion');\n if (color) {\n newDiscussion.attrs.className = classList([newDiscussion.attrs.className, 'Button--tagColored', textContrastClass(color)]);\n newDiscussion.attrs.style = {\n '--color': color\n };\n }\n newDiscussion.attrs.disabled = !canStartDiscussion;\n newDiscussion.children = app.translator.trans(canStartDiscussion ? 'core.forum.index.start_discussion_button' : 'core.forum.index.cannot_start_discussion_button');\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 (params) {\n if (typeof params.include === 'string') {\n params.include = [params.include];\n } else {\n var _params$include;\n (_params$include = params.include) == null ? void 0 : _params$include.push('tags', 'tags.parent');\n }\n if (this.params.tags) {\n params.filter || (params.filter = {});\n params.filter.tag = this.params.tags;\n }\n });\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/DiscussionListItem');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/DiscussionHero');","import extract from 'flarum/common/utils/extract';\nimport tagLabel from './tagLabel';\nimport sortTags from '../utils/sortTags';\nimport classList from 'flarum/common/utils/classList';\nexport default function tagsLabel(tags, attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n const children = [];\n const {\n link,\n ...otherAttrs\n } = attrs;\n otherAttrs.className = classList('TagsLabel', otherAttrs.className);\n if (tags) {\n sortTags(tags).forEach(tag => {\n if (tag || tags.length === 1) {\n children.push(tagLabel(tag, {\n link\n }));\n }\n });\n } else {\n children.push(tagLabel());\n }\n return m(\"span\", otherAttrs, children);\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagsLabel', tagsLabel);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/utils/DiscussionControls');","import { extend } from 'flarum/common/extend';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\nimport Button from 'flarum/common/components/Button';\nexport default function addTagControl() {\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('tags', m(Button, {\n icon: \"fas fa-tag\",\n onclick: () => app.modal.show(() => import(/* webpackChunkName: 'forum/components/TagDiscussionModal', webpackMode: 'lazy-once' */ './components/TagDiscussionModal'), {\n discussion\n })\n }, app.translator.trans('flarum-tags.forum.discussion_controls.edit_tags_button')));\n }\n });\n}flarum.reg.addChunkModule('642', '884', 'flarum-tags', 'forum/components/TagDiscussionModal');\nflarum.reg.addChunkModule('642', '884', 'flarum-tags', '/home/runner/work/framework/framework/extensions/tags/js/src/forum/components/TagDiscussionModal.tsx');\nflarum.reg.addChunkModule('642', '884', 'flarum-tags', '/home/runner/work/framework/framework/extensions/tags/js/src/common/components/TagSelectionModal.tsx');\nflarum.reg.addChunkModule('642', '884', 'flarum-tags', '/home/runner/work/framework/framework/extensions/tags/js/src/forum/components/ToggleButton.js');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/Discussion');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/EventPost');","import EventPost from 'flarum/forum/components/EventPost';\nimport tagsLabel from '../../common/helpers/tagsLabel';\nexport default class DiscussionTaggedPost extends EventPost {\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n const oldTags = attrs.post.content()[0];\n const newTags = attrs.post.content()[1];\n function diffTags(tags1, tags2) {\n return tags1.filter(tag => tags2.indexOf(tag) === -1).map(id => app.store.getById('tags', id));\n }\n attrs.tagsAdded = diffTags(newTags, oldTags);\n attrs.tagsRemoved = diffTags(oldTags, newTags);\n }\n icon() {\n return 'fas fa-tag';\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 return 'flarum-tags.forum.post_stream.added_tags_text';\n }\n return 'flarum-tags.forum.post_stream.removed_tags_text';\n }\n descriptionData() {\n const data = {};\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, {\n link: true\n }),\n count: this.attrs.tagsAdded.length\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, {\n link: true\n }),\n count: this.attrs.tagsRemoved.length\n });\n }\n return data;\n }\n}\nflarum.reg.add('flarum-tags', 'forum/components/DiscussionTaggedPost', DiscussionTaggedPost);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/computed');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Model');","import computed from 'flarum/common/utils/computed';\nimport Model from 'flarum/common/Model';\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 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 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 isPrimary() {\n return Model.attribute('isPrimary').call(this);\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 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 isPrimaryParent() {\n return computed('position', 'parent', (position, parent) => position !== null && parent === false).call(this);\n }\n}\nflarum.reg.add('flarum-tags', 'common/models/Tag', Tag);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/query/IGambit');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/common/app';\nimport { KeyValueGambit } from 'flarum/common/query/IGambit';\nexport default class TagGambit extends KeyValueGambit {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"predicates\", true);\n }\n key() {\n return app.translator.trans('flarum-tags.lib.gambits.discussions.tag.key', {}, true);\n }\n hint() {\n return app.translator.trans('flarum-tags.lib.gambits.discussions.tag.hint', {}, true);\n }\n filterKey() {\n return 'tag';\n }\n gambitValueToFilterValue(value) {\n return [value];\n }\n fromFilter(value, negate) {\n let gambits = [];\n if (Array.isArray(value)) {\n gambits = value.map(value => this.fromFilter(value.toString(), negate));\n } else {\n return \"\".concat(negate ? '-' : '').concat(this.key(), \":\").concat(this.filterValueToGambitValue(value));\n }\n return gambits.join(' ');\n }\n filterValueToGambitValue(value) {\n return value;\n }\n}\nflarum.reg.add('flarum-tags', 'common/query/discussions/TagGambit', TagGambit);","import Extend from 'flarum/common/extenders';\nimport Tag from './models/Tag';\nimport TagGambit from './query/discussions/TagGambit';\nexport default [new Extend.Store() //\n.add('tags', Tag), new Extend.Search() //\n.gambit('discussions', TagGambit)];","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 commonExtend from '../common/extend';\nexport default [...commonExtend, new Extend.Routes() //\n.add('tags', '/tags', TagsPage) //\n.add('tag', '/t/:tags', IndexPage) //\n.helper('tag', tag => app.route('tag', {\n tags: tag.slug()\n})), new Extend.PostTypes() //\n.add('discussionTagged', DiscussionTaggedPost), new Extend.Model(Discussion) //\n.hasMany('tags') //\n.attribute('canTag')];","import app from 'flarum/forum/app';\nimport TagListState from '../common/states/TagListState';\nimport addTagList from './addTagList';\nimport addTagFilter from './addTagFilter';\nimport addTagLabels from './addTagLabels';\nimport addTagControl from './addTagControl';\nimport addTagComposer from './addTagComposer';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-tags', () => {\n app.tagList = new TagListState();\n addTagList();\n addTagFilter();\n addTagLabels();\n addTagControl();\n addTagComposer();\n});\nimport './forum';","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport IndexSidebar from 'flarum/forum/components/IndexSidebar';\nimport Separator from 'flarum/common/components/Separator';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport TagLinkButton from './components/TagLinkButton';\nimport TagsPage from './components/TagsPage';\nimport sortTags from '../common/utils/sortTags';\nexport default function addTagList() {\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(IndexSidebar.prototype, 'navItems', function (items) {\n items.add('tags', m(LinkButton, {\n icon: \"fas fa-th-large\",\n href: app.route('tags')\n }, app.translator.trans('flarum-tags.forum.index.tags_link')), -10);\n if (app.current.matches(TagsPage)) return;\n items.add('separator', m(Separator, null), -12);\n const params = app.search.state.stickyParams();\n const tags = app.store.all('tags');\n const currentTag = app.currentTag();\n const addTag = tag => {\n let active = currentTag === tag;\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(), m(TagLinkButton, {\n model: tag,\n params: params,\n active: active\n }, tag == null ? void 0 : tag.name()), -14);\n };\n sortTags(tags).filter(tag => tag.position() !== null && (!tag.isChild() || currentTag && (tag.parent() === currentTag || tag.parent() === currentTag.parent()))).forEach(addTag);\n const more = tags.filter(tag => tag.position() === null).sort((a, b) => b.discussionCount() - a.discussionCount());\n more.splice(0, 3).forEach(addTag);\n if (more.length) {\n items.add('moreTags', m(LinkButton, {\n href: app.route('tags')\n }, app.translator.trans('flarum-tags.forum.index.more_link')), -16);\n }\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';\nimport tagsLabel from '../common/helpers/tagsLabel';\nimport sortTags from '../common/utils/sortTags';\nexport default function addTagLabels() {\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 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 if (tags && tags.length) {\n const color = tags[0].color();\n if (color) {\n view.attrs.style = {\n '--hero-bg': color\n };\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 if (tags && tags.length) {\n items.add('tags', tagsLabel(tags, {\n link: true\n }), 5);\n }\n });\n}","import app from 'flarum/forum/app';\nimport { extend, override } from 'flarum/common/extend';\nimport IndexSidebar from 'flarum/forum/components/IndexSidebar';\nimport classList from 'flarum/common/utils/classList';\nimport tagsLabel from '../common/helpers/tagsLabel';\nimport getSelectableTags from './utils/getSelectableTags';\nexport default function addTagComposer() {\n extend(IndexSidebar.prototype, 'newDiscussionAction', function (promise) {\n // From `addTagFilter\n const tag = app.currentTag();\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 extend('flarum/forum/components/DiscussionComposer', 'oninit', function () {\n app.tagList.load(['parent']).then(() => m.redraw());\n\n // Add tag-selection abilities to the discussion composer.\n this.constructor.prototype.chooseTags = function () {\n const selectableTags = getSelectableTags();\n if (!selectableTags.length) return;\n app.modal.show(() => import(/* webpackChunkName: 'forum/components/TagDiscussionModal', webpackMode: 'lazy-once' */ './components/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\n // Add a tag-selection menu to the discussion composer's header, after the\n // title.\n extend('flarum/forum/components/DiscussionComposer', 'headerItems', function (items) {\n const tags = this.composer.fields.tags || [];\n const selectableTags = getSelectableTags();\n items.add('tags', m(\"a\", {\n className: classList(['DiscussionComposer-changeTags', !selectableTags.length && 'disabled']),\n onclick: this.chooseTags.bind(this)\n }, tags.length ? tagsLabel(tags) : m(\"span\", {\n className: \"TagLabel untagged\"\n }, app.translator.trans('flarum-tags.forum.composer_discussion.choose_tags_link'))), 10);\n });\n override('flarum/forum/components/DiscussionComposer', '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 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 if ((!chosenTags.length && maxPrimaryTags !== 0 && maxSecondaryTags !== 0 || chosenPrimaryTags.length < minPrimaryTags || chosenSecondaryTags.length < minSecondaryTags) && selectableTags.length) {\n app.modal.show(() => import(/* webpackChunkName: 'forum/components/TagDiscussionModal', webpackMode: 'lazy-once' */ './components/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('flarum/forum/components/DiscussionComposer', 'data', function (data) {\n data.relationships = data.relationships || {};\n data.relationships.tags = this.composer.fields.tags;\n });\n}","export default function getSelectableTags(discussion) {\n let tags = app.store.all('tags');\n if (discussion) {\n const discussionTags = discussion.tags() || [];\n tags = tags.filter(tag => tag.canAddToDiscussion() || discussionTags.includes(tag));\n } else {\n tags = tags.filter(tag => tag.canStartDiscussion());\n }\n return tags;\n}\nflarum.reg.add('flarum-tags', 'forum/utils/getSelectableTags', getSelectableTags);","module.exports = flarum.reg.get('core', 'common/Component');","module.exports = flarum.reg.get('core', 'common/app');","module.exports = flarum.reg.get('core', 'common/components/Button');","module.exports = flarum.reg.get('core', 'common/components/FormModal');","module.exports = flarum.reg.get('core', 'common/components/Link');","module.exports = flarum.reg.get('core', 'common/components/LoadingIndicator');","module.exports = flarum.reg.get('core', 'common/helpers/highlight');","module.exports = flarum.reg.get('core', 'common/helpers/textContrastClass');","module.exports = flarum.reg.get('core', 'common/utils/KeyboardNavigatable');","module.exports = flarum.reg.get('core', 'common/utils/Stream');","module.exports = flarum.reg.get('core', 'common/utils/classList');","module.exports = flarum.reg.get('core', 'common/utils/extract');","module.exports = flarum.reg.get('core', 'common/utils/extractText');","module.exports = flarum.reg.get('core', 'forum/app');","module.exports = flarum.reg.get('core', 'forum/components/DiscussionPage');","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _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 }, _typeof(obj);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\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// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\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__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + \"forum/components/TagDiscussionModal\" + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\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};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.f.compat = (chunkId, promises) => {\n\n\tconst originalLoadChunk = __webpack_require__.l;\n\t__webpack_require__.l = flarum.reg.loadChunk.bind(flarum.reg, originalLoadChunk);\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t315: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkmodule_exports\"] = self[\"webpackChunkmodule_exports\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));"],"names":["inProgress","dataWebpackPrefix","tagIcon","tag","attrs","settings","hasIcon","icon","useColor","className","style","color","m","flarum","reg","add","tagLabel","link","tagText","name","app","translator","trans","title","description","href","route","tags","slug","isChild","sortTags","slice","sort","a","b","aPos","position","bPos","discussionCount","aParent","parent","bParent","TagListState","constructor","this","async","includes","loadedIncludes","query","unloadedIncludes","filter","include","has","length","Promise","resolve","Set","join","then","val","Array","isArray","forEach","get","TagLinkButton","view","vnode","model","child","undefined","static","super","initAttrs","params","TagsPage","arguments","oninit","preloaded","loading","redraw","oncreate","hero","bind","sidebar","contentItems","toArray","items","pinned","cloud","tagTileListView","cloudView","map","tagTileView","lastPostedDiscussion","children","colored","lastPostNumber","lastPostedAt","TagHero","findTag","find","localeCompare","sensitivity","tagsLabel","otherAttrs","push","addChunkModule","DiscussionTaggedPost","oldTags","post","content","newTags","diffTags","tags1","tags2","indexOf","id","store","getById","tagsAdded","tagsRemoved","descriptionKey","descriptionData","data","count","Tag","call","backgroundUrl","backgroundMode","defaultSort","isHidden","isPrimary","isRestricted","canStartDiscussion","canAddToDiscussion","isPrimaryParent","TagGambit","KeyValueGambit","key","hint","filterKey","gambitValueToFilterValue","value","fromFilter","negate","gambits","toString","concat","filterValueToGambitValue","gambit","helper","hasMany","attribute","extend","currentTag","addTag","active","more","splice","reload","currentActiveTag","search","state","currentTagLoading","finally","vdom","override","original","newDiscussion","disabled","param","_params$include","discussion","canTag","onclick","modal","show","promise","composer","fields","prototype","chooseTags","getSelectableTags","selectedTags","onsubmit","$","focus","selectableTags","chosenTags","chosenPrimaryTags","chosenSecondaryTags","minPrimaryTags","parseInt","minSecondaryTags","maxPrimaryTags","maxSecondaryTags","relationships","all","discussionTags","module","exports","_typeof","obj","Symbol","iterator","_defineProperty","arg","input","prim","toPrimitive","res","TypeError","String","toPropertyKey","Object","defineProperty","enumerable","configurable","writable","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","n","getter","__esModule","d","definition","o","f","e","chunkId","keys","reduce","promises","u","g","globalThis","Function","window","prop","hasOwnProperty","l","url","done","script","needAttach","scripts","document","getElementsByTagName","i","s","getAttribute","createElement","charset","timeout","nc","setAttribute","src","onScriptComplete","prev","event","onerror","onload","clearTimeout","doneFns","parentNode","removeChild","fn","setTimeout","type","target","head","appendChild","r","toStringTag","scriptUrl","importScripts","location","currentScript","Error","replace","p","compat","originalLoadChunk","loadChunk","installedChunks","j","installedChunkData","reject","error","errorType","realSrc","message","request","webpackJsonpCallback","parentChunkLoadingFunction","chunkIds","moreModules","runtime","some","chunkLoadingGlobal","self"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.js","mappings":"UAAIA,EACAC,E,qECAW,SAASC,EAAQC,EAAKC,EAAOC,QAC5B,IAAVD,IACFA,EAAQ,CAAC,QAEM,IAAbC,IACFA,EAAW,CAAC,GAEd,MAAMC,EAAUH,GAAOA,EAAII,QACrB,SACJC,GAAW,GACTH,EAQJ,OAPAD,EAAMK,UAAY,IAAU,CAACL,EAAMK,UAAW,oBAAqBH,EAAUH,EAAII,OAAS,YACtFJ,GAAOK,GACTJ,EAAMM,MAAQN,EAAMM,OAAS,CAAC,EAC9BN,EAAMM,MAAM,WAAaP,EAAIQ,SACnBR,IACVC,EAAMK,WAAa,aAEdH,EAAUM,EAAE,IAAKR,GAASQ,EAAE,OAAQR,EAC7C,CACAS,OAAOC,IAAIC,IAAI,cAAe,yBAA0Bb,E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Aa,CACtD,IAAIyG,KAAY8E,EACZ/E,EAAoBS,EAAEsE,EAAa9E,KACrCD,EAAoBhN,EAAEiN,GAAY8E,EAAY9E,IAG7C+E,GAAsBA,EAAQhF,EAClC,CAEA,IADG6E,GAA4BA,EAA2B9K,GACrDgI,EAAI+C,EAASrP,OAAQsM,IACzBnB,EAAUkE,EAAS/C,GAChB/B,EAAoBS,EAAE0D,EAAiBvD,IAAYuD,EAAgBvD,IACrEuD,EAAgBvD,GAAS,KAE1BuD,EAAgBvD,GAAW,CAC5B,EAIGsE,EAAqBC,KAAiC,2BAAIA,KAAiC,4BAAK,GACpGD,EAAmBhP,QAAQ0O,EAAqBtN,KAAK,KAAM,IAC3D4N,EAAmBrM,KAAO+L,EAAqBtN,KAAK,KAAM4N,EAAmBrM,KAAKvB,KAAK4N,G","sources":["webpack://@flarum/tags/webpack/runtime/load script","webpack://@flarum/tags/./src/common/helpers/tagIcon.js","webpack://@flarum/tags/./src/common/helpers/tagLabel.js","webpack://@flarum/tags/./src/common/utils/sortTags.tsx","webpack://@flarum/tags/./src/common/states/TagListState.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/IndexSidebar')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Separator')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/LinkButton')\"","webpack://@flarum/tags/./src/forum/components/TagLinkButton.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Page')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/PageStructure')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/WelcomeHero')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/ItemList')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/humanTime')\"","webpack://@flarum/tags/./src/forum/components/TagsPage.tsx","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/IndexPage')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/states/DiscussionListState')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/states/GlobalSearchState')\"","webpack://@flarum/tags/./src/forum/components/TagHero.js","webpack://@flarum/tags/./src/forum/addTagFilter.tsx","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/DiscussionListItem')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/DiscussionHero')\"","webpack://@flarum/tags/./src/common/helpers/tagsLabel.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/utils/DiscussionControls')\"","webpack://@flarum/tags/./src/forum/addTagControl.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/models/Discussion')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/EventPost')\"","webpack://@flarum/tags/./src/forum/components/DiscussionTaggedPost.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/computed')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/Model')\"","webpack://@flarum/tags/./src/common/models/Tag.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/query/IGambit')\"","webpack://@flarum/tags/./src/common/query/discussions/TagGambit.ts","webpack://@flarum/tags/./src/common/extend.ts","webpack://@flarum/tags/./src/forum/extend.ts","webpack://@flarum/tags/./src/forum/index.ts","webpack://@flarum/tags/./src/forum/addTagList.js","webpack://@flarum/tags/./src/forum/addTagLabels.js","webpack://@flarum/tags/./src/forum/addTagComposer.js","webpack://@flarum/tags/./src/forum/utils/getSelectableTags.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/Component')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/app')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/FormModal')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Link')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/LoadingIndicator')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/highlight')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/textContrastClass')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/KeyboardNavigatable')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/Stream')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/classList')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/extract')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/DiscussionPage')\"","webpack://@flarum/tags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/tags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/tags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/tags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPrimitive.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/ensure chunk","webpack://@flarum/tags/webpack/runtime/get javascript chunk filename","webpack://@flarum/tags/webpack/runtime/global","webpack://@flarum/tags/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/tags/webpack/runtime/make namespace object","webpack://@flarum/tags/webpack/runtime/publicPath","webpack://@flarum/tags/webpack/runtime/compat","webpack://@flarum/tags/webpack/runtime/jsonp chunk loading"],"sourcesContent":["var inProgress = {};\nvar dataWebpackPrefix = \"module.exports:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t};\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","import classList from 'flarum/common/utils/classList';\nexport default function tagIcon(tag, attrs, settings) {\n if (attrs === void 0) {\n attrs = {};\n }\n if (settings === void 0) {\n settings = {};\n }\n const hasIcon = tag && tag.icon();\n const {\n useColor = true\n } = settings;\n attrs.className = classList([attrs.className, 'icon text-colored', hasIcon ? tag.icon() : 'TagIcon']);\n if (tag && useColor) {\n attrs.style = attrs.style || {};\n attrs.style['--color'] = tag.color();\n } else if (!tag) {\n attrs.className += ' untagged';\n }\n return hasIcon ? m(\"i\", attrs) : m(\"span\", attrs);\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagIcon', tagIcon);","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';\nexport default function tagLabel(tag, attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n attrs.style = attrs.style || {};\n attrs.className = 'TagLabel ' + (attrs.className || '');\n const link = extract(attrs, 'link');\n const tagText = tag ? tag.name() : app.translator.trans('flarum-tags.lib.deleted_tag_text');\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 if (link) {\n attrs.title = tag.description() || '';\n attrs.href = app.route('tag', {\n tags: tag.slug()\n });\n }\n if (tag.isChild()) {\n attrs.className += ' TagLabel--child';\n }\n } else {\n attrs.className += ' untagged';\n }\n return m(link ? Link : 'span', attrs, m(\"span\", {\n className: \"TagLabel-text\"\n }, tag && tag.icon() && tagIcon(tag, {\n className: 'TagLabel-icon'\n }, {\n useColor: false\n }), m(\"span\", {\n className: \"TagLabel-name\"\n }, tagText)));\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagLabel', tagLabel);","export default function sortTags(tags) {\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;else if (bParent) return bParent === a ? -1 : aPos - bParent.position();\n return 0;\n });\n}\nflarum.reg.add('flarum-tags', 'common/utils/sortTags', sortTags);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/common/app';\nexport default class TagListState {\n constructor() {\n _defineProperty(this, \"loadedIncludes\", void 0);\n }\n async load(includes) {\n if (includes === void 0) {\n includes = [];\n }\n if (!this.loadedIncludes) {\n return this.query(includes);\n }\n const unloadedIncludes = includes.filter(include => !this.loadedIncludes.has(include));\n if (unloadedIncludes.length === 0) {\n return Promise.resolve(app.store.all('tags'));\n }\n return this.query(unloadedIncludes);\n }\n async query(includes) {\n var _this$loadedIncludes;\n if (includes === void 0) {\n includes = [];\n }\n (_this$loadedIncludes = this.loadedIncludes) != null ? _this$loadedIncludes : this.loadedIncludes = new Set();\n return app.store.find('tags', {\n include: includes.join(',')\n }).then(val => {\n const tags = Array.isArray(val) ? val : [val];\n includes.forEach(include => this.loadedIncludes.add(include));\n return tags;\n });\n }\n}\nflarum.reg.add('flarum-tags', 'common/states/TagListState', TagListState);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/IndexSidebar');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Separator');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/LinkButton');","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';\nexport default class TagLinkButton extends LinkButton {\n view(vnode) {\n const tag = this.attrs.model;\n const description = tag && tag.description();\n const className = classList('TagLinkButton hasIcon', {\n child: tag.isChild()\n }, this.attrs.className);\n return m(Link, {\n className: className,\n href: this.attrs.route,\n style: tag ? {\n '--color': tag.color()\n } : undefined,\n title: description || undefined\n }, tagIcon(tag, {\n className: 'Button-icon'\n }), m(\"span\", {\n className: \"Button-label\"\n }, tag ? tag.name() : app.translator.trans('flarum-tags.forum.index.untagged_link')));\n }\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n const tag = attrs.model;\n attrs.params.tags = tag ? tag.slug() : 'untagged';\n attrs.route = app.route('tag', attrs.params);\n }\n}\nflarum.reg.add('flarum-tags', 'forum/components/TagLinkButton', TagLinkButton);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Page');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/PageStructure');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/WelcomeHero');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/ItemList');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/humanTime');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/forum/app';\nimport Page from 'flarum/common/components/Page';\nimport PageStructure from 'flarum/forum/components/PageStructure';\nimport WelcomeHero from 'flarum/forum/components/WelcomeHero';\nimport IndexSidebar from 'flarum/forum/components/IndexSidebar';\nimport Link from 'flarum/common/components/Link';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport humanTime from 'flarum/common/helpers/humanTime';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport classList from 'flarum/common/utils/classList';\nimport extractText from 'flarum/common/utils/extractText';\nimport tagIcon from '../../common/helpers/tagIcon';\nimport tagLabel from '../../common/helpers/tagLabel';\nimport sortTags from '../../common/utils/sortTags';\nexport default class TagsPage extends Page {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"tags\", void 0);\n _defineProperty(this, \"loading\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n app.history.push('tags', extractText(app.translator.trans('flarum-tags.forum.header.back_to_tags_tooltip')));\n this.tags = [];\n const preloaded = app.preloadedApiDocument();\n if (preloaded) {\n this.tags = sortTags(preloaded.filter(tag => !tag.isChild()));\n return;\n }\n this.loading = true;\n app.tagList.load(['children', 'lastPostedDiscussion', 'parent']).then(() => {\n this.tags = sortTags(app.store.all('tags').filter(tag => !tag.isChild()));\n this.loading = false;\n m.redraw();\n });\n }\n oncreate(vnode) {\n super.oncreate(vnode);\n app.setTitle(extractText(app.translator.trans('flarum-tags.forum.all_tags.meta_title_text')));\n app.setTitleCount(0);\n }\n view() {\n return m(PageStructure, {\n className: \"TagsPage\",\n hero: this.hero.bind(this),\n sidebar: this.sidebar.bind(this)\n }, this.contentItems().toArray());\n }\n contentItems() {\n const items = new ItemList();\n if (this.loading) {\n items.add('loading', m(LoadingIndicator, null));\n } else {\n const pinned = this.tags.filter(tag => tag.position() !== null);\n const cloud = this.tags.filter(tag => tag.position() === null);\n items.add('tagTiles', this.tagTileListView(pinned), 100);\n if (cloud.length) {\n items.add('cloud', this.cloudView(cloud), 10);\n }\n }\n return items;\n }\n hero() {\n return m(WelcomeHero, null);\n }\n sidebar() {\n return m(IndexSidebar, null);\n }\n tagTileListView(pinned) {\n return m(\"ul\", {\n className: \"TagTiles\"\n }, pinned.map(this.tagTileView.bind(this)));\n }\n tagTileView(tag) {\n const lastPostedDiscussion = tag.lastPostedDiscussion();\n const children = sortTags(tag.children() || []);\n return m(\"li\", {\n className: classList('TagTile', {\n colored: tag.color()\n }, textContrastClass(tag.color())),\n style: {\n '--tag-bg': tag.color()\n }\n }, m(Link, {\n className: \"TagTile-info\",\n href: app.route.tag(tag)\n }, m(\"div\", {\n className: \"TagTile-heading\"\n }, tag.icon() && tagIcon(tag, {}, {\n useColor: false\n }), m(\"h3\", {\n className: \"TagTile-name\"\n }, tag.name())), m(\"p\", {\n className: \"TagTile-description\"\n }, tag.description()), !!children && m(\"div\", {\n className: \"TagTile-children\"\n }, children.map(child => [m(Link, {\n href: app.route.tag(child)\n }, child.name()), ' ']))), lastPostedDiscussion ? m(Link, {\n className: \"TagTile-lastPostedDiscussion\",\n href: app.route.discussion(lastPostedDiscussion, lastPostedDiscussion.lastPostNumber())\n }, m(\"span\", {\n className: \"TagTile-lastPostedDiscussion-title\"\n }, lastPostedDiscussion.title()), humanTime(lastPostedDiscussion.lastPostedAt())) : m(\"span\", {\n className: \"TagTile-lastPostedDiscussion\"\n }));\n }\n cloudView(cloud) {\n return m(\"div\", {\n className: \"TagCloud\"\n }, cloud.map(tag => [tagLabel(tag, {\n link: true\n }), ' ']));\n }\n}\nflarum.reg.add('flarum-tags', 'forum/components/TagsPage', TagsPage);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/IndexPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/states/DiscussionListState');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/states/GlobalSearchState');","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';\nexport default class TagHero extends Component {\n view() {\n const tag = this.attrs.model;\n const color = tag.color();\n return m(\"header\", {\n className: classList('Hero', 'TagHero', {\n 'TagHero--colored': color,\n [textContrastClass(color)]: color\n }),\n style: color ? {\n '--hero-bg': color\n } : undefined\n }, m(\"div\", {\n className: \"container\"\n }, m(\"div\", {\n className: \"containerNarrow\"\n }, m(\"h1\", {\n className: \"Hero-title\"\n }, tag.icon() && tagIcon(tag, {}, {\n useColor: false\n }), \" \", tag.name()), m(\"div\", {\n className: \"Hero-subtitle\"\n }, tag.description()))));\n }\n}\nflarum.reg.add('flarum-tags', 'forum/components/TagHero', TagHero);","import app from 'flarum/forum/app';\nimport { extend, override } from 'flarum/common/extend';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport IndexSidebar from 'flarum/forum/components/IndexSidebar';\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';\nimport TagHero from './components/TagHero';\nconst findTag = slug => app.store.all('tags').find(tag => tag.slug().localeCompare(slug, undefined, {\n sensitivity: 'base'\n}) === 0);\nexport default function addTagFilter() {\n app.currentTag = function (reload) {\n if (this.currentActiveTag && !reload) {\n return this.currentActiveTag;\n }\n const slug = this.search.state.params().tags;\n let tag = null;\n if (slug) {\n tag = findTag(slug);\n }\n if (slug && !tag || tag && !tag.isChild() && !tag.children()) {\n if (this.currentTagLoading) {\n return;\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 this.store.find('tags', slug, {\n include: 'children,children.parent,parent'\n }).then(() => {\n this.currentActiveTag = findTag(slug);\n m.redraw();\n }).finally(() => {\n this.currentTagLoading = false;\n });\n }\n if (tag) {\n this.currentActiveTag = tag;\n return this.currentActiveTag;\n }\n this.currentActiveTag = undefined;\n return;\n };\n extend(IndexPage.prototype, 'view', function (vdom) {\n app.currentTag(true);\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 = app.currentTag();\n if (tag) return m(TagHero, {\n model: tag\n });\n return original();\n });\n extend(IndexPage.prototype, 'view', function (vdom) {\n const tag = app.currentTag();\n if (tag) vdom.attrs.className += ' IndexPage--tag' + tag.id();\n });\n extend(IndexPage.prototype, 'setTitle', function () {\n const tag = app.currentTag();\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(IndexSidebar.prototype, 'items', function (items) {\n const tag = app.currentTag();\n if (tag) {\n const color = tag.color();\n const canStartDiscussion = tag.canStartDiscussion() || !app.session.user;\n const newDiscussion = items.get('newDiscussion');\n if (color) {\n newDiscussion.attrs.className = classList([newDiscussion.attrs.className, 'Button--tagColored', textContrastClass(color)]);\n newDiscussion.attrs.style = {\n '--color': color\n };\n }\n newDiscussion.attrs.disabled = !canStartDiscussion;\n newDiscussion.children = app.translator.trans(canStartDiscussion ? 'core.forum.index.start_discussion_button' : 'core.forum.index.cannot_start_discussion_button');\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 (params) {\n if (typeof params.include === 'string') {\n params.include = [params.include];\n } else {\n var _params$include;\n (_params$include = params.include) == null ? void 0 : _params$include.push('tags', 'tags.parent');\n }\n if (this.params.tags) {\n params.filter || (params.filter = {});\n params.filter.tag = this.params.tags;\n }\n });\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/DiscussionListItem');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/DiscussionHero');","import extract from 'flarum/common/utils/extract';\nimport tagLabel from './tagLabel';\nimport sortTags from '../utils/sortTags';\nimport classList from 'flarum/common/utils/classList';\nexport default function tagsLabel(tags, attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n const children = [];\n const {\n link,\n ...otherAttrs\n } = attrs;\n otherAttrs.className = classList('TagsLabel', otherAttrs.className);\n if (tags) {\n sortTags(tags).forEach(tag => {\n if (tag || tags.length === 1) {\n children.push(tagLabel(tag, {\n link\n }));\n }\n });\n } else {\n children.push(tagLabel());\n }\n return m(\"span\", otherAttrs, children);\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagsLabel', tagsLabel);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/utils/DiscussionControls');","import { extend } from 'flarum/common/extend';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\nimport Button from 'flarum/common/components/Button';\nexport default function addTagControl() {\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('tags', m(Button, {\n icon: \"fas fa-tag\",\n onclick: () => app.modal.show(() => import(/* webpackChunkName: 'forum/components/TagDiscussionModal', webpackMode: 'lazy-once' */ './components/TagDiscussionModal'), {\n discussion\n })\n }, app.translator.trans('flarum-tags.forum.discussion_controls.edit_tags_button')));\n }\n });\n}flarum.reg.addChunkModule('642', '884', 'flarum-tags', 'forum/components/TagDiscussionModal');\nflarum.reg.addChunkModule('642', '884', 'flarum-tags', 'common/components/TagSelectionModal');\nflarum.reg.addChunkModule('642', '884', 'flarum-tags', 'forum/components/ToggleButton');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/Discussion');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/EventPost');","import EventPost from 'flarum/forum/components/EventPost';\nimport tagsLabel from '../../common/helpers/tagsLabel';\nexport default class DiscussionTaggedPost extends EventPost {\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n const oldTags = attrs.post.content()[0];\n const newTags = attrs.post.content()[1];\n function diffTags(tags1, tags2) {\n return tags1.filter(tag => tags2.indexOf(tag) === -1).map(id => app.store.getById('tags', id));\n }\n attrs.tagsAdded = diffTags(newTags, oldTags);\n attrs.tagsRemoved = diffTags(oldTags, newTags);\n }\n icon() {\n return 'fas fa-tag';\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 return 'flarum-tags.forum.post_stream.added_tags_text';\n }\n return 'flarum-tags.forum.post_stream.removed_tags_text';\n }\n descriptionData() {\n const data = {};\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, {\n link: true\n }),\n count: this.attrs.tagsAdded.length\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, {\n link: true\n }),\n count: this.attrs.tagsRemoved.length\n });\n }\n return data;\n }\n}\nflarum.reg.add('flarum-tags', 'forum/components/DiscussionTaggedPost', DiscussionTaggedPost);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/computed');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Model');","import computed from 'flarum/common/utils/computed';\nimport Model from 'flarum/common/Model';\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 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 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 isPrimary() {\n return Model.attribute('isPrimary').call(this);\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 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 isPrimaryParent() {\n return computed('position', 'parent', (position, parent) => position !== null && parent === false).call(this);\n }\n}\nflarum.reg.add('flarum-tags', 'common/models/Tag', Tag);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/query/IGambit');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/common/app';\nimport { KeyValueGambit } from 'flarum/common/query/IGambit';\nexport default class TagGambit extends KeyValueGambit {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"predicates\", true);\n }\n key() {\n return app.translator.trans('flarum-tags.lib.gambits.discussions.tag.key', {}, true);\n }\n hint() {\n return app.translator.trans('flarum-tags.lib.gambits.discussions.tag.hint', {}, true);\n }\n filterKey() {\n return 'tag';\n }\n gambitValueToFilterValue(value) {\n return [value];\n }\n fromFilter(value, negate) {\n let gambits = [];\n if (Array.isArray(value)) {\n gambits = value.map(value => this.fromFilter(value.toString(), negate));\n } else {\n return \"\".concat(negate ? '-' : '').concat(this.key(), \":\").concat(this.filterValueToGambitValue(value));\n }\n return gambits.join(' ');\n }\n filterValueToGambitValue(value) {\n return value;\n }\n}\nflarum.reg.add('flarum-tags', 'common/query/discussions/TagGambit', TagGambit);","import Extend from 'flarum/common/extenders';\nimport Tag from './models/Tag';\nimport TagGambit from './query/discussions/TagGambit';\nexport default [new Extend.Store() //\n.add('tags', Tag), new Extend.Search() //\n.gambit('discussions', TagGambit)];","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 commonExtend from '../common/extend';\nexport default [...commonExtend, new Extend.Routes() //\n.add('tags', '/tags', TagsPage) //\n.add('tag', '/t/:tags', IndexPage) //\n.helper('tag', tag => app.route('tag', {\n tags: tag.slug()\n})), new Extend.PostTypes() //\n.add('discussionTagged', DiscussionTaggedPost), new Extend.Model(Discussion) //\n.hasMany('tags') //\n.attribute('canTag')];","import app from 'flarum/forum/app';\nimport TagListState from '../common/states/TagListState';\nimport addTagList from './addTagList';\nimport addTagFilter from './addTagFilter';\nimport addTagLabels from './addTagLabels';\nimport addTagControl from './addTagControl';\nimport addTagComposer from './addTagComposer';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-tags', () => {\n app.tagList = new TagListState();\n addTagList();\n addTagFilter();\n addTagLabels();\n addTagControl();\n addTagComposer();\n});\nimport './forum';","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport IndexSidebar from 'flarum/forum/components/IndexSidebar';\nimport Separator from 'flarum/common/components/Separator';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport TagLinkButton from './components/TagLinkButton';\nimport TagsPage from './components/TagsPage';\nimport sortTags from '../common/utils/sortTags';\nexport default function addTagList() {\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(IndexSidebar.prototype, 'navItems', function (items) {\n items.add('tags', m(LinkButton, {\n icon: \"fas fa-th-large\",\n href: app.route('tags')\n }, app.translator.trans('flarum-tags.forum.index.tags_link')), -10);\n if (app.current.matches(TagsPage)) return;\n items.add('separator', m(Separator, null), -12);\n const params = app.search.state.stickyParams();\n const tags = app.store.all('tags');\n const currentTag = app.currentTag();\n const addTag = tag => {\n let active = currentTag === tag;\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(), m(TagLinkButton, {\n model: tag,\n params: params,\n active: active\n }, tag == null ? void 0 : tag.name()), -14);\n };\n sortTags(tags).filter(tag => tag.position() !== null && (!tag.isChild() || currentTag && (tag.parent() === currentTag || tag.parent() === currentTag.parent()))).forEach(addTag);\n const more = tags.filter(tag => tag.position() === null).sort((a, b) => b.discussionCount() - a.discussionCount());\n more.splice(0, 3).forEach(addTag);\n if (more.length) {\n items.add('moreTags', m(LinkButton, {\n href: app.route('tags')\n }, app.translator.trans('flarum-tags.forum.index.more_link')), -16);\n }\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';\nimport tagsLabel from '../common/helpers/tagsLabel';\nimport sortTags from '../common/utils/sortTags';\nexport default function addTagLabels() {\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 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 if (tags && tags.length) {\n const color = tags[0].color();\n if (color) {\n view.attrs.style = {\n '--hero-bg': color\n };\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 if (tags && tags.length) {\n items.add('tags', tagsLabel(tags, {\n link: true\n }), 5);\n }\n });\n}","import app from 'flarum/forum/app';\nimport { extend, override } from 'flarum/common/extend';\nimport IndexSidebar from 'flarum/forum/components/IndexSidebar';\nimport classList from 'flarum/common/utils/classList';\nimport tagsLabel from '../common/helpers/tagsLabel';\nimport getSelectableTags from './utils/getSelectableTags';\nexport default function addTagComposer() {\n extend(IndexSidebar.prototype, 'newDiscussionAction', function (promise) {\n // From `addTagFilter\n const tag = app.currentTag();\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 extend('flarum/forum/components/DiscussionComposer', 'oninit', function () {\n app.tagList.load(['parent']).then(() => m.redraw());\n\n // Add tag-selection abilities to the discussion composer.\n this.constructor.prototype.chooseTags = function () {\n const selectableTags = getSelectableTags();\n if (!selectableTags.length) return;\n app.modal.show(() => import(/* webpackChunkName: 'forum/components/TagDiscussionModal', webpackMode: 'lazy-once' */ './components/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\n // Add a tag-selection menu to the discussion composer's header, after the\n // title.\n extend('flarum/forum/components/DiscussionComposer', 'headerItems', function (items) {\n const tags = this.composer.fields.tags || [];\n const selectableTags = getSelectableTags();\n items.add('tags', m(\"a\", {\n className: classList(['DiscussionComposer-changeTags', !selectableTags.length && 'disabled']),\n onclick: this.chooseTags.bind(this)\n }, tags.length ? tagsLabel(tags) : m(\"span\", {\n className: \"TagLabel untagged\"\n }, app.translator.trans('flarum-tags.forum.composer_discussion.choose_tags_link'))), 10);\n });\n override('flarum/forum/components/DiscussionComposer', '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 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 if ((!chosenTags.length && maxPrimaryTags !== 0 && maxSecondaryTags !== 0 || chosenPrimaryTags.length < minPrimaryTags || chosenSecondaryTags.length < minSecondaryTags) && selectableTags.length) {\n app.modal.show(() => import(/* webpackChunkName: 'forum/components/TagDiscussionModal', webpackMode: 'lazy-once' */ './components/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('flarum/forum/components/DiscussionComposer', 'data', function (data) {\n data.relationships = data.relationships || {};\n data.relationships.tags = this.composer.fields.tags;\n });\n}","export default function getSelectableTags(discussion) {\n let tags = app.store.all('tags');\n if (discussion) {\n const discussionTags = discussion.tags() || [];\n tags = tags.filter(tag => tag.canAddToDiscussion() || discussionTags.includes(tag));\n } else {\n tags = tags.filter(tag => tag.canStartDiscussion());\n }\n return tags;\n}\nflarum.reg.add('flarum-tags', 'forum/utils/getSelectableTags', getSelectableTags);","module.exports = flarum.reg.get('core', 'common/Component');","module.exports = flarum.reg.get('core', 'common/app');","module.exports = flarum.reg.get('core', 'common/components/Button');","module.exports = flarum.reg.get('core', 'common/components/FormModal');","module.exports = flarum.reg.get('core', 'common/components/Link');","module.exports = flarum.reg.get('core', 'common/components/LoadingIndicator');","module.exports = flarum.reg.get('core', 'common/helpers/highlight');","module.exports = flarum.reg.get('core', 'common/helpers/textContrastClass');","module.exports = flarum.reg.get('core', 'common/utils/KeyboardNavigatable');","module.exports = flarum.reg.get('core', 'common/utils/Stream');","module.exports = flarum.reg.get('core', 'common/utils/classList');","module.exports = flarum.reg.get('core', 'common/utils/extract');","module.exports = flarum.reg.get('core', 'common/utils/extractText');","module.exports = flarum.reg.get('core', 'forum/app');","module.exports = flarum.reg.get('core', 'forum/components/DiscussionPage');","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _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 }, _typeof(obj);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\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// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\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__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + \"forum/components/TagDiscussionModal\" + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\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};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.f.compat = (chunkId, promises) => {\n\n\tconst originalLoadChunk = __webpack_require__.l;\n\t__webpack_require__.l = flarum.reg.loadChunk.bind(flarum.reg, originalLoadChunk);\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t315: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkmodule_exports\"] = self[\"webpackChunkmodule_exports\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));"],"names":["inProgress","dataWebpackPrefix","tagIcon","tag","attrs","settings","hasIcon","icon","useColor","className","style","color","m","flarum","reg","add","tagLabel","link","tagText","name","app","translator","trans","title","description","href","route","tags","slug","isChild","sortTags","slice","sort","a","b","aPos","position","bPos","discussionCount","aParent","parent","bParent","TagListState","constructor","this","async","includes","loadedIncludes","query","unloadedIncludes","filter","include","has","length","Promise","resolve","Set","join","then","val","Array","isArray","forEach","get","TagLinkButton","view","vnode","model","child","undefined","static","super","initAttrs","params","TagsPage","arguments","oninit","preloaded","loading","redraw","oncreate","hero","bind","sidebar","contentItems","toArray","items","pinned","cloud","tagTileListView","cloudView","map","tagTileView","lastPostedDiscussion","children","colored","lastPostNumber","lastPostedAt","TagHero","findTag","find","localeCompare","sensitivity","tagsLabel","otherAttrs","push","addChunkModule","DiscussionTaggedPost","oldTags","post","content","newTags","diffTags","tags1","tags2","indexOf","id","store","getById","tagsAdded","tagsRemoved","descriptionKey","descriptionData","data","count","Tag","call","backgroundUrl","backgroundMode","defaultSort","isHidden","isPrimary","isRestricted","canStartDiscussion","canAddToDiscussion","isPrimaryParent","TagGambit","KeyValueGambit","key","hint","filterKey","gambitValueToFilterValue","value","fromFilter","negate","gambits","toString","concat","filterValueToGambitValue","gambit","helper","hasMany","attribute","extend","currentTag","addTag","active","more","splice","reload","currentActiveTag","search","state","currentTagLoading","finally","vdom","override","original","newDiscussion","disabled","param","_params$include","discussion","canTag","onclick","modal","show","promise","composer","fields","prototype","chooseTags","getSelectableTags","selectedTags","onsubmit","$","focus","selectableTags","chosenTags","chosenPrimaryTags","chosenSecondaryTags","minPrimaryTags","parseInt","minSecondaryTags","maxPrimaryTags","maxSecondaryTags","relationships","all","discussionTags","module","exports","_typeof","obj","Symbol","iterator","_defineProperty","arg","input","prim","toPrimitive","res","TypeError","String","toPropertyKey","Object","defineProperty","enumerable","configurable","writable","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","n","getter","__esModule","d","definition","o","f","e","chunkId","keys","reduce","promises","u","g","globalThis","Function","window","prop","hasOwnProperty","l","url","done","script","needAttach","scripts","document","getElementsByTagName","i","s","getAttribute","createElement","charset","timeout","nc","setAttribute","src","onScriptComplete","prev","event","onerror","onload","clearTimeout","doneFns","parentNode","removeChild","fn","setTimeout","type","target","head","appendChild","r","toStringTag","scriptUrl","importScripts","location","currentScript","Error","replace","p","compat","originalLoadChunk","loadChunk","installedChunks","j","installedChunkData","reject","error","errorType","realSrc","message","request","webpackJsonpCallback","parentChunkLoadingFunction","chunkIds","moreModules","runtime","some","chunkLoadingGlobal","self"],"sourceRoot":""} \ No newline at end of file diff --git a/framework/core/js/dist-typings/admin/AdminApplication.d.ts b/framework/core/js/dist-typings/admin/AdminApplication.d.ts index 6ca18f5857..d4e92574b6 100644 --- a/framework/core/js/dist-typings/admin/AdminApplication.d.ts +++ b/framework/core/js/dist-typings/admin/AdminApplication.d.ts @@ -27,7 +27,7 @@ export declare type Extension = { extra: { 'flarum-extension': { title: string; - 'database-support': undefined | string[]; + 'database-support'?: string[]; }; }; require?: Record; diff --git a/framework/core/js/dist-typings/admin/components/FormSection.d.ts b/framework/core/js/dist-typings/admin/components/FormSection.d.ts new file mode 100644 index 0000000000..b31d3c2198 --- /dev/null +++ b/framework/core/js/dist-typings/admin/components/FormSection.d.ts @@ -0,0 +1,9 @@ +import Component from '../../common/Component'; +import type { ComponentAttrs } from '../../common/Component'; +import Mithril from 'mithril'; +export interface IFormSectionAttrs extends ComponentAttrs { + label: any; +} +export default class FormSection extends Component { + view(vnode: Mithril.Vnode): JSX.Element; +} diff --git a/framework/core/js/dist-typings/admin/components/FormSectionGroup.d.ts b/framework/core/js/dist-typings/admin/components/FormSectionGroup.d.ts index 68a0fb7ff4..14f6cbfa60 100644 --- a/framework/core/js/dist-typings/admin/components/FormSectionGroup.d.ts +++ b/framework/core/js/dist-typings/admin/components/FormSectionGroup.d.ts @@ -6,9 +6,3 @@ export interface IFormSectionGroupAttrs extends ComponentAttrs { export default class FormSectionGroup extends Component { view(vnode: Mithril.Vnode): JSX.Element; } -export interface IFormSectionAttrs extends ComponentAttrs { - label: any; -} -export declare class FormSection extends Component { - view(vnode: Mithril.Vnode): JSX.Element; -} diff --git a/framework/core/js/dist-typings/forum/components/UsersSearchSource.d.ts b/framework/core/js/dist-typings/forum/components/UsersSearchSource.d.ts index 3500c69085..fe51a7504d 100644 --- a/framework/core/js/dist-typings/forum/components/UsersSearchSource.d.ts +++ b/framework/core/js/dist-typings/forum/components/UsersSearchSource.d.ts @@ -5,7 +5,7 @@ import type { SearchSource } from './Search'; * The `UsersSearchSource` finds and displays user search results in the search * dropdown. */ -export default class UsersSearchResults implements SearchSource { +export default class UsersSearchSource implements SearchSource { protected results: Map; resource: string; title(): string; diff --git a/framework/core/js/dist-typings/forum/states/ComposerState.d.ts b/framework/core/js/dist-typings/forum/states/ComposerState.d.ts index df0a509ed7..0bf590a5bf 100644 --- a/framework/core/js/dist-typings/forum/states/ComposerState.d.ts +++ b/framework/core/js/dist-typings/forum/states/ComposerState.d.ts @@ -44,7 +44,9 @@ declare class ComposerState { */ load(componentClass: () => Promise | typeof import('../components/ComposerBody').default, attrs: object): Promise; + }> | typeof import('../components/ComposerBody').default, attrs: object): Promise<(() => Promise | typeof import('../components/ComposerBody').default) | undefined>; /** * Clear the composer's content component. */ diff --git a/framework/core/js/dist/admin.js b/framework/core/js/dist/admin.js index a27fefd9f2..706edce3c3 100644 --- a/framework/core/js/dist/admin.js +++ b/framework/core/js/dist/admin.js @@ -1,3 +1,3 @@ /*! For license information please see admin.js.LICENSE.txt */ -(()=>{var t,e,n={1207:(t,e,n)=>{"use strict";n.d(e,{J:()=>B,Z:()=>R});var r=n(7905),s=n(7465),o=n(4041),i=n(8312),a=n(7224),l=n(8588),c=n(406),u=n(4153);function d(t){return Array.isArray(t.data)}class h{constructor(t){(0,r.Z)(this,"data",{}),(0,r.Z)(this,"models",void 0),this.models=t}pushPayload(t){t.included&&t.included.map(this.pushObject.bind(this));const e=t.data instanceof Array?t.data.map((t=>this.pushObject(t))):this.pushObject(t.data);return e.payload=t,e}pushObject(t){if(!this.models[t.type])return setTimeout((()=>{throw new Error("Pushing object of type `".concat(t.type,"` not allowed, as type not yet registered in the store."))})),null;const e=this.data[t.type]=this.data[t.type]||{},n=e[t.id],r=n?n.pushData(t):this.createRecord(t.type,t);return e[t.id]=r,r.exists=!0,r}async find(t,e,n,r){var o,i;void 0===n&&(n={}),void 0===r&&(r={});let a=n,l=s.Z.forum.attribute("apiUrl")+"/"+t;return e instanceof Array?l+="?filter[id]="+e.join(","):"object"==typeof e?a=e:e&&(l+="/"+e),"filter"in a&&null!=(o=a)&&null!=(i=o.filter)&&i.q&&(a.filter=s.Z.search.gambits.apply(t,a.filter)),s.Z.request({method:"GET",url:l,params:a,...r}).then((t=>(d(t),this.pushPayload(t))))}getById(t,e){var n,r;return null==(n=this.data)||null==(r=n[t])?void 0:r[e]}getBy(t,e,n){return this.all(t).filter((t=>t[e]()===n))[0]}all(t){const e=this.data[t];return e?Object.values(e):[]}remove(t){delete this.data[t.data.type][t.id()]}createRecord(t,e){return void 0===e&&(e={}),e.type=e.type||t,new this.models[t](e,this)}}flarum.reg.add("core","common/Store",h);class p{constructor(t,e){(0,r.Z)(this,"user",void 0),(0,r.Z)(this,"csrfToken",void 0),this.user=t,this.csrfToken=e}login(t,e){return void 0===e&&(e={}),s.Z.request({method:"POST",url:"".concat(s.Z.forum.attribute("baseUrl"),"/login"),body:t,...e})}logout(){window.location.href="".concat(s.Z.forum.attribute("baseUrl"),"/logout?token=").concat(this.csrfToken)}}flarum.reg.add("core","common/Session",p);var f=n(6786),g=n(1552),v=n(7569),b=n(4430),y=n(6386),w=n(4718),Z=n(9423);function x(){$("[data-humantime]").each((function(){const t=$(this),e=(0,Z.Z)(t.attr("datetime"));t.html(e)}))}function N(){setInterval(x,1e4)}flarum.reg.add("core","common/utils/liveHumanTimes",N);var k=n(8134),_=n(3813),C=n(7498),S=n(6322),E=n(4125),T=n(7645),A=n(5788),P=n(5013),D=n(5123),I=n(5278);function M(t,e,n){var r,o;console.group("%c".concat(e),"background-color: #d83e3e; color: #ffffff; font-weight: bold;"),console.error(n),console.groupEnd(),null!=(r=s.Z.session)&&null!=(o=r.user)&&o.isAdmin()&&s.Z.alerts.show({type:"error"},"".concat(t))}flarum.reg.add("core","common/helpers/fireApplicationError",M);var L=n(9175);class O extends L.Z{token(){return L.Z.attribute("token").call(this)}userId(){return L.Z.attribute("userId").call(this)}title(){return L.Z.attribute("title").call(this)}type(){return L.Z.attribute("type").call(this)}createdAt(){return L.Z.attribute("createdAt",L.Z.transformDate).call(this)}lastActivityAt(){return L.Z.attribute("lastActivityAt",L.Z.transformDate).call(this)}lastIpAddress(){return L.Z.attribute("lastIpAddress").call(this)}device(){return L.Z.attribute("device").call(this)}isCurrent(){return L.Z.attribute("isCurrent").call(this)}isSessionToken(){return L.Z.attribute("isSessionToken").call(this)}}flarum.reg.add("core","common/models/AccessToken",O);var j=n(8394);let B=function(t){return t.NO_MAINTENANCE="none",t.HIGH_MAINTENANCE="high",t.LOW_MAINTENANCE="low",t.SAFE_MODE="safe",t}({});class R{constructor(){(0,r.Z)(this,"forum",void 0),(0,r.Z)(this,"routes",{}),(0,r.Z)(this,"initializers",new o.Z),(0,r.Z)(this,"session",void 0),(0,r.Z)(this,"translator",new u.Z),(0,r.Z)(this,"store",new h({"access-tokens":O,forums:_.Z,users:C.Z,discussions:S.Z,posts:E.Z,groups:T.Z,notifications:A.Z})),(0,r.Z)(this,"search",void 0),(0,r.Z)(this,"cache",{}),(0,r.Z)(this,"booted",!1),(0,r.Z)(this,"current",new P.Z(null)),(0,r.Z)(this,"previous",new P.Z(null)),(0,r.Z)(this,"modal",new D.Z),(0,r.Z)(this,"alerts",new I.Z),(0,r.Z)(this,"drawer",void 0),(0,r.Z)(this,"history",null),(0,r.Z)(this,"pane",null),(0,r.Z)(this,"data",void 0),(0,r.Z)(this,"allowUserColorScheme",void 0),(0,r.Z)(this,"_title",""),(0,r.Z)(this,"_titleCount",0),(0,r.Z)(this,"requestErrorAlert",null),(0,r.Z)(this,"initialRoute",void 0)}set title(t){this._title=t}get title(){return this._title}set titleCount(t){this._titleCount=t}get titleCount(){return this._titleCount}load(t){this.data=t,this.translator.setLocale(t.locale)}boot(){var t;const e=[];this.initializers.toArray().forEach((t=>{try{t(this)}catch(n){const r=t.itemName.includes("/")?t.itemName.replace(/(\/flarum-ext-)|(\/flarum-)/g,"-"):t.itemName;e.push((()=>M((0,g.Z)(s.Z.translator.trans("core.lib.error.extension_initialiation_failed_message",{extension:r})),"".concat(r," failed to initialize"),n)))}})),this.store.pushPayload({data:this.data.resources}),this.forum=this.store.getById("forums","1"),this.session=new p(null!=(t=this.store.getById("users",String(this.data.session.userId)))?t:null,this.data.session.csrfToken),this.mount(),this.initialRoute=window.location.href,e.forEach((t=>t()))}bootExtensions(t){Object.keys(t).forEach((e=>{const n=t[e];if(!n.extend)return;const r=n.extend.flat(1/0);for(const t of r)t.extend(this,{name:e,exports:n})}))}mount(t){void 0===t&&(t=""),m.mount(document.getElementById("modal"),{view:()=>m(a.Z,{state:this.modal})}),m.mount(document.getElementById("alerts"),{view:()=>m(l.Z,{state:this.alerts})}),this.drawer=new v.Z,m.route(document.getElementById("content"),t+"/",(0,b.Z)(this.routes,t));const e=document.getElementById("app"),n=document.querySelector(".App-header"),r=new w.Z((t=>{const r=e.getBoundingClientRect().top+document.body.scrollTop;e.classList.toggle("affix",t>=r),e.classList.toggle("scrolled",t>r),n.classList.toggle("navbar-fixed-top",t>=r)}));r.start(),r.update(),document.body.classList.add("ontouchstart"in window?"touch":"no-touch"),this.initColorScheme(),N()}initColorScheme(t){var e,n,r;void 0===t&&(t=null),null!=t||(t=null!=(e=document.documentElement.getAttribute("data-theme"))?e:"auto"),this.allowUserColorScheme="auto"===t;const s=null==(n=this.session.user)||null==(r=n.preferences())?void 0:r.colorScheme;let o;this.allowUserColorScheme&&(o=s),o||(o=t),this.setColorScheme(o),this.allowUserColorScheme&&this.watchSystemColorSchemePreference((()=>{this.initColorScheme(t)}))}getSystemColorSchemePreference(){let t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";return window.matchMedia("(prefers-contrast: more)").matches&&(t+="-hc"),t}watchSystemColorSchemePreference(t){window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t),window.matchMedia("(prefers-contrast: more)").addEventListener("change",t)}setColorScheme(t){t===j.e.Auto&&(t=this.getSystemColorSchemePreference()),document.documentElement.setAttribute("data-theme",t)}setColoredHeader(t){document.documentElement.setAttribute("data-colored-header",t?"true":"false")}preloadedApiDocument(){if(this.data.apiDocument&&window.location.href===this.initialRoute){const t=(d(this.data.apiDocument),this.store.pushPayload(this.data.apiDocument));return this.data.apiDocument=null,t}return null}screen(){return getComputedStyle(document.documentElement).getPropertyValue("--flarum-screen")}setTitle(t){this.title=t,this.updateTitle()}setTitleCount(t){this.titleCount=t,this.updateTitle()}updateTitle(){const t=this.titleCount?"(".concat(this.titleCount,") "):"",e=m.route.get()===this.forum.attribute("basePath")+"/",n={pageTitle:this.title,forumName:this.forum.attribute("title"),pageNumber:1};let r=e||!this.title?(0,g.Z)(s.Z.translator.trans("core.lib.meta_titles.without_page_title",n)):(0,g.Z)(s.Z.translator.trans("core.lib.meta_titles.with_page_title",n));r=t+r;const o=new DOMParser;document.title=o.parseFromString(r,"text/html").body.innerText}transformRequestOptions(t){const{background:e,deserialize:n,modifyText:r,...o}={...t},i={background:null==e||e,deserialize:null!=n?n:t=>t,...o};if((0,k.l)(i,"config",((t,e)=>{e.setRequestHeader("X-CSRF-Token",this.session.csrfToken)})),i.method&&!["GET","POST"].includes(i.method)){const t=i.method;(0,k.l)(i,"config",((e,n)=>{n.setRequestHeader("X-HTTP-Method-Override",t)})),i.method="POST"}return i.extract=t=>{let e;e=r?r(t.responseText):t.responseText;const n=t.status;if(n<200||n>299)throw new y.Z(n,"".concat(e),i,t);if(t.getResponseHeader){const e=t.getResponseHeader("X-CSRF-Token");e&&(s.Z.session.csrfToken=e)}try{return""===e?null:JSON.parse(e)}catch(n){throw new y.Z(500,"".concat(e),i,t)}},i}request(t){const e=this.transformRequestOptions(t);return this.requestErrorAlert&&this.alerts.dismiss(this.requestErrorAlert),m.request(e).catch((e=>this.requestErrorCatch(e,t.errorHandler)))}requestErrorCatch(t,e){var n,r,o,a,l,c,u;const d=null!=(n=null==(r=t.response)||null==(o=r.errors)?void 0:o.map((t=>{var e;return decodeURI(null!=(e=t.detail)?e:"")})))?n:[];let h;switch(t.status){case 422:h=d.map((t=>[t,m("br",null)])).flat().slice(0,-1);break;case 401:case 403:h=s.Z.translator.trans("core.lib.error.permission_denied_message");break;case 404:case 410:h=s.Z.translator.trans("core.lib.error.not_found_message");break;case 413:h=s.Z.translator.trans("core.lib.error.payload_too_large_message");break;case 429:h=s.Z.translator.trans("core.lib.error.rate_limit_exceeded_message");break;default:h="db_error"===(null==(a=t.response)||null==(l=a.errors)||null==(c=l[0])?void 0:c.code)&&null!=(u=s.Z.session.user)&&u.isAdmin()?s.Z.translator.trans("core.lib.error.db_error_message"):this.requestWasCrossOrigin(t)?s.Z.translator.trans("core.lib.error.generic_cross_origin_message"):s.Z.translator.trans("core.lib.error.generic_message")}const p=s.Z.forum.attribute("debug");return t.alert={type:"error",content:h,controls:p&&[m(i.Z,{className:"Button Button--link",onclick:this.showDebug.bind(this,t,d)},s.Z.translator.trans("core.lib.debug_button"))]},e?e(t):this.requestErrorDefaultHandler(t,p,d),Promise.reject(t)}requestWasCrossOrigin(t){return new URL(t.options.url,document.baseURI).origin!==window.location.origin}requestErrorDefaultHandler(t,e,n){if(!(t instanceof y.Z))throw t;if(e&&t.xhr){const{method:e,url:r}=t.options,{status:s=""}=t.xhr;console.group("".concat(e," ").concat(r," ").concat(s)),n.length?console.error(...n):console.error(t),console.groupEnd()}500===t.status&&e?s.Z.modal.show(c.Z,{error:t,formattedError:n}):t.alert&&(this.requestErrorAlert=this.alerts.show(t.alert,t.alert.content))}showDebug(t,e){null!==this.requestErrorAlert&&this.alerts.dismiss(this.requestErrorAlert),this.modal.show(c.Z,{error:t,formattedError:e})}route(t,e){void 0===e&&(e={});const n=this.routes[t];if(!n)throw new Error("Route '".concat(t,"' does not exist"));const r=n.path.replace(/:([^\/]+)/g,((t,n)=>"".concat((0,f.Z)(e,n))));for(const t in e)e.hasOwnProperty(t)&&!e[t]&&delete e[t];const s=m.buildQueryString(e);return(""===m.route.prefix?this.forum.attribute("basePath"):"")+r+(s?"?"+s:"")}}flarum.reg.add("core","common/Application",R)},2190:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s});var r=n(7905);class s{constructor(){(0,r.Z)(this,"element",void 0),(0,r.Z)(this,"attrs",void 0),(0,r.Z)(this,"state",void 0)}oninit(t){this.setAttrs(t.attrs)}oncreate(t){this.element=t.dom}onbeforeupdate(t){this.setAttrs(t.attrs)}onupdate(t){}onbeforeremove(t){}onremove(t){}$(t){const e=$(this.element);return t?e.find(t):e}static component(t,e){void 0===t&&(t={}),void 0===e&&(e=null);const n={...t};return m(this,n,e)}setAttrs(t){if(void 0===t&&(t={}),this.constructor.initAttrs(t),t){if("children"in t)throw new Error("[".concat(this.constructor.name,'] The "children" attribute of attrs should never be used. Either pass children in as the vnode children or rename the attribute'));if("tag"in t)throw new Error("[".concat(this.constructor.name,'] You cannot use the "tag" attribute name with Mithril 2.'))}this.attrs=t}static initAttrs(t){}}flarum.reg.add("core","common/Component",s)},9175:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(7905),s=n(7465);class o{constructor(t,e){void 0===t&&(t={}),void 0===e&&(e=s.Z.store),(0,r.Z)(this,"data",{}),(0,r.Z)(this,"freshness",new Date),(0,r.Z)(this,"exists",!1),(0,r.Z)(this,"store",void 0),this.data=t,this.store=e}id(){return"id"in this.data?this.data.id:void 0}attribute(t){var e,n;return null==(e=this.data)||null==(n=e.attributes)?void 0:n[t]}pushData(t){if("id"in t&&(this.data.id=t.id),"type"in t&&(this.data.type=t.type),"attributes"in t){var e;(e=this.data).attributes||(e.attributes={});for(const e in t.attributes){const n=t.attributes[e];n&&n instanceof o&&delete t.attributes[e]}Object.assign(this.data.attributes,t.attributes)}if("relationships"in t){var n;const e=null!=(n=this.data.relationships)?n:{};for(const n in t.relationships){const r=t.relationships[n];if(null===r){delete e[n],delete t.relationships[n];continue}let s;s=r instanceof o?{data:o.getIdentifier(r)}:r instanceof Array?{data:r.map(o.getIdentifier)}:r,t.relationships[n]=s,e[n]=s}this.data.relationships=e}return this.freshness=new Date,this}pushAttributes(t){this.pushData({attributes:t})}save(t,e){void 0===e&&(e={});const n={type:this.data.type,attributes:t};if("id"in this.data&&(n.id=this.data.id),t.relationships){n.relationships={};for(const e in t.relationships){const r=t.relationships[e];null!==r&&(n.relationships[e]={data:r instanceof Array?r.map(o.getIdentifier):o.getIdentifier(r)})}delete t.relationships}const r=this.copyData();this.pushData(n);const i={data:n,meta:e.meta||void 0};return s.Z.request({method:this.exists?"PATCH":"POST",url:s.Z.forum.attribute("apiUrl")+this.apiEndpoint(),body:i,...e}).then((t=>this.store.pushPayload(t)),(t=>{throw this.pushData(r),m.redraw(),t}))}delete(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),this.exists?s.Z.request({method:"DELETE",url:s.Z.forum.attribute("apiUrl")+this.apiEndpoint(),body:t,...e}).then((()=>{this.exists=!1,this.store.remove(this)})):Promise.resolve()}apiEndpoint(){return"/"+this.data.type+("id"in this.data?"/"+this.data.id:"")}copyData(){return JSON.parse(JSON.stringify(this.data))}rawRelationship(t){var e,n;return null==(e=this.data.relationships)||null==(n=e[t])?void 0:n.data}static attribute(t,e){return function(){return e?e(this.attribute(t)):this.attribute(t)}}static hasOne(t){return function(){var e,n;const r=null==(e=this.data.relationships)||null==(n=e[t])?void 0:n.data;if(r&&r instanceof Array)throw new Error("Relationship ".concat(t," on model ").concat(this.data.type," is plural, so the hasOne method cannot be used to access it."));return!!r&&this.store.getById(r.type,r.id)}}static hasMany(t){return function(){var e,n;const r=null==(e=this.data.relationships)||null==(n=e[t])?void 0:n.data;if(r&&!(r instanceof Array))throw new Error("Relationship ".concat(t," on model ").concat(this.data.type," is singular, so the hasMany method cannot be used to access it."));return!!r&&r.map((t=>this.store.getById(t.type,t.id)))}}static transformDate(t){return null!=t?new Date(t):t}static getIdentifier(t){return t&&"id"in t.data?{type:t.data.type,id:t.data.id}:null}}flarum.reg.add("core","common/Model",o)},8740:(t,e,n)=>{"use strict";n.d(e,{Z:()=>h});var r=n(7905),s=n(7465),o=n(1586);class i extends o.y3{key(){return s.Z.translator.trans("core.lib.gambits.discussions.author.key",{},!0)}hint(){return s.Z.translator.trans("core.lib.gambits.discussions.author.hint",{},!0)}filterKey(){return"author"}}flarum.reg.add("core","common/query/discussions/AuthorGambit",i);class a extends o.y3{key(){return s.Z.translator.trans("core.lib.gambits.discussions.created.key",{},!0)}hint(){return s.Z.translator.trans("core.lib.gambits.discussions.created.hint",{},!0)}valuePattern(){return"(\\d{4}\\-\\d\\d\\-\\d\\d(?:\\.\\.(\\d{4}\\-\\d\\d\\-\\d\\d))?)"}filterKey(){return"created"}}flarum.reg.add("core","common/query/discussions/CreatedGambit",a);class l extends o.gD{key(){return s.Z.translator.trans("core.lib.gambits.discussions.hidden.key",{},!0)}filterKey(){return"hidden"}enabled(){return!!s.Z.session.user}}flarum.reg.add("core","common/query/discussions/HiddenGambit",l);class c extends o.gD{key(){return s.Z.translator.trans("core.lib.gambits.discussions.unread.key",{},!0)}filterKey(){return"unread"}enabled(){return!!s.Z.session.user}}flarum.reg.add("core","common/query/discussions/UnreadGambit",c);class u extends o.y3{key(){return s.Z.translator.trans("core.lib.gambits.users.email.key",{},!0)}hint(){return s.Z.translator.trans("core.lib.gambits.users.email.hint",{},!0)}filterKey(){return"email"}enabled(){return!(!s.Z.session.user||!s.Z.forum.attribute("canEditUserCredentials"))}}flarum.reg.add("core","common/query/users/EmailGambit",u);class d extends o.y3{key(){return s.Z.translator.trans("core.lib.gambits.users.group.key",{},!0)}hint(){return s.Z.translator.trans("core.lib.gambits.users.group.hint",{},!0)}filterKey(){return"group"}}flarum.reg.add("core","common/query/users/GroupGambit",d);class m{constructor(){(0,r.Z)(this,"gambits",{discussions:[i,a,l,c],users:[u,d]})}apply(t,e){return e.q=this.match(t,e.q,((t,n,r)=>{const s=t.toFilter(n,r);Object.keys(s).forEach((n=>{n in e&&t.predicates&&Array.isArray(s[n])?e[n]=e[n].concat(s[n]):e[n]=s[n]}))})),e}match(t,e,n){const r=this.for(t).filter((t=>t.enabled()));if(0===r.length)return e;const s=e.split(" ");for(const t of r)for(const r of s){const s="^(-?)".concat(t.pattern(),"$");let o=r.match(s);if(o){const s="-"===o[1];o.splice(1,1),n(t,o,s,r),e=e.replace(r,"")}}return e.trim().replace(/\s+/g," ")}from(t,e,n){const r=this.for(t);return 0===r.length||Object.keys(n).forEach((t=>{for(const s of r){const r="-"===t[0];r&&(t=t.substring(1)),s.filterKey()===t&&(e+=" ".concat(s.fromFilter(n[t],r)))}})),e}for(t){return(this.gambits[t]||[]).map((t=>new t))}}flarum.reg.add("core","common/GambitManager",m);class h{constructor(t){(0,r.Z)(this,"state",void 0),(0,r.Z)(this,"gambits",new m),this.state=t}}(0,r.Z)(h,"MIN_SEARCH_LEN",3),flarum.reg.add("core","common/SearchManager",h)},4153:(t,e,n)=>{"use strict";n.d(e,{Z:()=>V});var r,s=n(7905),o=n(6880),i=n.n(o),a=n(6353),l=n.n(a),c=n(2512),u=n.n(c),d=n(8328),h=n.n(d),p=n(9939),f=n.n(p),g=n(1627),v=n.n(g),b=n(871),y=n.n(b);function w(t){return t.reduce((function(t,e){return t.concat(Array.isArray(e)?w(e):e)}),[])}function Z(t){var e={};return function(){for(var n=arguments.length,r=new Array(n),s=0;s3&&void 0!==arguments[3]?arguments[3]:[];if(!t)return r;if(1===n)return r.push(t),r;var s=t.indexOf(e);if(-1===s)return r.push(t),r;var o=t.substring(0,s).trim(),i=t.substring(s+e.length+1).trim();return r.push(o),_(i,e,n-1,r)}function C(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function S(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,i=x(e),a=i.args,l=i.cases,c=parseInt(t);a.forEach((function(t){t.startsWith("offset:")&&(c-=parseInt(t.slice("offset:".length)))}));var u=[];if("PluralRules"in Intl){void 0!==r&&r.resolvedOptions().locale===n||(r=new Intl.PluralRules(n));var d=r.select(c);d!==T&&u.push(d)}1===c&&u.push("one"),u.push("=".concat(c),T);for(var m=0;m1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0,s=x(e),o=s.cases;return t in o?r(o[t],n):D in o?r(o.other,n):t}function M(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],s=[],o=function(r,o,i,a,l,c){if(o)return{break:!0};var u=L(t,i,a,l);if(!u)return s;var d=u.segmentIndex===a,m=t[u.segmentIndex],h=[];if(d)h.push(r.slice(l+1,u.segmentStart));else{h.push(r.slice(l+1));for(var p=a+1;p"===a[m]){var h=a.slice(c+1+l,m),p=s(a,l,h,i,m,c);if(p.exit)return;if(p.newSegmentIndex&&(i=p.newSegmentIndex),p.processedSegment&&(d=!0),p.break)break;l=!1,c=null,u=!1}else u&&(o=a[m],!/[a-zA-Z-_]/.test(o))&&(l=!1,c=null,u=!1);else c=m,u=!0,"/"===a[m+1]&&(l=!0,m++);d||r.push(a)}else r.push(a)}}function j(t){return Object.keys(t).reduce((function(e,n){return e[n]=R(t[n]),e}),{})}function B(t){return"string"!=typeof t?t:t.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&")}function R(t){return"string"==typeof t||t instanceof String?t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"):Array.isArray(t)?t.map(R):t}function $(t,e,n){return"<".concat(t,">").concat(B(n),"")}var H=function(t){h()(s,t);var e,n,r=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=v()(e);if(n){var s=v()(this).constructor;t=Reflect.construct(r,arguments,s)}else t=r.apply(this,arguments);return f()(this,t)});function s(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return l()(this,s),(e=r.call(this,t,n)).richHandler=o||$,e}return u()(s,[{key:"rich",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=j(e),r=w(this.process(t,n)),s=Math.random().toString(36)+Math.random().toString(36)+Math.random().toString(36),o=Object.fromEntries(Object.entries(e).map((function(t){var e=i()(t,2),n=e[0];return e[1],[n,s]}))),a=w(this.process(t,o)),l=M(a,o,(function(){return s})),c=l.map((function(t,e){return t===s?null:e})).filter((function(t){return null!==t}));return M(r,n,this.richHandler,c)}}]),s}(function(){function t(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};l()(this,t),y()(this,"format",Z((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return w(n.process(t,e)).join("")}))),this.locale=e,this.typeHandlers=r}return u()(t,[{key:"process",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t)return[];var n=t.indexOf("{");if(-1!==n){var r=N(t,n);if(-1===r)throw new Error('Unbalanced curly braces in string: "'.concat(t,'"'));var s=t.substring(n,r+1);if(s){var o=[],a=t.substring(0,n);a&&o.push(a);var l=k(s),c=i()(l,3),u=c[0],d=c[1],m=c[2],h=e[u];null==h&&(h="");var p=d&&this.typeHandlers[d];o.push(p?p(h,m,this.locale,e,this.process.bind(this)):h);var f=t.substring(r+1);return f&&o.push(this.process(f,e)),o}}return[t]}}]),t}());function U(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function F(t){for(var e=1;e{"use strict";n.d(e,{Z:()=>o});const r=window,s=new Proxy({},{get:(t,e)=>Reflect.get(r.app,e,r.app),set:(t,e,n)=>Reflect.set(r.app,e,n,r.app)}),o=s;flarum.reg.add("core","common/app",s)},3817:(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});var r=n(2190),s=n(8312),o=n(1268),i=n(6786),a=n(3344),l=n(7465),c=n(9133);class u extends r.Z{view(t){const e=Object.assign({},this.attrs),n=(0,i.Z)(e,"type");e.className=(0,a.Z)("Alert","Alert--".concat(n),e.className);const r=(0,i.Z)(e,"title"),u=(0,i.Z)(e,"icon"),d=(0,i.Z)(e,"content")||t.children,h=(0,i.Z)(e,"controls")||[],p=(0,i.Z)(e,"dismissible"),f=(0,i.Z)(e,"ondismiss"),g=[];return(p||void 0===p)&&g.push(m(s.Z,{"aria-label":l.Z.translator.trans("core.lib.alert.dismiss_a11y_label"),icon:"fas fa-times",className:"Button Button--link Button--icon Alert-dismiss",onclick:f})),m("div",e,m("div",{className:(0,a.Z)("Alert-container",e.containerClassName)},!!r&&m("div",{className:"Alert-title"},!!u&&m("span",{className:"Alert-title-icon"},m(c.Z,{name:u})),m("span",{className:"Alert-title-text"},r)),m("span",{className:"Alert-body"},d),m("ul",{className:"Alert-controls"},(0,o.Z)(h.concat(g)))))}}flarum.reg.add("core","common/components/Alert",u)},8588:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s});var r=n(2190);class s extends r.Z{oninit(t){super.oninit(t),this.state=this.attrs.state}view(){const t=this.state.getActiveAlerts();return m("div",{className:"AlertManager"},Object.keys(t).map(Number).map((e=>{const n=t[e],r="error"===n.attrs.type;return m("div",{className:"AlertManager-alert",role:"alert","aria-live":r?"assertive":"polite"},m(n.componentClass,Object.assign({},n.attrs,{ondismiss:this.state.dismiss.bind(this.state,e)}),n.children))})))}}flarum.reg.add("core","common/components/AlertManager",s)},7323:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(3344),s=n(2190);class o extends s.Z{view(t){const{user:e,...n}=t.attrs;n.className=(0,r.Z)("Avatar",n.className),null!=n.loading||(n.loading="lazy");let s="";const o="undefined"===n.title||n.title;if(o||delete n.title,e){const t=e.displayName()||"?",r=e.avatarUrl();if(o&&(n.title=n.title||t),r)return m("img",Object.assign({},n,{src:r,alt:""}));s=t.charAt(0).toUpperCase(),n.style={"--avatar-bg":e.color()}}return m("span",n,s)}}flarum.reg.add("core","common/components/Avatar",o)},3804:(t,e,n)=>{"use strict";n.d(e,{Z:()=>l});var r=n(6439),s=n(2190),o=n(3344),i=n(9215),a=n(9133);class l extends s.Z{view(){const{type:t,icon:e,label:n,color:s,style:l={},...c}=this.attrs,u=(0,o.Z)("Badge",[t&&"Badge--".concat(t)],c.className,(0,i.Z)(s)),d=e?m(a.Z,{name:e,className:"Badge-icon"}):m.trust(" "),h={...l,"--badge-bg":s},p={...c,className:u,style:h},f=m("div",p,d);return n?m(r.Z,{text:n},f):f}}flarum.reg.add("core","common/components/Badge",l)},8312:(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});var r=n(2190),s=n(7465);function o(){s.Z.forum.attribute("debug")&&console.warn(...arguments)}flarum.reg.add("core","common/helpers/fireDebugWarning",o);var i=n(3344),a=n(1552),l=n(5226),c=n(9133);class u extends r.Z{view(t){let{type:e,"aria-label":n,icon:r,disabled:s,loading:o,className:l,class:c,...u}=this.attrs;e||(e="button"),"object"==typeof n&&(n=(0,a.Z)(n)),(s||o)&&delete u.onclick,l=(0,i.Z)(c,l,{hasIcon:r,disabled:s||o,loading:o});const d={disabled:s,className:l,type:e,"aria-label":n,...u};return m("button",d,this.getButtonContent(t.children))}oncreate(t){var e,n;super.oncreate(t);const{"aria-label":r}=this.attrs;this.view!==u.prototype.view||r||(0,a.Z)(t.children)||null!=(e=this.element)&&null!=(n=e.getAttribute)&&n.call(e,"aria-label")||o('[Flarum Accessibility Warning] Button has no content and no accessible label. This means that screen-readers will not be able to interpret its meaning and just read "Button". Consider providing accessible text via the `aria-label` attribute. https://web.dev/button-name',this.element)}getButtonContent(t){const e=this.attrs.icon;return[e&&m(c.Z,{name:e,className:"Button-icon"}),t&&m("span",{className:"Button-label"},t),this.attrs.loading&&m(l.Z,{size:"small",display:"inline"})]}}flarum.reg.add("core","common/components/Button",u)},7298:(t,e,n)=>{"use strict";n.d(e,{Z:()=>l});var r=n(2190),s=n(5226),o=n(3344),i=n(7669),a=n(9133);class l extends r.Z{view(t){const e=(0,o.Z)(["Checkbox",this.attrs.state?"on":"off",this.attrs.className,this.attrs.loading&&"loading",this.attrs.disabled&&"disabled"]);return m("label",{className:e},m("input",{type:"checkbox",checked:this.attrs.state,disabled:this.attrs.disabled,onchange:(0,i.Z)("checked",this.onchange.bind(this))}),m("div",{className:"Checkbox-display","aria-hidden":"true"},this.getDisplay()),t.children)}getDisplay(){return this.attrs.loading?m(s.Z,{display:"unset",size:"small"}):m(a.Z,{name:this.attrs.state?"fas fa-check":"fas fa-times"})}onchange(t){this.attrs.onchange&&this.attrs.onchange(t,this)}}flarum.reg.add("core","common/components/Checkbox",l)},344:(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});var r=n(7905),s=n(7465),o=n(2190),i=n(1268),a=n(1552),l=n(6439),c=n(9133);class u extends o.Z{constructor(){super(...arguments),(0,r.Z)(this,"showing",!1)}static initAttrs(t){t.className||(t.className=""),t.buttonClassName||(t.buttonClassName=""),t.menuClassName||(t.menuClassName=""),t.label||(t.label=""),null!=t.caretIcon||(t.caretIcon="fas fa-caret-down"),t.accessibleToggleLabel||(t.accessibleToggleLabel=(0,a.Z)(s.Z.translator.trans("core.lib.dropdown.toggle_dropdown_accessible_label")))}view(t){const e=t.children?(0,i.Z)(t.children):[],n=!this.attrs.lazyDraw||this.showing;return m("div",{className:"ButtonGroup Dropdown dropdown "+this.attrs.className+" itemCount"+e.length+(this.showing?" open":"")},this.getButton(t.children),n&&this.getMenu(e))}oncreate(t){super.oncreate(t),this.$().on("shown.bs.dropdown",(()=>{var t,e,n,r,s,o,i,a,l,c,u;const{lazyDraw:d,onshow:h}=this.attrs;this.showing=!0,d&&m.redraw.sync(),"function"==typeof h&&h(),d||m.redraw();const p=this.$(".Dropdown-menu"),f=p.hasClass("Dropdown-menu--right"),g=null!=(t=null==(e=p.offset())?void 0:e.top)?t:0,v=null!=(n=p.height())?n:0,b=null!=(r=$(window).scrollTop())?r:0,y=null!=(s=$(window).height())?s:0;p.removeClass("Dropdown-menu--top Dropdown-menu--right"),p.toggleClass("Dropdown-menu--top",g+v>b+y),((null==(o=p.offset())?void 0:o.top)||0)<0&&p.removeClass("Dropdown-menu--top");const w=null!=(i=null==(a=p.offset())?void 0:a.left)?i:0,Z=null!=(l=p.width())?l:0,x=null!=(c=$(window).scrollLeft())?c:0,N=null!=(u=$(window).width())?u:0;p.toggleClass("Dropdown-menu--right",f||w+Z>x+N)})),this.$().on("hidden.bs.dropdown",(()=>{this.showing=!1,this.attrs.onhide&&this.attrs.onhide(),m.redraw()}))}getButton(t){let e=m("button",Object.assign({className:"Dropdown-toggle "+this.attrs.buttonClassName,"aria-haspopup":"menu","aria-label":this.attrs.accessibleToggleLabel,"data-toggle":"dropdown",onclick:this.attrs.onclick},this.attrs.buttonAttrs),this.getButtonContent(t));return this.attrs.tooltip&&(e=m(l.Z,{text:this.attrs.tooltip,position:"bottom"},e)),e}getButtonContent(t){return[this.attrs.icon?m(c.Z,{name:this.attrs.icon,className:"Button-icon"}):"",m("span",{className:"Button-label"},this.attrs.label),this.attrs.caretIcon?m(c.Z,{name:this.attrs.caretIcon,className:"Button-caret"}):""]}getMenu(t){return m("ul",{className:"Dropdown-menu dropdown-menu "+this.attrs.menuClassName},t)}}flarum.reg.add("core","common/components/Dropdown",u)},8034:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(2190),s=n(3344);class o extends r.Z{view(t){return m("div",{className:(0,s.Z)("FieldSet",this.attrs.className),role:"group","aria-label":this.attrs.label,"aria-disabled":!1},m("label",{className:"FieldSet-label","aria-hidden":"true"},this.attrs.label),this.attrs.description?m("div",{className:"FieldSet-description helpText"},this.attrs.description):null,m("div",{className:"FieldSet-items"},t.children))}}flarum.reg.add("core","common/components/FieldSet",o)},6352:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(2190),s=n(3344);class o extends r.Z{view(t){const{label:e,description:n,className:r,...o}=t.attrs;return m("div",Object.assign({className:(0,s.Z)("Form",r)},o),m("div",{className:"Form-header"},e&&m("label",null,e),n&&m("p",{className:"helpText"},n)),m("div",{className:"Form-body"},t.children))}}flarum.reg.add("core","common/components/Form",o)},899:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s});var r=n(7108);class s extends r.Z{wrapper(t){return m("form",{onsubmit:this.onsubmit.bind(this)},t)}onsubmit(t){}onready(){this.$().find("input, select, textarea").first().trigger("focus").trigger("select")}onerror(t){var e;this.alertAttrs=t.alert,m.redraw(),422===t.status&&null!=(e=t.response)&&e.errors?this.$("form [name="+t.response.errors[0].source.pointer.replace("/data/attributes/","")+"]").trigger("select"):this.onready()}}flarum.reg.add("core","common/components/FormModal",s)},6697:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s});var r=n(3804);class s extends r.Z{static initAttrs(t){super.initAttrs(t),t.group&&(t.icon=t.group.icon()||"",t.color=t.group.color()||"",t.label=void 0===t.label?t.group.nameSingular():t.label,t.type="group--"+t.group.id(),delete t.group)}}flarum.reg.add("core","common/components/GroupBadge",s)},9133:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(3344),s=n(2190);class o extends s.Z{view(t){const{name:e,...n}=t.attrs;return n.className=(0,r.Z)("icon",e,n.className),m("i",Object.assign({"aria-hidden":"true"},n))}}flarum.reg.add("core","common/components/Icon",o)},3986:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var r=n(2190),s=n(9133),o=n(3344);class i extends r.Z{view(t){const{icon:e,className:n,...r}=t.attrs;return m("div",Object.assign({className:(0,o.Z)("InfoTile",n)},r),this.icon(),m("div",{className:"InfoTile-text"},t.children))}icon(){return this.attrs.iconElement?this.attrs.iconElement:this.attrs.icon?m(s.Z,{name:(0,o.Z)(this.attrs.icon,"InfoTile-icon")}):null}}flarum.reg.add("core","common/components/InfoTile",i)},9908:(t,e,n)=>{"use strict";n.d(e,{Z:()=>c});var r=n(6789),s=n(2190),o=n(9133),i=n(5226),a=n(3344),l=n(8312);class c extends s.Z{oninit(t){super.oninit(t)}view(t){var e,n;const{className:s,...c}=this.attrs.inputAttrs||{},u=this.attrs.value||(null==(e=(n=this.attrs).stream)?void 0:e.call(n))||"";return m("div",{className:(0,a.Z)("Input",this.attrs.className,{"Input--withPrefix":this.attrs.prefixIcon,"Input--withClear":this.attrs.clearable})},this.attrs.prefixIcon&&m(o.Z,{name:(0,a.Z)(this.attrs.prefixIcon,"Input-prefix-icon")}),this.input({inputClassName:s,value:u,inputAttrs:c}),this.attrs.loading&&m(i.Z,{size:"small",display:"inline",containerClassName:"Button Button--icon Button--link"}),this.attrs.clearable&&u&&!this.attrs.loading&&m(l.Z,{className:"Input-clear Button Button--icon Button--link",onclick:this.clear.bind(this),"aria-label":this.attrs.clearLabel||r.Z.translator.trans("core.lib.input.clear_button"),type:"button",icon:"fas fa-times-circle"}))}input(t){let{inputClassName:e,value:n,inputAttrs:r}=t;const s={className:(0,a.Z)("FormControl",e),type:this.attrs.type||"text",value:n,oninput:t=>{var e;return null==(e=this.onchange)?void 0:e.call(this,t.target.value)},"aria-label":this.attrs.ariaLabel,placeholder:this.attrs.placeholder,readonly:this.attrs.readonly||void 0,disabled:this.attrs.disabled||void 0,...r};return this.attrs.renderInput?this.attrs.renderInput(s):m("input",s)}onchange(t){var e,n;this.attrs.stream?this.attrs.stream(t):null==(e=(n=this.attrs).onchange)||e.call(n,t)}clear(){this.onchange("")}}flarum.reg.add("core","common/components/Input",c)},5226:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var r=n(7465),s=n(2190),o=n(3344);class i extends s.Z{view(){const{display:t="block",size:e="medium",containerClassName:n,className:s,...i}=this.attrs,a=(0,o.Z)("LoadingIndicator",s),l=(0,o.Z)("LoadingIndicator-container","unset"!==t&&"LoadingIndicator-container--".concat(t),e&&"LoadingIndicator-container--".concat(e),n);return m("div",Object.assign({"aria-label":r.Z.translator.trans("core.lib.loading_indicator.accessible_label"),role:"status"},i.containerAttrs,{"data-size":e,className:l}),m("div",Object.assign({"aria-hidden":"true",className:a},i)))}}flarum.reg.add("core","common/components/LoadingIndicator",i)},7108:(t,e,n)=>{"use strict";n.d(e,{Z:()=>c});var r=n(7905),s=n(7465),o=n(2190),i=n(3817),a=n(8312),l=n(3344);class c extends o.Z{constructor(){super(...arguments),(0,r.Z)(this,"loading",!1),(0,r.Z)(this,"alertAttrs",null)}static get dismissibleOptions(){return{viaCloseButton:this.isDismissibleViaCloseButton,viaEscKey:this.isDismissibleViaEscKey,viaBackdropClick:this.isDismissibleViaBackdropClick}}oncreate(t){super.oncreate(t),this.attrs.animateShow((()=>this.onready()))}onbeforeremove(t){if(super.onbeforeremove(t),!this.attrs.state.modal)return new Promise((t=>setTimeout(t,300)))}view(){return this.alertAttrs&&(this.alertAttrs.dismissible=!1),m("div",{className:(0,l.Z)("Modal modal-dialog fade",this.className())},m("div",{className:"Modal-content"},this.dismissibleOptions.viaCloseButton&&m("div",{className:"Modal-close App-backControl"},m(a.Z,{icon:"fas fa-times",onclick:()=>this.hide(),className:"Button Button--icon Button--link","aria-label":s.Z.translator.trans("core.lib.modal.close")})),this.wrapper(this.inner())))}wrapper(t){return m("[",null,t)}inner(){return m("[",null,m("div",{className:"Modal-header"},m("h3",{className:"App-titleControl App-titleControl--text"},this.title())),!!this.alertAttrs&&m("div",{className:"Modal-alert"},m(i.Z,this.alertAttrs)),this.content())}onready(){}hide(){this.attrs.animateHide()}loaded(){this.loading=!1,m.redraw()}get dismissibleOptions(){return this.constructor.dismissibleOptions}}(0,r.Z)(c,"isDismissibleViaCloseButton",!0),(0,r.Z)(c,"isDismissibleViaEscKey",!0),(0,r.Z)(c,"isDismissibleViaBackdropClick",!0),flarum.reg.add("core","common/components/Modal",c)},7224:(t,e,n)=>{"use strict";n.d(e,{Z:()=>w});var r=n(7905),s=n(2190),o=n(7835),i=!1;if("undefined"!=typeof window){var a={get passive(){i=!0}};window.addEventListener("testPassive",null,a),window.removeEventListener("testPassive",null,a)}var l="undefined"!=typeof window&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||"MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints>1),c=[],u=!1,d=-1,h=void 0,p=void 0,f=void 0,g=function(t){return c.some((function(e){return!(!e.options.allowTouchMove||!e.options.allowTouchMove(t))}))},v=function(t){var e=t||window.event;return!!g(e.target)||e.touches.length>1||(e.preventDefault&&e.preventDefault(),!1)},b=function(){l&&(c.forEach((function(t){t.targetElement.ontouchstart=null,t.targetElement.ontouchmove=null})),u&&(document.removeEventListener("touchmove",v,i?{passive:!1}:void 0),u=!1),d=-1),l?function(){if(void 0!==p){var t=-parseInt(document.body.style.top,10),e=-parseInt(document.body.style.left,10);document.body.style.position=p.position,document.body.style.top=p.top,document.body.style.left=p.left,window.scrollTo(e,t),p=void 0}}():(void 0!==f&&(document.body.style.paddingRight=f,f=void 0),void 0!==h&&(document.body.style.overflow=h,h=void 0)),c=[]},y=n(5226);class w extends s.Z{constructor(){super(...arguments),(0,r.Z)(this,"focusTrap",void 0),(0,r.Z)(this,"lastSetFocusTrap",void 0),(0,r.Z)(this,"modalClosing",!1),(0,r.Z)(this,"keyUpListener",null)}view(t){return m("[",null,this.attrs.state.modalList.map(((t,e)=>{const n=null==t?void 0:t.componentClass;return m("div",{key:t.key,className:"ModalManager modal","data-modal-key":t.key,"data-modal-number":e,role:"dialog","aria-modal":"true",style:{"--modal-number":e},"aria-hidden":this.attrs.state.modal!==t&&"true"},!!n&&[m(n,Object.assign({key:t.key},t.attrs,{animateShow:this.animateShow.bind(this),animateHide:this.animateHide.bind(this),state:this.attrs.state})),m("div",{key:t.key,className:"ModalManager-invisibleBackdrop",onclick:this.handlePossibleBackdropClick.bind(this)})])})),(this.attrs.state.backdropShown||this.attrs.state.loadingModal)&&m("div",{className:"Modal-backdrop backdrop",ontransitionend:this.onBackdropTransitionEnd.bind(this),"data-showing":!!this.attrs.state.modalList.length||this.attrs.state.loadingModal,style:{"--modal-count":this.attrs.state.modalList.length+Number(this.attrs.state.loadingModal)}},this.attrs.state.loadingModal&&m(y.Z,null)))}oncreate(t){super.oncreate(t),this.keyUpListener=this.handleEscPress.bind(this),document.body.addEventListener("keyup",this.keyUpListener)}onbeforeremove(t){super.onbeforeremove(t),this.keyUpListener&&document.body.removeEventListener("keyup",this.keyUpListener),this.keyUpListener=null}onupdate(t){super.onupdate(t),requestAnimationFrame((()=>{try{var t,e,n,r;if(!this.attrs.state.isModalOpen())return null==(e=document.getElementById("app"))||e.setAttribute("aria-hidden","false"),null==(n=(r=this.focusTrap).deactivate)||n.call(r),void b();null==(t=document.getElementById("app"))||t.setAttribute("aria-hidden","true");const w=this.attrs.state.modal.key;var s,a,m,y;this.focusTrap&&this.lastSetFocusTrap!==w&&(null==(s=(a=this.focusTrap).deactivate)||s.call(a),b()),this.activeDialogElement&&this.lastSetFocusTrap!==w&&(this.focusTrap=(0,o.v)(this.activeDialogElement,{allowOutsideClick:!0}),null==(m=(y=this.focusTrap).activate)||m.call(y),function(t,e){if(t){if(!c.some((function(e){return e.targetElement===t}))){var n={targetElement:t,options:e||{}};c=[].concat(function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e=r&&(document.body.style.top=-(e+t))}))}),300)}})):function(t){if(void 0===f){var e=!!t&&!0===t.reserveScrollBarGap,n=window.innerWidth-document.documentElement.clientWidth;if(e&&n>0){var r=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right"),10);f=document.body.style.paddingRight,document.body.style.paddingRight=r+n+"px"}}void 0===h&&(h=document.body.style.overflow,document.body.style.overflow="hidden")}(e),l&&(t.ontouchstart=function(t){1===t.targetTouches.length&&(d=t.targetTouches[0].clientY)},t.ontouchmove=function(e){1===e.targetTouches.length&&function(t,e){var n=t.targetTouches[0].clientY-d;!g(t.target)&&(e&&0===e.scrollTop&&n>0||function(t){return!!t&&t.scrollHeight-t.scrollTop<=t.clientHeight}(e)&&n<0?v(t):t.stopPropagation())}(e,t)},u||(document.addEventListener("touchmove",v,i?{passive:!1}:void 0),u=!0))}}else console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.")}(this.activeDialogManagerElement,{reserveScrollBarGap:!0})),this.lastSetFocusTrap=w}catch{}}))}get activeDialogElement(){var t;return document.body.querySelector('.ModalManager[data-modal-key="'.concat(null==(t=this.attrs.state.modal)?void 0:t.key,'"] .Modal'))}get activeDialogManagerElement(){var t;return document.body.querySelector('.ModalManager[data-modal-key="'.concat(null==(t=this.attrs.state.modal)?void 0:t.key,'"]'))}animateShow(t){void 0===t&&(t=()=>{}),this.attrs.state.modal&&(this.activeDialogElement.addEventListener("transitionend",(()=>{t()}),{once:!0}),requestAnimationFrame((()=>{this.activeDialogElement.classList.add("in")})))}animateHide(t){void 0===t&&(t=()=>{}),this.modalClosing||(this.modalClosing=!0,this.activeDialogElement.addEventListener("transitionend",(()=>{this.modalClosing=!1,this.attrs.state.close(),t()}),{once:!0}),this.activeDialogElement.classList.remove("in"),this.activeDialogElement.classList.add("out"))}handleEscPress(t){if(!this.attrs.state.modal)return;const e=this.attrs.state.modal.componentClass.dismissibleOptions;"Escape"===t.key&&e.viaEscKey&&(t.preventDefault(),this.animateHide())}handlePossibleBackdropClick(t){this.attrs.state.modal&&this.attrs.state.modal.componentClass.dismissibleOptions.viaBackdropClick&&this.animateHide()}onBackdropTransitionEnd(t){"opacity"===t.propertyName&&null===t.currentTarget.getAttribute("data-showing")&&(this.attrs.state.backdropShown=!1,m.redraw())}}flarum.reg.add("core","common/components/ModalManager",w)},5386:(t,e,n)=>{"use strict";n.d(e,{Z:()=>l});var r=n(7465),s=n(2190),o=n(8312),i=n(2360),a=n(3344);class l extends s.Z{view(){const{history:t,pane:e}=r.Z;return m("div",{className:(0,a.Z)("Navigation ButtonGroup",this.attrs.className),onmouseenter:e&&e.show.bind(e),onmouseleave:e&&e.onmouseleave.bind(e)},null!=t&&t.canGoBack()?[this.getBackButton(),this.getPaneButton()]:this.getDrawerButton())}getBackButton(){const{history:t}=r.Z,e=null==t?void 0:t.getPrevious();return m(i.Z,{className:"Button Navigation-back Button--icon",href:null==t?void 0:t.backUrl(),icon:"fas fa-chevron-left","aria-label":null==e?void 0:e.title,onclick:e=>{e.shiftKey||e.ctrlKey||e.metaKey||2===e.which||(e.preventDefault(),null==t||t.back())}})}getPaneButton(){const{pane:t}=r.Z;return t&&t.active?m(o.Z,{className:(0,a.Z)("Button Button--icon Navigation-pin",{active:t.pinned}),onclick:t.togglePinned.bind(t),icon:"fas fa-thumbtack"}):null}getDrawerButton(){if(!this.attrs.drawer)return null;const{drawer:t}=r.Z,e=r.Z.session.user;return m(o.Z,{className:(0,a.Z)("Button Button--icon Navigation-drawer",{new:null==e?void 0:e.newNotificationCount()}),onclick:e=>{e.stopPropagation(),t.show()},icon:"fas fa-bars","aria-label":r.Z.translator.trans("core.lib.nav.drawer_button")})}}flarum.reg.add("core","common/components/Navigation",l)},4661:(t,e,n)=>{"use strict";n.d(e,{Z:()=>a});var r=n(7905),s=n(7465),o=n(2190),i=n(5013);class a extends o.Z{constructor(){super(...arguments),(0,r.Z)(this,"bodyClass",""),(0,r.Z)(this,"scrollTopOnCreate",!0),(0,r.Z)(this,"useBrowserScrollRestoration",!0)}oninit(t){super.oninit(t),s.Z.previous=s.Z.current,s.Z.current=new i.Z(this.constructor,{routeName:this.attrs.routeName}),s.Z.drawer.hide(),s.Z.modal.close()}oncreate(t){super.oncreate(t),this.bodyClass&&$("#app").addClass(this.bodyClass),this.scrollTopOnCreate&&$(window).scrollTop(0),"scrollRestoration"in history&&(history.scrollRestoration=this.useBrowserScrollRestoration?"auto":"manual")}onremove(t){super.onremove(t),this.bodyClass&&$("#app").removeClass(this.bodyClass)}}flarum.reg.add("core","common/components/Page",a)},406:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s});var r=n(7108);class s extends r.Z{className(){return"RequestErrorModal Modal--large"}title(){return!!this.attrs.error.xhr&&"".concat(this.attrs.error.xhr.status," ").concat(this.attrs.error.xhr.statusText)}content(){var t;const{error:e,formattedError:n}=this.attrs;let r;return r=n.length?n.join("\n\n"):e.response?JSON.stringify(e.response,null,2):e.responseText,null!=(t=r)&&t.includes("