diff --git a/framework/core/js/dist/admin.js b/framework/core/js/dist/admin.js index 2579e81f9..9ff5c3792 100644 --- a/framework/core/js/dist/admin.js +++ b/framework/core/js/dist/admin.js @@ -1,4 +1,4 @@ -flarum.core=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=152)}([function(t,e,n){"use strict";function r(t,e){return(r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function i(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,r(t,e)}n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e=null),this.data=t,this.freshness=new Date,this.exists=!1,this.store=e}var e=t.prototype;return e.id=function(){return this.data.id},e.attribute=function(t){return this.data.attributes[t]},e.pushData=function(e){for(var n in e)if("object"==typeof e[n])for(var r in this.data[n]=this.data[n]||{},e[n])e[n][r]instanceof t&&(e[n][r]={data:t.getIdentifier(e[n][r])}),this.data[n][r]=e[n][r];else this.data[n]=e[n];this.freshness=new Date},e.pushAttributes=function(t){this.pushData({attributes:t})},e.save=function(e,n){var r=this;void 0===n&&(n={});var i={type:this.data.type,id:this.data.id,attributes:e};if(e.relationships){for(var o in i.relationships={},e.relationships){var a=e.relationships[o];i.relationships[o]={data:a instanceof Array?a.map(t.getIdentifier):t.getIdentifier(a)}}delete e.relationships}var s=this.copyData();this.pushData(i);var u={data:i};return n.meta&&(u.meta=n.meta),app.request(Object.assign({method:this.exists?"PATCH":"POST",url:app.forum.attribute("apiUrl")+this.apiEndpoint(),body:u},n)).then((function(t){return r.store.data[t.data.type]=r.store.data[t.data.type]||{},r.store.data[t.data.type][t.data.id]=r,r.store.pushPayload(t)}),(function(t){throw r.pushData(s),m.redraw(),t}))},e.delete=function(t,e){var n=this;return void 0===e&&(e={}),this.exists?app.request(Object.assign({method:"DELETE",url:app.forum.attribute("apiUrl")+this.apiEndpoint(),body:t},e)).then((function(){n.exists=!1,n.store.remove(n)})):Promise.resolve()},e.apiEndpoint=function(){return"/"+this.data.type+(this.exists?"/"+this.data.id:"")},e.copyData=function(){return JSON.parse(JSON.stringify(this.data))},t.attribute=function(t,e){return function(){var n=this.data.attributes&&this.data.attributes[t];return e?e(n):n}},t.hasOne=function(t){return function(){if(this.data.relationships){var e=this.data.relationships[t];if(e)return app.store.getById(e.data.type,e.data.id)}return!1}},t.hasMany=function(t){return function(){if(this.data.relationships){var e=this.data.relationships[t];if(e)return e.data.map((function(t){return app.store.getById(t.type,t.id)}))}return!1}},t.transformDate=function(t){return t?new Date(t):null},t.getIdentifier=function(t){return{type:t.data.type,id:t.data.id}},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n(0),i=n(3),o=n(5),a=n(7),s=n(14),u=n(8),l=n(15),c=function(t){function e(){return t.apply(this,arguments)||this}Object(r.a)(e,t);var n=e.prototype;return n.view=function(t){var e=Object.assign({},this.attrs);e.type=e.type||"button",e.title&&!t.children&&(e["aria-label"]=e.title),"object"==typeof e.title&&(e.title=Object(u.a)(e.title)),!e.title&&t.children&&(e.title=Object(u.a)(t.children));var n=Object(s.a)(e,"icon"),r=Object(s.a)(e,"loading");return(e.disabled||r)&&delete e.onclick,e.className=Object(a.a)([e.className,n&&"hasIcon",(e.disabled||r)&&"disabled",r&&"loading"]),m("button",e,this.getButtonContent(t.children))},n.getButtonContent=function(t){var e=this.attrs.icon;return[e&&!0!==e?Object(o.a)(e,{className:"Button-icon"}):"",t?m("span",{className:"Button-label"},t):"",this.attrs.loading?m(l.a,{size:"small",display:"inline"}):""]},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(){this.element=void 0,this.attrs=void 0}var e=t.prototype;return e.oninit=function(t){this.setAttrs(t.attrs)},e.oncreate=function(t){this.element=t.dom},e.onbeforeupdate=function(t){this.setAttrs(t.attrs)},e.onupdate=function(t){},e.onbeforeremove=function(t){},e.onremove=function(t){},e.$=function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){var e=$(this.element);return t?e.find(t):e})),t.component=function(t,e){void 0===t&&(t={}),void 0===e&&(e=null);var n=Object.assign({},t);return m(this,n,e)},e.setAttrs=function(t){if(void 0===t&&(t={}),this.constructor.initAttrs(t),t){if("children"in t)throw new Error("["+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("["+this.constructor.name+'] You cannot use the "tag" attribute name with Mithril 2.')}this.attrs=t},t.initAttrs=function(t){},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=function(t,e){this.content=void 0,this.priority=void 0,this.key=void 0,this.content=t,this.priority=e},i=function(){function t(){this.items={}}var e=t.prototype;return e.isEmpty=function(){for(var t in this.items)if(this.items.hasOwnProperty(t))return!1;return!0},e.has=function(t){return!!this.items[t]},e.get=function(t){return this.items[t].content},e.add=function(t,e,n){return void 0===n&&(n=0),this.items[t]=new r(e,n),this},e.replace=function(t,e,n){return void 0===e&&(e=null),void 0===n&&(n=null),this.items[t]&&(null!==e&&(this.items[t].content=e),null!==n&&(this.items[t].priority=n)),this},e.remove=function(t){return delete this.items[t],this},e.merge=function(t){for(var e in t.items)t.items.hasOwnProperty(e)&&t.items[e]instanceof r&&(this.items[e]=t.items[e]);return this},e.toArray=function(){var t=[];for(var e in this.items)this.items.hasOwnProperty(e)&&this.items[e]instanceof r&&(this.items[e].content=Object(this.items[e].content),this.items[e].content.itemName=e,t.push(this.items[e]),this.items[e].key=t.length);return t.sort((function(t,e){return t.priority===e.priority?t.key-e.key:t.priority>e.priority?-1:1})).map((function(t){return t.content}))},t}()},function(t,e,n){"use strict";function r(t,e){return void 0===e&&(e={}),e.className="icon "+t+" "+(e.className||""),m("i",Object.assign({"aria-hidden":"true"},e))}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(22),i=n(7);function o(t){return t.tag===r.a}function a(t){return t instanceof Array||(t=[t]),function(t){var e,n=[];return t.filter(Boolean).forEach((function(r,i){(!o(r)||e&&!o(e)&&i!==t.length-1)&&(e=r,n.push(r))})),n}(t).map((function(t){var e=t.tag&&t.tag.isListItem,n=t.tag&&t.tag.isActive&&t.tag.isActive(t.attrs),r=t.attrs&&t.attrs.itemClassName||t.itemClassName;return e&&(t.attrs=t.attrs||{},t.attrs.key=t.attrs.key||t.itemName,t.key=t.attrs.key),e?t:m("li",{className:Object(i.a)([r,t.itemName&&"item-"+t.itemName,n&&"active"]),key:t.attrs&&t.attrs.key||t.itemName},t)}))}},function(t,e,n){"use strict";function r(t){var e,n,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t)if(Array.isArray(t))for(e=0;e$(window).scrollTop()+$(window).height()),t.offset().top<0&&t.removeClass("Dropdown-menu--top"),t.toggleClass("Dropdown-menu--right",e||t.offset().left+t.width()>$(window).scrollLeft()+$(window).width())})),this.$().on("hidden.bs.dropdown",(function(){n.showing=!1,n.attrs.onhide&&n.attrs.onhide(),m.redraw()}))},n.getButton=function(t){return m("button",{className:"Dropdown-toggle "+this.attrs.buttonClassName,"aria-haspopup":"menu","aria-label":this.attrs.accessibleToggleLabel,"data-toggle":"dropdown",onclick:this.attrs.onclick},this.getButtonContent(t))},n.getButtonContent=function(t){return[this.attrs.icon?Object(o.a)(this.attrs.icon,{className:"Button-icon"}):"",m("span",{className:"Button-label"},this.attrs.label),this.attrs.caretIcon?Object(o.a)(this.attrs.caretIcon,{className:"Button-caret"}):""]},n.getMenu=function(t){return m("ul",{className:"Dropdown-menu dropdown-menu "+this.attrs.menuClassName},t)},e}(i.a)},function(t,e,n){"use strict";function r(t,e){void 0===e&&(e={}),e.className="Avatar "+(e.className||"");var n="",r="undefined"===e.title||e.title;if(r||delete e.title,t){var i=t.displayName()||"?",o=t.avatarUrl();if(r&&(e.title=e.title||i),o)return m("img",Object.assign({},e,{src:o,alt:""}));n=i.charAt(0).toUpperCase(),e.style={background:t.color()}}return m("span",e,n)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r=0||(i[n]=t[n]);return i}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t){var e=t&&t.displayName()||app.translator.trans("core.lib.username.deleted_text");return m("span",{className:"username"},e)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(){for(var t=arguments.length,e=new Array(t),n=0;n or .");var u=e[0];if("object"!=typeof u||Array.isArray(u)||null===u)throw new Error("Tooltip component was provided with no direct child DOM element. Tooltips must contain a single direct DOM node to attach to.");if("string"==typeof u.tag&&["#","[","<"].includes(u.tag))throw new Error('Tooltip component with provided with a vnode with tag "'+u.tag+'". This is not a DOM element, so is not a valid child element. Please wrap this vnode in another element, such as a
or .');return this.firstChild=u,e},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.checkDomNodeChanged(),this.recreateTooltip()},n.onupdate=function(e){t.prototype.onupdate.call(this,e),this.checkDomNodeChanged(),this.recreateTooltip()},n.recreateTooltip=function(){this.shouldRecreateTooltip&&null!==this.childDomNode&&($(this.childDomNode).tooltip("destroy","DANGEROUS_tooltip_jquery_fn_deprecation_exempt"),this.createTooltip(),this.shouldRecreateTooltip=!1),this.shouldChangeTooltipVisibility&&(this.shouldChangeTooltipVisibility=!1,this.updateVisibility())},n.updateVisibility=function(){null!==this.childDomNode&&(!0===this.attrs.tooltipVisible?$(this.childDomNode).tooltip("show","DANGEROUS_tooltip_jquery_fn_deprecation_exempt"):!1===this.attrs.tooltipVisible&&$(this.childDomNode).tooltip("hide","DANGEROUS_tooltip_jquery_fn_deprecation_exempt"))},n.createTooltip=function(){if(null!==this.childDomNode){var t=this.attrs,e=t.showOnFocus,n=void 0===e||e,r=t.position,i=void 0===r?"top":r,o=t.delay,s=t.html,u=void 0!==s&&s,l=t.tooltipVisible,c=(t.text,"boolean"==typeof l?"manual":Object(a.a)("hover",[n&&"focus"])),d=this.getRealText();this.childDomNode.setAttribute("title",d),this.childDomNode.setAttribute("aria-label",d),$(this.childDomNode).tooltip({html:u,delay:o,placement:i,trigger:c},"DANGEROUS_tooltip_jquery_fn_deprecation_exempt")}},n.getRealText=function(){var t=this.attrs.text;return Array.isArray(t)?Object(s.a)(t):t},n.checkDomNodeChanged=function(){var t=this.firstChild.dom;t&&!t.isSameNode(this.childDomNode)&&(this.childDomNode=t,this.shouldRecreateTooltip=!0)},e}(o.a)},function(t,e,n){t.exports=function(){"use strict";var t="millisecond",e="second",n="minute",r="hour",i="day",o="week",a="month",s="quarter",u="year",l="date",c=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,d=/\[([^\]]+)]|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("_")},f=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},h={s:f,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+f(r,2,"0")+":"+f(i,2,"0")},m:function t(e,n){if(e.date()0?"...":"")+t.substring(n,n+e)+(t.length>n+e?"...":"")}function i(t){return t.toLowerCase().replace(/[^a-z0-9]/gi,"-").replace(/-+/g,"-").replace(/-$|^-/g,"")}function o(t){var e=t.replace(/(<\/p>|
)/g,"$1  ").replace(/]*>/gi," "),n=$("
").html(e);return n.find(o.removeSelectors.join(",")).remove(),n.text().replace(/\s+/g," ").trim()}function a(t){return t.substr(0,1).toUpperCase()+t.substr(1)}n.r(e),n.d(e,"truncate",(function(){return r})),n.d(e,"slug",(function(){return i})),n.d(e,"getPlainContent",(function(){return o})),n.d(e,"ucfirst",(function(){return a})),o.removeSelectors=["blockquote","script"]},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(0),i=n(17),o=n(5);function a(t){var e=t.tag;return("string"!=typeof e||"a"===e||"button"===e)&&("initAttrs"in e&&e.initAttrs(t.attrs),"isActive"in e?e.isActive(t.attrs):t.attrs.active)}var s=function(t){function e(){return t.apply(this,arguments)||this}return Object(r.a)(e,t),e.initAttrs=function(e){e.caretIcon=void 0!==e.caretIcon?e.caretIcon:"fas fa-sort",t.initAttrs.call(this,e),e.className+=" Dropdown--select"},e.prototype.getButtonContent=function(t){var e=t.find(a),n=e&&e.children||this.attrs.defaultLabel;return n instanceof Array&&(n=n[0]),[m("span",{className:"Button-label"},n),Object(o.a)(this.attrs.caretIcon,{className:"Button-caret"})]},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(31);function i(t,e,n){if(!e&&!n)return t;var i=e instanceof RegExp?e:new RegExp(e,"gi"),o=t,a=0;return n&&(e&&(a=Math.max(0,t.search(i)-n/2)),o=Object(r.truncate)(o,n,a)),o=$("
").text(o).html(),e&&(o=o.replace(i,"$&")),m.trust(o)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=null;function i(t,e){var n=e.text,i=e.selectionStart,o=e.selectionEnd,a=t.selectionStart,s=t.value.slice(0,a),u=t.value.slice(t.selectionEnd);if(null===r||!0===r){t.contentEditable="true";try{r=document.execCommand("insertText",!1,n)}catch(t){r=!1}t.contentEditable="false"}r&&!t.value.slice(0,t.selectionStart).endsWith(n)&&(r=!1),r||(t.value=s+n+u,t.dispatchEvent(new CustomEvent("input",{bubbles:!0,cancelable:!0}))),null!=i&&null!=o?t.setSelectionRange(i,o):t.setSelectionRange(a,t.selectionEnd)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)},i=function(){function t(t){this.callback=t,this.ticking=!1}var e=t.prototype;return e.loop=function(){var t=this;this.ticking||(r((function(){t.update(),t.ticking=!1})),this.ticking=!0)},e.update=function(){this.callback(window.pageYOffset)},e.start=function(){this.active||window.addEventListener("scroll",this.active=this.loop.bind(this),{passive:!0})},e.stop=function(){window.removeEventListener("scroll",this.active),this.active=null},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(0),i=function(t){function e(){return t.apply(this,arguments)||this}return Object(r.a)(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e),e.className=(e.className||"")+" Checkbox--switch"},e.prototype.getDisplay=function(){return this.attrs.loading?t.prototype.getDisplay.call(this):""},e}(n(45).a)},function(t,e,n){"use strict";e.a=function(t,e){return function(){e(this.getAttribute(t)||this[t])}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(11),i=function(){function t(t,e){this.component=void 0,this.routeName=void 0,this.component=t,this.routeName=e}var e=t.prototype;return e.makeKey=function(){return this.routeName+JSON.stringify(m.route.param())},e.makeAttrs=function(t){return Object(r.a)({},t.attrs,{routeName:this.routeName})},e.onmatch=function(t,e,n){return this.component},e.render=function(t){return[Object(r.a)({},t,{attrs:this.makeAttrs(t),key:this.makeKey()})]},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(0),i=n(1),o=n(21),a=n(4),s=n(26),u=function(t){function e(){return t.apply(this,arguments)||this}return Object(r.a)(e,t),e}(i.a);Object.assign(u.prototype,{title:i.a.attribute("title"),slug:i.a.attribute("slug"),createdAt:i.a.attribute("createdAt",i.a.transformDate),user:i.a.hasOne("user"),firstPost:i.a.hasOne("firstPost"),lastPostedAt:i.a.attribute("lastPostedAt",i.a.transformDate),lastPostedUser:i.a.hasOne("lastPostedUser"),lastPost:i.a.hasOne("lastPost"),lastPostNumber:i.a.attribute("lastPostNumber"),commentCount:i.a.attribute("commentCount"),replyCount:Object(o.a)("commentCount",(function(t){return Math.max(0,t-1)})),posts:i.a.hasMany("posts"),mostRelevantPost:i.a.hasOne("mostRelevantPost"),lastReadAt:i.a.attribute("lastReadAt",i.a.transformDate),lastReadPostNumber:i.a.attribute("lastReadPostNumber"),isUnread:Object(o.a)("unreadCount",(function(t){return!!t})),isRead:Object(o.a)("unreadCount",(function(t){return app.session.user&&!t})),hiddenAt:i.a.attribute("hiddenAt",i.a.transformDate),hiddenUser:i.a.hasOne("hiddenUser"),isHidden:Object(o.a)("hiddenAt",(function(t){return!!t})),canReply:i.a.attribute("canReply"),canRename:i.a.attribute("canRename"),canHide:i.a.attribute("canHide"),canDelete:i.a.attribute("canDelete"),removePost:function(t){var e=this.data.relationships,n=e&&e.posts;n&&n.data.some((function(e,r){if(t===e.id)return n.data.splice(r,1),!0}))},unreadCount:function(){var t=app.session.user;if(t&&t.markedAllAsReadAt()t?f():!0!==e&&(i=setTimeout(r?h:f,void 0===r?t-p:t)))}return"boolean"!=typeof e&&(r=n,n=e,e=void 0),u.cancel=function(){s(),o=!0},u}function i(t,e,n){return void 0===n?r(t,e,!1):r(t,n,!1!==e)}n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(11);function i(t,e,n){void 0===e&&(e=null),void 0===n&&(n={});var i=Object(r.a)({},n);i.state=i.state||{},i.state.key=Date.now(),m.route.set(t,e,i)}},function(t,e,n){"use strict";(function(e){t.exports=function(){if("object"==typeof globalThis)return globalThis;var t;try{t=this||new Function("return this")()}catch(t){if("object"==typeof window)return window;if("object"==typeof self)return self;if(void 0!==e)return e}return t}()}).call(this,n(50))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(){for(var t=arguments.length,e=new Array(t),n=0;n1?m("div",{className:"Form"},this.fields().toArray()):app.translator.trans("core.lib.edit_user.nothing_available"))},n.fields=function(){var t=this,e=new l.a;return app.session.user.canEditCredentials()&&(e.add("username",m("div",{className:"Form-group"},m("label",null,app.translator.trans("core.lib.edit_user.username_heading")),m("input",{className:"FormControl",placeholder:Object(u.a)(app.translator.trans("core.lib.edit_user.username_label")),bidi:this.username,disabled:this.nonAdminEditingAdmin()})),40),app.session.user!==this.attrs.user&&(e.add("email",m("div",{className:"Form-group"},m("label",null,app.translator.trans("core.lib.edit_user.email_heading")),m("div",null,m("input",{className:"FormControl",placeholder:Object(u.a)(app.translator.trans("core.lib.edit_user.email_label")),bidi:this.email,disabled:this.nonAdminEditingAdmin()})),!this.isEmailConfirmed()&&this.userIsAdmin(app.session.user)?m("div",null,o.a.component({className:"Button Button--block",loading:this.loading,onclick:this.activate.bind(this)},app.translator.trans("core.lib.edit_user.activate_button"))):""),30),e.add("password",m("div",{className:"Form-group"},m("label",null,app.translator.trans("core.lib.edit_user.password_heading")),m("div",null,m("label",{className:"checkbox"},m("input",{type:"checkbox",onchange:function(e){t.setPassword(e.target.checked),m.redraw.sync(),e.target.checked&&t.$("[name=password]").select(),e.redraw=!1},disabled:this.nonAdminEditingAdmin()}),app.translator.trans("core.lib.edit_user.set_password_label")),this.setPassword()?m("input",{className:"FormControl",type:"password",name:"password",placeholder:Object(u.a)(app.translator.trans("core.lib.edit_user.password_label")),bidi:this.password,disabled:this.nonAdminEditingAdmin()}):"")),20))),app.session.user.canEditGroups()&&e.add("groups",m("div",{className:"Form-group EditUserModal-groups"},m("label",null,app.translator.trans("core.lib.edit_user.groups_heading")),m("div",null,Object.keys(this.groups).map((function(t){return app.store.getById("groups",t)})).map((function(e){return m("label",{className:"checkbox"},m("input",{type:"checkbox",bidi:t.groups[e.id()],disabled:e.id()===s.a.ADMINISTRATOR_ID&&(t.attrs.user===app.session.user||!t.userIsAdmin(app.session.user))}),a.a.component({group:e,label:""})," ",e.nameSingular())})))),10),e.add("submit",m("div",{className:"Form-group"},o.a.component({className:"Button Button--primary",type:"submit",loading:this.loading},app.translator.trans("core.lib.edit_user.submit_button"))),-10),e},n.activate=function(){var t=this;this.loading=!0;var e={username:this.username(),isEmailConfirmed:!0};this.attrs.user.save(e,{errorHandler:this.onerror.bind(this)}).then((function(){t.isEmailConfirmed(!0),t.loading=!1,m.redraw()})).catch((function(){t.loading=!1,m.redraw()}))},n.data=function(){var t=this,e={relationships:{}};return this.attrs.user.canEditCredentials()&&!this.nonAdminEditingAdmin()&&(e.username=this.username(),app.session.user!==this.attrs.user&&(e.email=this.email()),this.setPassword()&&(e.password=this.password())),this.attrs.user.canEditGroups()&&(e.relationships.groups=Object.keys(this.groups).filter((function(e){return t.groups[e]()})).map((function(t){return app.store.getById("groups",t)}))),e},n.onsubmit=function(t){var e=this;t.preventDefault(),this.loading=!0,this.attrs.user.save(this.data(),{errorHandler:this.onerror.bind(this)}).then(this.hide.bind(this)).catch((function(){e.loading=!1,m.redraw()}))},n.nonAdminEditingAdmin=function(){return this.userIsAdmin(this.attrs.user)&&!this.userIsAdmin(app.session.user)},n.userIsAdmin=function(t){return t.groups().some((function(t){return t.id()===s.a.ADMINISTRATOR_ID}))},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(t,e,n){void 0===t&&(t={}),void 0===e&&(e=1),void 0===n&&(n=20),this.location=void 0,this.pageSize=void 0,this.pages=[],this.params={},this.initialLoading=!1,this.loadingPrev=!1,this.loadingNext=!1,this.params=t,this.location={page:e},this.pageSize=n}var e=t.prototype;return e.clear=function(){this.pages=[],m.redraw()},e.loadPrev=function(){var t=this;if(this.loadingPrev||1===this.getLocation().page)return Promise.resolve();this.loadingPrev=!0;var e=this.getPrevPageNumber();return this.loadPage(e).then(this.parseResults.bind(this,e)).finally((function(){return t.loadingPrev=!1}))},e.loadNext=function(){var t=this;if(this.loadingNext)return Promise.resolve();this.loadingNext=!0;var e=this.getNextPageNumber();return this.loadPage(e).then(this.parseResults.bind(this,e)).finally((function(){return t.loadingNext=!1}))},e.parseResults=function(t,e){var n,r=Number(t),i=(null==(n=e.payload)?void 0:n.links)||{},o={number:r,items:e,hasNext:!!i.next,hasPrev:!!i.prev};this.isEmpty()||r>this.getNextPageNumber()-1?this.pages.push(o):this.pages.unshift(o),this.location={page:r},m.redraw()},e.loadPage=function(t){void 0===t&&(t=1);var e=this.requestParams();return e.page={offset:this.pageSize*(t-1)},Array.isArray(e.include)&&(e.include=e.include.join(",")),app.store.find(this.type,e)},e.requestParams=function(){return this.params},e.refreshParams=function(t,e){if(this.isEmpty()||this.paramsChanged(t))return this.params=t,this.refresh(e)},e.refresh=function(t){var e=this;return void 0===t&&(t=1),this.initialLoading=!0,this.loadingPrev=!1,this.loadingNext=!1,this.clear(),this.location={page:t},this.loadPage().then((function(t){e.pages=[],e.parseResults(e.location.page,t)})).finally((function(){return e.initialLoading=!1}))},e.getPages=function(){return this.pages},e.getLocation=function(){return this.location},e.isLoading=function(){return this.initialLoading||this.loadingNext||this.loadingPrev},e.isInitialLoading=function(){return this.initialLoading},e.isLoadingPrev=function(){return this.loadingPrev},e.isLoadingNext=function(){return this.loadingNext},e.hasItems=function(){return!!this.getAllItems().length},e.isEmpty=function(){return!this.isInitialLoading()&&!this.hasItems()},e.hasPrev=function(){var t;return!(null==(t=this.pages[0])||!t.hasPrev)},e.hasNext=function(){var t;return!(null==(t=this.pages[this.pages.length-1])||!t.hasNext)},e.getParams=function(){return this.params},e.getNextPageNumber=function(){var t,e=null==(t=this.pages[this.pages.length-1])?void 0:t.number;return e&&!isNaN(e)?e+1:this.location.page},e.getPrevPageNumber=function(){var t,e=null==(t=this.pages[0])?void 0:t.number;return e&&!isNaN(e)?Math.max(e-1,1):this.location.page},e.paramsChanged=function(t){var e=this;return Object.keys(t).some((function(n){return e.getParams()[n]!==t[n]}))},e.getAllItems=function(){return this.getPages().map((function(t){return t.items})).flat()},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(11),i=n(0),o=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.view=function(){var t=this.attrs.state.modal;return m("div",{className:"ModalManager modal fade"},t?t.componentClass.component(Object(r.a)({},t.attrs,{animateShow:this.animateShow.bind(this),animateHide:this.animateHide.bind(this),state:this.attrs.state})):"")},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.$().on("hidden.bs.modal",this.attrs.state.close.bind(this.attrs.state))},n.animateShow=function(t){var e=!!this.attrs.state.modal.componentClass.isDismissible;this.$().hasClass("in")?t():this.$().one("shown.bs.modal",t).modal({backdrop:e||"static",keyboard:e}).modal("show")},n.animateHide=function(){this.$().modal("hide")},e}(n(3).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(0),i=n(3),o=(n(27),function(t){function e(){return t.apply(this,arguments)||this}Object(r.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.state=this.attrs.state},n.view=function(){var t=this;return m("div",{className:"AlertManager"},Object.entries(this.state.getActiveAlerts()).map((function(e){var n=e[0],r=e[1];return m("div",{className:"AlertManager-alert"},m(r.componentClass,Object.assign({},r.attrs,{ondismiss:t.state.dismiss.bind(t.state,n)}),r.children))})))},e}(i.a))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(0),i=function(t){function e(){return t.apply(this,arguments)||this}Object(r.a)(e,t);var n=e.prototype;return n.className=function(){return"RequestErrorModal Modal--large"},n.title=function(){return this.attrs.error.xhr?this.attrs.error.xhr.status+" "+this.attrs.error.xhr.statusText:""},n.content=function(){var t,e=this.attrs,n=e.error,r=e.formattedError;if(r)t=r.join("\n\n");else try{var i=n.response||JSON.parse(n.responseText);t=JSON.stringify(i,null,2)}catch(e){t=n.responseText}return m("div",{className:"Modal-body"},m("pre",null,this.attrs.error.options.method," ",this.attrs.error.options.url,m("br",null),m("br",null),t))},e}(n(13).a)},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function n(t,e){for(var n=0;n").addClass("drawer-backdrop fade").appendTo("body").click((function(){return t.hide()})),setTimeout((function(){return t.$backdrop.addClass("in")}))},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(38);function i(t,e){void 0===e&&(e="");var n={};for(var i in t){var o=t[i];if("resolver"in o)n[e+o.path]=o.resolver;else{if(!("component"in o))throw new Error("Either a resolver or a component must be provided for the route ["+i+"]");var a="resolverClass"in o?o.resolverClass:r.a;n[e+o.path]=new a(o.component,i)}}return n}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(25);function i(){$("[data-humantime]").each((function(){var t=$(this),e=Object(r.a)(t.attr("datetime"));t.html(e)}))}function o(){setInterval(i,1e4)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(0),i=function(t){function e(){return t.apply(this,arguments)||this}return Object(r.a)(e,t),e.prototype.apiEndpoint=function(){return"/"},e}(n(1).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(0),i=n(1),o=n(70),a=n(4),s=n(21),u=n(29),l=function(t){function e(){return t.apply(this,arguments)||this}return Object(r.a)(e,t),e}(i.a);Object.assign(l.prototype,{username:i.a.attribute("username"),slug:i.a.attribute("slug"),displayName:i.a.attribute("displayName"),email:i.a.attribute("email"),isEmailConfirmed:i.a.attribute("isEmailConfirmed"),password:i.a.attribute("password"),avatarUrl:i.a.attribute("avatarUrl"),preferences:i.a.attribute("preferences"),groups:i.a.hasMany("groups"),joinTime:i.a.attribute("joinTime",i.a.transformDate),lastSeenAt:i.a.attribute("lastSeenAt",i.a.transformDate),markedAllAsReadAt:i.a.attribute("markedAllAsReadAt",i.a.transformDate),unreadNotificationCount:i.a.attribute("unreadNotificationCount"),newNotificationCount:i.a.attribute("newNotificationCount"),discussionCount:i.a.attribute("discussionCount"),commentCount:i.a.attribute("commentCount"),canEdit:i.a.attribute("canEdit"),canEditCredentials:i.a.attribute("canEditCredentials"),canEditGroups:i.a.attribute("canEditGroups"),canDelete:i.a.attribute("canDelete"),avatarColor:null,color:Object(s.a)("displayName","avatarUrl","avatarColor",(function(t,e,n){return n?"rgb("+n.join(", ")+")":e?(this.calculateAvatarColor(),""):"#"+Object(o.a)(t)})),isOnline:function(){return dayjs().subtract(5,"minutes").isBefore(this.lastSeenAt())},badges:function(){var t=new a.a,e=this.groups();return e&&e.forEach((function(e){t.add("group"+e.id(),u.a.component({group:e}))})),t},calculateAvatarColor:function(){var t=new Image,e=this;t.onload=function(){var t=new ColorThief;e.avatarColor=t.getColor(this),e.freshness=new Date,m.redraw()},t.crossOrigin="anonymous",t.src=this.avatarUrl()},savePreferences:function(t){var e=this.preferences();return Object.assign(e,t),this.save({preferences:e})}})},function(t,e,n){"use strict";function r(t){for(var e=0,n=0;n3&&void 0!==arguments[3]?arguments[3]:[];if(!e)return i;if(1===r)return i.push(e),i;var o=e.indexOf(n);if(-1===o)return i.push(e),i;var a=e.substring(0,o).trim(),s=e.substring(o+n.length+1).trim();return i.push(a),t(s,n,r-1,i)}(t.slice(1,-1),",",3)}function N(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 O(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0,i=w(e),o=i.args,a=i.cases,s=parseInt(t);o.forEach((function(t){t.startsWith("offset:")&&(s-=parseInt(t.slice("offset:".length)))}));var u=[];1===s&&u.push("one"),u.push("=".concat(s),"other");for(var l=0;l1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0,i=w(e),o=i.cases;return t in o?r(o[t],n):"other"in o?r(o.other,n):t}function j(t,e,n){return"<".concat(t,">").concat(n,"")}function k(t,e,n){var r=[];return A(t,0,0,r,(function(i,o,a,s,u,l){if(o)return{break:!0};var c=function(t,e,n,r){var i,o=1;return A(t,n,r,[],(function(t,n,r,a,s,u){if(r===e&&(n?o--:o++,0===o))return i={segmentIndex:a,segmentStart:u,segmentEnd:s},{exit:!0};return{exit:!1}})),i}(t,a,s,u);if(!c)throw new Error("Unbalanced tags: no closing tag found for <".concat(a,">"));var d=c.segmentIndex===s,p=t[c.segmentIndex],f=[];if(d)f.push(i.slice(u+1,c.segmentStart));else{f.push(i.slice(u+1));for(var h=s+1;h"===s[p]){var f=s.slice(l+1+u,p),h=i(s,u,f,a,p,l);if(h.exit)return;if(h.newSegmentIndex&&(a=h.newSegmentIndex),h.processedSegment&&(d=!0),h.break)break;u=!1,l=null,c=!1}else c&&(o=s[p],!/[a-zA-Z-_]/.test(o))&&(u=!1,l=null,c=!1);else l=p,c=!0,"/"===s[p+1]&&(u=!0,p++);d||r.push(s)}else r.push(s)}}function D(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=p()(t);if(e){var i=p()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return c()(this,n)}}var P=function(t){u()(n,t);var e=D(n);function n(t){var r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return i()(this,n),(r=e.call(this,t,o)).richHandler=a||j,r}return a()(n,[{key:"rich",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=y(this.process(t,e));return k(n,e,this.richHandler)}}]),n}(function(){function t(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i()(this,t),v()(this,"format",b((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return y(n.process(t,e)).join("")}))),this.locale=e,this.typeHandlers=r}return a()(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=x(t,n);if(-1===r)throw new Error('Unbalanced curly braces in string: "'.concat(t,'"'));var i=t.substring(n,r+1);if(i){var o=[],a=t.substring(0,n);a&&o.push(a);var s=T(i),u=h()(s,3),l=u[0],c=u[1],d=u[2],p=e[l];null==p&&(p="");var f=c&&this.typeHandlers[c];o.push(f?f(p,d,this.locale,e,this.process.bind(this)):p);var m=t.substring(r+1);return m&&o.push(this.process(m,e)),o}}return[t]}}]),t}());function I(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 $(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function A(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=n).toggleClass("scrolled",t>n),$(".App-header").toggleClass("navbar-fixed-top",t>=n)}));n.start(),n.update(),$((function(){$("body").addClass("ontouchstart"in window?"touch":"no-touch")})),Object(v.a)()},e.preloadedApiDocument=function(){if(this.data.apiDocument&&window.location.href===this.initialRoute){var t=this.store.pushPayload(this.data.apiDocument);return this.data.apiDocument=null,t}return null},e.screen=function(){return getComputedStyle(document.documentElement).getPropertyValue("--flarum-screen")},e.setTitle=function(t){this.title=t,this.updateTitle()},e.setTitleCount=function(t){this.titleCount=t,this.updateTitle()},e.updateTitle=function(){var t=this.titleCount?"("+this.titleCount+") ":"",e=this.title&&m.route.get()!==this.forum.attribute("basePath")+"/"?this.title+" - ":"",n=this.forum.attribute("title");document.title=t+e+n},e.request=function(t){var e=this,n=Object.assign({},t);if(n.background=n.background||!0,Object(y.extend)(n,"config",(function(t,n){return n.setRequestHeader("X-CSRF-Token",e.session.csrfToken)})),"GET"!==n.method&&"POST"!==n.method){var r=n.method;Object(y.extend)(n,"config",(function(t,e){return e.setRequestHeader("X-HTTP-Method-Override",r)})),n.method="POST"}n.deserialize=n.deserialize||function(t){return t},n.errorHandler=n.errorHandler||function(t){throw t};var o=n.extract;return n.extract=function(t){var e;e=o?o(t.responseText):t.responseText||null;var r=t.status;if(r<200||r>299)throw new h.a(r,e,n,t);if(t.getResponseHeader){var i=t.getResponseHeader("X-CSRF-Token");i&&(app.session.csrfToken=i)}try{return JSON.parse(e)}catch(r){throw new h.a(500,e,n,t)}},this.requestErrorAlert&&this.alerts.dismiss(this.requestErrorAlert),m.request(n).then((function(t){return t}),(function(t){var r;switch(t.status){case 422:r=t.response.errors.map((function(t){return[t.detail,m("br",null)]})).reduce((function(t,e){return t.concat(e)}),[]).slice(0,-1);break;case 401:case 403:r=app.translator.trans("core.lib.error.permission_denied_message");break;case 404:case 410:r=app.translator.trans("core.lib.error.not_found_message");break;case 429:r=app.translator.trans("core.lib.error.rate_limit_exceeded_message");break;default:r=app.translator.trans("core.lib.error.generic_message")}var o=app.forum.attribute("debug"),a=t.response&&t.response.errors,s=Array.isArray(a)&&a[0]&&a[0].detail&&a.map((function(t){return decodeURI(t.detail)}));t.alert={type:"error",content:r,controls:o&&[m(i.a,{className:"Button Button--link",onclick:e.showDebug.bind(e,t,s)},"Debug")]};try{n.errorHandler(t)}catch(t){if(o&&t.xhr){var u,l=t.options,c=l.method,d=l.url,p=t.xhr.status,f=void 0===p?"":p;console.group(c+" "+d+" "+f),(u=console).error.apply(u,s||[t]),console.groupEnd()}e.requestErrorAlert=e.alerts.show(t.alert,t.alert.content)}return Promise.reject(t)}))},e.showDebug=function(t,e){this.alerts.dismiss(this.requestErrorAlert),this.modal.show(s.a,{error:t,formattedError:e})},e.route=function(t,e){void 0===e&&(e={});var n=this.routes[t];if(!n)throw new Error("Route '"+t+"' does not exist");var r=n.path.replace(/:([^\/]+)/g,(function(t,n){return Object(d.a)(e,n)}));for(var i in e)e.hasOwnProperty(i)&&!e[i]&&delete e[i];var o=m.buildQueryString(e);return(""===m.route.prefix?this.forum.attribute("basePath"):"")+r+(o?"?"+o:"")},t}()},function(t,e,n){"use strict";function r(t,e){var n="select"===t.tag?t.attrs.multi?"multi":"select":t.attrs.type;return t.attrs.onchange="multi"===n?function(){e([].slice.call(this.selectedOptions,(function(t){return t.value})))}:"select"===n?function(t){e(this.selectedOptions[0].value)}:"checkbox"===n?function(t){e(this.checked)}:t.attrs.oninput=function(t){e(this.value)},"select"===t.tag?t.children.forEach((function(t){t.attrs.value!==e()&&t.children[0]!==e()||(t.attrs.selected=!0)})):"checkbox"===n?t.attrs.checked=e():"radio"===n?t.attrs.checked=e()===t.attrs.value:t.attrs.value=e(),t.attrs.bidi=null,t}n.d(e,"a",(function(){return o})),r.view=function(t,e,n){return r(e,e.attrs.bidi)};var i=r;function o(t){var e=t.m,n=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o=0&&(m+=t.slice(n,a)),d>=0&&(m+=(n<0?"?":"&")+c.slice(d,f));var g=r(l);return g&&(m+=(n<0&&d<0?"?":"&")+g),o>=0&&(m+=t.slice(o)),p>=0&&(m+=(o<0?"":"&")+c.slice(p)),m}},function(t,e,n){"use strict";var r=n(100);t.exports=function(t){var e=t.indexOf("?"),n=t.indexOf("#"),i=n<0?t.length:n,o=e<0?i:e,a=t.slice(0,o).replace(/\/{2,}/g,"/");return a?("/"!==a[0]&&(a="/"+a),a.length>1&&"/"===a[a.length-1]&&(a=a.slice(0,-1))):a="/",{path:a,params:e<0?{}:r(t.slice(e+1,i))}}},function(t,e,n){"use strict";function r(t){return t>=1e6?Math.floor(t/1e6)+app.translator.trans("core.lib.number_suffix.mega_text"):t>=1e3?(t/1e3).toFixed(1)+app.translator.trans("core.lib.number_suffix.kilo_text"):t.toString()}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n(0),i=n(3),o=n(4),a=n(6),s=n(2),u=n(44),l=n(23),c=function(t){function e(){return t.apply(this,arguments)||this}Object(r.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.value=this.attrs.value||"",this.disabled=!!this.attrs.disabled},n.view=function(){return m("div",{className:"TextEditor"},m("div",{className:"TextEditor-editorContainer"}),m("ul",{className:"TextEditor-controls Composer-footer"},Object(a.a)(this.controlItems().toArray()),m("li",{className:"TextEditor-toolbar"},this.toolbarItems().toArray())))},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.attrs.composer.editor=this.buildEditor(this.$(".TextEditor-editorContainer")[0])},n.onupdate=function(e){t.prototype.onupdate.call(this,e);var n=!!this.attrs.disabled;this.disabled!==n&&(this.disabled=n,this.attrs.composer.editor.disabled(n))},n.buildEditorParams=function(){var t=this;return{classNames:["FormControl","Composer-flexible","TextEditor-editor"],disabled:this.disabled,placeholder:this.attrs.placeholder||"",value:this.value,oninput:this.oninput.bind(this),inputListeners:[],onsubmit:function(){t.onsubmit(),m.redraw()}}},n.buildEditor=function(t){return new u.a(t,this.buildEditorParams())},n.controlItems=function(){var t=new o.a;return t.add("submit",s.a.component({icon:"fas fa-paper-plane",className:"Button Button--primary",itemClassName:"App-primaryControl",onclick:this.onsubmit.bind(this)},this.attrs.submitLabel)),this.attrs.preview&&t.add("preview",m(l.a,{text:app.translator.trans("core.forum.composer.preview_tooltip")},m(s.a,{icon:"far fa-eye",className:"Button Button--icon",onclick:this.attrs.preview}))),t},n.toolbarItems=function(){return new o.a},n.oninput=function(t){this.value=t,this.attrs.onchange(this.value)},n.onsubmit=function(){this.attrs.onsubmit(this.value)},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=/[.*+?^${}()|[\]\\]/g;function i(t){return t.replace(r,"\\$&")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(0),i=n(17),o=n(2),a=n(5),s=function(t){function e(){return t.apply(this,arguments)||this}Object(r.a)(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e),e.className+=" Dropdown--split",e.menuClassName+=" Dropdown-menu--right"};var n=e.prototype;return n.getButton=function(t){var e=this.getFirstChild(t),n=Object.assign({},e.attrs);return n.className=(n.className||"")+" SplitDropdown-button Button "+this.attrs.buttonClassName,[o.a.component(n,e.children),m("button",{className:"Dropdown-toggle Button Button--icon "+this.attrs.buttonClassName,"aria-haspopup":"menu","aria-label":this.attrs.accessibleToggleLabel,"data-toggle":"dropdown"},Object(a.a)(this.attrs.icon,{className:"Button-icon"}),Object(a.a)("fas fa-caret-down",{className:"Button-caret"}))]},n.getFirstChild=function(t){for(var e=t;e instanceof Array;)e=e[0];return e},e}(i.a)},function(t,e,n){"use strict";function r(t,e){var n=$(window),r=$(t).offset().top-n.scrollTop();e(),n.scrollTop($(t).offset().top-r)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(5);function i(t){if(t.lastSeenAt()&&t.isOnline())return m("span",{className:"UserOnline"},Object(r.a)("fas fa-circle"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(24),i=n.n(r);function o(t){var e=i()(t),n=e.format(),r=e.format("LLLL");return m("time",{pubdate:!0,datetime:n},r)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(19),i=n(0),o=n(3),a=n(5),s=n(37),u=n(7),l=function(t){function e(){return t.apply(this,arguments)||this}return Object(i.a)(e,t),e.prototype.view=function(){var t=this.attrs,e=t.options,n=t.onchange,i=t.value,o=t.disabled,l=t.className,c=t.class,d=t.wrapperAttrs,p=(d=void 0===d?{}:d).className,f=d.class,h=Object(r.a)(d,["className","class"]),g=Object(r.a)(t,["options","onchange","value","disabled","className","class","wrapperAttrs"]);return m("span",Object.assign({className:Object(u.a)("Select",p,f)},h),m("select",Object.assign({className:Object(u.a)("Select-input FormControl",l,c),onchange:n?Object(s.a)("value",n.bind(this)):void 0,value:i,disabled:o},g),Object.keys(e).map((function(t){return m("option",{value:t},e[t])}))),Object(a.a)("fas fa-sort",{className:"Select-caret"}))},e}(o.a)},function(t,e,n){"use strict";function r(t){if(2===t.length)return app.translator.trans("core.lib.series.two_text",{first:t[0],second:t[1]});if(t.length>=3){var e=t.slice(1,t.length-1).reduce((function(t,e){return t.concat([e,app.translator.trans("core.lib.series.glue_text")])}),[]).slice(0,-1);return app.translator.trans("core.lib.series.three_text",{first:t[0],second:e,third:t[t.length-1]})}return t}n.d(e,"a",(function(){return r}))},function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.default=t.exports,t.exports.__esModule=!0,n(e)}t.exports=n,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";function r(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";var r=n(28),i=n(93),o=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g,a={},s={}.hasOwnProperty;function u(t){for(var e in t)if(s.call(t,e))return!1;return!0}function l(t){for(var e,n="div",r=[],i={};e=o.exec(t);){var s=e[1],u=e[2];if(""===s&&""!==u)n=u;else if("#"===s)i.id=u;else if("."===s)r.push(u);else if("["===e[3][0]){var l=e[6];l&&(l=l.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\")),"class"===e[4]?r.push(l):i[e[4]]=""===l?l:l||!0}}return r.length>0&&(i.className=r.join(" ")),a[t]={tag:n,attrs:i}}function c(t,e){var n=e.attrs,i=r.normalizeChildren(e.children),o=s.call(n,"class"),a=o?n.class:n.className;if(e.tag=t.tag,e.attrs=null,e.children=void 0,!u(t.attrs)&&!u(n)){var l={};for(var c in n)s.call(n,c)&&(l[c]=n[c]);n=l}for(var c in t.attrs)s.call(t.attrs,c)&&"className"!==c&&!s.call(n,c)&&(n[c]=t.attrs[c]);for(var c in null==a&&null==t.attrs.className||(n.className=null!=a?null!=t.attrs.className?String(t.attrs.className)+" "+String(a):a:null!=t.attrs.className?t.attrs.className:null),o&&(n.class=null),n)if(s.call(n,c)&&"key"!==c){e.attrs=n;break}return Array.isArray(i)&&1===i.length&&null!=i[0]&&"#"===i[0].tag?e.text=i[0].children:e.children=i,e}t.exports=function(t){if(null==t||"string"!=typeof t&&"function"!=typeof t&&"function"!=typeof t.view)throw Error("The selector must be either a string or a component.");var e=i.apply(1,arguments);return"string"==typeof t&&(e.children=r.normalizeChildren(e.children),"["!==t)?c(a[t]||l(t),e):(e.tag=t,e)}},function(t,e,n){"use strict";var r=n(28);t.exports=function(){var t,e=arguments[this],n=this+1;if(null==e?e={}:("object"!=typeof e||null!=e.tag||Array.isArray(e))&&(e={},n=this),arguments.length===n+1)t=arguments[n],Array.isArray(t)||(t=[t]);else for(t=[];n0||t(n)}}var r=n(s);try{t(n(a),r)}catch(t){r(t)}}d(n)};n.prototype.then=function(t,e){var r,i,o=this._instance;function a(t,e,n,a){e.push((function(e){if("function"!=typeof t)n(e);else try{r(t(e))}catch(t){i&&i(t)}})),"function"==typeof o.retry&&a===o.state&&o.retry()}var s=new n((function(t,e){r=t,i=e}));return a(t,o.resolvers,r,!0),a(e,o.rejectors,i,!1),s},n.prototype.catch=function(t){return this.then(null,t)},n.prototype.finally=function(t){return this.then((function(e){return n.resolve(t()).then((function(){return e}))}),(function(e){return n.resolve(t()).then((function(){return n.reject(e)}))}))},n.resolve=function(t){return t instanceof n?t:new n((function(e){e(t)}))},n.reject=function(t){return new n((function(e,n){n(t)}))},n.all=function(t){return new n((function(e,n){var r=t.length,i=0,o=[];if(0===t.length)e([]);else for(var a=0;a=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n(118),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(50))},function(t,e,n){"use strict";t.exports=n(120)(window)},function(t,e,n){"use strict";t.exports=function(t){if("[object Object]"!==Object.prototype.toString.call(t))return"";var e=[];for(var n in t)r(n,t[n]);return e.join("&");function r(t,n){if(Array.isArray(n))for(var i=0;i-1&&u.pop();for(var c=0;c` component exposed by flarum/core instead. `$.tooltip` may be removed in a future version of Flarum.\n\nIf this component doesn't meet your requirements, please open an issue: https://github.com/flarum/core/issues/new?assignees=davwheat&labels=type/bug,needs-verification&template=bug-report.md&title=Tooltip%20component%20unsuitable%20for%20use%20case"),p.bind(this)(t)}},function(t,e,n){t.exports=function(){"use strict";return function(t,e,n){t=t||{};var r=e.prototype,i={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function o(t,e,n,i){return r.fromToBase(t,e,n,i)}n.en.relativeTime=i,r.fromToBase=function(e,r,o,a,s){for(var u,l,c,d=o.$locale().relativeTime||i,p=t.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],f=p.length,h=0;h0,g<=m.r||!m.r){g<=1&&h>0&&(m=p[h-1]);var v=d[m.l];s&&(g=s(""+g)),l="string"==typeof v?v.replace("%d",g):v(g,r,m.l,c);break}}if(r)return l;var y=c?d.future:d.past;return"function"==typeof y?y(l):y.replace("%s",l)},r.to=function(t,e){return o(t,e,this,!0)},r.from=function(t,e){return o(t,e,this)};var a=function(t){return t.$u?n.utc():n()};r.toNow=function(t){return this.to(a(this),t)},r.fromNow=function(t){return this.from(a(this),t)}}}()},function(t,e,n){t.exports=function(){"use strict";var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(e,n,r){var i=n.prototype,o=i.format;r.en.formats=t,i.format=function(e){void 0===e&&(e="YYYY-MM-DDTHH:mm:ssZ");var n=this.$locale().formats,r=function(e,n){return e.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(e,r,i){var o=i&&i.toUpperCase();return r||n[i]||t[i]||n[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(t,e,n){return e||n.slice(1)}))}))}(e,void 0===n?{}:n);return o.call(this,r)}}}()},function(t,e,n){!function(){var e=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"],n="undefined"!=typeof window,r=n&&null!=window.mozInnerScreenX;function i(t,i,o){if(!n)throw new Error("textarea-caret-position#getCaretCoordinates should only be called in a browser");var a=o&&o.debug||!1;if(a){var s=document.querySelector("#input-textarea-caret-position-mirror-div");s&&s.parentNode.removeChild(s)}var u=document.createElement("div");u.id="input-textarea-caret-position-mirror-div",document.body.appendChild(u);var l=u.style,c=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,d="INPUT"===t.nodeName;l.whiteSpace="pre-wrap",d||(l.wordWrap="break-word"),l.position="absolute",a||(l.visibility="hidden"),e.forEach((function(t){d&&"lineHeight"===t?l.lineHeight=c.height:l[t]=c[t]})),r?t.scrollHeight>parseInt(c.height)&&(l.overflowY="scroll"):l.overflow="hidden",u.textContent=t.value.substring(0,i),d&&(u.textContent=u.textContent.replace(/\s/g," "));var p=document.createElement("span");p.textContent=t.value.substring(i)||".",u.appendChild(p);var f={top:p.offsetTop+parseInt(c.borderTopWidth),left:p.offsetLeft+parseInt(c.borderLeftWidth),height:parseInt(c.lineHeight)};return a?p.style.backgroundColor="#aaa":document.body.removeChild(u),f}void 0!==t.exports?t.exports=i:n&&(window.getCaretCoordinates=i)}()},function(t,e,n){"use strict";t.exports=n(134)},function(t,e,n){var r=n(135);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){var r=n(136).default,i=n(137);t.exports=function(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?i(t):e},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){var r=n(138),i=n(139),o=n(140),a=n(142);t.exports=function(t,e){return r(t)||i(t,e)||o(t,e)||a()},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";var r={};n.r(r),n.d(r,"throttle",(function(){return S.b})),n.d(r,"debounce",(function(){return S.a}));var i=n(40),o=n(64),a=n(63),s=n(44),u={handlers:null,getHandlers:function(t){return this.handlers=this.handlers||{},this.handlers[t]=this.handlers[t]||[],this.handlers[t]},trigger:function(t){for(var e=this,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i1}function y(t,e){return Array(e+1).join(t)}function b(t,e,n){for(var r=e,i=n?/\n/:/\s/;t[r]&&!t[r].match(i);)r++;return r}function w(t){var e,n,r=t.value.slice(0,t.selectionStart),i=t.value.slice(t.selectionEnd),o=r.match(/\n*$/),a=i.match(/^\n*/),s=o?o[0].length:0,u=a?a[0].length:0;return r.match(/\S/)&&s<2&&(e=y("\n",2-s)),i.match(/\S/)&&u<2&&(n=y("\n",2-u)),null==e&&(e=""),null==n&&(n=""),{newlinesToAppend:e,newlinesToPrepend:n}}var x=n(65),T=n(85),N=n(48),O=n(81),E=n(83),_=n(31),S=n(51),C=n(9),j=n(54),k=n(52),A=n(14),D=n(35),P=n(70),I=n(42),L=n(76),M=n(73),R=n(7),B=n(8),H=n(77),q=n(66),F=n(37),U=n(72),W=n(69),z=n(71),G=n(39),V=n(10),Y=n(68),K=n(3),X=n(74),J=n(59),Q=n(30),Z=n(36),tt=n(26),et=n(15),nt=n(55),rt=n(22),it=n(17),ot=n(84),at=n(60),st=n(41),ut=n(88),lt=n(49),ct=n(27),dt=n(12),pt=n(16),ft=n(45),ht=n(32),mt=n(58),gt=n(2),vt=n(13),yt=n(29),bt=n(82),wt=n(23),xt=function(t){function e(){return t.apply(this,arguments)||this}return Object(d.a)(e,t),e.prototype.view=function(e){var n=t.prototype.view.call(this,e),r=n.attrs.title;return delete n.attrs.title,m(wt.a,{text:r},n)},e.initAttrs=function(e){t.initAttrs.call(this,e),e.className=e.className||"Button Button--icon Button--link"},e}(gt.a),Tt=n(56),Nt=n(1),Ot=n(75),Et=n(87),_t=n(18),St=n(5),Ct=n(43),jt=n(89),kt=n(33),At=n(20),Dt=n(86),Pt=n(6),It=function(){function t(){this.element=void 0}var e=t.prototype;return e.$=function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){var e=$(this.element);return t?e.find(t):e})),e.render=function(){var t=this,e=this.view();e.attrs=e.attrs||{};var n=e.attrs.oncreate;return e.attrs.oncreate=function(e){t.element=e.dom,n&&n.apply(t,[e])},e},t}(),$t=n(38),Lt=n(57);e.a={extend:i,Session:o.a,Store:a.a,"utils/BasicEditorDriver":s.a,"utils/evented":u,"utils/liveHumanTimes":l.a,"utils/ItemList":c.a,"utils/mixin":function(t){for(var e=function(t){function e(){return t.apply(this,arguments)||this}return Object(d.a)(e,t),e}(t),n=arguments.length,r=new Array(n>1?n-1:0),i=1;i0?a+"\n":i,g=v(h)&&s.length>0?"\n"+s:o;if(l){var y=t.value[t.selectionStart-1];0===t.selectionStart||null==y||y.match(/\s/)||(m=" "+m)}h=function(t,e,n,r){void 0===r&&(r=!1);if(t.selectionStart===t.selectionEnd)t.selectionStart=function(t,e){var n=e;for(;t[n]&&null!=t[n-1]&&!t[n-1].match(/\s/);)n--;return n}(t.value,t.selectionStart),t.selectionEnd=b(t.value,t.selectionEnd,r);else{var i=t.selectionStart-e.length,o=t.selectionEnd+n.length,a=t.value.slice(i,t.selectionStart)===e,s=t.value.slice(t.selectionEnd,o)===n;a&&s&&(t.selectionStart=i,t.selectionEnd=o)}return t.value.slice(t.selectionStart,t.selectionEnd)}(t,m,g,e.multiline);var x=t.selectionStart,T=t.selectionEnd,N=u.length>0&&g.indexOf(u)>-1&&h.length>0;if(d){var O=w(t);n=O.newlinesToAppend,r=O.newlinesToPrepend,m=n+i,g+=r}if(h.startsWith(m)&&h.endsWith(g)){var E=h.slice(m.length,h.length-g.length);if(p===f){var _=p-m.length;_=Math.max(_,x),_=Math.min(_,x+E.length),x=T=_}else T=x+E.length;return{text:E,selectionStart:x,selectionEnd:T}}if(N){if(c.length>0&&h.match(c)){g=g.replace(u,h);var S=m+g;return x=T=x+m.length,{text:S,selectionStart:x,selectionEnd:T}}var C=m+h+g;return x=x+m.length+h.length+g.indexOf(u),T=x+u.length,{text:C,selectionStart:x,selectionEnd:T}}var j=m+h+g;x=p+m.length,T=f+m.length;var k=h.match(/^\s*|\s*$/g);if(e.trimFirst&&k){var A=k[0]||"",D=k[1]||"";j=A+m+h.trim()+g+D,x+=A.length,T-=D.length}return{text:j,selectionStart:x,selectionEnd:T}}(t,e),Object(h.a)(t,n)},"utils/Drawer":x.a,"utils/anchorScroll":T.a,"utils/RequestError":N.a,"utils/abbreviateNumber":O.a,"utils/string":_,"utils/SubtreeRetainer":j.a,"utils/escapeRegExp":E.a,"utils/extract":A.a,"utils/ScrollListener":D.a,"utils/stringToColor":P.a,"utils/Stream":C.a,"utils/subclassOf":I.a,"utils/setRouteWithForcedRefresh":k.a,"utils/patchMithril":L.a,"utils/proxifyCompat":M.a,"utils/classList":R.a,"utils/extractText":B.a,"utils/formatNumber":H.a,"utils/mapRoutes":q.a,"utils/withAttr":F.a,"utils/throttleDebounce":r,"models/Notification":U.a,"models/User":W.a,"models/Post":z.a,"models/Discussion":G.a,"models/Group":V.a,"models/Forum":Y.a,Component:K.a,Fragment:It,Translator:X.a,"components/AlertManager":J.a,"components/Page":Q.a,"components/Switch":Z.a,"components/Badge":tt.a,"components/LoadingIndicator":et.a,"components/Placeholder":nt.a,"components/Separator":rt.a,"components/Dropdown":it.a,"components/SplitDropdown":ot.a,"components/RequestErrorModal":at.a,"components/FieldSet":st.a,"components/Select":ut.a,"components/Navigation":lt.a,"components/Alert":ct.a,"components/Link":dt.a,"components/LinkButton":pt.a,"components/Checkbox":ft.a,"components/SelectDropdown":ht.a,"components/ModalManager":mt.a,"components/Button":gt.a,"components/Modal":vt.a,"components/GroupBadge":yt.a,"components/TextEditor":bt.a,"components/TextEditorButton":xt,"components/Tooltip":wt.a,"components/EditUserModal":Tt.a,Model:Nt.a,Application:Ot.a,"helpers/fullTime":Et.a,"helpers/avatar":_t.a,"helpers/icon":St.a,"helpers/humanTime":Ct.a,"helpers/punctuateSeries":jt.a,"helpers/highlight":kt.a,"helpers/username":At.a,"helpers/userOnline":Dt.a,"helpers/listItems":Pt.a,"resolvers/DefaultResolver":$t.a,"states/PaginatedListState":Lt.a}},function(t,e,n){var r=n(111),i=n(53);void 0===i.$&&(i.$=r),void 0===i.jQuery&&(i.jQuery=r),t.exports=r},function(t,e,n){var r; +flarum.core=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=152)}([function(t,e,n){"use strict";function r(t,e){return(r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function i(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,r(t,e)}n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e=null),this.data=t,this.freshness=new Date,this.exists=!1,this.store=e}var e=t.prototype;return e.id=function(){return this.data.id},e.attribute=function(t){return this.data.attributes[t]},e.pushData=function(e){for(var n in e)if("object"==typeof e[n])for(var r in this.data[n]=this.data[n]||{},e[n])e[n][r]instanceof t&&(e[n][r]={data:t.getIdentifier(e[n][r])}),this.data[n][r]=e[n][r];else this.data[n]=e[n];this.freshness=new Date},e.pushAttributes=function(t){this.pushData({attributes:t})},e.save=function(e,n){var r=this;void 0===n&&(n={});var i={type:this.data.type,id:this.data.id,attributes:e};if(e.relationships){for(var o in i.relationships={},e.relationships){var a=e.relationships[o];i.relationships[o]={data:a instanceof Array?a.map(t.getIdentifier):t.getIdentifier(a)}}delete e.relationships}var s=this.copyData();this.pushData(i);var l={data:i};return n.meta&&(l.meta=n.meta),app.request(Object.assign({method:this.exists?"PATCH":"POST",url:app.forum.attribute("apiUrl")+this.apiEndpoint(),body:l},n)).then((function(t){return r.store.data[t.data.type]=r.store.data[t.data.type]||{},r.store.data[t.data.type][t.data.id]=r,r.store.pushPayload(t)}),(function(t){throw r.pushData(s),m.redraw(),t}))},e.delete=function(t,e){var n=this;return void 0===e&&(e={}),this.exists?app.request(Object.assign({method:"DELETE",url:app.forum.attribute("apiUrl")+this.apiEndpoint(),body:t},e)).then((function(){n.exists=!1,n.store.remove(n)})):Promise.resolve()},e.apiEndpoint=function(){return"/"+this.data.type+(this.exists?"/"+this.data.id:"")},e.copyData=function(){return JSON.parse(JSON.stringify(this.data))},t.attribute=function(t,e){return function(){var n=this.data.attributes&&this.data.attributes[t];return e?e(n):n}},t.hasOne=function(t){return function(){if(this.data.relationships){var e=this.data.relationships[t];if(e)return app.store.getById(e.data.type,e.data.id)}return!1}},t.hasMany=function(t){return function(){if(this.data.relationships){var e=this.data.relationships[t];if(e)return e.data.map((function(t){return app.store.getById(t.type,t.id)}))}return!1}},t.transformDate=function(t){return t?new Date(t):null},t.getIdentifier=function(t){return{type:t.data.type,id:t.data.id}},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n(0),i=n(3),o=n(5),a=n(7),s=n(14),l=n(8),u=n(15),c=function(t){function e(){return t.apply(this,arguments)||this}Object(r.a)(e,t);var n=e.prototype;return n.view=function(t){var e=Object.assign({},this.attrs);e.type=e.type||"button",e.title&&!t.children&&(e["aria-label"]=e.title),"object"==typeof e.title&&(e.title=Object(l.a)(e.title)),!e.title&&t.children&&(e.title=Object(l.a)(t.children));var n=Object(s.a)(e,"icon"),r=Object(s.a)(e,"loading");return(e.disabled||r)&&delete e.onclick,e.className=Object(a.a)([e.className,n&&"hasIcon",(e.disabled||r)&&"disabled",r&&"loading"]),m("button",e,this.getButtonContent(t.children))},n.getButtonContent=function(t){var e=this.attrs.icon;return[e&&!0!==e?Object(o.a)(e,{className:"Button-icon"}):"",t?m("span",{className:"Button-label"},t):"",this.attrs.loading?m(u.a,{size:"small",display:"inline"}):""]},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(){this.element=void 0,this.attrs=void 0}var e=t.prototype;return e.oninit=function(t){this.setAttrs(t.attrs)},e.oncreate=function(t){this.element=t.dom},e.onbeforeupdate=function(t){this.setAttrs(t.attrs)},e.onupdate=function(t){},e.onbeforeremove=function(t){},e.onremove=function(t){},e.$=function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){var e=$(this.element);return t?e.find(t):e})),t.component=function(t,e){void 0===t&&(t={}),void 0===e&&(e=null);var n=Object.assign({},t);return m(this,n,e)},e.setAttrs=function(t){if(void 0===t&&(t={}),this.constructor.initAttrs(t),t){if("children"in t)throw new Error("["+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("["+this.constructor.name+'] You cannot use the "tag" attribute name with Mithril 2.')}this.attrs=t},t.initAttrs=function(t){},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=function(t,e){this.content=void 0,this.priority=void 0,this.key=void 0,this.content=t,this.priority=e},i=function(){function t(){this.items={}}var e=t.prototype;return e.isEmpty=function(){for(var t in this.items)if(this.items.hasOwnProperty(t))return!1;return!0},e.has=function(t){return!!this.items[t]},e.get=function(t){return this.items[t].content},e.add=function(t,e,n){return void 0===n&&(n=0),this.items[t]=new r(e,n),this},e.replace=function(t,e,n){return void 0===e&&(e=null),void 0===n&&(n=null),this.items[t]&&(null!==e&&(this.items[t].content=e),null!==n&&(this.items[t].priority=n)),this},e.remove=function(t){return delete this.items[t],this},e.merge=function(t){for(var e in t.items)t.items.hasOwnProperty(e)&&t.items[e]instanceof r&&(this.items[e]=t.items[e]);return this},e.toArray=function(){var t=[];for(var e in this.items)this.items.hasOwnProperty(e)&&this.items[e]instanceof r&&(this.items[e].content=Object(this.items[e].content),this.items[e].content.itemName=e,t.push(this.items[e]),this.items[e].key=t.length);return t.sort((function(t,e){return t.priority===e.priority?t.key-e.key:t.priority>e.priority?-1:1})).map((function(t){return t.content}))},t}()},function(t,e,n){"use strict";function r(t,e){return void 0===e&&(e={}),e.className="icon "+t+" "+(e.className||""),m("i",Object.assign({"aria-hidden":"true"},e))}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(22),i=n(7);function o(t){return t.tag===r.a}function a(t){return t instanceof Array||(t=[t]),function(t){var e,n=[];return t.filter(Boolean).forEach((function(r,i){(!o(r)||e&&!o(e)&&i!==t.length-1)&&(e=r,n.push(r))})),n}(t).map((function(t){var e=t.tag&&t.tag.isListItem,n=t.tag&&t.tag.isActive&&t.tag.isActive(t.attrs),r=t.attrs&&t.attrs.itemClassName||t.itemClassName;return e&&(t.attrs=t.attrs||{},t.attrs.key=t.attrs.key||t.itemName,t.key=t.attrs.key),e?t:m("li",{className:Object(i.a)([r,t.itemName&&"item-"+t.itemName,n&&"active"]),key:t.attrs&&t.attrs.key||t.itemName},t)}))}},function(t,e,n){"use strict";function r(t){var e,n,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t)if(Array.isArray(t))for(e=0;e$(window).scrollTop()+$(window).height()),t.offset().top<0&&t.removeClass("Dropdown-menu--top"),t.toggleClass("Dropdown-menu--right",e||t.offset().left+t.width()>$(window).scrollLeft()+$(window).width())})),this.$().on("hidden.bs.dropdown",(function(){n.showing=!1,n.attrs.onhide&&n.attrs.onhide(),m.redraw()}))},n.getButton=function(t){return m("button",{className:"Dropdown-toggle "+this.attrs.buttonClassName,"aria-haspopup":"menu","aria-label":this.attrs.accessibleToggleLabel,"data-toggle":"dropdown",onclick:this.attrs.onclick},this.getButtonContent(t))},n.getButtonContent=function(t){return[this.attrs.icon?Object(o.a)(this.attrs.icon,{className:"Button-icon"}):"",m("span",{className:"Button-label"},this.attrs.label),this.attrs.caretIcon?Object(o.a)(this.attrs.caretIcon,{className:"Button-caret"}):""]},n.getMenu=function(t){return m("ul",{className:"Dropdown-menu dropdown-menu "+this.attrs.menuClassName},t)},e}(i.a)},function(t,e,n){"use strict";function r(t,e){void 0===e&&(e={}),e.className="Avatar "+(e.className||"");var n="",r="undefined"===e.title||e.title;if(r||delete e.title,t){var i=t.displayName()||"?",o=t.avatarUrl();if(r&&(e.title=e.title||i),o)return m("img",Object.assign({},e,{src:o,alt:""}));n=i.charAt(0).toUpperCase(),e.style={"--avatar-bg":t.color()}}return m("span",e,n)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r=0||(i[n]=t[n]);return i}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t){var e=t&&t.displayName()||app.translator.trans("core.lib.username.deleted_text");return m("span",{className:"username"},e)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(){for(var t=arguments.length,e=new Array(t),n=0;n or .");var l=e[0];if("object"!=typeof l||Array.isArray(l)||null===l)throw new Error("Tooltip component was provided with no direct child DOM element. Tooltips must contain a single direct DOM node to attach to.");if("string"==typeof l.tag&&["#","[","<"].includes(l.tag))throw new Error('Tooltip component with provided with a vnode with tag "'+l.tag+'". This is not a DOM element, so is not a valid child element. Please wrap this vnode in another element, such as a
or .');return this.firstChild=l,e},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.checkDomNodeChanged(),this.recreateTooltip()},n.onupdate=function(e){t.prototype.onupdate.call(this,e),this.checkDomNodeChanged(),this.recreateTooltip()},n.recreateTooltip=function(){this.shouldRecreateTooltip&&null!==this.childDomNode&&($(this.childDomNode).tooltip("destroy","DANGEROUS_tooltip_jquery_fn_deprecation_exempt"),this.createTooltip(),this.shouldRecreateTooltip=!1),this.shouldChangeTooltipVisibility&&(this.shouldChangeTooltipVisibility=!1,this.updateVisibility())},n.updateVisibility=function(){null!==this.childDomNode&&(!0===this.attrs.tooltipVisible?$(this.childDomNode).tooltip("show","DANGEROUS_tooltip_jquery_fn_deprecation_exempt"):!1===this.attrs.tooltipVisible&&$(this.childDomNode).tooltip("hide","DANGEROUS_tooltip_jquery_fn_deprecation_exempt"))},n.createTooltip=function(){if(null!==this.childDomNode){var t=this.attrs,e=t.showOnFocus,n=void 0===e||e,r=t.position,i=void 0===r?"top":r,o=t.delay,s=t.html,l=void 0!==s&&s,u=t.tooltipVisible,c=(t.text,"boolean"==typeof u?"manual":Object(a.a)("hover",[n&&"focus"])),d=this.getRealText();this.childDomNode.setAttribute("title",d),this.childDomNode.setAttribute("aria-label",d),$(this.childDomNode).tooltip({html:l,delay:o,placement:i,trigger:c},"DANGEROUS_tooltip_jquery_fn_deprecation_exempt")}},n.getRealText=function(){var t=this.attrs.text;return Array.isArray(t)?Object(s.a)(t):t},n.checkDomNodeChanged=function(){var t=this.firstChild.dom;t&&!t.isSameNode(this.childDomNode)&&(this.childDomNode=t,this.shouldRecreateTooltip=!0)},e}(o.a)},function(t,e,n){t.exports=function(){"use strict";var t="millisecond",e="second",n="minute",r="hour",i="day",o="week",a="month",s="quarter",l="year",u="date",c=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,d=/\[([^\]]+)]|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("_")},f=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},h={s:f,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+f(r,2,"0")+":"+f(i,2,"0")},m:function t(e,n){if(e.date()0?"...":"")+t.substring(n,n+e)+(t.length>n+e?"...":"")}function i(t){return t.toLowerCase().replace(/[^a-z0-9]/gi,"-").replace(/-+/g,"-").replace(/-$|^-/g,"")}function o(t){var e=t.replace(/(<\/p>|
)/g,"$1  ").replace(/]*>/gi," "),n=$("
").html(e);return n.find(o.removeSelectors.join(",")).remove(),n.text().replace(/\s+/g," ").trim()}function a(t){return t.substr(0,1).toUpperCase()+t.substr(1)}n.r(e),n.d(e,"truncate",(function(){return r})),n.d(e,"slug",(function(){return i})),n.d(e,"getPlainContent",(function(){return o})),n.d(e,"ucfirst",(function(){return a})),o.removeSelectors=["blockquote","script"]},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(0),i=n(17),o=n(5);function a(t){var e=t.tag;return("string"!=typeof e||"a"===e||"button"===e)&&("initAttrs"in e&&e.initAttrs(t.attrs),"isActive"in e?e.isActive(t.attrs):t.attrs.active)}var s=function(t){function e(){return t.apply(this,arguments)||this}return Object(r.a)(e,t),e.initAttrs=function(e){e.caretIcon=void 0!==e.caretIcon?e.caretIcon:"fas fa-sort",t.initAttrs.call(this,e),e.className+=" Dropdown--select"},e.prototype.getButtonContent=function(t){var e=t.find(a),n=e&&e.children||this.attrs.defaultLabel;return n instanceof Array&&(n=n[0]),[m("span",{className:"Button-label"},n),Object(o.a)(this.attrs.caretIcon,{className:"Button-caret"})]},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(31);function i(t,e,n){if(!e&&!n)return t;var i=e instanceof RegExp?e:new RegExp(e,"gi"),o=t,a=0;return n&&(e&&(a=Math.max(0,t.search(i)-n/2)),o=Object(r.truncate)(o,n,a)),o=$("
").text(o).html(),e&&(o=o.replace(i,"$&")),m.trust(o)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=null;function i(t,e){var n=e.text,i=e.selectionStart,o=e.selectionEnd,a=t.selectionStart,s=t.value.slice(0,a),l=t.value.slice(t.selectionEnd);if(null===r||!0===r){t.contentEditable="true";try{r=document.execCommand("insertText",!1,n)}catch(t){r=!1}t.contentEditable="false"}r&&!t.value.slice(0,t.selectionStart).endsWith(n)&&(r=!1),r||(t.value=s+n+l,t.dispatchEvent(new CustomEvent("input",{bubbles:!0,cancelable:!0}))),null!=i&&null!=o?t.setSelectionRange(i,o):t.setSelectionRange(a,t.selectionEnd)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)},i=function(){function t(t){this.callback=t,this.ticking=!1}var e=t.prototype;return e.loop=function(){var t=this;this.ticking||(r((function(){t.update(),t.ticking=!1})),this.ticking=!0)},e.update=function(){this.callback(window.pageYOffset)},e.start=function(){this.active||window.addEventListener("scroll",this.active=this.loop.bind(this),{passive:!0})},e.stop=function(){window.removeEventListener("scroll",this.active),this.active=null},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(0),i=function(t){function e(){return t.apply(this,arguments)||this}return Object(r.a)(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e),e.className=(e.className||"")+" Checkbox--switch"},e.prototype.getDisplay=function(){return this.attrs.loading?t.prototype.getDisplay.call(this):""},e}(n(45).a)},function(t,e,n){"use strict";e.a=function(t,e){return function(){e(this.getAttribute(t)||this[t])}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(11),i=function(){function t(t,e){this.component=void 0,this.routeName=void 0,this.component=t,this.routeName=e}var e=t.prototype;return e.makeKey=function(){return this.routeName+JSON.stringify(m.route.param())},e.makeAttrs=function(t){return Object(r.a)({},t.attrs,{routeName:this.routeName})},e.onmatch=function(t,e,n){return this.component},e.render=function(t){return[Object(r.a)({},t,{attrs:this.makeAttrs(t),key:this.makeKey()})]},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(0),i=n(1),o=n(21),a=n(4),s=n(26),l=function(t){function e(){return t.apply(this,arguments)||this}return Object(r.a)(e,t),e}(i.a);Object.assign(l.prototype,{title:i.a.attribute("title"),slug:i.a.attribute("slug"),createdAt:i.a.attribute("createdAt",i.a.transformDate),user:i.a.hasOne("user"),firstPost:i.a.hasOne("firstPost"),lastPostedAt:i.a.attribute("lastPostedAt",i.a.transformDate),lastPostedUser:i.a.hasOne("lastPostedUser"),lastPost:i.a.hasOne("lastPost"),lastPostNumber:i.a.attribute("lastPostNumber"),commentCount:i.a.attribute("commentCount"),replyCount:Object(o.a)("commentCount",(function(t){return Math.max(0,t-1)})),posts:i.a.hasMany("posts"),mostRelevantPost:i.a.hasOne("mostRelevantPost"),lastReadAt:i.a.attribute("lastReadAt",i.a.transformDate),lastReadPostNumber:i.a.attribute("lastReadPostNumber"),isUnread:Object(o.a)("unreadCount",(function(t){return!!t})),isRead:Object(o.a)("unreadCount",(function(t){return app.session.user&&!t})),hiddenAt:i.a.attribute("hiddenAt",i.a.transformDate),hiddenUser:i.a.hasOne("hiddenUser"),isHidden:Object(o.a)("hiddenAt",(function(t){return!!t})),canReply:i.a.attribute("canReply"),canRename:i.a.attribute("canRename"),canHide:i.a.attribute("canHide"),canDelete:i.a.attribute("canDelete"),removePost:function(t){var e=this.data.relationships,n=e&&e.posts;n&&n.data.some((function(e,r){if(t===e.id)return n.data.splice(r,1),!0}))},unreadCount:function(){var t=app.session.user;if(t&&t.markedAllAsReadAt()t?f():!0!==e&&(i=setTimeout(r?h:f,void 0===r?t-p:t)))}return"boolean"!=typeof e&&(r=n,n=e,e=void 0),l.cancel=function(){s(),o=!0},l}function i(t,e,n){return void 0===n?r(t,e,!1):r(t,n,!1!==e)}n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(11);function i(t,e,n){void 0===e&&(e=null),void 0===n&&(n={});var i=Object(r.a)({},n);i.state=i.state||{},i.state.key=Date.now(),m.route.set(t,e,i)}},function(t,e,n){"use strict";(function(e){t.exports=function(){if("object"==typeof globalThis)return globalThis;var t;try{t=this||new Function("return this")()}catch(t){if("object"==typeof window)return window;if("object"==typeof self)return self;if(void 0!==e)return e}return t}()}).call(this,n(50))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(){for(var t=arguments.length,e=new Array(t),n=0;n1?m("div",{className:"Form"},this.fields().toArray()):app.translator.trans("core.lib.edit_user.nothing_available"))},n.fields=function(){var t=this,e=new u.a;return app.session.user.canEditCredentials()&&(e.add("username",m("div",{className:"Form-group"},m("label",null,app.translator.trans("core.lib.edit_user.username_heading")),m("input",{className:"FormControl",placeholder:Object(l.a)(app.translator.trans("core.lib.edit_user.username_label")),bidi:this.username,disabled:this.nonAdminEditingAdmin()})),40),app.session.user!==this.attrs.user&&(e.add("email",m("div",{className:"Form-group"},m("label",null,app.translator.trans("core.lib.edit_user.email_heading")),m("div",null,m("input",{className:"FormControl",placeholder:Object(l.a)(app.translator.trans("core.lib.edit_user.email_label")),bidi:this.email,disabled:this.nonAdminEditingAdmin()})),!this.isEmailConfirmed()&&this.userIsAdmin(app.session.user)?m("div",null,o.a.component({className:"Button Button--block",loading:this.loading,onclick:this.activate.bind(this)},app.translator.trans("core.lib.edit_user.activate_button"))):""),30),e.add("password",m("div",{className:"Form-group"},m("label",null,app.translator.trans("core.lib.edit_user.password_heading")),m("div",null,m("label",{className:"checkbox"},m("input",{type:"checkbox",onchange:function(e){t.setPassword(e.target.checked),m.redraw.sync(),e.target.checked&&t.$("[name=password]").select(),e.redraw=!1},disabled:this.nonAdminEditingAdmin()}),app.translator.trans("core.lib.edit_user.set_password_label")),this.setPassword()?m("input",{className:"FormControl",type:"password",name:"password",placeholder:Object(l.a)(app.translator.trans("core.lib.edit_user.password_label")),bidi:this.password,disabled:this.nonAdminEditingAdmin()}):"")),20))),app.session.user.canEditGroups()&&e.add("groups",m("div",{className:"Form-group EditUserModal-groups"},m("label",null,app.translator.trans("core.lib.edit_user.groups_heading")),m("div",null,Object.keys(this.groups).map((function(t){return app.store.getById("groups",t)})).map((function(e){return m("label",{className:"checkbox"},m("input",{type:"checkbox",bidi:t.groups[e.id()],disabled:e.id()===s.a.ADMINISTRATOR_ID&&(t.attrs.user===app.session.user||!t.userIsAdmin(app.session.user))}),a.a.component({group:e,label:""})," ",e.nameSingular())})))),10),e.add("submit",m("div",{className:"Form-group"},o.a.component({className:"Button Button--primary",type:"submit",loading:this.loading},app.translator.trans("core.lib.edit_user.submit_button"))),-10),e},n.activate=function(){var t=this;this.loading=!0;var e={username:this.username(),isEmailConfirmed:!0};this.attrs.user.save(e,{errorHandler:this.onerror.bind(this)}).then((function(){t.isEmailConfirmed(!0),t.loading=!1,m.redraw()})).catch((function(){t.loading=!1,m.redraw()}))},n.data=function(){var t=this,e={relationships:{}};return this.attrs.user.canEditCredentials()&&!this.nonAdminEditingAdmin()&&(e.username=this.username(),app.session.user!==this.attrs.user&&(e.email=this.email()),this.setPassword()&&(e.password=this.password())),this.attrs.user.canEditGroups()&&(e.relationships.groups=Object.keys(this.groups).filter((function(e){return t.groups[e]()})).map((function(t){return app.store.getById("groups",t)}))),e},n.onsubmit=function(t){var e=this;t.preventDefault(),this.loading=!0,this.attrs.user.save(this.data(),{errorHandler:this.onerror.bind(this)}).then(this.hide.bind(this)).catch((function(){e.loading=!1,m.redraw()}))},n.nonAdminEditingAdmin=function(){return this.userIsAdmin(this.attrs.user)&&!this.userIsAdmin(app.session.user)},n.userIsAdmin=function(t){return t.groups().some((function(t){return t.id()===s.a.ADMINISTRATOR_ID}))},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(t,e,n){void 0===t&&(t={}),void 0===e&&(e=1),void 0===n&&(n=20),this.location=void 0,this.pageSize=void 0,this.pages=[],this.params={},this.initialLoading=!1,this.loadingPrev=!1,this.loadingNext=!1,this.params=t,this.location={page:e},this.pageSize=n}var e=t.prototype;return e.clear=function(){this.pages=[],m.redraw()},e.loadPrev=function(){var t=this;if(this.loadingPrev||1===this.getLocation().page)return Promise.resolve();this.loadingPrev=!0;var e=this.getPrevPageNumber();return this.loadPage(e).then(this.parseResults.bind(this,e)).finally((function(){return t.loadingPrev=!1}))},e.loadNext=function(){var t=this;if(this.loadingNext)return Promise.resolve();this.loadingNext=!0;var e=this.getNextPageNumber();return this.loadPage(e).then(this.parseResults.bind(this,e)).finally((function(){return t.loadingNext=!1}))},e.parseResults=function(t,e){var n,r=Number(t),i=(null==(n=e.payload)?void 0:n.links)||{},o={number:r,items:e,hasNext:!!i.next,hasPrev:!!i.prev};this.isEmpty()||r>this.getNextPageNumber()-1?this.pages.push(o):this.pages.unshift(o),this.location={page:r},m.redraw()},e.loadPage=function(t){void 0===t&&(t=1);var e=this.requestParams();return e.page={offset:this.pageSize*(t-1)},Array.isArray(e.include)&&(e.include=e.include.join(",")),app.store.find(this.type,e)},e.requestParams=function(){return this.params},e.refreshParams=function(t,e){if(this.isEmpty()||this.paramsChanged(t))return this.params=t,this.refresh(e)},e.refresh=function(t){var e=this;return void 0===t&&(t=1),this.initialLoading=!0,this.loadingPrev=!1,this.loadingNext=!1,this.clear(),this.location={page:t},this.loadPage().then((function(t){e.pages=[],e.parseResults(e.location.page,t)})).finally((function(){return e.initialLoading=!1}))},e.getPages=function(){return this.pages},e.getLocation=function(){return this.location},e.isLoading=function(){return this.initialLoading||this.loadingNext||this.loadingPrev},e.isInitialLoading=function(){return this.initialLoading},e.isLoadingPrev=function(){return this.loadingPrev},e.isLoadingNext=function(){return this.loadingNext},e.hasItems=function(){return!!this.getAllItems().length},e.isEmpty=function(){return!this.isInitialLoading()&&!this.hasItems()},e.hasPrev=function(){var t;return!(null==(t=this.pages[0])||!t.hasPrev)},e.hasNext=function(){var t;return!(null==(t=this.pages[this.pages.length-1])||!t.hasNext)},e.getParams=function(){return this.params},e.getNextPageNumber=function(){var t,e=null==(t=this.pages[this.pages.length-1])?void 0:t.number;return e&&!isNaN(e)?e+1:this.location.page},e.getPrevPageNumber=function(){var t,e=null==(t=this.pages[0])?void 0:t.number;return e&&!isNaN(e)?Math.max(e-1,1):this.location.page},e.paramsChanged=function(t){var e=this;return Object.keys(t).some((function(n){return e.getParams()[n]!==t[n]}))},e.getAllItems=function(){return this.getPages().map((function(t){return t.items})).flat()},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(11),i=n(0),o=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.view=function(){var t=this.attrs.state.modal;return m("div",{className:"ModalManager modal fade"},t?t.componentClass.component(Object(r.a)({},t.attrs,{animateShow:this.animateShow.bind(this),animateHide:this.animateHide.bind(this),state:this.attrs.state})):"")},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.$().on("hidden.bs.modal",this.attrs.state.close.bind(this.attrs.state))},n.animateShow=function(t){var e=!!this.attrs.state.modal.componentClass.isDismissible;this.$().hasClass("in")?t():this.$().one("shown.bs.modal",t).modal({backdrop:e||"static",keyboard:e}).modal("show")},n.animateHide=function(){this.$().modal("hide")},e}(n(3).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(0),i=n(3),o=(n(27),function(t){function e(){return t.apply(this,arguments)||this}Object(r.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.state=this.attrs.state},n.view=function(){var t=this;return m("div",{className:"AlertManager"},Object.entries(this.state.getActiveAlerts()).map((function(e){var n=e[0],r=e[1];return m("div",{className:"AlertManager-alert"},m(r.componentClass,Object.assign({},r.attrs,{ondismiss:t.state.dismiss.bind(t.state,n)}),r.children))})))},e}(i.a))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(0),i=function(t){function e(){return t.apply(this,arguments)||this}Object(r.a)(e,t);var n=e.prototype;return n.className=function(){return"RequestErrorModal Modal--large"},n.title=function(){return this.attrs.error.xhr?this.attrs.error.xhr.status+" "+this.attrs.error.xhr.statusText:""},n.content=function(){var t,e=this.attrs,n=e.error,r=e.formattedError;if(r)t=r.join("\n\n");else try{var i=n.response||JSON.parse(n.responseText);t=JSON.stringify(i,null,2)}catch(e){t=n.responseText}return m("div",{className:"Modal-body"},m("pre",null,this.attrs.error.options.method," ",this.attrs.error.options.url,m("br",null),m("br",null),t))},e}(n(13).a)},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function n(t,e){for(var n=0;n").addClass("drawer-backdrop fade").appendTo("body").click((function(){return t.hide()})),setTimeout((function(){return t.$backdrop.addClass("in")}))},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(38);function i(t,e){void 0===e&&(e="");var n={};for(var i in t){var o=t[i];if("resolver"in o)n[e+o.path]=o.resolver;else{if(!("component"in o))throw new Error("Either a resolver or a component must be provided for the route ["+i+"]");var a="resolverClass"in o?o.resolverClass:r.a;n[e+o.path]=new a(o.component,i)}}return n}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(25);function i(){$("[data-humantime]").each((function(){var t=$(this),e=Object(r.a)(t.attr("datetime"));t.html(e)}))}function o(){setInterval(i,1e4)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(0),i=function(t){function e(){return t.apply(this,arguments)||this}return Object(r.a)(e,t),e.prototype.apiEndpoint=function(){return"/"},e}(n(1).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(0),i=n(1),o=n(70),a=n(4),s=n(21),l=n(29),u=function(t){function e(){return t.apply(this,arguments)||this}return Object(r.a)(e,t),e}(i.a);Object.assign(u.prototype,{username:i.a.attribute("username"),slug:i.a.attribute("slug"),displayName:i.a.attribute("displayName"),email:i.a.attribute("email"),isEmailConfirmed:i.a.attribute("isEmailConfirmed"),password:i.a.attribute("password"),avatarUrl:i.a.attribute("avatarUrl"),preferences:i.a.attribute("preferences"),groups:i.a.hasMany("groups"),joinTime:i.a.attribute("joinTime",i.a.transformDate),lastSeenAt:i.a.attribute("lastSeenAt",i.a.transformDate),markedAllAsReadAt:i.a.attribute("markedAllAsReadAt",i.a.transformDate),unreadNotificationCount:i.a.attribute("unreadNotificationCount"),newNotificationCount:i.a.attribute("newNotificationCount"),discussionCount:i.a.attribute("discussionCount"),commentCount:i.a.attribute("commentCount"),canEdit:i.a.attribute("canEdit"),canEditCredentials:i.a.attribute("canEditCredentials"),canEditGroups:i.a.attribute("canEditGroups"),canDelete:i.a.attribute("canDelete"),avatarColor:null,color:Object(s.a)("displayName","avatarUrl","avatarColor",(function(t,e,n){return n?"rgb("+n.join(", ")+")":e?(this.calculateAvatarColor(),""):"#"+Object(o.a)(t)})),isOnline:function(){return dayjs().subtract(5,"minutes").isBefore(this.lastSeenAt())},badges:function(){var t=new a.a,e=this.groups();return e&&e.forEach((function(e){t.add("group"+e.id(),l.a.component({group:e}))})),t},calculateAvatarColor:function(){var t=new Image,e=this;t.onload=function(){var t=new ColorThief;e.avatarColor=t.getColor(this),e.freshness=new Date,m.redraw()},t.crossOrigin="anonymous",t.src=this.avatarUrl()},savePreferences:function(t){var e=this.preferences();return Object.assign(e,t),this.save({preferences:e})}})},function(t,e,n){"use strict";function r(t){for(var e=0,n=0;n3&&void 0!==arguments[3]?arguments[3]:[];if(!e)return i;if(1===r)return i.push(e),i;var o=e.indexOf(n);if(-1===o)return i.push(e),i;var a=e.substring(0,o).trim(),s=e.substring(o+n.length+1).trim();return i.push(a),t(s,n,r-1,i)}(t.slice(1,-1),",",3)}function N(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 O(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0,i=w(e),o=i.args,a=i.cases,s=parseInt(t);o.forEach((function(t){t.startsWith("offset:")&&(s-=parseInt(t.slice("offset:".length)))}));var l=[];1===s&&l.push("one"),l.push("=".concat(s),"other");for(var u=0;u1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0,i=w(e),o=i.cases;return t in o?r(o[t],n):"other"in o?r(o.other,n):t}function j(t,e,n){return"<".concat(t,">").concat(n,"")}function k(t,e,n){var r=[];return A(t,0,0,r,(function(i,o,a,s,l,u){if(o)return{break:!0};var c=function(t,e,n,r){var i,o=1;return A(t,n,r,[],(function(t,n,r,a,s,l){if(r===e&&(n?o--:o++,0===o))return i={segmentIndex:a,segmentStart:l,segmentEnd:s},{exit:!0};return{exit:!1}})),i}(t,a,s,l);if(!c)throw new Error("Unbalanced tags: no closing tag found for <".concat(a,">"));var d=c.segmentIndex===s,p=t[c.segmentIndex],f=[];if(d)f.push(i.slice(l+1,c.segmentStart));else{f.push(i.slice(l+1));for(var h=s+1;h"===s[p]){var f=s.slice(u+1+l,p),h=i(s,l,f,a,p,u);if(h.exit)return;if(h.newSegmentIndex&&(a=h.newSegmentIndex),h.processedSegment&&(d=!0),h.break)break;l=!1,u=null,c=!1}else c&&(o=s[p],!/[a-zA-Z-_]/.test(o))&&(l=!1,u=null,c=!1);else u=p,c=!0,"/"===s[p+1]&&(l=!0,p++);d||r.push(s)}else r.push(s)}}function D(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=p()(t);if(e){var i=p()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return c()(this,n)}}var P=function(t){l()(n,t);var e=D(n);function n(t){var r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return i()(this,n),(r=e.call(this,t,o)).richHandler=a||j,r}return a()(n,[{key:"rich",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=y(this.process(t,e));return k(n,e,this.richHandler)}}]),n}(function(){function t(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i()(this,t),v()(this,"format",b((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return y(n.process(t,e)).join("")}))),this.locale=e,this.typeHandlers=r}return a()(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=x(t,n);if(-1===r)throw new Error('Unbalanced curly braces in string: "'.concat(t,'"'));var i=t.substring(n,r+1);if(i){var o=[],a=t.substring(0,n);a&&o.push(a);var s=T(i),l=h()(s,3),u=l[0],c=l[1],d=l[2],p=e[u];null==p&&(p="");var f=c&&this.typeHandlers[c];o.push(f?f(p,d,this.locale,e,this.process.bind(this)):p);var m=t.substring(r+1);return m&&o.push(this.process(m,e)),o}}return[t]}}]),t}());function I(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 $(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function A(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=n).toggleClass("scrolled",t>n),$(".App-header").toggleClass("navbar-fixed-top",t>=n)}));n.start(),n.update(),$((function(){$("body").addClass("ontouchstart"in window?"touch":"no-touch")})),Object(v.a)()},e.preloadedApiDocument=function(){if(this.data.apiDocument&&window.location.href===this.initialRoute){var t=this.store.pushPayload(this.data.apiDocument);return this.data.apiDocument=null,t}return null},e.screen=function(){return getComputedStyle(document.documentElement).getPropertyValue("--flarum-screen")},e.setTitle=function(t){this.title=t,this.updateTitle()},e.setTitleCount=function(t){this.titleCount=t,this.updateTitle()},e.updateTitle=function(){var t=this.titleCount?"("+this.titleCount+") ":"",e=this.title&&m.route.get()!==this.forum.attribute("basePath")+"/"?this.title+" - ":"",n=this.forum.attribute("title");document.title=t+e+n},e.request=function(t){var e=this,n=Object.assign({},t);if(n.background=n.background||!0,Object(y.extend)(n,"config",(function(t,n){return n.setRequestHeader("X-CSRF-Token",e.session.csrfToken)})),"GET"!==n.method&&"POST"!==n.method){var r=n.method;Object(y.extend)(n,"config",(function(t,e){return e.setRequestHeader("X-HTTP-Method-Override",r)})),n.method="POST"}n.deserialize=n.deserialize||function(t){return t},n.errorHandler=n.errorHandler||function(t){throw t};var o=n.extract;return n.extract=function(t){var e;e=o?o(t.responseText):t.responseText||null;var r=t.status;if(r<200||r>299)throw new h.a(r,e,n,t);if(t.getResponseHeader){var i=t.getResponseHeader("X-CSRF-Token");i&&(app.session.csrfToken=i)}try{return JSON.parse(e)}catch(r){throw new h.a(500,e,n,t)}},this.requestErrorAlert&&this.alerts.dismiss(this.requestErrorAlert),m.request(n).then((function(t){return t}),(function(t){var r;switch(t.status){case 422:r=t.response.errors.map((function(t){return[t.detail,m("br",null)]})).reduce((function(t,e){return t.concat(e)}),[]).slice(0,-1);break;case 401:case 403:r=app.translator.trans("core.lib.error.permission_denied_message");break;case 404:case 410:r=app.translator.trans("core.lib.error.not_found_message");break;case 429:r=app.translator.trans("core.lib.error.rate_limit_exceeded_message");break;default:r=app.translator.trans("core.lib.error.generic_message")}var o=app.forum.attribute("debug"),a=t.response&&t.response.errors,s=Array.isArray(a)&&a[0]&&a[0].detail&&a.map((function(t){return decodeURI(t.detail)}));t.alert={type:"error",content:r,controls:o&&[m(i.a,{className:"Button Button--link",onclick:e.showDebug.bind(e,t,s)},"Debug")]};try{n.errorHandler(t)}catch(t){if(o&&t.xhr){var l,u=t.options,c=u.method,d=u.url,p=t.xhr.status,f=void 0===p?"":p;console.group(c+" "+d+" "+f),(l=console).error.apply(l,s||[t]),console.groupEnd()}e.requestErrorAlert=e.alerts.show(t.alert,t.alert.content)}return Promise.reject(t)}))},e.showDebug=function(t,e){this.alerts.dismiss(this.requestErrorAlert),this.modal.show(s.a,{error:t,formattedError:e})},e.route=function(t,e){void 0===e&&(e={});var n=this.routes[t];if(!n)throw new Error("Route '"+t+"' does not exist");var r=n.path.replace(/:([^\/]+)/g,(function(t,n){return Object(d.a)(e,n)}));for(var i in e)e.hasOwnProperty(i)&&!e[i]&&delete e[i];var o=m.buildQueryString(e);return(""===m.route.prefix?this.forum.attribute("basePath"):"")+r+(o?"?"+o:"")},t}()},function(t,e,n){"use strict";function r(t,e){var n="select"===t.tag?t.attrs.multi?"multi":"select":t.attrs.type;return t.attrs.onchange="multi"===n?function(){e([].slice.call(this.selectedOptions,(function(t){return t.value})))}:"select"===n?function(t){e(this.selectedOptions[0].value)}:"checkbox"===n?function(t){e(this.checked)}:t.attrs.oninput=function(t){e(this.value)},"select"===t.tag?t.children.forEach((function(t){t.attrs.value!==e()&&t.children[0]!==e()||(t.attrs.selected=!0)})):"checkbox"===n?t.attrs.checked=e():"radio"===n?t.attrs.checked=e()===t.attrs.value:t.attrs.value=e(),t.attrs.bidi=null,t}n.d(e,"a",(function(){return o})),r.view=function(t,e,n){return r(e,e.attrs.bidi)};var i=r;function o(t){var e=t.m,n=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o=0&&(m+=t.slice(n,a)),d>=0&&(m+=(n<0?"?":"&")+c.slice(d,f));var g=r(u);return g&&(m+=(n<0&&d<0?"?":"&")+g),o>=0&&(m+=t.slice(o)),p>=0&&(m+=(o<0?"":"&")+c.slice(p)),m}},function(t,e,n){"use strict";var r=n(100);t.exports=function(t){var e=t.indexOf("?"),n=t.indexOf("#"),i=n<0?t.length:n,o=e<0?i:e,a=t.slice(0,o).replace(/\/{2,}/g,"/");return a?("/"!==a[0]&&(a="/"+a),a.length>1&&"/"===a[a.length-1]&&(a=a.slice(0,-1))):a="/",{path:a,params:e<0?{}:r(t.slice(e+1,i))}}},function(t,e,n){"use strict";function r(t){return t>=1e6?Math.floor(t/1e6)+app.translator.trans("core.lib.number_suffix.mega_text"):t>=1e3?(t/1e3).toFixed(1)+app.translator.trans("core.lib.number_suffix.kilo_text"):t.toString()}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n(0),i=n(3),o=n(4),a=n(6),s=n(2),l=n(44),u=n(23),c=function(t){function e(){return t.apply(this,arguments)||this}Object(r.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.value=this.attrs.value||"",this.disabled=!!this.attrs.disabled},n.view=function(){return m("div",{className:"TextEditor"},m("div",{className:"TextEditor-editorContainer"}),m("ul",{className:"TextEditor-controls Composer-footer"},Object(a.a)(this.controlItems().toArray()),m("li",{className:"TextEditor-toolbar"},this.toolbarItems().toArray())))},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.attrs.composer.editor=this.buildEditor(this.$(".TextEditor-editorContainer")[0])},n.onupdate=function(e){t.prototype.onupdate.call(this,e);var n=!!this.attrs.disabled;this.disabled!==n&&(this.disabled=n,this.attrs.composer.editor.disabled(n))},n.buildEditorParams=function(){var t=this;return{classNames:["FormControl","Composer-flexible","TextEditor-editor"],disabled:this.disabled,placeholder:this.attrs.placeholder||"",value:this.value,oninput:this.oninput.bind(this),inputListeners:[],onsubmit:function(){t.onsubmit(),m.redraw()}}},n.buildEditor=function(t){return new l.a(t,this.buildEditorParams())},n.controlItems=function(){var t=new o.a;return t.add("submit",s.a.component({icon:"fas fa-paper-plane",className:"Button Button--primary",itemClassName:"App-primaryControl",onclick:this.onsubmit.bind(this)},this.attrs.submitLabel)),this.attrs.preview&&t.add("preview",m(u.a,{text:app.translator.trans("core.forum.composer.preview_tooltip")},m(s.a,{icon:"far fa-eye",className:"Button Button--icon",onclick:this.attrs.preview}))),t},n.toolbarItems=function(){return new o.a},n.oninput=function(t){this.value=t,this.attrs.onchange(this.value)},n.onsubmit=function(){this.attrs.onsubmit(this.value)},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=/[.*+?^${}()|[\]\\]/g;function i(t){return t.replace(r,"\\$&")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(0),i=n(17),o=n(2),a=n(5),s=function(t){function e(){return t.apply(this,arguments)||this}Object(r.a)(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e),e.className+=" Dropdown--split",e.menuClassName+=" Dropdown-menu--right"};var n=e.prototype;return n.getButton=function(t){var e=this.getFirstChild(t),n=Object.assign({},e.attrs);return n.className=(n.className||"")+" SplitDropdown-button Button "+this.attrs.buttonClassName,[o.a.component(n,e.children),m("button",{className:"Dropdown-toggle Button Button--icon "+this.attrs.buttonClassName,"aria-haspopup":"menu","aria-label":this.attrs.accessibleToggleLabel,"data-toggle":"dropdown"},Object(a.a)(this.attrs.icon,{className:"Button-icon"}),Object(a.a)("fas fa-caret-down",{className:"Button-caret"}))]},n.getFirstChild=function(t){for(var e=t;e instanceof Array;)e=e[0];return e},e}(i.a)},function(t,e,n){"use strict";function r(t,e){var n=$(window),r=$(t).offset().top-n.scrollTop();e(),n.scrollTop($(t).offset().top-r)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(5);function i(t){if(t.lastSeenAt()&&t.isOnline())return m("span",{className:"UserOnline"},Object(r.a)("fas fa-circle"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(24),i=n.n(r);function o(t){var e=i()(t),n=e.format(),r=e.format("LLLL");return m("time",{pubdate:!0,datetime:n},r)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(19),i=n(0),o=n(3),a=n(5),s=n(37),l=n(7),u=function(t){function e(){return t.apply(this,arguments)||this}return Object(i.a)(e,t),e.prototype.view=function(){var t=this.attrs,e=t.options,n=t.onchange,i=t.value,o=t.disabled,u=t.className,c=t.class,d=t.wrapperAttrs,p=(d=void 0===d?{}:d).className,f=d.class,h=Object(r.a)(d,["className","class"]),g=Object(r.a)(t,["options","onchange","value","disabled","className","class","wrapperAttrs"]);return m("span",Object.assign({className:Object(l.a)("Select",p,f)},h),m("select",Object.assign({className:Object(l.a)("Select-input FormControl",u,c),onchange:n?Object(s.a)("value",n.bind(this)):void 0,value:i,disabled:o},g),Object.keys(e).map((function(t){return m("option",{value:t},e[t])}))),Object(a.a)("fas fa-sort",{className:"Select-caret"}))},e}(o.a)},function(t,e,n){"use strict";function r(t){if(2===t.length)return app.translator.trans("core.lib.series.two_text",{first:t[0],second:t[1]});if(t.length>=3){var e=t.slice(1,t.length-1).reduce((function(t,e){return t.concat([e,app.translator.trans("core.lib.series.glue_text")])}),[]).slice(0,-1);return app.translator.trans("core.lib.series.three_text",{first:t[0],second:e,third:t[t.length-1]})}return t}n.d(e,"a",(function(){return r}))},function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.default=t.exports,t.exports.__esModule=!0,n(e)}t.exports=n,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";function r(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";var r=n(28),i=n(93),o=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g,a={},s={}.hasOwnProperty;function l(t){for(var e in t)if(s.call(t,e))return!1;return!0}function u(t){for(var e,n="div",r=[],i={};e=o.exec(t);){var s=e[1],l=e[2];if(""===s&&""!==l)n=l;else if("#"===s)i.id=l;else if("."===s)r.push(l);else if("["===e[3][0]){var u=e[6];u&&(u=u.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\")),"class"===e[4]?r.push(u):i[e[4]]=""===u?u:u||!0}}return r.length>0&&(i.className=r.join(" ")),a[t]={tag:n,attrs:i}}function c(t,e){var n=e.attrs,i=r.normalizeChildren(e.children),o=s.call(n,"class"),a=o?n.class:n.className;if(e.tag=t.tag,e.attrs=null,e.children=void 0,!l(t.attrs)&&!l(n)){var u={};for(var c in n)s.call(n,c)&&(u[c]=n[c]);n=u}for(var c in t.attrs)s.call(t.attrs,c)&&"className"!==c&&!s.call(n,c)&&(n[c]=t.attrs[c]);for(var c in null==a&&null==t.attrs.className||(n.className=null!=a?null!=t.attrs.className?String(t.attrs.className)+" "+String(a):a:null!=t.attrs.className?t.attrs.className:null),o&&(n.class=null),n)if(s.call(n,c)&&"key"!==c){e.attrs=n;break}return Array.isArray(i)&&1===i.length&&null!=i[0]&&"#"===i[0].tag?e.text=i[0].children:e.children=i,e}t.exports=function(t){if(null==t||"string"!=typeof t&&"function"!=typeof t&&"function"!=typeof t.view)throw Error("The selector must be either a string or a component.");var e=i.apply(1,arguments);return"string"==typeof t&&(e.children=r.normalizeChildren(e.children),"["!==t)?c(a[t]||u(t),e):(e.tag=t,e)}},function(t,e,n){"use strict";var r=n(28);t.exports=function(){var t,e=arguments[this],n=this+1;if(null==e?e={}:("object"!=typeof e||null!=e.tag||Array.isArray(e))&&(e={},n=this),arguments.length===n+1)t=arguments[n],Array.isArray(t)||(t=[t]);else for(t=[];n0||t(n)}}var r=n(s);try{t(n(a),r)}catch(t){r(t)}}d(n)};n.prototype.then=function(t,e){var r,i,o=this._instance;function a(t,e,n,a){e.push((function(e){if("function"!=typeof t)n(e);else try{r(t(e))}catch(t){i&&i(t)}})),"function"==typeof o.retry&&a===o.state&&o.retry()}var s=new n((function(t,e){r=t,i=e}));return a(t,o.resolvers,r,!0),a(e,o.rejectors,i,!1),s},n.prototype.catch=function(t){return this.then(null,t)},n.prototype.finally=function(t){return this.then((function(e){return n.resolve(t()).then((function(){return e}))}),(function(e){return n.resolve(t()).then((function(){return n.reject(e)}))}))},n.resolve=function(t){return t instanceof n?t:new n((function(e){e(t)}))},n.reject=function(t){return new n((function(e,n){n(t)}))},n.all=function(t){return new n((function(e,n){var r=t.length,i=0,o=[];if(0===t.length)e([]);else for(var a=0;a=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n(118),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(50))},function(t,e,n){"use strict";t.exports=n(120)(window)},function(t,e,n){"use strict";t.exports=function(t){if("[object Object]"!==Object.prototype.toString.call(t))return"";var e=[];for(var n in t)r(n,t[n]);return e.join("&");function r(t,n){if(Array.isArray(n))for(var i=0;i-1&&l.pop();for(var c=0;c` component exposed by flarum/core instead. `$.tooltip` may be removed in a future version of Flarum.\n\nIf this component doesn't meet your requirements, please open an issue: https://github.com/flarum/core/issues/new?assignees=davwheat&labels=type/bug,needs-verification&template=bug-report.md&title=Tooltip%20component%20unsuitable%20for%20use%20case"),p.bind(this)(t)}},function(t,e,n){t.exports=function(){"use strict";return function(t,e,n){t=t||{};var r=e.prototype,i={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function o(t,e,n,i){return r.fromToBase(t,e,n,i)}n.en.relativeTime=i,r.fromToBase=function(e,r,o,a,s){for(var l,u,c,d=o.$locale().relativeTime||i,p=t.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],f=p.length,h=0;h0,g<=m.r||!m.r){g<=1&&h>0&&(m=p[h-1]);var v=d[m.l];s&&(g=s(""+g)),u="string"==typeof v?v.replace("%d",g):v(g,r,m.l,c);break}}if(r)return u;var y=c?d.future:d.past;return"function"==typeof y?y(u):y.replace("%s",u)},r.to=function(t,e){return o(t,e,this,!0)},r.from=function(t,e){return o(t,e,this)};var a=function(t){return t.$u?n.utc():n()};r.toNow=function(t){return this.to(a(this),t)},r.fromNow=function(t){return this.from(a(this),t)}}}()},function(t,e,n){t.exports=function(){"use strict";var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(e,n,r){var i=n.prototype,o=i.format;r.en.formats=t,i.format=function(e){void 0===e&&(e="YYYY-MM-DDTHH:mm:ssZ");var n=this.$locale().formats,r=function(e,n){return e.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(e,r,i){var o=i&&i.toUpperCase();return r||n[i]||t[i]||n[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(t,e,n){return e||n.slice(1)}))}))}(e,void 0===n?{}:n);return o.call(this,r)}}}()},function(t,e,n){!function(){var e=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"],n="undefined"!=typeof window,r=n&&null!=window.mozInnerScreenX;function i(t,i,o){if(!n)throw new Error("textarea-caret-position#getCaretCoordinates should only be called in a browser");var a=o&&o.debug||!1;if(a){var s=document.querySelector("#input-textarea-caret-position-mirror-div");s&&s.parentNode.removeChild(s)}var l=document.createElement("div");l.id="input-textarea-caret-position-mirror-div",document.body.appendChild(l);var u=l.style,c=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,d="INPUT"===t.nodeName;u.whiteSpace="pre-wrap",d||(u.wordWrap="break-word"),u.position="absolute",a||(u.visibility="hidden"),e.forEach((function(t){d&&"lineHeight"===t?u.lineHeight=c.height:u[t]=c[t]})),r?t.scrollHeight>parseInt(c.height)&&(u.overflowY="scroll"):u.overflow="hidden",l.textContent=t.value.substring(0,i),d&&(l.textContent=l.textContent.replace(/\s/g," "));var p=document.createElement("span");p.textContent=t.value.substring(i)||".",l.appendChild(p);var f={top:p.offsetTop+parseInt(c.borderTopWidth),left:p.offsetLeft+parseInt(c.borderLeftWidth),height:parseInt(c.lineHeight)};return a?p.style.backgroundColor="#aaa":document.body.removeChild(l),f}void 0!==t.exports?t.exports=i:n&&(window.getCaretCoordinates=i)}()},function(t,e,n){"use strict";t.exports=n(134)},function(t,e,n){var r=n(135);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){var r=n(136).default,i=n(137);t.exports=function(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?i(t):e},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){var r=n(138),i=n(139),o=n(140),a=n(142);t.exports=function(t,e){return r(t)||i(t,e)||o(t,e)||a()},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";var r={};n.r(r),n.d(r,"throttle",(function(){return S.b})),n.d(r,"debounce",(function(){return S.a}));var i=n(40),o=n(64),a=n(63),s=n(44),l={handlers:null,getHandlers:function(t){return this.handlers=this.handlers||{},this.handlers[t]=this.handlers[t]||[],this.handlers[t]},trigger:function(t){for(var e=this,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i1}function y(t,e){return Array(e+1).join(t)}function b(t,e,n){for(var r=e,i=n?/\n/:/\s/;t[r]&&!t[r].match(i);)r++;return r}function w(t){var e,n,r=t.value.slice(0,t.selectionStart),i=t.value.slice(t.selectionEnd),o=r.match(/\n*$/),a=i.match(/^\n*/),s=o?o[0].length:0,l=a?a[0].length:0;return r.match(/\S/)&&s<2&&(e=y("\n",2-s)),i.match(/\S/)&&l<2&&(n=y("\n",2-l)),null==e&&(e=""),null==n&&(n=""),{newlinesToAppend:e,newlinesToPrepend:n}}var x=n(65),T=n(85),N=n(48),O=n(81),E=n(83),_=n(31),S=n(51),C=n(9),j=n(54),k=n(52),A=n(14),D=n(35),P=n(70),I=n(42),L=n(76),M=n(73),R=n(7),B=n(8),H=n(77),q=n(66),F=n(37),U=n(72),W=n(69),z=n(71),G=n(39),V=n(10),Y=n(68),K=n(3),X=n(74),J=n(59),Q=n(30),Z=n(36),tt=n(26),et=n(15),nt=n(55),rt=n(22),it=n(17),ot=n(84),at=n(60),st=n(41),lt=n(88),ut=n(49),ct=n(27),dt=n(12),pt=n(16),ft=n(45),ht=n(32),mt=n(58),gt=n(2),vt=n(13),yt=n(29),bt=n(82),wt=n(23),xt=function(t){function e(){return t.apply(this,arguments)||this}return Object(d.a)(e,t),e.prototype.view=function(e){var n=t.prototype.view.call(this,e),r=n.attrs.title;return delete n.attrs.title,m(wt.a,{text:r},n)},e.initAttrs=function(e){t.initAttrs.call(this,e),e.className=e.className||"Button Button--icon Button--link"},e}(gt.a),Tt=n(56),Nt=n(1),Ot=n(75),Et=n(87),_t=n(18),St=n(5),Ct=n(43),jt=n(89),kt=n(33),At=n(20),Dt=n(86),Pt=n(6),It=function(){function t(){this.element=void 0}var e=t.prototype;return e.$=function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){var e=$(this.element);return t?e.find(t):e})),e.render=function(){var t=this,e=this.view();e.attrs=e.attrs||{};var n=e.attrs.oncreate;return e.attrs.oncreate=function(e){t.element=e.dom,n&&n.apply(t,[e])},e},t}(),$t=n(38),Lt=n(57);e.a={extend:i,Session:o.a,Store:a.a,"utils/BasicEditorDriver":s.a,"utils/evented":l,"utils/liveHumanTimes":u.a,"utils/ItemList":c.a,"utils/mixin":function(t){for(var e=function(t){function e(){return t.apply(this,arguments)||this}return Object(d.a)(e,t),e}(t),n=arguments.length,r=new Array(n>1?n-1:0),i=1;i0?a+"\n":i,g=v(h)&&s.length>0?"\n"+s:o;if(u){var y=t.value[t.selectionStart-1];0===t.selectionStart||null==y||y.match(/\s/)||(m=" "+m)}h=function(t,e,n,r){void 0===r&&(r=!1);if(t.selectionStart===t.selectionEnd)t.selectionStart=function(t,e){var n=e;for(;t[n]&&null!=t[n-1]&&!t[n-1].match(/\s/);)n--;return n}(t.value,t.selectionStart),t.selectionEnd=b(t.value,t.selectionEnd,r);else{var i=t.selectionStart-e.length,o=t.selectionEnd+n.length,a=t.value.slice(i,t.selectionStart)===e,s=t.value.slice(t.selectionEnd,o)===n;a&&s&&(t.selectionStart=i,t.selectionEnd=o)}return t.value.slice(t.selectionStart,t.selectionEnd)}(t,m,g,e.multiline);var x=t.selectionStart,T=t.selectionEnd,N=l.length>0&&g.indexOf(l)>-1&&h.length>0;if(d){var O=w(t);n=O.newlinesToAppend,r=O.newlinesToPrepend,m=n+i,g+=r}if(h.startsWith(m)&&h.endsWith(g)){var E=h.slice(m.length,h.length-g.length);if(p===f){var _=p-m.length;_=Math.max(_,x),_=Math.min(_,x+E.length),x=T=_}else T=x+E.length;return{text:E,selectionStart:x,selectionEnd:T}}if(N){if(c.length>0&&h.match(c)){g=g.replace(l,h);var S=m+g;return x=T=x+m.length,{text:S,selectionStart:x,selectionEnd:T}}var C=m+h+g;return x=x+m.length+h.length+g.indexOf(l),T=x+l.length,{text:C,selectionStart:x,selectionEnd:T}}var j=m+h+g;x=p+m.length,T=f+m.length;var k=h.match(/^\s*|\s*$/g);if(e.trimFirst&&k){var A=k[0]||"",D=k[1]||"";j=A+m+h.trim()+g+D,x+=A.length,T-=D.length}return{text:j,selectionStart:x,selectionEnd:T}}(t,e),Object(h.a)(t,n)},"utils/Drawer":x.a,"utils/anchorScroll":T.a,"utils/RequestError":N.a,"utils/abbreviateNumber":O.a,"utils/string":_,"utils/SubtreeRetainer":j.a,"utils/escapeRegExp":E.a,"utils/extract":A.a,"utils/ScrollListener":D.a,"utils/stringToColor":P.a,"utils/Stream":C.a,"utils/subclassOf":I.a,"utils/setRouteWithForcedRefresh":k.a,"utils/patchMithril":L.a,"utils/proxifyCompat":M.a,"utils/classList":R.a,"utils/extractText":B.a,"utils/formatNumber":H.a,"utils/mapRoutes":q.a,"utils/withAttr":F.a,"utils/throttleDebounce":r,"models/Notification":U.a,"models/User":W.a,"models/Post":z.a,"models/Discussion":G.a,"models/Group":V.a,"models/Forum":Y.a,Component:K.a,Fragment:It,Translator:X.a,"components/AlertManager":J.a,"components/Page":Q.a,"components/Switch":Z.a,"components/Badge":tt.a,"components/LoadingIndicator":et.a,"components/Placeholder":nt.a,"components/Separator":rt.a,"components/Dropdown":it.a,"components/SplitDropdown":ot.a,"components/RequestErrorModal":at.a,"components/FieldSet":st.a,"components/Select":lt.a,"components/Navigation":ut.a,"components/Alert":ct.a,"components/Link":dt.a,"components/LinkButton":pt.a,"components/Checkbox":ft.a,"components/SelectDropdown":ht.a,"components/ModalManager":mt.a,"components/Button":gt.a,"components/Modal":vt.a,"components/GroupBadge":yt.a,"components/TextEditor":bt.a,"components/TextEditorButton":xt,"components/Tooltip":wt.a,"components/EditUserModal":Tt.a,Model:Nt.a,Application:Ot.a,"helpers/fullTime":Et.a,"helpers/avatar":_t.a,"helpers/icon":St.a,"helpers/humanTime":Ct.a,"helpers/punctuateSeries":jt.a,"helpers/highlight":kt.a,"helpers/username":At.a,"helpers/userOnline":Dt.a,"helpers/listItems":Pt.a,"resolvers/DefaultResolver":$t.a,"states/PaginatedListState":Lt.a}},function(t,e,n){var r=n(111),i=n(53);void 0===i.$&&(i.$=r),void 0===i.jQuery&&(i.jQuery=r),t.exports=r},function(t,e,n){var r; /*! * jQuery JavaScript Library v3.6.0 * https://jquery.com/ @@ -11,7 +11,7 @@ flarum.core=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i * https://jquery.org/license * * Date: 2021-03-02T17:08Z - */!function(e,n){"use strict";"object"==typeof t.exports?t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(e)}("undefined"!=typeof window?window:this,(function(n,i){"use strict";var o=[],a=Object.getPrototypeOf,s=o.slice,u=o.flat?function(t){return o.flat.call(t)}:function(t){return o.concat.apply([],t)},l=o.push,c=o.indexOf,d={},p=d.toString,f=d.hasOwnProperty,h=f.toString,m=h.call(Object),g={},v=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType&&"function"!=typeof t.item},y=function(t){return null!=t&&t===t.window},b=n.document,w={type:!0,src:!0,nonce:!0,noModule:!0};function x(t,e,n){var r,i,o=(n=n||b).createElement("script");if(o.text=t,e)for(r in w)(i=e[r]||e.getAttribute&&e.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function T(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?d[p.call(t)]||"object":typeof t}var N=function t(e,n){return new t.fn.init(e,n)};function O(t){var e=!!t&&"length"in t&&t.length,n=T(t);return!v(t)&&!y(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}N.fn=N.prototype={jquery:"3.6.0",constructor:N,length:0,toArray:function(){return s.call(this)},get:function(t){return null==t?s.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=N.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return N.each(this,t)},map:function(t){return this.pushStack(N.map(this,(function(e,n){return t.call(e,n,e)})))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(N.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(N.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n0&&e-1 in t)}N.fn=N.prototype={jquery:"3.6.0",constructor:N,length:0,toArray:function(){return s.call(this)},get:function(t){return null==t?s.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=N.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return N.each(this,t)},map:function(t){return this.pushStack(N.map(this,(function(e,n){return t.call(e,n,e)})))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(N.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(N.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n+~]|"+M+")"+M+"*"),z=new RegExp(M+"|>"),G=new RegExp(H),V=new RegExp("^"+R+"$"),Y={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+B),PSEUDO:new RegExp("^"+H),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},K=/HTML$/i,X=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tt=/[+~]/,et=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),nt=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},rt=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,it=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},ot=function(){p()},at=wt((function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{P.apply(k=I.call(x.childNodes),x.childNodes),k[x.childNodes.length].nodeType}catch(t){P={apply:k.length?function(t,e){D.apply(t,I.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}function st(t,e,r,i){var o,s,l,c,d,h,v,y=e&&e.ownerDocument,x=e?e.nodeType:9;if(r=r||[],"string"!=typeof t||!t||1!==x&&9!==x&&11!==x)return r;if(!i&&(p(e),e=e||f,m)){if(11!==x&&(d=Z.exec(t)))if(o=d[1]){if(9===x){if(!(l=e.getElementById(o)))return r;if(l.id===o)return r.push(l),r}else if(y&&(l=y.getElementById(o))&&b(e,l)&&l.id===o)return r.push(l),r}else{if(d[2])return P.apply(r,e.getElementsByTagName(t)),r;if((o=d[3])&&n.getElementsByClassName&&e.getElementsByClassName)return P.apply(r,e.getElementsByClassName(o)),r}if(n.qsa&&!S[t+" "]&&(!g||!g.test(t))&&(1!==x||"object"!==e.nodeName.toLowerCase())){if(v=t,y=e,1===x&&(z.test(t)||W.test(t))){for((y=tt.test(t)&&vt(e.parentNode)||e)===e&&n.scope||((c=e.getAttribute("id"))?c=c.replace(rt,it):e.setAttribute("id",c=w)),s=(h=a(t)).length;s--;)h[s]=(c?"#"+c:":scope")+" "+bt(h[s]);v=h.join(",")}try{return P.apply(r,y.querySelectorAll(v)),r}catch(e){S(t,!0)}finally{c===w&&e.removeAttribute("id")}}}return u(t.replace(F,"$1"),e,r,i)}function ut(){var t=[];return function e(n,i){return t.push(n+" ")>r.cacheLength&&delete e[t.shift()],e[n+" "]=i}}function lt(t){return t[w]=!0,t}function ct(t){var e=f.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function dt(t,e){for(var n=t.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=e}function pt(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function ft(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function ht(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function mt(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&at(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function gt(t){return lt((function(e){return e=+e,lt((function(n,r){for(var i,o=t([],n.length,e),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))}))}))}function vt(t){return t&&void 0!==t.getElementsByTagName&&t}for(e in n=st.support={},o=st.isXML=function(t){var e=t&&t.namespaceURI,n=t&&(t.ownerDocument||t).documentElement;return!K.test(e||n&&n.nodeName||"HTML")},p=st.setDocument=function(t){var e,i,a=t?t.ownerDocument||t:x;return a!=f&&9===a.nodeType&&a.documentElement?(h=(f=a).documentElement,m=!o(f),x!=f&&(i=f.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",ot,!1):i.attachEvent&&i.attachEvent("onunload",ot)),n.scope=ct((function(t){return h.appendChild(t).appendChild(f.createElement("div")),void 0!==t.querySelectorAll&&!t.querySelectorAll(":scope fieldset div").length})),n.attributes=ct((function(t){return t.className="i",!t.getAttribute("className")})),n.getElementsByTagName=ct((function(t){return t.appendChild(f.createComment("")),!t.getElementsByTagName("*").length})),n.getElementsByClassName=Q.test(f.getElementsByClassName),n.getById=ct((function(t){return h.appendChild(t).id=w,!f.getElementsByName||!f.getElementsByName(w).length})),n.getById?(r.filter.ID=function(t){var e=t.replace(et,nt);return function(t){return t.getAttribute("id")===e}},r.find.ID=function(t,e){if(void 0!==e.getElementById&&m){var n=e.getElementById(t);return n?[n]:[]}}):(r.filter.ID=function(t){var e=t.replace(et,nt);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},r.find.ID=function(t,e){if(void 0!==e.getElementById&&m){var n,r,i,o=e.getElementById(t);if(o){if((n=o.getAttributeNode("id"))&&n.value===t)return[o];for(i=e.getElementsByName(t),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===t)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,r=[],i=0,o=e.getElementsByTagName(t);if("*"===t){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&m)return e.getElementsByClassName(t)},v=[],g=[],(n.qsa=Q.test(f.querySelectorAll))&&(ct((function(t){var e;h.appendChild(t).innerHTML="",t.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+M+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||g.push("\\["+M+"*(?:value|"+L+")"),t.querySelectorAll("[id~="+w+"-]").length||g.push("~="),(e=f.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||g.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),t.querySelectorAll(":checked").length||g.push(":checked"),t.querySelectorAll("a#"+w+"+*").length||g.push(".#.+[+~]"),t.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")})),ct((function(t){t.innerHTML="";var e=f.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&g.push("name"+M+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),h.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),g.push(",.*:")}))),(n.matchesSelector=Q.test(y=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ct((function(t){n.disconnectedMatch=y.call(t,"*"),y.call(t,"[s!='']:x"),v.push("!=",H)})),g=g.length&&new RegExp(g.join("|")),v=v.length&&new RegExp(v.join("|")),e=Q.test(h.compareDocumentPosition),b=e||Q.test(h.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},C=e?function(t,e){if(t===e)return d=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(1&(r=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!n.sortDetached&&e.compareDocumentPosition(t)===r?t==f||t.ownerDocument==x&&b(x,t)?-1:e==f||e.ownerDocument==x&&b(x,e)?1:c?$(c,t)-$(c,e):0:4&r?-1:1)}:function(t,e){if(t===e)return d=!0,0;var n,r=0,i=t.parentNode,o=e.parentNode,a=[t],s=[e];if(!i||!o)return t==f?-1:e==f?1:i?-1:o?1:c?$(c,t)-$(c,e):0;if(i===o)return pt(t,e);for(n=t;n=n.parentNode;)a.unshift(n);for(n=e;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?pt(a[r],s[r]):a[r]==x?-1:s[r]==x?1:0},f):f},st.matches=function(t,e){return st(t,null,null,e)},st.matchesSelector=function(t,e){if(p(t),n.matchesSelector&&m&&!S[e+" "]&&(!v||!v.test(e))&&(!g||!g.test(e)))try{var r=y.call(t,e);if(r||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(t){S(e,!0)}return st(e,f,null,[t]).length>0},st.contains=function(t,e){return(t.ownerDocument||t)!=f&&p(t),b(t,e)},st.attr=function(t,e){(t.ownerDocument||t)!=f&&p(t);var i=r.attrHandle[e.toLowerCase()],o=i&&j.call(r.attrHandle,e.toLowerCase())?i(t,e,!m):void 0;return void 0!==o?o:n.attributes||!m?t.getAttribute(e):(o=t.getAttributeNode(e))&&o.specified?o.value:null},st.escape=function(t){return(t+"").replace(rt,it)},st.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},st.uniqueSort=function(t){var e,r=[],i=0,o=0;if(d=!n.detectDuplicates,c=!n.sortStable&&t.slice(0),t.sort(C),d){for(;e=t[o++];)e===t[o]&&(i=r.push(o));for(;i--;)t.splice(r[i],1)}return c=null,t},i=st.getText=function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=i(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[r++];)n+=i(e);return n},(r=st.selectors={cacheLength:50,createPseudo:lt,match:Y,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(et,nt),t[3]=(t[3]||t[4]||t[5]||"").replace(et,nt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||st.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&st.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return Y.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&G.test(n)&&(e=a(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(et,nt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=O[t+" "];return e||(e=new RegExp("(^|"+M+")"+t+"("+M+"|$)"))&&O(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var i=st.attr(r,t);return null==i?"!="===e:!e||(i+="","="===e?i===n:"!="===e?i!==n:"^="===e?n&&0===i.indexOf(n):"*="===e?n&&i.indexOf(n)>-1:"$="===e?n&&i.slice(-n.length)===n:"~="===e?(" "+i.replace(q," ")+" ").indexOf(n)>-1:"|="===e&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,i){var o="nth"!==t.slice(0,3),a="last"!==t.slice(-4),s="of-type"===e;return 1===r&&0===i?function(t){return!!t.parentNode}:function(e,n,u){var l,c,d,p,f,h,m=o!==a?"nextSibling":"previousSibling",g=e.parentNode,v=s&&e.nodeName.toLowerCase(),y=!u&&!s,b=!1;if(g){if(o){for(;m;){for(p=e;p=p[m];)if(s?p.nodeName.toLowerCase()===v:1===p.nodeType)return!1;h=m="only"===t&&!h&&"nextSibling"}return!0}if(h=[a?g.firstChild:g.lastChild],a&&y){for(b=(f=(l=(c=(d=(p=g)[w]||(p[w]={}))[p.uniqueID]||(d[p.uniqueID]={}))[t]||[])[0]===T&&l[1])&&l[2],p=f&&g.childNodes[f];p=++f&&p&&p[m]||(b=f=0)||h.pop();)if(1===p.nodeType&&++b&&p===e){c[t]=[T,f,b];break}}else if(y&&(b=f=(l=(c=(d=(p=e)[w]||(p[w]={}))[p.uniqueID]||(d[p.uniqueID]={}))[t]||[])[0]===T&&l[1]),!1===b)for(;(p=++f&&p&&p[m]||(b=f=0)||h.pop())&&((s?p.nodeName.toLowerCase()!==v:1!==p.nodeType)||!++b||(y&&((c=(d=p[w]||(p[w]={}))[p.uniqueID]||(d[p.uniqueID]={}))[t]=[T,b]),p!==e)););return(b-=i)===r||b%r==0&&b/r>=0}}},PSEUDO:function(t,e){var n,i=r.pseudos[t]||r.setFilters[t.toLowerCase()]||st.error("unsupported pseudo: "+t);return i[w]?i(e):i.length>1?(n=[t,t,"",e],r.setFilters.hasOwnProperty(t.toLowerCase())?lt((function(t,n){for(var r,o=i(t,e),a=o.length;a--;)t[r=$(t,o[a])]=!(n[r]=o[a])})):function(t){return i(t,0,n)}):i}},pseudos:{not:lt((function(t){var e=[],n=[],r=s(t.replace(F,"$1"));return r[w]?lt((function(t,e,n,i){for(var o,a=r(t,null,i,[]),s=t.length;s--;)(o=a[s])&&(t[s]=!(e[s]=o))})):function(t,i,o){return e[0]=t,r(e,null,o,n),e[0]=null,!n.pop()}})),has:lt((function(t){return function(e){return st(t,e).length>0}})),contains:lt((function(t){return t=t.replace(et,nt),function(e){return(e.textContent||i(e)).indexOf(t)>-1}})),lang:lt((function(t){return V.test(t||"")||st.error("unsupported lang: "+t),t=t.replace(et,nt).toLowerCase(),function(e){var n;do{if(n=m?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===h},focus:function(t){return t===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:mt(!1),disabled:mt(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!r.pseudos.empty(t)},header:function(t){return J.test(t.nodeName)},input:function(t){return X.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:gt((function(){return[0]})),last:gt((function(t,e){return[e-1]})),eq:gt((function(t,e,n){return[n<0?n+e:n]})),even:gt((function(t,e){for(var n=0;ne?e:n;--r>=0;)t.push(r);return t})),gt:gt((function(t,e,n){for(var r=n<0?n+e:n;++r1?function(e,n,r){for(var i=t.length;i--;)if(!t[i](e,n,r))return!1;return!0}:t[0]}function Tt(t,e,n,r,i){for(var o,a=[],s=0,u=t.length,l=null!=e;s-1&&(o[l]=!(a[l]=d))}}else v=Tt(v===a?v.splice(h,v.length):v),i?i(null,a,v,u):P.apply(a,v)}))}function Ot(t){for(var e,n,i,o=t.length,a=r.relative[t[0].type],s=a||r.relative[" "],u=a?1:0,c=wt((function(t){return t===e}),s,!0),d=wt((function(t){return $(e,t)>-1}),s,!0),p=[function(t,n,r){var i=!a&&(r||n!==l)||((e=n).nodeType?c(t,n,r):d(t,n,r));return e=null,i}];u1&&xt(p),u>1&&bt(t.slice(0,u-1).concat({value:" "===t[u-2].type?"*":""})).replace(F,"$1"),n,u0,i=t.length>0,o=function(o,a,s,u,c){var d,h,g,v=0,y="0",b=o&&[],w=[],x=l,N=o||i&&r.find.TAG("*",c),O=T+=null==x?1:Math.random()||.1,E=N.length;for(c&&(l=a==f||a||c);y!==E&&null!=(d=N[y]);y++){if(i&&d){for(h=0,a||d.ownerDocument==f||(p(d),s=!m);g=t[h++];)if(g(d,a||f,s)){u.push(d);break}c&&(T=O)}n&&((d=!g&&d)&&v--,o&&b.push(d))}if(v+=y,n&&y!==v){for(h=0;g=e[h++];)g(b,w,a,s);if(o){if(v>0)for(;y--;)b[y]||w[y]||(w[y]=A.call(u));w=Tt(w)}P.apply(u,w),c&&!o&&w.length>0&&v+e.length>1&&st.uniqueSort(u)}return c&&(T=O,l=x),b};return n?lt(o):o}(o,i))).selector=t}return s},u=st.select=function(t,e,n,i){var o,u,l,c,d,p="function"==typeof t&&t,f=!i&&a(t=p.selector||t);if(n=n||[],1===f.length){if((u=f[0]=f[0].slice(0)).length>2&&"ID"===(l=u[0]).type&&9===e.nodeType&&m&&r.relative[u[1].type]){if(!(e=(r.find.ID(l.matches[0].replace(et,nt),e)||[])[0]))return n;p&&(e=e.parentNode),t=t.slice(u.shift().value.length)}for(o=Y.needsContext.test(t)?0:u.length;o--&&(l=u[o],!r.relative[c=l.type]);)if((d=r.find[c])&&(i=d(l.matches[0].replace(et,nt),tt.test(u[0].type)&&vt(e.parentNode)||e))){if(u.splice(o,1),!(t=i.length&&bt(u)))return P.apply(n,i),n;break}}return(p||s(t,f))(i,e,!m,n,!e||tt.test(t)&&vt(e.parentNode)||e),n},n.sortStable=w.split("").sort(C).join("")===w,n.detectDuplicates=!!d,p(),n.sortDetached=ct((function(t){return 1&t.compareDocumentPosition(f.createElement("fieldset"))})),ct((function(t){return t.innerHTML="","#"===t.firstChild.getAttribute("href")}))||dt("type|href|height|width",(function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)})),n.attributes&&ct((function(t){return t.innerHTML="",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")}))||dt("value",(function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue})),ct((function(t){return null==t.getAttribute("disabled")}))||dt(L,(function(t,e,n){var r;if(!n)return!0===t[e]?e.toLowerCase():(r=t.getAttributeNode(e))&&r.specified?r.value:null})),st}(n);N.find=E,(N.expr=E.selectors)[":"]=N.expr.pseudos,N.uniqueSort=N.unique=E.uniqueSort,N.text=E.getText,N.isXMLDoc=E.isXML,N.contains=E.contains,N.escapeSelector=E.escape;var _=function(t,e,n){for(var r=[],i=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(i&&N(t).is(n))break;r.push(t)}return r},S=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},C=N.expr.match.needsContext;function j(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var k=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function A(t,e,n){return v(e)?N.grep(t,(function(t,r){return!!e.call(t,r,t)!==n})):e.nodeType?N.grep(t,(function(t){return t===e!==n})):"string"!=typeof e?N.grep(t,(function(t){return c.call(e,t)>-1!==n})):N.filter(e,t,n)}N.filter=function(t,e,n){var r=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===r.nodeType?N.find.matchesSelector(r,t)?[r]:[]:N.find.matches(t,N.grep(e,(function(t){return 1===t.nodeType})))},N.fn.extend({find:function(t){var e,n,r=this.length,i=this;if("string"!=typeof t)return this.pushStack(N(t).filter((function(){for(e=0;e1?N.uniqueSort(n):n},filter:function(t){return this.pushStack(A(this,t||[],!1))},not:function(t){return this.pushStack(A(this,t||[],!0))},is:function(t){return!!A(this,"string"==typeof t&&C.test(t)?N(t):t||[],!1).length}});var D,P=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(N.fn.init=function(t,e,n){var r,i;if(!t)return this;if(n=n||D,"string"==typeof t){if(!(r="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:P.exec(t))||!r[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(r[1]){if(e=e instanceof N?e[0]:e,N.merge(this,N.parseHTML(r[1],e&&e.nodeType?e.ownerDocument||e:b,!0)),k.test(r[1])&&N.isPlainObject(e))for(r in e)v(this[r])?this[r](e[r]):this.attr(r,e[r]);return this}return(i=b.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):v(t)?void 0!==n.ready?n.ready(t):t(N):N.makeArray(t,this)}).prototype=N.fn,D=N(b);var I=/^(?:parents|prev(?:Until|All))/,$={children:!0,contents:!0,next:!0,prev:!0};function L(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}N.fn.extend({has:function(t){var e=N(t,this),n=e.length;return this.filter((function(){for(var t=0;t-1:1===n.nodeType&&N.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?N.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?c.call(N(t),this[0]):c.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(N.uniqueSort(N.merge(this.get(),N(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),N.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return _(t,"parentNode")},parentsUntil:function(t,e,n){return _(t,"parentNode",n)},next:function(t){return L(t,"nextSibling")},prev:function(t){return L(t,"previousSibling")},nextAll:function(t){return _(t,"nextSibling")},prevAll:function(t){return _(t,"previousSibling")},nextUntil:function(t,e,n){return _(t,"nextSibling",n)},prevUntil:function(t,e,n){return _(t,"previousSibling",n)},siblings:function(t){return S((t.parentNode||{}).firstChild,t)},children:function(t){return S(t.firstChild)},contents:function(t){return null!=t.contentDocument&&a(t.contentDocument)?t.contentDocument:(j(t,"template")&&(t=t.content||t),N.merge([],t.childNodes))}},(function(t,e){N.fn[t]=function(n,r){var i=N.map(this,e,n);return"Until"!==t.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=N.filter(r,i)),this.length>1&&($[t]||N.uniqueSort(i),I.test(t)&&i.reverse()),this.pushStack(i)}}));var M=/[^\x20\t\r\n\f]+/g;function R(t){return t}function B(t){throw t}function H(t,e,n,r){var i;try{t&&v(i=t.promise)?i.call(t).done(e).fail(n):t&&v(i=t.then)?i.call(t,e,n):e.apply(void 0,[t].slice(r))}catch(t){n.apply(void 0,[t])}}N.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return N.each(t.match(M)||[],(function(t,n){e[n]=!0})),e}(t):N.extend({},t);var e,n,r,i,o=[],a=[],s=-1,u=function(){for(i=i||t.once,r=e=!0;a.length;s=-1)for(n=a.shift();++s-1;)o.splice(n,1),n<=s&&s--})),this},has:function(t){return t?N.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||e||(o=n=""),this},locked:function(){return!!i},fireWith:function(t,n){return i||(n=[t,(n=n||[]).slice?n.slice():n],a.push(n),e||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l},N.extend({Deferred:function(t){var e=[["notify","progress",N.Callbacks("memory"),N.Callbacks("memory"),2],["resolve","done",N.Callbacks("once memory"),N.Callbacks("once memory"),0,"resolved"],["reject","fail",N.Callbacks("once memory"),N.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return i.then(null,t)},pipe:function(){var t=arguments;return N.Deferred((function(n){N.each(e,(function(e,r){var i=v(t[r[4]])&&t[r[4]];o[r[1]]((function(){var t=i&&i.apply(this,arguments);t&&v(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[t]:arguments)}))})),t=null})).promise()},then:function(t,r,i){var o=0;function a(t,e,r,i){return function(){var s=this,u=arguments,l=function(){var n,l;if(!(t=o&&(r!==B&&(s=void 0,u=[n]),e.rejectWith(s,u))}};t?c():(N.Deferred.getStackHook&&(c.stackTrace=N.Deferred.getStackHook()),n.setTimeout(c))}}return N.Deferred((function(n){e[0][3].add(a(0,n,v(i)?i:R,n.notifyWith)),e[1][3].add(a(0,n,v(t)?t:R)),e[2][3].add(a(0,n,v(r)?r:B))})).promise()},promise:function(t){return null!=t?N.extend(t,i):i}},o={};return N.each(e,(function(t,n){var a=n[2],s=n[5];i[n[1]]=a.add,s&&a.add((function(){r=s}),e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),a.add(n[3].fire),o[n[0]]=function(){return o[n[0]+"With"](this===o?void 0:this,arguments),this},o[n[0]+"With"]=a.fireWith})),i.promise(o),t&&t.call(o,o),o},when:function(t){var e=arguments.length,n=e,r=Array(n),i=s.call(arguments),o=N.Deferred(),a=function(t){return function(n){r[t]=this,i[t]=arguments.length>1?s.call(arguments):n,--e||o.resolveWith(r,i)}};if(e<=1&&(H(t,o.done(a(n)).resolve,o.reject,!e),"pending"===o.state()||v(i[n]&&i[n].then)))return o.then();for(;n--;)H(i[n],a(n),o.reject);return o.promise()}});var q=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;N.Deferred.exceptionHook=function(t,e){n.console&&n.console.warn&&t&&q.test(t.name)&&n.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},N.readyException=function(t){n.setTimeout((function(){throw t}))};var F=N.Deferred();function U(){b.removeEventListener("DOMContentLoaded",U),n.removeEventListener("load",U),N.ready()}N.fn.ready=function(t){return F.then(t).catch((function(t){N.readyException(t)})),this},N.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--N.readyWait:N.isReady)||(N.isReady=!0,!0!==t&&--N.readyWait>0||F.resolveWith(b,[N]))}}),N.ready.then=F.then,"complete"===b.readyState||"loading"!==b.readyState&&!b.documentElement.doScroll?n.setTimeout(N.ready):(b.addEventListener("DOMContentLoaded",U),n.addEventListener("load",U));var W=function t(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===T(r))for(u in o=!0,r)t(e,n,u,r[u],!0,a,s);else if(void 0!==i&&(o=!0,v(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(t,e,n){return c.call(N(t),n)})),n))for(;u1,null,!0)},removeData:function(t){return this.each((function(){Q.remove(this,t)}))}}),N.extend({queue:function(t,e,n){var r;if(t)return e=(e||"fx")+"queue",r=J.get(t,e),n&&(!r||Array.isArray(n)?r=J.access(t,e,N.makeArray(n)):r.push(n)),r||[]},dequeue:function(t,e){var n=N.queue(t,e=e||"fx"),r=n.length,i=n.shift(),o=N._queueHooks(t,e);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===e&&n.unshift("inprogress"),delete o.stop,i.call(t,(function(){N.dequeue(t,e)}),o)),!r&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return J.get(t,n)||J.access(t,n,{empty:N.Callbacks("once memory").add((function(){J.remove(t,[e+"queue",n])}))})}}),N.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length\x20\t\r\n\f]*)/i,vt=/^$|^module$|\/(?:java|ecma)script/i;ft=b.createDocumentFragment().appendChild(b.createElement("div")),(ht=b.createElement("input")).setAttribute("type","radio"),ht.setAttribute("checked","checked"),ht.setAttribute("name","t"),ft.appendChild(ht),g.checkClone=ft.cloneNode(!0).cloneNode(!0).lastChild.checked,ft.innerHTML="",g.noCloneChecked=!!ft.cloneNode(!0).lastChild.defaultValue,ft.innerHTML="",g.option=!!ft.lastChild;var yt={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function bt(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&j(t,e)?N.merge([t],n):n}function wt(t,e){for(var n=0,r=t.length;n",""]);var xt=/<|&#?\w+;/;function Tt(t,e,n,r,i){for(var o,a,s,u,l,c,d=e.createDocumentFragment(),p=[],f=0,h=t.length;f-1)i&&i.push(o);else if(l=at(o),a=bt(d.appendChild(o),"script"),l&&wt(a),n)for(c=0;o=a[c++];)vt.test(o.type||"")&&n.push(o);return d}var Nt=/^([^.]*)(?:\.(.+)|)/;function Ot(){return!0}function Et(){return!1}function _t(t,e){return t===function(){try{return b.activeElement}catch(t){}}()==("focus"===e)}function St(t,e,n,r,i,o){var a,s;if("object"==typeof e){for(s in"string"!=typeof n&&(r=r||n,n=void 0),e)St(t,s,n,r,e[s],o);return t}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Et;else if(!i)return t;return 1===o&&(a=i,(i=function(t){return N().off(t),a.apply(this,arguments)}).guid=a.guid||(a.guid=N.guid++)),t.each((function(){N.event.add(this,e,i,r,n)}))}function Ct(t,e,n){n?(J.set(t,e,!1),N.event.add(t,e,{namespace:!1,handler:function(t){var r,i,o=J.get(this,e);if(1&t.isTrigger&&this[e]){if(o.length)(N.event.special[e]||{}).delegateType&&t.stopPropagation();else if(o=s.call(arguments),J.set(this,e,o),r=n(this,e),this[e](),o!==(i=J.get(this,e))||r?J.set(this,e,!1):i={},o!==i)return t.stopImmediatePropagation(),t.preventDefault(),i&&i.value}else o.length&&(J.set(this,e,{value:N.event.trigger(N.extend(o[0],N.Event.prototype),o.slice(1),this)}),t.stopImmediatePropagation())}})):void 0===J.get(t,e)&&N.event.add(t,e,Ot)}N.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,d,p,f,h,m,g=J.get(t);if(K(t))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&N.find.matchesSelector(ot,i),n.guid||(n.guid=N.guid++),(u=g.events)||(u=g.events=Object.create(null)),(a=g.handle)||(a=g.handle=function(e){return void 0!==N&&N.event.triggered!==e.type?N.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(M)||[""]).length;l--;)f=m=(s=Nt.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),f&&(d=N.event.special[f]||{},f=(i?d.delegateType:d.bindType)||f,d=N.event.special[f]||{},c=N.extend({type:f,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&N.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[f])||((p=u[f]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(f,a)),d.add&&(d.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),N.event.global[f]=!0)},remove:function(t,e,n,r,i){var o,a,s,u,l,c,d,p,f,h,m,g=J.hasData(t)&&J.get(t);if(g&&(u=g.events)){for(l=(e=(e||"").match(M)||[""]).length;l--;)if(f=m=(s=Nt.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),f){for(d=N.event.special[f]||{},p=u[f=(r?d.delegateType:d.bindType)||f]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;o--;)c=p[o],!i&&m!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,d.remove&&d.remove.call(t,c));a&&!p.length&&(d.teardown&&!1!==d.teardown.call(t,h,g.handle)||N.removeEvent(t,f,g.handle),delete u[f])}else for(f in u)N.event.remove(t,f+e[l],n,r,!0);N.isEmptyObject(u)&&J.remove(t,"handle events")}},dispatch:function(t){var e,n,r,i,o,a,s=new Array(arguments.length),u=N.event.fix(t),l=(J.get(this,"events")||Object.create(null))[u.type]||[],c=N.event.special[u.type]||{};for(s[0]=u,e=1;e=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==t.type||!0!==l.disabled)){for(o=[],a={},n=0;n-1:N.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u\s*$/g;function Dt(t,e){return j(t,"table")&&j(11!==e.nodeType?e:e.firstChild,"tr")&&N(t).children("tbody")[0]||t}function Pt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function It(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function $t(t,e){var n,r,i,o,a,s;if(1===e.nodeType){if(J.hasData(t)&&(s=J.get(t).events))for(i in J.remove(e,"handle events"),s)for(n=0,r=s[i].length;n1&&"string"==typeof h&&!g.checkClone&&kt.test(h))return t.each((function(i){var o=t.eq(i);m&&(e[0]=h.call(this,i,o.html())),Mt(o,e,n,r)}));if(p&&(o=(i=Tt(e,t[0].ownerDocument,!1,t,r)).firstChild,1===i.childNodes.length&&(i=o),o||r)){for(s=(a=N.map(bt(i,"script"),Pt)).length;d0&&wt(a,!u&&bt(t,"script")),s},cleanData:function(t){for(var e,n,r,i=N.event.special,o=0;void 0!==(n=t[o]);o++)if(K(n)){if(e=n[J.expando]){if(e.events)for(r in e.events)i[r]?N.event.remove(n,r):N.removeEvent(n,r,e.handle);n[J.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),N.fn.extend({detach:function(t){return Rt(this,t,!0)},remove:function(t){return Rt(this,t)},text:function(t){return W(this,(function(t){return void 0===t?N.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return Mt(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Dt(this,t).appendChild(t)}))},prepend:function(){return Mt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Dt(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return Mt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return Mt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(N.cleanData(bt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return N.clone(this,t,e)}))},html:function(t){return W(this,(function(t){var e=this[0]||{},n=0,r=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!jt.test(t)&&!yt[(gt.exec(t)||["",""])[1].toLowerCase()]){t=N.htmlPrefilter(t);try{for(;n=0&&(u+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-o-u-s-.5))||0),u}function ee(t,e,n){var r=Ht(t),i=(!g.boxSizingReliable()||n)&&"border-box"===N.css(t,"boxSizing",!1,r),o=i,a=Ut(t,e,r),s="offset"+e[0].toUpperCase()+e.slice(1);if(Bt.test(a)){if(!n)return a;a="auto"}return(!g.boxSizingReliable()&&i||!g.reliableTrDimensions()&&j(t,"tr")||"auto"===a||!parseFloat(a)&&"inline"===N.css(t,"display",!1,r))&&t.getClientRects().length&&(i="border-box"===N.css(t,"boxSizing",!1,r),(o=s in t)&&(a=t[s])),(a=parseFloat(a)||0)+te(t,e,n||(i?"border":"content"),o,r,a)+"px"}function ne(t,e,n,r,i){return new ne.prototype.init(t,e,n,r,i)}N.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=Ut(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(t,e,n,r){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var i,o,a,s=Y(e),u=Xt.test(e),l=t.style;if(u||(e=Yt(s)),a=N.cssHooks[e]||N.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(t,!1,r))?i:l[e];"string"===(o=typeof n)&&(i=rt.exec(n))&&i[1]&&(n=lt(t,e,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(N.cssNumber[s]?"":"px")),g.clearCloneStyle||""!==n||0!==e.indexOf("background")||(l[e]="inherit"),a&&"set"in a&&void 0===(n=a.set(t,n,r))||(u?l.setProperty(e,n):l[e]=n))}},css:function(t,e,n,r){var i,o,a,s=Y(e);return Xt.test(e)||(e=Yt(s)),(a=N.cssHooks[e]||N.cssHooks[s])&&"get"in a&&(i=a.get(t,!0,n)),void 0===i&&(i=Ut(t,e,r)),"normal"===i&&e in Qt&&(i=Qt[e]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),N.each(["height","width"],(function(t,e){N.cssHooks[e]={get:function(t,n,r){if(n)return!Kt.test(N.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?ee(t,e,r):qt(t,Jt,(function(){return ee(t,e,r)}))},set:function(t,n,r){var i,o=Ht(t),a=!g.scrollboxSize()&&"absolute"===o.position,s=(a||r)&&"border-box"===N.css(t,"boxSizing",!1,o),u=r?te(t,e,r,s,o):0;return s&&a&&(u-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(o[e])-te(t,e,"border",!1,o)-.5)),u&&(i=rt.exec(n))&&"px"!==(i[3]||"px")&&(t.style[e]=n,n=N.css(t,e)),Zt(0,n,u)}}})),N.cssHooks.marginLeft=Wt(g.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(Ut(t,"marginLeft"))||t.getBoundingClientRect().left-qt(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),N.each({margin:"",padding:"",border:"Width"},(function(t,e){N.cssHooks[t+e]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[t+it[r]+e]=o[r]||o[r-2]||o[0];return i}},"margin"!==t&&(N.cssHooks[t+e].set=Zt)})),N.fn.extend({css:function(t,e){return W(this,(function(t,e,n){var r,i,o={},a=0;if(Array.isArray(e)){for(r=Ht(t),i=e.length;a1)}}),N.Tween=ne,ne.prototype={constructor:ne,init:function(t,e,n,r,i,o){this.elem=t,this.prop=n,this.easing=i||N.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=r,this.unit=o||(N.cssNumber[n]?"":"px")},cur:function(){var t=ne.propHooks[this.prop];return t&&t.get?t.get(this):ne.propHooks._default.get(this)},run:function(t){var e,n=ne.propHooks[this.prop];return this.options.duration?this.pos=e=N.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):ne.propHooks._default.set(this),this}},ne.prototype.init.prototype=ne.prototype,ne.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=N.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){N.fx.step[t.prop]?N.fx.step[t.prop](t):1!==t.elem.nodeType||!N.cssHooks[t.prop]&&null==t.elem.style[Yt(t.prop)]?t.elem[t.prop]=t.now:N.style(t.elem,t.prop,t.now+t.unit)}}},ne.propHooks.scrollTop=ne.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},N.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},(N.fx=ne.prototype.init).step={};var re,ie,oe=/^(?:toggle|show|hide)$/,ae=/queueHooks$/;function se(){ie&&(!1===b.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(se):n.setTimeout(se,N.fx.interval),N.fx.tick())}function ue(){return n.setTimeout((function(){re=void 0})),re=Date.now()}function le(t,e){var n,r=0,i={height:t};for(e=e?1:0;r<4;r+=2-e)i["margin"+(n=it[r])]=i["padding"+n]=t;return e&&(i.opacity=i.width=t),i}function ce(t,e,n){for(var r,i=(de.tweeners[e]||[]).concat(de.tweeners["*"]),o=0,a=i.length;o1)},removeAttr:function(t){return this.each((function(){N.removeAttr(this,t)}))}}),N.extend({attr:function(t,e,n){var r,i,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===t.getAttribute?N.prop(t,e,n):(1===o&&N.isXMLDoc(t)||(i=N.attrHooks[e.toLowerCase()]||(N.expr.match.bool.test(e)?pe:void 0)),void 0!==n?null===n?void N.removeAttr(t,e):i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:(t.setAttribute(e,n+""),n):i&&"get"in i&&null!==(r=i.get(t,e))?r:null==(r=N.find.attr(t,e))?void 0:r)},attrHooks:{type:{set:function(t,e){if(!g.radioValue&&"radio"===e&&j(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,r=0,i=e&&e.match(M);if(i&&1===t.nodeType)for(;n=i[r++];)t.removeAttribute(n)}}),pe={set:function(t,e,n){return!1===e?N.removeAttr(t,n):t.setAttribute(n,n),n}},N.each(N.expr.match.bool.source.match(/\w+/g),(function(t,e){var n=fe[e]||N.find.attr;fe[e]=function(t,e,r){var i,o,a=e.toLowerCase();return r||(o=fe[a],fe[a]=i,i=null!=n(t,e,r)?a:null,fe[a]=o),i}}));var he=/^(?:input|select|textarea|button)$/i,me=/^(?:a|area)$/i;function ge(t){return(t.match(M)||[]).join(" ")}function ve(t){return t.getAttribute&&t.getAttribute("class")||""}function ye(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(M)||[]}N.fn.extend({prop:function(t,e){return W(this,N.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[N.propFix[t]||t]}))}}),N.extend({prop:function(t,e,n){var r,i,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&N.isXMLDoc(t)||(e=N.propFix[e]||e,i=N.propHooks[e]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:t[e]=n:i&&"get"in i&&null!==(r=i.get(t,e))?r:t[e]},propHooks:{tabIndex:{get:function(t){var e=N.find.attr(t,"tabindex");return e?parseInt(e,10):he.test(t.nodeName)||me.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(N.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),N.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){N.propFix[this.toLowerCase()]=this})),N.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,u=0;if(v(t))return this.each((function(e){N(this).addClass(t.call(this,e,ve(this)))}));if((e=ye(t)).length)for(;n=this[u++];)if(i=ve(n),r=1===n.nodeType&&" "+ge(i)+" "){for(a=0;o=e[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=ge(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,u=0;if(v(t))return this.each((function(e){N(this).removeClass(t.call(this,e,ve(this)))}));if(!arguments.length)return this.attr("class","");if((e=ye(t)).length)for(;n=this[u++];)if(i=ve(n),r=1===n.nodeType&&" "+ge(i)+" "){for(a=0;o=e[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");i!==(s=ge(r))&&n.setAttribute("class",s)}return this},toggleClass:function(t,e){var n=typeof t,r="string"===n||Array.isArray(t);return"boolean"==typeof e&&r?e?this.addClass(t):this.removeClass(t):v(t)?this.each((function(n){N(this).toggleClass(t.call(this,n,ve(this),e),e)})):this.each((function(){var e,i,o,a;if(r)for(i=0,o=N(this),a=ye(t);e=a[i++];)o.hasClass(e)?o.removeClass(e):o.addClass(e);else void 0!==t&&"boolean"!==n||((e=ve(this))&&J.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":J.get(this,"__className__")||""))}))},hasClass:function(t){var e,n,r=0;for(e=" "+t+" ";n=this[r++];)if(1===n.nodeType&&(" "+ge(ve(n))+" ").indexOf(e)>-1)return!0;return!1}});var be=/\r/g;N.fn.extend({val:function(t){var e,n,r,i=this[0];return arguments.length?(r=v(t),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?t.call(this,n,N(this).val()):t)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=N.map(i,(function(t){return null==t?"":t+""}))),(e=N.valHooks[this.type]||N.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,i,"value")||(this.value=i))}))):i?(e=N.valHooks[i.type]||N.valHooks[i.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(be,""):null==n?"":n:void 0}}),N.extend({valHooks:{option:{get:function(t){var e=N.find.attr(t,"value");return null!=e?e:ge(N.text(t))}},select:{get:function(t){var e,n,r,i=t.options,o=t.selectedIndex,a="select-one"===t.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r-1)&&(n=!0);return n||(t.selectedIndex=-1),o}}}}),N.each(["radio","checkbox"],(function(){N.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=N.inArray(N(t).val(),e)>-1}},g.checkOn||(N.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})})),g.focusin="onfocusin"in n;var we=/^(?:focusinfocus|focusoutblur)$/,xe=function(t){t.stopPropagation()};N.extend(N.event,{trigger:function(t,e,r,i){var o,a,s,u,l,c,d,p,h=[r||b],m=f.call(t,"type")?t.type:t,g=f.call(t,"namespace")?t.namespace.split("."):[];if(a=p=s=r=r||b,3!==r.nodeType&&8!==r.nodeType&&!we.test(m+N.event.triggered)&&(m.indexOf(".")>-1&&(g=m.split("."),m=g.shift(),g.sort()),l=m.indexOf(":")<0&&"on"+m,(t=t[N.expando]?t:new N.Event(m,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=g.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),e=null==e?[t]:N.makeArray(e,[t]),d=N.event.special[m]||{},i||!d.trigger||!1!==d.trigger.apply(r,e))){if(!i&&!d.noBubble&&!y(r)){for(u=d.delegateType||m,we.test(u+m)||(a=a.parentNode);a;a=a.parentNode)h.push(a),s=a;s===(r.ownerDocument||b)&&h.push(s.defaultView||s.parentWindow||n)}for(o=0;(a=h[o++])&&!t.isPropagationStopped();)p=a,t.type=o>1?u:d.bindType||m,(c=(J.get(a,"events")||Object.create(null))[t.type]&&J.get(a,"handle"))&&c.apply(a,e),(c=l&&a[l])&&c.apply&&K(a)&&(t.result=c.apply(a,e),!1===t.result&&t.preventDefault());return t.type=m,i||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(h.pop(),e)||!K(r)||l&&v(r[m])&&!y(r)&&((s=r[l])&&(r[l]=null),N.event.triggered=m,t.isPropagationStopped()&&p.addEventListener(m,xe),r[m](),t.isPropagationStopped()&&p.removeEventListener(m,xe),N.event.triggered=void 0,s&&(r[l]=s)),t.result}},simulate:function(t,e,n){var r=N.extend(new N.Event,n,{type:t,isSimulated:!0});N.event.trigger(r,null,e)}}),N.fn.extend({trigger:function(t,e){return this.each((function(){N.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var n=this[0];if(n)return N.event.trigger(t,e,n,!0)}}),g.focusin||N.each({focus:"focusin",blur:"focusout"},(function(t,e){var n=function(t){N.event.simulate(e,t.target,N.event.fix(t))};N.event.special[e]={setup:function(){var r=this.ownerDocument||this.document||this,i=J.access(r,e);i||r.addEventListener(t,n,!0),J.access(r,e,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=J.access(r,e)-1;i?J.access(r,e,i):(r.removeEventListener(t,n,!0),J.remove(r,e))}}}));var Te=n.location,Ne={guid:Date.now()},Oe=/\?/;N.parseXML=function(t){var e,r;if(!t||"string"!=typeof t)return null;try{e=(new n.DOMParser).parseFromString(t,"text/xml")}catch(t){}return r=e&&e.getElementsByTagName("parsererror")[0],e&&!r||N.error("Invalid XML: "+(r?N.map(r.childNodes,(function(t){return t.textContent})).join("\n"):t)),e};var Ee=/\[\]$/,_e=/\r?\n/g,Se=/^(?:submit|button|image|reset|file)$/i,Ce=/^(?:input|select|textarea|keygen)/i;function je(t,e,n,r){var i;if(Array.isArray(e))N.each(e,(function(e,i){n||Ee.test(t)?r(t,i):je(t+"["+("object"==typeof i&&null!=i?e:"")+"]",i,n,r)}));else if(n||"object"!==T(e))r(t,e);else for(i in e)je(t+"["+i+"]",e[i],n,r)}N.param=function(t,e){var n,r=[],i=function(t,e){var n=v(e)?e():e;r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!N.isPlainObject(t))N.each(t,(function(){i(this.name,this.value)}));else for(n in t)je(n,t[n],e,i);return r.join("&")},N.fn.extend({serialize:function(){return N.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=N.prop(this,"elements");return t?N.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!N(this).is(":disabled")&&Ce.test(this.nodeName)&&!Se.test(t)&&(this.checked||!mt.test(t))})).map((function(t,e){var n=N(this).val();return null==n?null:Array.isArray(n)?N.map(n,(function(t){return{name:e.name,value:t.replace(_e,"\r\n")}})):{name:e.name,value:n.replace(_e,"\r\n")}})).get()}});var ke=/%20/g,Ae=/#.*$/,De=/([?&])_=[^&]*/,Pe=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ie=/^(?:GET|HEAD)$/,$e=/^\/\//,Le={},Me={},Re="*/".concat("*"),Be=b.createElement("a");function He(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var r,i=0,o=e.toLowerCase().match(M)||[];if(v(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(t[r]=t[r]||[]).unshift(n)):(t[r]=t[r]||[]).push(n)}}function qe(t,e,n,r){var i={},o=t===Me;function a(s){var u;return i[s]=!0,N.each(t[s]||[],(function(t,s){var l=s(e,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):void 0:(e.dataTypes.unshift(l),a(l),!1)})),u}return a(e.dataTypes[0])||!i["*"]&&a("*")}function Fe(t,e){var n,r,i=N.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((i[n]?t:r||(r={}))[n]=e[n]);return r&&N.extend(!0,t,r),t}Be.href=Te.href,N.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Te.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Te.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Re,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":N.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Fe(Fe(t,N.ajaxSettings),e):Fe(N.ajaxSettings,t)},ajaxPrefilter:He(Le),ajaxTransport:He(Me),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0);var r,i,o,a,s,u,l,c,d,p,f=N.ajaxSetup({},e=e||{}),h=f.context||f,m=f.context&&(h.nodeType||h.jquery)?N(h):N.event,g=N.Deferred(),v=N.Callbacks("once memory"),y=f.statusCode||{},w={},x={},T="canceled",O={readyState:0,getResponseHeader:function(t){var e;if(l){if(!a)for(a={};e=Pe.exec(o);)a[e[1].toLowerCase()+" "]=(a[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=a[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return l?o:null},setRequestHeader:function(t,e){return null==l&&(t=x[t.toLowerCase()]=x[t.toLowerCase()]||t,w[t]=e),this},overrideMimeType:function(t){return null==l&&(f.mimeType=t),this},statusCode:function(t){var e;if(t)if(l)O.always(t[O.status]);else for(e in t)y[e]=[y[e],t[e]];return this},abort:function(t){var e=t||T;return r&&r.abort(e),E(0,e),this}};if(g.promise(O),f.url=((t||f.url||Te.href)+"").replace($e,Te.protocol+"//"),f.type=e.method||e.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(M)||[""],null==f.crossDomain){u=b.createElement("a");try{u.href=f.url,u.href=u.href,f.crossDomain=Be.protocol+"//"+Be.host!=u.protocol+"//"+u.host}catch(t){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=N.param(f.data,f.traditional)),qe(Le,f,e,O),l)return O;for(d in(c=N.event&&f.global)&&0==N.active++&&N.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Ie.test(f.type),i=f.url.replace(Ae,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(ke,"+")):(p=f.url.slice(i.length),f.data&&(f.processData||"string"==typeof f.data)&&(i+=(Oe.test(i)?"&":"?")+f.data,delete f.data),!1===f.cache&&(i=i.replace(De,"$1"),p=(Oe.test(i)?"&":"?")+"_="+Ne.guid+++p),f.url=i+p),f.ifModified&&(N.lastModified[i]&&O.setRequestHeader("If-Modified-Since",N.lastModified[i]),N.etag[i]&&O.setRequestHeader("If-None-Match",N.etag[i])),(f.data&&f.hasContent&&!1!==f.contentType||e.contentType)&&O.setRequestHeader("Content-Type",f.contentType),O.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Re+"; q=0.01":""):f.accepts["*"]),f.headers)O.setRequestHeader(d,f.headers[d]);if(f.beforeSend&&(!1===f.beforeSend.call(h,O,f)||l))return O.abort();if(T="abort",v.add(f.complete),O.done(f.success),O.fail(f.error),r=qe(Me,f,e,O)){if(O.readyState=1,c&&m.trigger("ajaxSend",[O,f]),l)return O;f.async&&f.timeout>0&&(s=n.setTimeout((function(){O.abort("timeout")}),f.timeout));try{l=!1,r.send(w,E)}catch(t){if(l)throw t;E(-1,t)}}else E(-1,"No Transport");function E(t,e,a,u){var d,p,b,w,x,T=e;l||(l=!0,s&&n.clearTimeout(s),r=void 0,o=u||"",O.readyState=t>0?4:0,d=t>=200&&t<300||304===t,a&&(w=function(t,e,n){for(var r,i,o,a,s=t.contents,u=t.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=t.mimeType||e.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||t.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(f,O,a)),!d&&N.inArray("script",f.dataTypes)>-1&&N.inArray("json",f.dataTypes)<0&&(f.converters["text script"]=function(){}),w=function(t,e,n,r){var i,o,a,s,u,l={},c=t.dataTypes.slice();if(c[1])for(a in t.converters)l[a.toLowerCase()]=t.converters[a];for(o=c.shift();o;)if(t.responseFields[o]&&(n[t.responseFields[o]]=e),!u&&r&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&t.throws)e=a(e);else try{e=a(e)}catch(t){return{state:"parsererror",error:a?t:"No conversion from "+u+" to "+o}}}return{state:"success",data:e}}(f,w,O,d),d?(f.ifModified&&((x=O.getResponseHeader("Last-Modified"))&&(N.lastModified[i]=x),(x=O.getResponseHeader("etag"))&&(N.etag[i]=x)),204===t||"HEAD"===f.type?T="nocontent":304===t?T="notmodified":(T=w.state,p=w.data,d=!(b=w.error))):(b=T,!t&&T||(T="error",t<0&&(t=0))),O.status=t,O.statusText=(e||T)+"",d?g.resolveWith(h,[p,T,O]):g.rejectWith(h,[O,T,b]),O.statusCode(y),y=void 0,c&&m.trigger(d?"ajaxSuccess":"ajaxError",[O,f,d?p:b]),v.fireWith(h,[O,T]),c&&(m.trigger("ajaxComplete",[O,f]),--N.active||N.event.trigger("ajaxStop")))}return O},getJSON:function(t,e,n){return N.get(t,e,n,"json")},getScript:function(t,e){return N.get(t,void 0,e,"script")}}),N.each(["get","post"],(function(t,e){N[e]=function(t,n,r,i){return v(n)&&(i=i||r,r=n,n=void 0),N.ajax(N.extend({url:t,type:e,dataType:i,data:n,success:r},N.isPlainObject(t)&&t))}})),N.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),N._evalUrl=function(t,e,n){return N.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){N.globalEval(t,e,n)}})},N.fn.extend({wrapAll:function(t){var e;return this[0]&&(v(t)&&(t=t.call(this[0])),e=N(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return v(t)?this.each((function(e){N(this).wrapInner(t.call(this,e))})):this.each((function(){var e=N(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=v(t);return this.each((function(n){N(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){N(this).replaceWith(this.childNodes)})),this}}),N.expr.pseudos.hidden=function(t){return!N.expr.pseudos.visible(t)},N.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},N.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(t){}};var Ue={0:200,1223:204},We=N.ajaxSettings.xhr();g.cors=!!We&&"withCredentials"in We,g.ajax=We=!!We,N.ajaxTransport((function(t){var e,r;if(g.cors||We&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];for(a in t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(a,i[a]);e=function(t){return function(){e&&(e=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===t?s.abort():"error"===t?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Ue[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=e(),r=s.onerror=s.ontimeout=e("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&n.setTimeout((function(){e&&r()}))},e=e("abort");try{s.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}})),N.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),N.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return N.globalEval(t),t}}}),N.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),N.ajaxTransport("script",(function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(r,i){e=N("