Repository: rafalp/Misago

Issue:
URL fails to validate
```
https://i.ytimg.com/vi/fgPMGcG0cJw/hq720.jpg?sqp=-oaymwEhCK4FEIIDSFryq4qpAxMIARUAAAAAGAElAADIQj0AgKJD&rs=AOn4CLC6hZOnP5-KhMkw9fEeQiIUSgaN7g
```

Discussion:
@rafalp: I guess validator should check if url is relative (starts with `/`) or if its absolute, only check stuff until the URL path

Solution patch:
diff --git a/frontend/src/lightbox.js b/frontend/src/lightbox.js
index 32be74650..39d7a90fd 100644
--- a/frontend/src/lightbox.js
+++ b/frontend/src/lightbox.js
@@ -138,14 +138,14 @@ export default class Lightbox {
   updateLightbox() {
     this.updateLightboxPager()
     this.updateLightboxOptions()
-    this.updateLightboxButtons()
+    this.updateLightboxNav()
     this.updateLightboxContainer()
     this.updateLightboxCaption()
   }
 
   updateLightboxPager() {
     const { state, pager } = this
-    if (state.total) {
+    if (state.total > 1) {
       pager.textContent = pager
         .getAttribute("misago-lightbox-pager")
         .replace("%(total)s", state.total)
@@ -175,15 +175,17 @@ export default class Lightbox {
     }
   }
 
-  updateLightboxButtons() {
-    const { state, container } = this
-    container.querySelectorAll("button").forEach(function (button) {
-      if (state.total) {
-        button.classList.remove("d-none")
-      } else {
-        button.classList.add("d-none")
-      }
-    })
+  updateLightboxNav() {
+    const { state } = this
+    this.modal
+      .querySelectorAll("[misago-lightbox-previous], [misago-lightbox-next]")
+      .forEach(function (button) {
+        if (state.total > 1) {
+          button.classList.remove("d-none")
+        } else {
+          button.classList.add("d-none")
+        }
+      })
   }
 
   updateLightboxContainer() {
diff --git a/misago/parser/patterns/urls.py b/misago/parser/patterns/urls.py
index e8774735c..b5bdfeb33 100644
--- a/misago/parser/patterns/urls.py
+++ b/misago/parser/patterns/urls.py
@@ -8,14 +8,14 @@ from ..parser import Parser, Pattern
 
 MAIL_RE = re.compile(r"^\w+[.-_+\w]*@[-\w]+(.\w+)+$")
 URL_RE = re.compile(
-    r"^(((https?)|(ftps?)|(wss?))://)?"  # http/ftp/ws(s) prefix
+    r"^(((https?)|(ftps?)|(wss?)):\/\/)?"  # http/ftp/ws(s) prefix
     r"("  # start hostnames
     r"(localhost)"  # localhost
     r"|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})"  # IP address
-    r"|((\w+((-|_)\w+)*\w+\.)+[a-z]+)"  # Other hostname
+    r"|((\w+([-_]\w+)*\.)+[a-z]+)"  # Other hostname
     r")"  # end hostnames
     r"(:[1-9][0-9]*)?"
-    r"(/+[^\s\|]*)?$"
+    r"(\/+[^\s\|]*)?$"
 )
 
 
@@ -320,7 +320,7 @@ class AutoUrl(AutolinkMarkdown):
     pattern_type: str = "auto-url"
     pattern: str = (
         r"(?<!\w)"
-        r"(((https?)|(ftps?)|(wss?))://)?"  # http/ftp/ws(s) prefix
+        r"(((https?)|(ftps?)|(wss?)):\/\/)?"  # http/ftp/ws(s) prefix
         r"("  # start hostnames
         r"("  # start ther hostname
         r"(\w+((-|_)\w+)*\w+\.)+"  # word-word.
@@ -330,7 +330,7 @@ class AutoUrl(AutolinkMarkdown):
         r"|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})"  # IP address
         r")"  # end hostnames
         r"(:[1-9][0-9]*)?"
-        r"(/+[^\s\|]*)?"
+        r"(\/+[^\s\|]*)?"
     )
 
     def parse(self, parser: Parser, match: str, parents: list[dict]) -> dict:
diff --git a/misago/static/misago/js/misago.js b/misago/static/misago/js/misago.js
index 476c3407d..0405a1cd5 100644
--- a/misago/static/misago/js/misago.js
+++ b/misago/static/misago/js/misago.js
@@ -1,2 +1,2 @@
-(()=>{var t,e,n,a={60642:(t,e,n)=>{"use strict";n.d(e,{b:()=>v,D:()=>f});var a=n(15861),i=n(15671),o=n(43144),r=n(97326),s=n(79340),l=n(6215),c=n(61120),u=n(4942),d=n(64687),p=n.n(d),h=n(57588),m=n.n(h);var v=function(t){(0,s.Z)(h,t);var e,n,d=(e=h,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,l.Z)(this,t)});function h(t){var e;return(0,i.Z)(this,h),e=d.call(this,t),(0,u.Z)((0,r.Z)(e),"hasCache",(function(t){return e.props.cache&&e.props.cache[t]})),(0,u.Z)((0,r.Z)(e),"getCache",function(){var t=(0,a.Z)(p().mark((function t(n){var a;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=e.props.cache[n],e.setState({loading:!1,error:null,data:a}),!e.props.onData){t.next=5;break}return t.next=5,e.props.onData(a);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),(0,u.Z)((0,r.Z)(e),"setCache",(function(t,n){e.props.cache&&(e.props.cache[t]=n)})),(0,u.Z)((0,r.Z)(e),"request",(function(t){e.setState({loading:!0}),fetch(t,{method:"GET",credentials:"include",signal:e.signal}).then(function(){var n=(0,a.Z)(p().mark((function n(a){var i,o;return p().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(t!==e.props.url){n.next=18;break}if(200!=a.status){n.next=12;break}return n.next=4,a.json();case 4:if(i=n.sent,e.setState({loading:!1,error:null,data:i}),e.setCache(t,i),!e.props.onData){n.next=10;break}return n.next=10,e.props.onData(i);case 10:n.next=18;break;case 12:if(o={status:a.status},"application/json"!==a.headers.get("Content-Type")){n.next=17;break}return n.next=16,a.json();case 16:o.data=n.sent;case 17:e.setState({loading:!1,error:o});case 18:case"end":return n.stop()}}),n)})));return function(t){return n.apply(this,arguments)}}(),(function(n){t===e.props.url&&e.setState({loading:!1,error:{status:0,rejection:n}})}))})),(0,u.Z)((0,r.Z)(e),"refetch",(function(){e.request(e.props.url)})),(0,u.Z)((0,r.Z)(e),"update",(function(t){e.setState((function(e){return{data:t(e.data)}}))})),e.state={data:null,loading:!1,error:null},e.controller=new AbortController,e.signal=e.controller.signal,e}return(0,o.Z)(h,[{key:"componentDidMount",value:function(){this.props.url&&!this.props.disabled&&this.request(this.props.url)}},{key:"componentDidUpdate",value:function(t){var e=this.props.url,n=e&&e!==t.url,a=this.props.disabled!=t.disabled;(n||a)&&(this.props.disabled?this.controller.abort():this.hasCache(e)?this.getCache(e):(this.controller.abort(),this.controller=new AbortController,this.signal=this.controller.signal,this.request(e)))}},{key:"componentWillUnmount",value:function(){this.controller.abort()}},{key:"render",value:function(){return this.props.children(Object.assign({refetch:this.refetch,update:this.update},this.state))}}]),h}(m().Component);var f=function(t){(0,s.Z)(h,t);var e,n,d=(e=h,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,l.Z)(this,t)});function h(t){var e;return(0,i.Z)(this,h),e=d.call(this,t),(0,u.Z)((0,r.Z)(e),"mutate",(function(t){e.setState({loading:!0}),fetch(e.props.url,{method:e.props.method||"POST",credentials:"include",headers:Z(t),body:g(t)}).then(function(){var n=(0,a.Z)(p().mark((function n(a){var i,o;return p().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(200!=a.status){n.next=10;break}return n.next=3,a.json();case 3:if(i=n.sent,e.setState({loading:!1,data:i}),!t.onSuccess){n.next=8;break}return n.next=8,t.onSuccess(i);case 8:n.next=26;break;case 10:if(204!=a.status){n.next=17;break}if(e.setState({loading:!1}),!t.onSuccess){n.next=15;break}return n.next=15,t.onSuccess();case 15:n.next=26;break;case 17:if(o={status:a.status},"application/json"!==a.headers.get("Content-Type")){n.next=22;break}return n.next=21,a.json();case 21:o.data=n.sent;case 22:if(e.setState({loading:!1,error:o}),!t.onError){n.next=26;break}return n.next=26,t.onError(o);case 26:case"end":return n.stop()}}),n)})));return function(t){return n.apply(this,arguments)}}(),function(){var n=(0,a.Z)(p().mark((function n(a){var i;return p().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(i={status:0,rejection:a},e.setState({loading:!1,error:i}),!t.onError){n.next=5;break}return n.next=5,t.onError(i);case 5:case"end":return n.stop()}}),n)})));return function(t){return n.apply(this,arguments)}}())})),e.state={data:null,loading:!1,error:null},e}return(0,o.Z)(h,[{key:"render",value:function(){return this.props.children(this.mutate,this.state)}}]),h}(m().Component);function Z(t){return t.json?{"Content-Type":"application/json; charset=utf-8","X-CSRFToken":y()}:{"X-CSRFToken":y()}}function g(t){if(t.json)return JSON.stringify(t.json)}function y(){var t=window.misago_csrf;if(-1!==document.cookie.indexOf(t)){var e=new RegExp(t+"=([^;]*)"),n=document.cookie.match(e)[0];return n?n.split("=")[1]:null}return null}},49021:(t,e,n)=>{"use strict";n.d(e,{Lt:()=>m,YV:()=>Z,kE:()=>g,Aw:()=>y,Xi:()=>b,KE:()=>k,iC:()=>_});var a=n(15671),i=n(43144),o=n(97326),r=n(79340),s=n(6215),l=n(61120),c=n(4942),u=n(94184),d=n.n(u),p=n(57588),h=n.n(p);var m=function(t){(0,r.Z)(p,t);var e,n,u=(e=p,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,l.Z)(e);if(n){var i=(0,l.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,s.Z)(this,t)});function p(t){var e;return(0,a.Z)(this,p),e=u.call(this,t),(0,c.Z)((0,o.Z)(e),"handleClick",(function(t){e.state.isOpen&&(!e.root.contains(t.target)||e.menu.contains(t.target)&&t.target.closest("a"))&&e.setState({isOpen:!1})})),(0,c.Z)((0,o.Z)(e),"toggle",(function(){e.setState((function(t){return{isOpen:!t.isOpen}}))})),(0,c.Z)((0,o.Z)(e),"close",(function(){e.setState({isOpen:!1})})),e.state={isOpen:!1},e.root=null,e.dropdown=null,e}return(0,i.Z)(p,[{key:"componentDidMount",value:function(){window.addEventListener("click",this.handleClick)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("click",this.handleClick)}},{key:"componentDidUpdate",value:function(t,e){e.isOpen!==this.state.isOpen&&(this.state.isOpen&&this.props.onOpen&&this.props.onOpen(this.root),!this.state.isOpen&&this.props.onClose&&this.props.onClose(this.root))}},{key:"render",value:function(){var t=this,e=this.state.isOpen;return h().createElement("div",{id:this.props.id,className:d()("dropdown",{open:e},this.props.className),ref:function(e){e&&!t.element&&(t.root=e)}},this.props.toggle({isOpen:e,toggle:this.toggle,aria:v(e)}),h().createElement("div",{className:d()("dropdown-menu",{"dropdown-menu-right":this.props.menuAlignRight},this.props.menuClassName),ref:function(e){e&&!t.menu&&(t.menu=e)},role:"menu"},this.props.children({isOpen:e,close:this.close})))}}]),p}(h().Component);function v(t){return{"aria-haspopup":"true","aria-expanded":t?"true":"false"}}var f=n(22928);function Z(t){var e=t.className;return(0,f.Z)("li",{className:d()("divider",e)})}function g(t){var e=t.children;return t.listItem?(0,f.Z)("li",{className:"dropdown-footer"},void 0,e):(0,f.Z)("div",{className:"dropdown-footer"},void 0,e)}function y(t){var e=t.className,n=t.children;return(0,f.Z)("div",{className:d()("dropdown-header",e)},void 0,n)}function b(t){var e=t.className,n=t.children;return(0,f.Z)("li",{className:d()("dropdown-menu-item",e)},void 0,n)}function k(t){var e=t.className,n=t.children;return(0,f.Z)("div",{className:d()("dropdown-pills",e)},void 0,n)}function _(t){var e=t.className,n=t.children;return(0,f.Z)("li",{className:d()("dropdown-subheader",e)},void 0,n)}},98936:(t,e,n)=>{"use strict";n.d(e,{gq:()=>r,Z6:()=>s,kw:()=>l});var a=n(22928),i=n(94184),o=n.n(i);n(57588);const r=function(t){var e=t.children,n=t.className;return(0,a.Z)("div",{className:o()("flex-row",n)},void 0,e)},s=function(t){var e=t.children,n=t.className,i=t.shrink;return(0,a.Z)("div",{className:o()("flex-row-col",n,{"flex-row-col-shrink":i})},void 0,e)},l=function(t){var e=t.auto,n=t.children,i=t.className;return(0,a.Z)("div",{className:o()("flex-row-section",{"flex-row-section-auto":e},i)},void 0,n)}},66398:(t,e,n)=>{"use strict";n.d(e,{NX:()=>s,PB:()=>c,Zn:()=>u,WI:()=>l,WE:()=>d,j0:()=>p});var a,i=n(22928),o=n(94184),r=n.n(o);function s(t){var e=t.className,n=t.children;return(0,i.Z)("ul",{className:r()("list-group",e)},void 0,n)}function l(t){var e=t.className,n=t.children;return(0,i.Z)("li",{className:r()("list-group-item",e)},void 0,n)}function c(t){var e=t.className,n=t.icon,a=t.message;return(0,i.Z)(l,{className:r()("list-group-empty",e)},void 0,!!n&&(0,i.Z)("div",{className:"list-group-empty-icon"},void 0,(0,i.Z)("span",{className:"material-icon"},void 0,n)),(0,i.Z)("p",{className:"list-group-empty-message"},void 0,a))}function u(t){var e=t.className,n=t.icon,a=t.message,o=t.detail;return(0,i.Z)(l,{className:r()("list-group-error",e)},void 0,!!n&&(0,i.Z)("div",{className:"list-group-error-icon"},void 0,(0,i.Z)("span",{className:"material-icon"},void 0,n)),(0,i.Z)("p",{className:"list-group-error-message"},void 0,a),!!o&&(0,i.Z)("p",{className:"list-group-error-detail"},void 0,o))}function d(t){var e=t.className,n=t.message;return(0,i.Z)(l,{className:r()("list-group-loading",e)},void 0,(0,i.Z)("p",{className:"list-group-loading-message"},void 0,n),a||(a=(0,i.Z)("div",{className:"list-group-loading-progress"},void 0,(0,i.Z)("div",{className:"list-group-loading-progress-bar"}))))}function p(t){var e=t.className,n=t.icon,a=t.message,o=t.detail;return(0,i.Z)(l,{className:r()("list-group-message",e)},void 0,!!n&&(0,i.Z)("div",{className:"list-group-message-icon"},void 0,(0,i.Z)("span",{className:"material-icon"},void 0,n)),(0,i.Z)("p",{className:"list-group-message-message"},void 0,a),!!o&&(0,i.Z)("p",{className:"list-group-message-detail"},void 0,o))}n(57588)},4517:(t,e,n)=>{"use strict";n.d(e,{Z:()=>l});var a=n(22928),i=(n(57588),n(37424)),o=n(35486),r=n(60642);function s(t,e){var n=misago.get("NOTIFICATIONS_API")+"?limit=30";return n+="&filter="+t,e&&(e.after&&(n+="&after="+e.after),e.before&&(n+="&before="+e.before)),n}const l=(0,i.$j)((function(t){var e=t.auth;return e.user?{unreadNotifications:e.user.unreadNotifications}:{unreadNotifications:null}}))((function(t){var e=t.children,n=t.filter,i=t.query,l=t.dispatch,c=t.unreadNotifications,u=t.disabled;return(0,a.Z)(r.b,{url:s(n,i),disabled:u,onData:function(t){t.unreadNotifications!=c&&l((0,o.yH)({unreadNotifications:t.unreadNotifications}))}},void 0,(function(t){var n=t.data,a=t.loading,i=t.error,o=t.refetch;return e({data:n,loading:a,error:i,refetch:o})}))}))},63026:(t,e,n)=>{"use strict";n.d(e,{Z:()=>a});const a=n(4517).Z},66462:(t,e,n)=>{"use strict";n.d(e,{uE:()=>b,lb:()=>k,Pu:()=>_});var a=n(22928),i=(n(57588),n(66398));function o(t){var e=t.filter;return(0,a.Z)(i.PB,{icon:"unread"===e?"sentiment_very_satisfied":"notifications_none",message:r(e)})}function r(t){return"read"===t?pgettext("notifications list","You don't have any read notifications."):"unread"===t?pgettext("notifications list","You don't have any unread notifications."):pgettext("notifications list","You don't have any notifications.")}var s=n(94184),l=n.n(s);function c(t){var e=t.className,n=t.children;return(0,a.Z)("div",{className:l()("notifications-list",e)},void 0,(0,a.Z)(i.NX,{},void 0,n))}var u,d,p,h=n(19605);function m(t){var e=t.notification;return e.actor?(0,a.Z)("a",{href:e.actor.url,className:"notifications-list-item-actor",title:e.actor.username},void 0,(0,a.Z)(h.ZP,{size:30,user:e.actor})):(0,a.Z)("span",{className:"threads-list-item-last-poster",title:e.actor_name||null},void 0,u||(u=(0,a.Z)(h.ZP,{size:30})))}function v(t){var e=t.notification;return(0,a.Z)("a",{href:e.url,className:l()("notification-message",{"notification-message-read":e.isRead,"notification-message-unread":!e.isRead}),dangerouslySetInnerHTML:{__html:e.message}})}function f(t){return t.notification.isRead?(0,a.Z)("div",{className:"notifications-list-item-read-status",title:pgettext("notification status","Read notification")},void 0,d||(d=(0,a.Z)("span",{className:"notification-read-icon"}))):(0,a.Z)("div",{className:"notifications-list-item-read-status",title:pgettext("notification status","Unread notification")},void 0,p||(p=(0,a.Z)("span",{className:"notification-unread-icon"})))}var Z=n(16069);function g(t){var e=t.notification;return(0,a.Z)("div",{className:"notifications-list-item-timestamp"},void 0,(0,a.Z)(Z.Z,{datetime:e.createdAt}))}function y(t){var e=t.notification;return(0,a.Z)(i.WI,{className:l()("notifications-list-item",{"notifications-list-item-read":e.isRead,"notifications-list-item-unread":!e.isRead})},e.id,(0,a.Z)("div",{className:"notifications-list-item-left-col"},void 0,(0,a.Z)("div",{className:"notifications-list-item-col-actor"},void 0,(0,a.Z)(m,{notification:e})),(0,a.Z)("div",{className:"notifications-list-item-col-read-icon"},void 0,(0,a.Z)(f,{notification:e}))),(0,a.Z)("div",{className:"notifications-list-item-right-col"},void 0,(0,a.Z)("div",{className:"notifications-list-item-col-message"},void 0,(0,a.Z)(v,{notification:e})),(0,a.Z)("div",{className:"notifications-list-item-col-timestamp"},void 0,(0,a.Z)(g,{notification:e}))))}function b(t){var e=t.filter,n=t.items;return(0,a.Z)(c,{className:n.length>0?"notifications-list-ready":"notifications-list-pending"},void 0,0===n.length&&(0,a.Z)(o,{filter:e}),n.map((function(t){return(0,a.Z)(y,{notification:t},t.id)})))}function k(t){var e,n=0===(e=t.error).status?gettext("Check your internet connection and try refreshing the site."):e.data&&e.data.detail?e.data.detail:void 0;return(0,a.Z)(c,{className:"notifications-list-pending"},void 0,(0,a.Z)(i.Zn,{icon:"notifications_off",message:pgettext("notifications list","Notifications could not be loaded."),detail:n}))}function _(){return(0,a.Z)(c,{className:"notifications-list-pending"},void 0,(0,a.Z)(i.WE,{message:pgettext("notifications list","Loading notifications...")}))}},64836:(t,e,n)=>{"use strict";n.d(e,{a:()=>y,i:()=>k});var a=n(22928),i=n(15671),o=n(43144),r=n(97326),s=n(79340),l=n(6215),c=n(61120),u=n(4942),d=n(94184),p=n.n(d),h=n(57588),m=n.n(h),v=n(37424),f=n(993);var Z="has-overlay",g=function(t){(0,s.Z)(h,t);var e,n,d=(e=h,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,l.Z)(this,t)});function h(t){var e;return(0,i.Z)(this,h),e=d.call(this,t),(0,u.Z)((0,r.Z)(e),"closeOnNavigation",(function(t){t.target.closest("a")&&e.props.dispatch((0,f.xv)())})),e.scrollOrigin=null,e}return(0,o.Z)(h,[{key:"componentDidUpdate",value:function(t){t.open!==this.props.open&&(this.props.open?(this.scrollOrigin=window.pageYOffset,document.body.classList.add(Z),this.props.onOpen&&this.props.onOpen()):(document.body.classList.remove(Z),window.scrollTo(0,this.scrollOrigin),this.scrollOrigin=null))}},{key:"render",value:function(){return(0,a.Z)("div",{className:p()("overlay",this.props.className,{"overlay-open":this.props.open}),onClick:this.closeOnNavigation},void 0,this.props.children)}}]),h}(m().Component);const y=(0,v.$j)()(g);var b;const k=(0,v.$j)()((function(t){var e=t.children,n=t.dispatch;return(0,a.Z)("div",{className:"overlay-header"},void 0,(0,a.Z)("div",{className:"overlay-header-caption"},void 0,e),(0,a.Z)("button",{className:"btn btn-overlay-close",title:pgettext("modal","Close"),type:"button",onClick:function(){return n((0,f.xv)())}},void 0,b||(b=(0,a.Z)("span",{className:"material-icon"},void 0,"close"))))}))},59131:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var a=n(22928);n(57588);const i=function(t){var e=t.children;return(0,a.Z)("div",{className:"container page-container"},void 0,e)}},99755:(t,e,n)=>{"use strict";n.d(e,{mr:()=>s,gC:()=>l,sP:()=>c,eA:()=>u,Iv:()=>d});var a,i=n(22928),o=n(94184),r=n.n(o);n(57588);const s=function(t){var e=t.children,n=t.className,o=t.styleName;return(0,i.Z)("div",{className:r()("page-header",n,o&&"page-header-"+o)},void 0,(0,i.Z)("div",{className:"page-header-bg-image"},void 0,(0,i.Z)("div",{className:"page-header-bg-overlay"},void 0,a||(a=(0,i.Z)("div",{className:"page-header-image"})),e)))},l=function(t){var e=t.children,n=t.className,a=t.styleName;return(0,i.Z)("div",{className:r()("page-header-banner",n,a&&"page-header-banner-"+a)},void 0,(0,i.Z)("div",{className:"page-header-banner-bg-image"},void 0,(0,i.Z)("div",{className:"page-header-banner-bg-overlay"},void 0,e)))},c=function(t){var e=t.children;return(0,i.Z)("div",{className:"container page-header-container"},void 0,e)},u=function(t){var e=t.children,n=t.className;return(0,i.Z)("div",{className:r()("page-header-details",n)},void 0,e)},d=function(t){var e=t.styleName,n=t.header,a=t.message;return(0,i.Z)(c,{},void 0,(0,i.Z)(s,{styleName:e},void 0,(0,i.Z)(l,{styleName:e},void 0,(0,i.Z)("h1",{},void 0,n)),a&&(0,i.Z)(u,{styleName:e},void 0,a)))}},40689:(t,e,n)=>{"use strict";n.d(e,{Z:()=>H});var a=n(22928),i=n(15671),o=n(43144),r=n(97326),s=n(79340),l=n(6215),c=n(61120),u=n(4942),d=n(94184),p=n.n(d),h=n(57588),m=n.n(h),v=n(78657),f=n(93825),Z=n(59801),g=n(53904),y=n(37848),b=n(87462),k=n(82211),_=n(43345),x=n(96359),N=n(59940);var w,C,R,E=["progress-bar-danger","progress-bar-warning","progress-bar-warning","progress-bar-primary","progress-bar-success"],S=[pgettext("password strength indicator","Entered password is very weak."),pgettext("password strength indicator","Entered password is weak."),pgettext("password strength indicator","Entered password is average."),pgettext("password strength indicator","Entered password is strong."),pgettext("password strength indicator","Entered password is very strong.")],L=function(t){(0,s.Z)(u,t);var e,n,r=(e=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,l.Z)(this,t)});function u(t){var e;return(0,i.Z)(this,u),(e=r.call(this,t))._score=0,e._password=null,e._inputs=[],e.state={loaded:!1},e}return(0,o.Z)(u,[{key:"componentDidMount",value:function(){var t=this;N.Z.load().then((function(){t.setState({loaded:!0})}))}},{key:"getScore",value:function(t,e){var n=this,a=!1;return t!==this._password&&(a=!0),e.length!==this._inputs.length?a=!0:e.map((function(t,e){t.trim()!==n._inputs[e]&&(a=!0)})),a&&(this._score=N.Z.scorePassword(t,e),this._password=t,this._inputs=e.map((function(t){return t.trim()}))),this._score}},{key:"render",value:function(){if(!this.state.loaded)return null;var t=this.getScore(this.props.password,this.props.inputs);return(0,a.Z)("div",{className:"help-block password-strength"},void 0,(0,a.Z)("div",{className:"progress"},void 0,(0,a.Z)("div",{className:"progress-bar "+E[t],style:{width:20+20*t+"%"},role:"progress-bar","aria-valuenow":t,"aria-valuemin":"0","aria-valuemax":"4"},void 0,(0,a.Z)("span",{className:"sr-only"},void 0,S[t]))),(0,a.Z)("p",{className:"text-small"},void 0,S[t]))}}]),u}(m().Component),O=n(26106),P=n(47235),A=n(34458),T=n(98274),I=n(93051),B=n(55210);function j(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function D(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?j(Object(n),!0).forEach((function(e){(0,u.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function U(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,a=(0,c.Z)(t);if(e){var i=(0,c.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,l.Z)(this,n)}}var z,q=function(t){(0,s.Z)(n,t);var e=U(n);function n(t){var a;(0,i.Z)(this,n),a=e.call(this,t),(0,u.Z)((0,r.Z)(a),"handlePrivacyPolicyChange",(function(t){var e=t.target.value;a.handleToggleAgreement("privacyPolicy",e)})),(0,u.Z)((0,r.Z)(a),"handleTermsOfServiceChange",(function(t){var e=t.target.value;a.handleToggleAgreement("termsOfService",e)})),(0,u.Z)((0,r.Z)(a),"handleToggleAgreement",(function(t,e){a.setState((function(n,i){if(null===n[t]){var o=D(D({},n.errors),{},(0,u.Z)({},t,null));return(0,u.Z)({errors:o},t,e)}var r=a.state.validators[t][0],s=D(D({},n.errors),{},(0,u.Z)({},t,[r(null)]));return(0,u.Z)({errors:s},t,null)}))}));var o=a.props.criteria,s=o.username,l=o.password,c=0;l.forEach((function(t){"MinimumLengthValidator"===t.name&&(c=t.min_length)}));var d={username:[B.lG(),B.HR(s.min_length),B.gS(s.max_length)],email:[B.Do()],password:[B.Vb(c)],captcha:f.ZP.validator()};return A.Z.get("TERMS_OF_SERVICE_ID")&&(d.termsOfService=[B.fT()]),A.Z.get("PRIVACY_POLICY_ID")&&(d.privacyPolicy=[B.jA()]),a.state={isLoading:!1,username:"",email:"",password:"",captcha:"",termsOfService:null,privacyPolicy:null,validators:d,errors:{}},a}return(0,o.Z)(n,[{key:"clean",value:function(){return!!this.isValid()||(g.Z.error(gettext("Form contains errors.")),this.setState({errors:this.validate()}),!1)}},{key:"send",value:function(){return v.Z.post(A.Z.get("USERS_API"),{username:this.state.username,email:this.state.email,password:this.state.password,captcha:this.state.captcha,terms_of_service:this.state.termsOfService,privacy_policy:this.state.privacyPolicy})}},{key:"handleSuccess",value:function(t){this.props.callback(t)}},{key:"handleError",value:function(t){400===t.status?(this.setState({errors:Object.assign({},this.state.errors,t)}),t.__all__&&t.__all__.length>0?g.Z.error(t.__all__[0]):g.Z.error(gettext("Form contains errors."))):403===t.status&&t.ban?((0,I.Z)(t.ban),Z.Z.hide()):g.Z.apiError(t)}},{key:"render",value:function(){return(0,a.Z)("div",{className:"modal-dialog modal-register",role:"document"},void 0,(0,a.Z)("div",{className:"modal-content"},void 0,(0,a.Z)("div",{className:"modal-header"},void 0,(0,a.Z)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":pgettext("modal","Close")},void 0,w||(w=(0,a.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,a.Z)("h4",{className:"modal-title"},void 0,pgettext("register modal title","Register"))),(0,a.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,a.Z)("input",{type:"type",style:{display:"none"}}),(0,a.Z)("input",{type:"password",style:{display:"none"}}),(0,a.Z)("div",{className:"modal-body"},void 0,(0,a.Z)(P.Z,{buttonClassName:"col-xs-12 col-sm-6",buttonLabel:pgettext("register modal field","Join with %(site)s"),formLabel:pgettext("register modal field","Or create forum account:")}),(0,a.Z)(x.Z,{label:pgettext("register modal field","Username"),for:"id_username",validation:this.state.errors.username},void 0,(0,a.Z)("input",{type:"text",id:"id_username",className:"form-control","aria-describedby":"id_username_status",disabled:this.state.isLoading,onChange:this.bindInput("username"),value:this.state.username})),(0,a.Z)(x.Z,{label:pgettext("register modal field","E-mail"),for:"id_email",validation:this.state.errors.email},void 0,(0,a.Z)("input",{type:"text",id:"id_email",className:"form-control","aria-describedby":"id_email_status",disabled:this.state.isLoading,onChange:this.bindInput("email"),value:this.state.email})),(0,a.Z)(x.Z,{label:pgettext("register modal field","Password"),for:"id_password",validation:this.state.errors.password,extra:(0,a.Z)(L,{password:this.state.password,inputs:[this.state.username,this.state.email]})},void 0,(0,a.Z)("input",{type:"password",id:"id_password",className:"form-control","aria-describedby":"id_password_status",disabled:this.state.isLoading,onChange:this.bindInput("password"),value:this.state.password})),f.ZP.component({form:this}),(0,a.Z)(O.Z,{errors:this.state.errors,privacyPolicy:this.state.privacyPolicy,termsOfService:this.state.termsOfService,onPrivacyPolicyChange:this.handlePrivacyPolicyChange,onTermsOfServiceChange:this.handleTermsOfServiceChange})),(0,a.Z)("div",{className:"modal-footer"},void 0,(0,a.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,pgettext("register modal btn","Cancel")),(0,a.Z)(k.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,pgettext("register modal btn","Register account"))))))}}]),n}(_.Z),M=function(t){(0,s.Z)(n,t);var e=U(n);function n(){return(0,i.Z)(this,n),e.apply(this,arguments)}return(0,o.Z)(n,[{key:"getLead",value:function(){return"user"===this.props.activation?pgettext("account activation required","%(username)s, your account has been created but you need to activate it before you will be able to sign in."):"admin"===this.props.activation?pgettext("account activation required","%(username)s, your account has been created but the site administrator will have to activate it before you will be able to sign in."):void 0}},{key:"getSubscript",value:function(){return"user"===this.props.activation?pgettext("account activation required","We have sent an e-mail to %(email)s with link that you have to click to activate your account."):"admin"===this.props.activation?pgettext("account activation required","We will send an e-mail to %(email)s when this takes place."):void 0}},{key:"render",value:function(){return(0,a.Z)("div",{className:"modal-dialog modal-message modal-register",role:"document"},void 0,(0,a.Z)("div",{className:"modal-content"},void 0,(0,a.Z)("div",{className:"modal-header"},void 0,(0,a.Z)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":pgettext("modal","Close")},void 0,C||(C=(0,a.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,a.Z)("h4",{className:"modal-title"},void 0,pgettext("register modal title","Registration complete"))),(0,a.Z)("div",{className:"modal-body"},void 0,R||(R=(0,a.Z)("div",{className:"message-icon"},void 0,(0,a.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,a.Z)("div",{className:"message-body"},void 0,(0,a.Z)("p",{className:"lead"},void 0,interpolate(this.getLead(),{username:this.props.username},!0)),(0,a.Z)("p",{},void 0,interpolate(this.getSubscript(),{email:this.props.email},!0)),(0,a.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,pgettext("register modal dismiss","Ok"))))))}}]),n}(m().Component),F=function(t){(0,s.Z)(n,t);var e=U(n);function n(t){var a;return(0,i.Z)(this,n),a=e.call(this,t),(0,u.Z)((0,r.Z)(a),"completeRegistration",(function(t){"active"===t.activation?(Z.Z.hide(),T.Z.signIn(t)):a.setState({complete:t})})),a.state={complete:!1},a}return(0,o.Z)(n,[{key:"render",value:function(){return this.state.complete?(0,a.Z)(M,{activation:this.state.complete.activation,email:this.state.complete.email,username:this.state.complete.username}):m().createElement(q,(0,b.Z)({callback:this.completeRegistration},this.props))}}]),n}(m().Component);const H=function(t){(0,s.Z)(h,t);var e,n,d=(e=h,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,l.Z)(this,t)});function h(t){var e;return(0,i.Z)(this,h),e=d.call(this,t),(0,u.Z)((0,r.Z)(e),"showRegisterForm",(function(){e.props.onClick&&e.props.onClick(),"closed"===misago.get("SETTINGS").account_activation?g.Z.info(pgettext("register form","Registration form is currently disabled by the site administrator.")):e.state.isLoaded?Z.Z.show((0,a.Z)(F,{criteria:e.state.criteria})):(e.setState({isLoading:!0}),Promise.all([f.ZP.load(),v.Z.get(misago.get("AUTH_CRITERIA_API"))]).then((function(t){e.setState({isLoading:!1,isLoaded:!0,criteria:t[1]}),Z.Z.show((0,a.Z)(F,{criteria:t[1]}))}),(function(){e.setState({isLoading:!1}),g.Z.error(pgettext("register form","Registration form is currently unavailable due to an error."))})))})),e.state={isLoading:!1,isLoaded:!1,criteria:null},e}return(0,o.Z)(h,[{key:"render",value:function(){return(0,a.Z)("button",{className:p()("btn btn-register",this.props.className,{"btn-block":this.props.block,"btn-loading":this.state.isLoading}),disabled:this.state.isLoading,onClick:this.showRegisterForm,type:"button"},void 0,pgettext("cta","Register"),this.state.isLoading?z||(z=(0,a.Z)(y.Z,{})):null)}}]),h}(m().Component)},26106:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s});var a=n(22928),i=(n(57588),n(34458)),o=n(89627),r=function(t){var e=t.agreement,n=t.checked,i=t.errors,r=t.url,s=t.value,l=t.onChange;if(!r)return null;var c=interpolate('<a href="%(url)s" target="_blank">%(agreement)s</a>',{agreement:(0,o.Z)(e),url:(0,o.Z)(r)},!0),u=interpolate(pgettext("register form agreement prompt","I have read and accept %(agreement)s."),{agreement:c},!0);return(0,a.Z)("div",{className:"checkbox legal-footnote"},void 0,(0,a.Z)("label",{},void 0,(0,a.Z)("input",{checked:n,type:"checkbox",value:s,onChange:l}),(0,a.Z)("span",{dangerouslySetInnerHTML:{__html:u}})),i&&i.map((function(t,e){return(0,a.Z)("div",{className:"help-block errors"},e,t)})))};const s=function(t){var e=t.errors,n=t.privacyPolicy,o=t.termsOfService,s=t.onPrivacyPolicyChange,l=t.onTermsOfServiceChange,c=i.Z.get("TERMS_OF_SERVICE_ID"),u=i.Z.get("TERMS_OF_SERVICE_URL"),d=i.Z.get("PRIVACY_POLICY_ID"),p=i.Z.get("PRIVACY_POLICY_URL");return c||d?(0,a.Z)("div",{},void 0,(0,a.Z)(r,{agreement:pgettext("register form agreement prompt","the terms of service"),checked:null!==o,errors:e.termsOfService,url:u,value:c,onChange:l}),(0,a.Z)(r,{agreement:pgettext("register form agreement prompt","the privacy policy"),checked:null!==n,errors:e.privacyPolicy,url:p,value:d,onChange:s})):null}},80261:(t,e,n)=>{"use strict";n.d(e,{Z:()=>c});var a,i=n(22928),o=n(94184),r=n.n(o),s=(n(57588),n(59801)),l=n(14467);const c=function(t){var e=t.block,n=t.className,o=t.onClick,c=misago.get("SETTINGS");return c.DELEGATE_AUTH?(0,i.Z)("a",{className:r()("btn btn-sign-in",n,{"btn-block":e}),href:c.LOGIN_URL,onClick:function(){o&&o()}},void 0,pgettext("cta","Sign in")):(0,i.Z)("a",{className:r()("btn btn-sign-in",n,{"btn-block":e}),href:c.LOGIN_URL,onClick:function(t){t.preventDefault(),o&&o(),s.Z.show(a||(a=(0,i.Z)(l.Z,{})))}},void 0,pgettext("cta","Sign in"))}},6333:(t,e,n)=>{"use strict";n.d(e,{bS:()=>v,Or:()=>g});var a,i,o,r=n(22928),s=n(94184),l=n.n(s),c=(n(57588),n(37424)),u=n(49021),d=n(40689),p=n(80261),h=(0,c.$j)((function(t){return{isAnonymous:!t.auth.user.id}}))((function(t){var e=t.isAnonymous,n=t.close,s=t.dropdown,c=t.overlay,h=misago.get("MISAGO_PATH"),m=misago.get("SETTINGS"),v=misago.get("main_menu"),f=misago.get("extraMenuItems"),Z=misago.get("extraFooterItems"),g=misago.get("categories_menu"),y=misago.get("usersLists"),b=m.enable_oauth2_client,k=[];v.forEach((function(t){k.push({title:t.label,url:t.url})})),k.push({title:pgettext("site nav","Search"),url:h+"search/"});var _=[],x=misago.get("TERMS_OF_SERVICE_TITLE"),N=misago.get("TERMS_OF_SERVICE_URL");x&&N&&_.push({title:x,url:N});var w=misago.get("PRIVACY_POLICY_TITLE"),C=misago.get("PRIVACY_POLICY_URL");return w&&C&&_.push({title:w,url:C}),(0,r.Z)("ul",{className:l()("site-nav-menu",{"dropdown-menu-list":s,"overlay-menu-list":c})},void 0,e&&(0,r.Z)(u.Aw,{className:"site-nav-sign-in-message"},void 0,pgettext("cta","You are not signed in")),e&&(0,r.Z)(u.KE,{className:"site-nav-sign-in-options"},void 0,(0,r.Z)(p.Z,{onClick:n}),!b&&(0,r.Z)(d.Z,{onClick:n})),(0,r.Z)(u.iC,{},void 0,m.forum_name),k.map((function(t){return(0,r.Z)(u.Xi,{},t.url,(0,r.Z)("a",{href:t.url},void 0,t.title))})),f.map((function(t,e){return(0,r.Z)(u.Xi,{className:t.className},e,(0,r.Z)("a",{href:t.url,target:t.targetBlank?"_blank":null,rel:t.rel},void 0,t.title))})),!!y.length&&(a||(a=(0,r.Z)(u.YV,{className:"site-nav-users-divider"}))),!!y.length&&(0,r.Z)(u.iC,{className:"site-nav-users"},void 0,pgettext("site nav section","Users")),y.map((function(t){return(0,r.Z)(u.Xi,{},t.url,(0,r.Z)("a",{href:t.url},void 0,t.name))})),i||(i=(0,r.Z)(u.YV,{className:"site-nav-categories-divider"})),(0,r.Z)(u.iC,{className:"site-nav-categories"},void 0,pgettext("site nav section","Categories")),g.map((function(t){return t.is_vanilla?(0,r.Z)(u.Xi,{className:"site-nav-category-header"},t.id,(0,r.Z)("a",{href:t.url},void 0,t.name)):(0,r.Z)(u.Xi,{className:l()("site-nav-category",{"site-nav-category-last":t.last})},t.id,(0,r.Z)("a",{href:t.url},void 0,(0,r.Z)("span",{},void 0,t.name),(0,r.Z)("span",{className:l()("threads-list-item-category threads-list-category-label",{"threads-list-category-label-color":!!t.color}),style:{"--label-color":t.color}},void 0,t.short_name||t.name)))})),(!!_.length||!!Z.length)&&(o||(o=(0,r.Z)(u.YV,{className:"site-nav-footer-divider"}))),(!!_.length||!!Z.length)&&(0,r.Z)(u.iC,{className:"site-nav-footer"},void 0,pgettext("site nav section","Footer")),Z.map((function(t,e){return(0,r.Z)(u.Xi,{className:t.className},e,(0,r.Z)("a",{href:t.url,target:t.targetBlank?"_blank":null,rel:t.rel},void 0,t.title))})),_.map((function(t){return(0,r.Z)(u.Xi,{},t.url,(0,r.Z)("a",{href:t.url},void 0,t.title))})))}));const m=h;function v(t){var e=t.close;return(0,r.Z)(m,{close:e,dropdown:!0})}var f=n(993),Z=n(64836);const g=(0,c.$j)((function(t){return{isOpen:t.overlay.siteNav}}))((function(t){var e=t.dispatch,n=t.isOpen;return(0,r.Z)(Z.a,{open:n},void 0,(0,r.Z)(Z.i,{},void 0,pgettext("site nav title","Menu")),(0,r.Z)(m,{close:function(){return e((0,f.xv)())},overlay:!0}))}))},47235:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s});var a,i=n(22928),o=(n(57588),n(34458)),r=function(t){var e=t.className,n=t.text;return n?(0,i.Z)("h5",{className:e||""},void 0,n):null};const s=function(t){var e=t.buttonClassName,n=t.buttonLabel,s=t.formLabel,l=t.header,c=t.labelClassName,u=o.Z.get("SOCIAL_AUTH");return 0===u.length?null:(0,i.Z)("div",{className:"form-group form-social-auth"},void 0,(0,i.Z)(r,{className:c,text:l}),(0,i.Z)("div",{className:"row"},void 0,u.map((function(t){var a=t.pk,o=t.name,r=t.button_text,s=t.button_color,l=t.url,c="btn btn-block btn-default btn-social-"+a,u=s?{color:s}:null,d=r||interpolate(n,{site:o},!0);return(0,i.Z)("div",{className:e||"col-xs-12"},a,(0,i.Z)("a",{className:c,style:u,href:l},void 0,d))}))),a||(a=(0,i.Z)("hr",{})),(0,i.Z)(r,{className:c,text:s}))}},16069:(t,e,n)=>{"use strict";n.d(e,{Z:()=>v});var a=n(22928),i=n(15671),o=n(43144),r=n(97326),s=n(79340),l=n(6215),c=n(61120),u=n(4942),d=n(57588),p=n.n(d),h=n(75557);function m(t){return{tick:t.tick+1}}const v=function(t){(0,s.Z)(p,t);var e,n,d=(e=p,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,l.Z)(this,t)});function p(t){var e;return(0,i.Z)(this,p),e=d.call(this,t),(0,u.Z)((0,r.Z)(e),"scheduleNextUpdate",(function(){var t=new Date,n=Math.ceil(Math.abs(Math.round((e.date-t)/1e3)));n<3600?e.timeout=window.setTimeout((function(){e.setState(m),e.scheduleNextUpdate()}),5e4):n<86400&&(e.timeout=window.setTimeout((function(){e.setState(m)}),24e5))})),e.state={tick:0},e.date=new Date(t.datetime),e.timeout=null,e}return(0,o.Z)(p,[{key:"componentDidMount",value:function(){this.scheduleNextUpdate()}},{key:"componentWillUnmount",value:function(){this.timeout&&window.clearTimeout(this.timeout)}},{key:"render",value:function(){var t=this.props.narrow?(0,h.xn)(this.date):(0,h.SW)(this.date);return(0,a.Z)("attr",{title:this.props.title?this.props.title.replace("%(timestamp)s",h.ry.format(this.date)):h.ry.format(this.date)},void 0,t)}}]),p}(p().Component)},92490:(t,e,n)=>{"use strict";n.d(e,{o8:()=>r,Eg:()=>s,Z2:()=>l,tw:()=>c});var a=n(22928),i=n(94184),o=n.n(i);n(57588);const r=function(t){var e=t.children,n=t.className;return(0,a.Z)("nav",{className:o()("toolbar",n)},void 0,e)},s=function(t){var e=t.children,n=t.className,i=t.shrink;return(0,a.Z)("div",{className:o()("toolbar-item",n,{"toolbar-item-shrink":i})},void 0,e)},l=function(t){var e=t.auto,n=t.children,i=t.className;return(0,a.Z)("div",{className:o()("toolbar-section",{"toolbar-section-auto":e},i)},void 0,n)},c=function(t){var e=t.className;return(0,a.Z)("div",{className:o()("toolbar-spacer",e)})}},28166:(t,e,n)=>{"use strict";n.d(e,{o4:()=>it,Qm:()=>st});var a,i=n(42982),o=n(22928),r=n(15671),s=n(43144),l=n(97326),c=n(79340),u=n(6215),d=n(61120),p=n(4942),h=n(94184),m=n.n(h),v=n(57588),f=n.n(v),Z=n(37424),g=n(59801),y=n(19605),b=n(82211),k=n(37848),_=n(78657),x=n(53904);var N,w=function(t){(0,c.Z)(h,t);var e,n,i=(e=h,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,d.Z)(e);if(n){var i=(0,d.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,u.Z)(this,t)});function h(t){var e;return(0,r.Z)(this,h),e=i.call(this,t),(0,p.Z)((0,l.Z)(e),"setGravatar",(function(){e.callApi("gravatar")})),(0,p.Z)((0,l.Z)(e),"setGenerated",(function(){e.callApi("generated")})),e.state={isLoading:!1},e}return(0,s.Z)(h,[{key:"callApi",value:function(t){var e=this;if(this.state.isLoading)return!1;this.setState({isLoading:!0}),_.Z.post(this.props.user.api.avatar,{avatar:t}).then((function(t){e.setState({isLoading:!1}),x.Z.success(t.detail),e.props.onComplete(t)}),(function(t){400===t.status?(x.Z.error(t.detail),e.setState({isLoading:!1})):e.props.showError(t)}))}},{key:"getGravatarButton",value:function(){return this.props.options.gravatar?(0,o.Z)(b.Z,{onClick:this.setGravatar,disabled:this.state.isLoading,className:"btn-default btn-block btn-avatar-gravatar"},void 0,pgettext("avatar modal btn","Download my Gravatar")):null}},{key:"getCropButton",value:function(){return this.props.options.crop_src?(0,o.Z)(b.Z,{className:"btn-default btn-block btn-avatar-crop",disabled:this.state.isLoading,onClick:this.props.showCrop},void 0,pgettext("avatar modal btn","Re-crop uploaded image")):null}},{key:"getUploadButton",value:function(){return this.props.options.upload?(0,o.Z)(b.Z,{className:"btn-default btn-block btn-avatar-upload",disabled:this.state.isLoading,onClick:this.props.showUpload},void 0,pgettext("avatar modal btn","Upload new image")):null}},{key:"getGalleryButton",value:function(){return this.props.options.galleries?(0,o.Z)(b.Z,{className:"btn-default btn-block btn-avatar-gallery",disabled:this.state.isLoading,onClick:this.props.showGallery},void 0,pgettext("avatar modal btn","Pick avatar from gallery")):null}},{key:"getAvatarPreview",value:function(){var t={id:this.props.user.id,avatars:this.props.options.avatars};return this.state.isLoading?(0,o.Z)("div",{className:"avatar-preview preview-loading"},void 0,(0,o.Z)(y.ZP,{size:"200",user:t}),a||(a=(0,o.Z)(k.Z,{}))):(0,o.Z)("div",{className:"avatar-preview"},void 0,(0,o.Z)(y.ZP,{size:"200",user:t}))}},{key:"render",value:function(){return(0,o.Z)("div",{className:"modal-body modal-avatar-index"},void 0,(0,o.Z)("div",{className:"row"},void 0,(0,o.Z)("div",{className:"col-md-5"},void 0,this.getAvatarPreview()),(0,o.Z)("div",{className:"col-md-7"},void 0,this.getGravatarButton(),(0,o.Z)(b.Z,{onClick:this.setGenerated,disabled:this.state.isLoading,className:"btn-default btn-block btn-avatar-generate"},void 0,pgettext("avatar modal btn","Generate my individual avatar")),this.getCropButton(),this.getUploadButton(),this.getGalleryButton())))}}]),h}(f().Component),C=n(19755);var R,E=function(t){(0,c.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,d.Z)(e);if(n){var i=(0,d.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,u.Z)(this,t)});function i(t){var e;return(0,r.Z)(this,i),e=a.call(this,t),(0,p.Z)((0,l.Z)(e),"cropAvatar",(function(){if(e.state.isLoading)return!1;e.setState({isLoading:!0});var t=e.props.upload?"crop_tmp":"crop_src",n=C(".crop-form"),a=n.cropit("exportZoom"),i=n.cropit("offset");_.Z.post(e.props.user.api.avatar,{avatar:t,crop:{offset:{x:i.x*a,y:i.y*a},zoom:n.cropit("zoom")*a}}).then((function(t){e.props.onComplete(t),x.Z.success(t.detail)}),(function(t){400===t.status?(x.Z.error(t.detail),e.setState({isLoading:!1})):e.props.showError(t)}))})),e.state={isLoading:!1,deviceRatio:1},e}return(0,s.Z)(i,[{key:"getAvatarSize",value:function(){return this.props.upload?this.props.options.crop_tmp.size:this.props.options.crop_src.size}},{key:"getImagePath",value:function(){return this.props.upload?this.props.dataUrl:this.props.options.crop_src.url}},{key:"componentDidMount",value:function(){for(var t=this,e=C(".crop-form"),n=this.getAvatarSize(),a=e.width();a<n;)n/=2;var i=this.getAvatarSize()/n;e.width(n),e.cropit({width:n,height:n,exportZoom:i,imageState:{src:this.getImagePath()},onImageLoaded:function(){if(t.props.upload){var n=e.cropit("zoom"),a=e.cropit("imageSize");if(a.width>a.height){var i=(a.width*n-t.getAvatarSize())/-2;e.cropit("offset",{x:i,y:0})}else if(a.width<a.height){var o=(a.height*n-t.getAvatarSize())/-2;e.cropit("offset",{x:0,y:o})}else e.cropit("offset",{x:0,y:0})}else{var r=t.props.options.crop_src.crop;r&&(e.cropit("zoom",r.zoom),e.cropit("offset",{x:r.x,y:r.y}))}}})}},{key:"componentWillUnmount",value:function(){C(".crop-form").cropit("disable")}},{key:"render",value:function(){return(0,o.Z)("div",{},void 0,N||(N=(0,o.Z)("div",{className:"modal-body modal-avatar-crop"},void 0,(0,o.Z)("div",{className:"crop-form"},void 0,(0,o.Z)("div",{className:"cropit-preview"}),(0,o.Z)("input",{type:"range",className:"cropit-image-zoom-input"})))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("div",{className:"col-md-6 col-md-offset-3"},void 0,(0,o.Z)(b.Z,{onClick:this.cropAvatar,loading:this.state.isLoading,className:"btn-primary btn-block"},void 0,this.props.upload?pgettext("avatar crop modal btn","Set avatar"):pgettext("avatar crop modal btn","Crop image")),(0,o.Z)(b.Z,{onClick:this.props.showIndex,disabled:this.state.isLoading,className:"btn-default btn-block"},void 0,pgettext("avatar crop modal btn","Cancel")))))}}]),i}(f().Component),S=n(48772);var L,O=function(t){(0,c.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,d.Z)(e);if(n){var i=(0,d.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,u.Z)(this,t)});function i(t){var e;return(0,r.Z)(this,i),e=a.call(this,t),(0,p.Z)((0,l.Z)(e),"pickFile",(function(){document.getElementById("avatar-hidden-upload").click()})),(0,p.Z)((0,l.Z)(e),"uploadFile",(function(){var t=document.getElementById("avatar-hidden-upload").files[0];if(t){var n=e.validateFile(t);if(n)x.Z.error(n);else{e.setState({image:t,preview:URL.createObjectURL(t),progress:0});var a=new FormData;a.append("avatar","upload"),a.append("image",t),_.Z.upload(e.props.user.api.avatar,a,(function(t){e.setState({progress:t})})).then((function(t){e.setState({options:t,uploaded:t.detail}),x.Z.info(pgettext("avatar upload modal","Your image has been uploaded and you may now crop it."))}),(function(t){400===t.status||413===t.status?(x.Z.error(t.detail),e.setState({isLoading:!1,image:null,progress:0})):e.props.showError(t)}))}}})),e.state={image:null,preview:null,progress:0,uploaded:null,dataUrl:null},e}return(0,s.Z)(i,[{key:"validateFile",value:function(t){if(t.size>this.props.options.upload.limit)return interpolate(pgettext("avatar upload modal","Selected file is too big. (%(filesize)s)"),{filesize:(0,S.Z)(t.size)},!0);var e=pgettext("avatar upload modal","Selected file type is not supported.");if(-1===this.props.options.upload.allowed_mime_types.indexOf(t.type))return e;var n=!1,a=t.name.toLowerCase();return this.props.options.upload.allowed_extensions.map((function(t){a.substr(-1*t.length)===t&&(n=!0)})),!n&&e}},{key:"getUploadRequirements",value:function(t){var e=t.allowed_extensions.map((function(t){return t.substr(1)}));return interpolate(pgettext("avatar upload modal","%(files)s files smaller than %(limit)s"),{files:e.join(", "),limit:(0,S.Z)(t.limit)},!0)}},{key:"getUploadButton",value:function(){return(0,o.Z)("div",{className:"modal-body modal-avatar-upload"},void 0,(0,o.Z)(b.Z,{className:"btn-pick-file",onClick:this.pickFile},void 0,R||(R=(0,o.Z)("div",{className:"material-icon"},void 0,"input")),pgettext("avatar upload modal field","Select file")),(0,o.Z)("p",{className:"text-muted"},void 0,this.getUploadRequirements(this.props.options.upload)))}},{key:"getUploadProgressLabel",value:function(){return interpolate(pgettext("avatar upload modal field","%(progress)s % complete"),{progress:this.state.progress},!0)}},{key:"getUploadProgress",value:function(){return(0,o.Z)("div",{className:"modal-body modal-avatar-upload"},void 0,(0,o.Z)("div",{className:"upload-progress"},void 0,(0,o.Z)("img",{src:this.state.preview}),(0,o.Z)("div",{className:"progress"},void 0,(0,o.Z)("div",{className:"progress-bar",role:"progressbar","aria-valuenow":"{this.state.progress}","aria-valuemin":"0","aria-valuemax":"100",style:{width:this.state.progress+"%"}},void 0,(0,o.Z)("span",{className:"sr-only"},void 0,this.getUploadProgressLabel())))))}},{key:"renderUpload",value:function(){return(0,o.Z)("div",{},void 0,(0,o.Z)("input",{type:"file",id:"avatar-hidden-upload",className:"hidden-file-upload",onChange:this.uploadFile}),this.state.image?this.getUploadProgress():this.getUploadButton(),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("div",{className:"col-md-6 col-md-offset-3"},void 0,(0,o.Z)(b.Z,{onClick:this.props.showIndex,disabled:!!this.state.image,className:"btn-default btn-block"},void 0,pgettext("avatar upload modal btn","Cancel")))))}},{key:"renderCrop",value:function(){return(0,o.Z)(E,{options:this.state.options,user:this.props.user,upload:this.state.uploaded,dataUrl:this.state.preview,onComplete:this.props.onComplete,showError:this.props.showError,showIndex:this.props.showIndex})}},{key:"render",value:function(){return this.state.uploaded?this.renderCrop():this.renderUpload()}}]),i}(f().Component),P=n(87462),A=(n(34458),n(69130));function T(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,a=(0,d.Z)(t);if(e){var i=(0,d.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,u.Z)(this,n)}}var I,B,j,D=function(t){(0,c.Z)(n,t);var e=T(n);function n(){var t;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,p.Z)((0,l.Z)(t),"select",(function(){t.props.select(t.props.id)})),t}return(0,s.Z)(n,[{key:"getClassName",value:function(){return this.props.selection===this.props.id?this.props.disabled?"btn btn-avatar btn-disabled avatar-selected":"btn btn-avatar avatar-selected":this.props.disabled?"btn btn-avatar btn-disabled":"btn btn-avatar"}},{key:"render",value:function(){return(0,o.Z)("button",{type:"button",className:this.getClassName(),disabled:this.props.disabled,onClick:this.select},void 0,(0,o.Z)("img",{src:this.props.url}))}}]),n}(f().Component),U=function(t){(0,c.Z)(n,t);var e=T(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,s.Z)(n,[{key:"render",value:function(){var t=this;return(0,o.Z)("div",{className:"avatars-gallery"},void 0,(0,o.Z)("h3",{},void 0,this.props.name),(0,o.Z)("div",{className:"avatars-gallery-images"},void 0,(0,A.Z)(this.props.images,4,null).map((function(e,n){return(0,o.Z)("div",{className:"row"},n,e.map((function(e,n){return(0,o.Z)("div",{className:"col-xs-3"},n,e?f().createElement(D,(0,P.Z)({disabled:t.props.disabled,select:t.props.select,selection:t.props.selection},e)):L||(L=(0,o.Z)("div",{className:"blank-avatar"})))})))}))))}}]),n}(f().Component),z=function(t){(0,c.Z)(n,t);var e=T(n);function n(t){var a;return(0,r.Z)(this,n),a=e.call(this,t),(0,p.Z)((0,l.Z)(a),"select",(function(t){a.setState({selection:t})})),(0,p.Z)((0,l.Z)(a),"save",(function(){if(a.state.isLoading)return!1;a.setState({isLoading:!0}),_.Z.post(a.props.user.api.avatar,{avatar:"galleries",image:a.state.selection}).then((function(t){a.setState({isLoading:!1}),x.Z.success(t.detail),a.props.onComplete(t),a.props.showIndex()}),(function(t){400===t.status?(x.Z.error(t.detail),a.setState({isLoading:!1})):a.props.showError(t)}))})),a.state={selection:null,isLoading:!1},a}return(0,s.Z)(n,[{key:"render",value:function(){var t=this;return(0,o.Z)("div",{},void 0,(0,o.Z)("div",{className:"modal-body modal-avatar-gallery"},void 0,this.props.options.galleries.map((function(e,n){return(0,o.Z)(U,{name:e.name,images:e.images,selection:t.state.selection,disabled:t.state.isLoading,select:t.select},n)}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("div",{className:"row"},void 0,(0,o.Z)("div",{className:"col-md-6 col-md-offset-3"},void 0,(0,o.Z)(b.Z,{onClick:this.save,loading:this.state.isLoading,disabled:!this.state.selection,className:"btn-primary btn-block"},void 0,this.state.selection?pgettext("avatar gallery modal btn","Save choice"):pgettext("avatar gallery modal btn","Select avatar")),(0,o.Z)(b.Z,{onClick:this.props.showIndex,disabled:this.state.isLoading,className:"btn-default btn-block"},void 0,pgettext("avatar gallery modal btn","Cancel"))))))}}]),n}(f().Component),q=n(3784),M=n(6935),F=n(90287);function H(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,a=(0,d.Z)(t);if(e){var i=(0,d.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,u.Z)(this,n)}}var V=function(t){(0,c.Z)(n,t);var e=H(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,s.Z)(n,[{key:"getErrorReason",value:function(){return this.props.reason?(0,o.Z)("p",{dangerouslySetInnerHTML:{__html:this.props.reason}}):null}},{key:"render",value:function(){return(0,o.Z)("div",{className:"modal-body"},void 0,I||(I=(0,o.Z)("div",{className:"message-icon"},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,"remove_circle_outline"))),(0,o.Z)("div",{className:"message-body"},void 0,(0,o.Z)("p",{className:"lead"},void 0,this.props.message),this.getErrorReason(),(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,pgettext("avatar modal dismiss","Ok"))))}}]),n}(f().Component),Y=function(t){(0,c.Z)(n,t);var e=H(n);function n(){var t;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,p.Z)((0,l.Z)(t),"showError",(function(e){t.setState({error:e})})),(0,p.Z)((0,l.Z)(t),"showIndex",(function(){t.setState({component:w})})),(0,p.Z)((0,l.Z)(t),"showUpload",(function(){t.setState({component:O})})),(0,p.Z)((0,l.Z)(t),"showCrop",(function(){t.setState({component:E})})),(0,p.Z)((0,l.Z)(t),"showGallery",(function(){t.setState({component:z})})),(0,p.Z)((0,l.Z)(t),"completeFlow",(function(e){F.Z.dispatch((0,M.n1)(t.props.user,e.avatars)),t.setState({component:w,options:e})})),t}return(0,s.Z)(n,[{key:"componentDidMount",value:function(){var t=this;_.Z.get(this.props.user.api.avatar).then((function(e){t.setState({component:w,options:e,error:null})}),(function(e){t.showError(e)}))}},{key:"getBody",value:function(){return this.state?this.state.error?(0,o.Z)(V,{message:this.state.error.detail,reason:this.state.error.reason}):(0,o.Z)(this.state.component,{options:this.state.options,user:this.props.user,onComplete:this.completeFlow,showError:this.showError,showIndex:this.showIndex,showCrop:this.showCrop,showUpload:this.showUpload,showGallery:this.showGallery}):B||(B=(0,o.Z)(q.Z,{}))}},{key:"getClassName",value:function(){return this.state&&this.state.error?"modal-dialog modal-message modal-change-avatar":"modal-dialog modal-change-avatar"}},{key:"render",value:function(){return(0,o.Z)("div",{className:this.getClassName(),role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":pgettext("modal","Close")},void 0,j||(j=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,pgettext("avatar modal title","Change your avatar"))),this.getBody()))}}]),n}(f().Component);function G(t){return{user:t.auth.user}}var W,$,Q,K,X,J,tt=n(49021);function et(){document.getElementById("hidden-logout-form").submit()}var nt=function(t){(0,c.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,d.Z)(e);if(n){var i=(0,d.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,u.Z)(this,t)});function i(t){var e;return(0,r.Z)(this,i),e=a.call(this,t),(0,p.Z)((0,l.Z)(e),"changeAvatar",(function(){e.props.close(),g.Z.show((0,Z.$j)(G)(Y))})),(0,p.Z)((0,l.Z)(e),"revealOptions",(function(){e.setState({options:e.props.options,optionsMore:!1})})),t.dropdown?e.state={options:t.options.slice(0,2),optionsMore:t.options.length>2}:e.state={options:t.options,optionsMore:!1},e}return(0,s.Z)(i,[{key:"render",value:function(){var t=this.props,e=t.user,n=t.close,a=t.dropdown,i=t.overlay;if(!e)return null;var r=misago.get("ADMIN_URL");return(0,o.Z)("ul",{className:m()("user-nav-menu",{"dropdown-menu-list":a,"overlay-menu-list":i})},void 0,(0,o.Z)("li",{className:"dropdown-menu-item"},void 0,(0,o.Z)("a",{href:e.url,className:"user-nav-profile"},void 0,(0,o.Z)("strong",{},void 0,e.username),(0,o.Z)("small",{},void 0,pgettext("user nav","Go to your profile")))),W||(W=(0,o.Z)(tt.YV,{})),(0,o.Z)(tt.Xi,{},void 0,(0,o.Z)("a",{href:misago.get("NOTIFICATIONS_URL")},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,e.unreadNotifications?"notifications_active":"notifications_none"),pgettext("user nav","Notifications"),!!e.unreadNotifications&&(0,o.Z)("span",{className:"badge"},void 0,e.unreadNotifications))),!!e.showPrivateThreads&&(0,o.Z)(tt.Xi,{},void 0,(0,o.Z)("a",{href:misago.get("PRIVATE_THREADS_URL")},void 0,$||($=(0,o.Z)("span",{className:"material-icon"},void 0,"inbox")),pgettext("user nav","Private threads"),!!e.unreadPrivateThreads&&(0,o.Z)("span",{className:"badge"},void 0,e.unreadPrivateThreads))),!!r&&(0,o.Z)(tt.Xi,{},void 0,(0,o.Z)("a",{href:r,target:"_blank"},void 0,Q||(Q=(0,o.Z)("span",{className:"material-icon"},void 0,"security")),pgettext("user nav","Admin control panel"))),K||(K=(0,o.Z)(tt.YV,{})),(0,o.Z)(tt.iC,{className:"user-nav-options"},void 0,pgettext("user nav section","Account settings")),(0,o.Z)(tt.Xi,{},void 0,(0,o.Z)("button",{className:"btn-link",onClick:this.changeAvatar,type:"button"},void 0,X||(X=(0,o.Z)("span",{className:"material-icon"},void 0,"portrait")),pgettext("user nav","Change avatar"))),this.state.options.map((function(t){return(0,o.Z)(tt.Xi,{},t.icon,(0,o.Z)("a",{href:t.url},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,t.icon),t.name))})),(0,o.Z)(tt.Xi,{},void 0,(0,o.Z)("button",{className:m()("btn-link",{"d-none":!this.state.optionsMore}),onClick:this.revealOptions,type:"button"},void 0,J||(J=(0,o.Z)("span",{className:"material-icon"},void 0,"more_vertical")),pgettext("user nav","See more"))),!!a&&(0,o.Z)(tt.kE,{listItem:!0},void 0,(0,o.Z)("button",{className:"btn btn-default btn-block",onClick:function(){et(),n()},type:"button"},void 0,pgettext("user nav","Log out"))))}}]),i}(f().Component);const at=(0,Z.$j)((function(t){var e=t.auth.user;return e.id?{user:{username:e.username,unreadNotifications:e.unreadNotifications,unreadPrivateThreads:e.unread_private_threads,showPrivateThreads:e.acl.can_use_private_threads,url:e.url},options:(0,i.Z)(misago.get("userOptions"))}:{user:null}}))(nt);function it(t){var e=t.close;return(0,o.Z)(at,{close:e,dropdown:!0})}var ot=n(993),rt=n(64836);const st=(0,Z.$j)((function(t){return{isOpen:t.overlay.userNav}}))((function(t){var e=t.dispatch,n=t.isOpen;return(0,o.Z)(rt.a,{open:n},void 0,(0,o.Z)(rt.i,{},void 0,pgettext("user nav title","Your options")),(0,o.Z)(at,{close:function(){return e((0,ot.xv)())},overlay:!0}),(0,o.Z)(tt.kE,{},void 0,(0,o.Z)("button",{className:"btn btn-default btn-block",onClick:function(){et(),e((0,ot.xv)())},type:"button"},void 0,pgettext("user nav","Log out"))))}))},19605:(t,e,n)=>{"use strict";n.d(e,{ZP:()=>o});var a=n(22928),i=(n(57588),n(34458));function o(t){var e=t.size||100,n=t.size2x||2*e;return(0,a.Z)("img",{alt:"",className:t.className||"user-avatar",src:r(t.user,e),srcSet:r(t.user,n),width:t.height||e,height:t.height||e})}function r(t,e){return t&&t.id?function(t,e){var n=t[0];return t.forEach((function(t){t.size>=e&&(n=t)})),n}(t.avatars,e).url:i.Z.get("BLANK_AVATAR_URL")}},82211:(t,e,n)=>{"use strict";n.d(e,{Z:()=>h});var a,i=n(22928),o=n(15671),r=n(43144),s=n(79340),l=n(6215),c=n(61120),u=n(57588),d=n.n(u),p=n(37848);var h=function(t){(0,s.Z)(d,t);var e,n,u=(e=d,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,l.Z)(this,t)});function d(){return(0,o.Z)(this,d),u.apply(this,arguments)}return(0,r.Z)(d,[{key:"render",value:function(){var t="btn "+this.props.className,e=this.props.disabled;return this.props.loading&&(t+=" btn-loading",e=!0),(0,i.Z)("button",{className:t,disabled:e,onClick:this.props.onClick,type:this.props.onClick?"button":"submit"},void 0,this.props.children,this.props.loading?a||(a=(0,i.Z)(p.Z,{})):null)}}]),d}(d().Component);h.defaultProps={className:"btn-default",type:"submit",loading:!1,disabled:!1,onClick:null}},57026:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var a=n(22928);function i(t){return(0,a.Z)("select",{className:t.className||"form-control",disabled:t.disabled||!1,id:t.id||null,onChange:t.onChange,value:t.value},void 0,t.choices.map((function(t){return(0,a.Z)("option",{disabled:t.disabled||!1,value:t.value},t.value,"- - ".repeat(t.level)+t.label)})))}n(57588)},96359:(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});var a=n(22928),i=n(15671),o=n(43144),r=n(79340),s=n(6215),l=n(61120),c=n(57588);var u=function(t){(0,r.Z)(u,t);var e,n,c=(e=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,l.Z)(e);if(n){var i=(0,l.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,s.Z)(this,t)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,o.Z)(u,[{key:"isValidated",value:function(){return void 0!==this.props.validation}},{key:"getClassName",value:function(){var t="form-group";return this.isValidated()&&(t+=" has-feedback",null===this.props.validation?t+=" has-success":t+=" has-error"),t}},{key:"getFeedback",value:function(){var t=this;return this.props.validation?(0,a.Z)("div",{className:"help-block errors"},void 0,this.props.validation.map((function(e,n){return(0,a.Z)("p",{},t.props.for+"FeedbackItem"+n,e)}))):null}},{key:"getFeedbackDescription",value:function(){return this.isValidated()?(0,a.Z)("span",{id:this.props.for+"_status",className:"sr-only"},void 0,this.props.validation?pgettext("field validation status","(error)"):pgettext("field validation status","(success)")):null}},{key:"getHelpText",value:function(){return this.props.helpText?(0,a.Z)("p",{className:"help-block"},void 0,this.props.helpText):null}},{key:"render",value:function(){return(0,a.Z)("div",{className:this.getClassName()},void 0,(0,a.Z)("label",{className:"control-label "+(this.props.labelClass||""),htmlFor:this.props.for||""},void 0,this.props.label+":"),(0,a.Z)("div",{className:this.props.controlClass||""},void 0,this.props.children,this.getFeedbackDescription(),this.getFeedback(),this.getHelpText(),this.props.extra||null))}}]),u}(n.n(c)().Component)},43345:(t,e,n)=>{"use strict";n.d(e,{Z:()=>v});var a=n(15671),i=n(43144),o=n(97326),r=n(79340),s=n(6215),l=n(61120),c=n(4942),u=n(57588),d=n.n(u),p=n(55210),h=n(53904);var m=(0,p.C1)(),v=function(t){(0,r.Z)(d,t);var e,n,u=(e=d,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,l.Z)(e);if(n){var i=(0,l.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,s.Z)(this,t)});function d(){var t;(0,a.Z)(this,d);for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return t=u.call.apply(u,[this].concat(n)),(0,c.Z)((0,o.Z)(t),"bindInput",(function(e){return function(n){t.changeValue(e,n.target.value)}})),(0,c.Z)((0,o.Z)(t),"changeValue",(function(e,n){var a=(0,c.Z)({},e,n),i=t.state.errors||{};i[e]=t.validateField(e,a[e]),a.errors=i,t.setState(a)})),(0,c.Z)((0,o.Z)(t),"handleSubmit",(function(e){if(e&&e.preventDefault(),!t.state.isLoading&&t.clean()){t.setState({isLoading:!0});var n=t.send();n?n.then((function(e){t.setState({isLoading:!1}),t.handleSuccess(e)}),(function(e){t.setState({isLoading:!1}),t.handleError(e)})):t.setState({isLoading:!1})}})),t}return(0,i.Z)(d,[{key:"validate",value:function(){var t={};if(!this.state.validators)return t;var e={required:this.state.validators.required||this.state.validators,optional:this.state.validators.optional||{}},n=[];for(var a in e.required)e.required.hasOwnProperty(a)&&e.required[a]&&n.push(a);for(var i in e.optional)e.optional.hasOwnProperty(i)&&e.optional[i]&&n.push(i);for(var o in n){var r=n[o],s=this.validateField(r,this.state[r]);null===s?t[r]=null:s&&(t[r]=s)}return t}},{key:"isValid",value:function(){var t=this.validate();for(var e in t)if(t.hasOwnProperty(e)&&null!==t[e])return!1;return!0}},{key:"validateField",value:function(t,e){var n=[];if(!this.state.validators)return n;var a={required:(this.state.validators.required||this.state.validators)[t],optional:(this.state.validators.optional||{})[t]},i=m(e)||!1;if(a.required){if(i)n=[i];else for(var o in a.required){var r=a.required[o](e);r&&n.push(r)}return n.length?n:null}if(!1===i&&a.optional){for(var s in a.optional){var l=a.optional[s](e);l&&n.push(l)}return n.length?n:null}return!1}},{key:"clean",value:function(){return!0}},{key:"send",value:function(){return null}},{key:"handleSuccess",value:function(t){}},{key:"handleError",value:function(t){h.Z.apiError(t)}}]),d}(d().Component)},94417:(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});var a=n(22928),i=n(15671),o=n(43144),r=n(79340),s=n(6215),l=n(61120),c=n(57588);var u=function(t){(0,r.Z)(u,t);var e,n,c=(e=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,l.Z)(e);if(n){var i=(0,l.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,s.Z)(this,t)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,o.Z)(u,[{key:"isActive",value:function(){return this.props.isControlled?this.props.isActive:!!this.props.path&&0===document.location.pathname.indexOf(this.props.path)}},{key:"getClassName",value:function(){return this.isActive()?(this.props.className||"")+" "+(this.props.activeClassName||"active"):this.props.className||""}},{key:"render",value:function(){return(0,a.Z)("li",{className:this.getClassName()},void 0,this.props.children)}}]),u}(n.n(c)().Component)},37848:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var a,i=n(22928);function o(t){return(0,i.Z)("div",{className:t.className||"loader"},void 0,a||(a=(0,i.Z)("div",{className:"loader-spinning-wheel"})))}n(57588)},69092:(t,e,n)=>{"use strict";n.d(e,{Z:()=>g});var a=n(15671),i=n(43144),o=n(79340),r=n(6215),s=n(61120),l=n(94184),c=n.n(l),u=n(57588),d=n.n(u),p=n(4942),h=n(19755),m=new RegExp("^.*(?:(?:youtu.be/|v/|vi/|u/w/|embed/)|(?:(?:watch)??v(?:i)?=|&v(?:i)?=))([^#&?]*).*");const v=new(function(){function t(){var e=this;(0,a.Z)(this,t),(0,p.Z)(this,"render",(function(t){t&&(e.highlightCode(t),e.embedYoutubePlayers(t))})),this._youtube={}}return(0,i.Z)(t,[{key:"highlightCode",value:function(t){n.e(417).then(n.bind(n,15739)).then((function(e){for(var n=e.default,a=t.querySelectorAll("pre>code"),i=0;i<a.length;i++)n.highlightElement(a[i])}))}},{key:"embedYoutubePlayers",value:function(t){for(var e=t.querySelectorAll("p>a"),n=0;n<e.length;n++){var a=e[n],i=1===a.parentNode.childNodes.length;this._youtube[a.href]||(this._youtube[a.href]=f(a.href));var o=this._youtube[a.href];i&&o&&!1!==o.data&&this.swapYoutubePlayer(a,o)}}},{key:"swapYoutubePlayer",value:function(t,e){var n="https://www.youtube.com/embed/";n+=e.video,n+="?feature=oembed",e.start&&(n+="&start="+e.start);var a=h('<iframe class="embed-responsive-item" frameborder="0" src="'+n+'" allow="encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>');h(t).replaceWith(a),a.wrap('<div class="embed-responsive embed-responsive-16by9"></div>')}}]),t}());function f(t){var e=function(t){var e=t;return"https://"===t.substr(0,8)?e=e.substr(8):"http://"===t.substr(0,7)&&(e=e.substr(7)),"www."===e.substr(0,4)&&(e=e.substr(4)),e}(t),n=function(t){if(-1===t.indexOf("youtu"))return null;var e=t.match(m);return e?e[1]:null}(e);if(!n)return null;var a=0;if(e.indexOf("?")>0){var i=e.substr(e.indexOf("?")+1).split("&").filter((function(t){return"t="===t.substr(0,2)}))[0];if(i){var o=i.substr(2).split("m");"s"===o[0].substr(-1)?a+=parseInt(o[0].substr(0,o[0].length-1)):(a+=60*parseInt(o[0]),o[1]&&"s"===o[1].substr(-1)&&(a+=parseInt(o[1].substr(0,o[1].length-1))))}}return{start:a,video:n}}var Z=n(19755);var g=function(t){(0,o.Z)(u,t);var e,n,l=(e=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,s.Z)(e);if(n){var i=(0,s.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,r.Z)(this,t)});function u(){return(0,a.Z)(this,u),l.apply(this,arguments)}return(0,i.Z)(u,[{key:"componentDidMount",value:function(){v.render(this.documentNode),Z(this.documentNode).find(".spoiler-reveal").click(y)}},{key:"componentDidUpdate",value:function(t,e){v.render(this.documentNode),Z(this.documentNode).find(".spoiler-reveal").click(y)}},{key:"shouldComponentUpdate",value:function(t,e){return t.markup!==this.props.markup}},{key:"render",value:function(){var t=this;return d().createElement("article",{className:c()("misago-markup",this.props.className),dangerouslySetInnerHTML:{__html:this.props.markup},"data-author":this.props.author||void 0,ref:function(e){t.documentNode=e}})}}]),u}(d().Component);function y(t){var e=t.target;Z(e).parent().parent().addClass("revealed")}},3784:(t,e,n)=>{"use strict";n.d(e,{Z:()=>h});var a,i=n(22928),o=n(15671),r=n(43144),s=n(79340),l=n(6215),c=n(61120),u=n(57588),d=n.n(u),p=n(37848);var h=function(t){(0,s.Z)(d,t);var e,n,u=(e=d,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,l.Z)(this,t)});function d(){return(0,o.Z)(this,d),u.apply(this,arguments)}return(0,r.Z)(d,[{key:"render",value:function(){return a||(a=(0,i.Z)("div",{className:"modal-body modal-loader"},void 0,(0,i.Z)(p.Z,{})))}}]),d}(d().Component)},30337:(t,e,n)=>{"use strict";n.d(e,{Z:()=>c});var a=n(22928),i=n(15671),o=n(43144),r=n(79340),s=n(6215),l=n(61120);n(57588);var c=function(t){(0,r.Z)(u,t);var e,n,c=(e=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,l.Z)(e);if(n){var i=(0,l.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,s.Z)(this,t)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,o.Z)(u,[{key:"getHelpText",value:function(){return this.props.helpText?(0,a.Z)("p",{className:"help-block"},void 0,this.props.helpText):null}},{key:"render",value:function(){return(0,a.Z)("div",{className:"modal-body"},void 0,(0,a.Z)("div",{className:"message-icon"},void 0,(0,a.Z)("span",{className:"material-icon"},void 0,this.props.icon||"info_outline")),(0,a.Z)("div",{className:"message-body"},void 0,(0,a.Z)("p",{className:"lead"},void 0,this.props.message),this.getHelpText(),(0,a.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,pgettext("modal message dismiss btn","Ok"))))}}]),u}(n(33556).Z)},33556:(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});var a=n(22928),i=n(15671),o=n(43144),r=n(79340),s=n(6215),l=n(61120),c=n(57588);var u=function(t){(0,r.Z)(u,t);var e,n,c=(e=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,l.Z)(e);if(n){var i=(0,l.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,s.Z)(this,t)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,o.Z)(u,[{key:"getHelpText",value:function(){return this.props.helpText?(0,a.Z)("p",{className:"help-block"},void 0,this.props.helpText):null}},{key:"render",value:function(){return(0,a.Z)("div",{className:"panel-body panel-message-body"},void 0,(0,a.Z)("div",{className:"message-icon"},void 0,(0,a.Z)("span",{className:"material-icon"},void 0,this.props.icon||"info_outline")),(0,a.Z)("div",{className:"message-body"},void 0,(0,a.Z)("p",{className:"lead"},void 0,this.props.message),this.getHelpText()))}}]),u}(n.n(c)().Component)},11005:(t,e,n)=>{"use strict";n.d(e,{Z:()=>N});var a=n(22928),i=n(57588),o=n.n(i),r=n(69092);function s(t){return t.post.content?o().createElement(l,t):o().createElement(c,t)}function l(t){return(0,a.Z)("div",{className:"post-body"},void 0,(0,a.Z)(r.Z,{markup:t.post.headline||t.post.content}))}function c(t){return(0,a.Z)("div",{className:"post-body post-body-invalid"},void 0,(0,a.Z)("p",{className:"lead"},void 0,pgettext("post body invalid","This post's contents cannot be displayed.")),(0,a.Z)("p",{className:"text-muted"},void 0,pgettext("post body invalid","This error is caused by invalid post content manipulation.")))}function u(t){var e=t.post,n=e.category,i=e.thread,o=interpolate(pgettext("posts feed item header","posted %(posted_on)s"),{posted_on:e.posted_on.format("LL, LT")},!0);return(0,a.Z)("div",{className:"post-heading"},void 0,(0,a.Z)("a",{className:"btn btn-link item-title",href:i.url},void 0,i.title),(0,a.Z)("a",{className:"btn btn-link post-category",href:n.url.index},void 0,n.name),(0,a.Z)("a",{href:e.url.index,className:"btn btn-link posted-on",title:o},void 0,e.posted_on.fromNow()))}var d,p,h=n(19605);function m(t){var e=t.post;return(0,a.Z)("a",{className:"btn btn-default btn-icon pull-right",href:e.url.index},void 0,(0,a.Z)("span",{className:"btn-text-left hidden-xs"},void 0,pgettext("go to post link","See post")),d||(d=(0,a.Z)("span",{className:"material-icon"},void 0,"chevron_right")))}function v(t){var e=t.post;return(0,a.Z)("div",{className:"post-side post-side-anonymous"},void 0,(0,a.Z)(m,{post:e}),(0,a.Z)("div",{className:"media"},void 0,p||(p=(0,a.Z)("div",{className:"media-left"},void 0,(0,a.Z)("span",{},void 0,(0,a.Z)(h.ZP,{className:"poster-avatar",size:50})))),(0,a.Z)("div",{className:"media-body"},void 0,(0,a.Z)("div",{className:"media-heading"},void 0,(0,a.Z)("span",{className:"item-title"},void 0,e.poster_name)),(0,a.Z)("span",{className:"user-title user-title-anonymous"},void 0,pgettext("post removed poster username","Removed user")))))}function f(t){var e=t.rank,n=t.title||e.title||e.name,i="user-title";return e.css_class&&(i+=" user-title-"+e.css_class),e.is_tab?(0,a.Z)("a",{className:i,href:e.url},void 0,n):(0,a.Z)("span",{className:i},void 0,n)}function Z(t){var e=t.post,n=t.poster;return(0,a.Z)("div",{className:"post-side post-side-registered"},void 0,(0,a.Z)(m,{post:e}),(0,a.Z)("div",{className:"media"},void 0,(0,a.Z)("div",{className:"media-left"},void 0,(0,a.Z)("a",{href:n.url},void 0,(0,a.Z)(h.ZP,{className:"poster-avatar",size:50,user:n}))),(0,a.Z)("div",{className:"media-body"},void 0,(0,a.Z)("div",{className:"media-heading"},void 0,(0,a.Z)("a",{className:"item-title",href:n.url},void 0,n.username)),(0,a.Z)(f,{title:n.title,rank:n.rank}))))}function g(t){var e=t.post,n=t.poster;return n&&n.id?(0,a.Z)(Z,{post:e,poster:n}):(0,a.Z)(v,{post:e})}function y(t){var e=t.post,n=t.poster||e.poster,i="post";return n&&n.rank.css_class&&(i+=" post-"+n.rank.css_class),(0,a.Z)("li",{className:i,id:"post-"+e.id},void 0,(0,a.Z)("div",{className:"panel panel-default panel-post"},void 0,(0,a.Z)("div",{className:"panel-body"},void 0,(0,a.Z)("div",{className:"panel-content"},void 0,(0,a.Z)(g,{post:e,poster:n}),(0,a.Z)(u,{post:e}),(0,a.Z)(s,{post:e})))))}var b,k,_=n(44039);function x(){return(0,a.Z)("ul",{className:"posts-list post-feed ui-preview"},void 0,(0,a.Z)("li",{className:"post"},void 0,(0,a.Z)("div",{className:"panel panel-default panel-post"},void 0,(0,a.Z)("div",{className:"panel-body"},void 0,(0,a.Z)("div",{className:"panel-content"},void 0,(0,a.Z)("div",{className:"post-side post-side-anonymous"},void 0,(0,a.Z)("div",{className:"media"},void 0,b||(b=(0,a.Z)("div",{className:"media-left"},void 0,(0,a.Z)("span",{},void 0,(0,a.Z)(h.ZP,{className:"poster-avatar",size:50})))),(0,a.Z)("div",{className:"media-body"},void 0,(0,a.Z)("div",{className:"media-heading"},void 0,(0,a.Z)("span",{className:"item-title"},void 0,(0,a.Z)("span",{className:"ui-preview-text",style:{width:_.e(30,200)+"px"}},void 0," "))),(0,a.Z)("span",{className:"user-title user-title-anonymous"},void 0,(0,a.Z)("span",{className:"ui-preview-text",style:{width:_.e(30,200)+"px"}},void 0," "))))),(0,a.Z)("div",{className:"post-heading"},void 0,(0,a.Z)("span",{className:"ui-preview-text",style:{width:_.e(30,200)+"px"}},void 0," ")),(0,a.Z)("div",{className:"post-body"},void 0,(0,a.Z)("article",{className:"misago-markup"},void 0,(0,a.Z)("p",{},void 0,(0,a.Z)("span",{className:"ui-preview-text",style:{width:_.e(30,200)+"px"}},void 0," ")," ",(0,a.Z)("span",{className:"ui-preview-text",style:{width:_.e(30,200)+"px"}},void 0," ")," ",(0,a.Z)("span",{className:"ui-preview-text",style:{width:_.e(30,200)+"px"}},void 0," ")))))))))}function N(t){var e=t.isReady,n=t.posts,i=t.poster;return e?(0,a.Z)("ul",{className:"posts-list post-feed ui-ready"},void 0,n.map((function(t){return(0,a.Z)(y,{post:t,poster:i},t.id)}))):k||(k=(0,a.Z)(x,{}))}},9771:(t,e,n)=>{"use strict";n.d(e,{mv:()=>v,ZP:()=>cn,MO:()=>T,Fi:()=>x});var a,i=n(57588),o=n.n(i),r=n(22928),s=n(43144),l=n(15671),c=n(97326),u=n(79340),d=n(6215),p=n(61120),h=n(4942),m=n(64646);var v=function(t){(0,u.Z)(v,t);var e,n,i=(e=v,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function v(t){var e;return(0,l.Z)(this,v),e=i.call(this,t),(0,h.Z)((0,c.Z)(e),"selected",(function(){if(e.element){var t=Z(e.element)||null,n=t?t.getBoundingClientRect():null;e.setState({range:t,rect:n})}})),(0,h.Z)((0,c.Z)(e),"reply",(function(){if(m.Z.isOpen()){var t=T();t&&!t.disabled&&(t.quote(x(e.state.range)),e.setState({range:null,rect:null}),f())}else{var n=x(e.state.range);m.Z.open(Object.assign({},e.props.posting,{default:n})),e.setState({range:null,rect:null}),window.setTimeout(f,1e3)}})),(0,h.Z)((0,c.Z)(e),"render",(function(){return(0,r.Z)("div",{},void 0,o().createElement("div",{ref:function(t){t&&(e.element=t)},onMouseUp:e.selected,onTouchEnd:e.selected},e.props.children),!!e.state.rect&&(0,r.Z)("div",{className:"quote-control",style:{position:"absolute",left:e.state.rect.left+window.scrollX,top:e.state.rect.bottom+window.scrollY}},void 0,a||(a=(0,r.Z)("div",{className:"quote-control-arrow"})),(0,r.Z)("div",{className:"quote-control-inner"},void 0,(0,r.Z)("button",{className:"btn quote-control-btn",type:"button",onClick:e.reply},void 0,pgettext("post reply","Quote")))))})),e.state={range:null,rect:null},e.element=null,e}return(0,s.Z)(v)}(o().Component);function f(){var t=document.querySelector("#posting-mount textarea");t.focus(),t.selectionStart=t.selectionEnd=t.value.length}var Z=function(t){if(void 0!==window.getSelection){var e=window.getSelection();if(e&&"Range"===e.type&&1===e.rangeCount){var n=e.getRangeAt(0);if(g(n,t)&&y(n)&&b(n.cloneContents()))return n}}},g=function(t,e){var n=t.commonAncestorContainer;if(n===e)return!0;for(var a=n.parentNode;a;){if(a===e)return!0;a=a.parentNode}return!1},y=function(t){var e=t.commonAncestorContainer;if("ARTICLE"===e.nodeName)return!0;if(e.dataset&&"1"===e.dataset.noquote)return!1;for(var n=e.parentNode;n;){if(n.dataset&&"1"===n.dataset.noquote)return!1;if("ARTICLE"===n.nodeName)return!0;n=n.parentNode}return!1},b=function t(e){for(var n=0;n<e.childNodes.length;n++){var a=e.childNodes[n];if(a.nodeType===Node.TEXT_NODE&&a.textContent&&a.textContent.trim().length>0)return!0;if("IMG"===a.nodeName)return!0;if(t(a))return!0}return!1},k=n(42982),_=n(70885);const x=function(t){var e=N(t),n=O(t.cloneContents().childNodes,[]),a=e?'[quote="'.concat(e,'"]\n'):"[quote]\n",i="\n[/quote]\n\n",o=R(t);return o?(a+=o.syntax?"[code=".concat(o.syntax,"]\n"):"[code]\n",i="\n[/code]"+i):S(t)?(n=n.trim(),a+="`",i="`"+i):n=n.trim(),a+n+i};var N=function(t){var e=t.commonAncestorContainer;if(w(e))return C(e);for(var n=e.parentNode;n;){if(w(n))return C(n);n=n.parentNode}return""},w=function(t){return t.nodeType===Node.ELEMENT_NODE&&("ARTICLE"===t.nodeName||"BLOCKQUOTE"===t.nodeName&&t.dataset&&"quote"===t.dataset.block)},C=function(t){return t.dataset&&t.dataset.author||null},R=function(t){var e=t.commonAncestorContainer;if(E(e))return L(e);for(var n=e.parentNode;n;){if(E(n))return L(n);n=n.parentNode}return null},E=function(t){return"PRE"===t.nodeName},S=function(t){var e=t.commonAncestorContainer;if("CODE"===e.nodeName)return!0;for(var n=e.parentNode;n;){if(w(n))return!1;if("CODE"===n.nodeName)return!0;n=n.parentNode}return!1},L=function(t){return t.dataset?{syntax:t.dataset.syntax||null}:{syntax:null}},O=function(t,e){for(var n="",a=0;a<t.length;a++){var i=t[a];n+=A(i,e)}return n},P={H1:["\n\n# ",""],H2:["\n\n## ",""],H3:["\n\n### ",""],H4:["\n\n#### ",""],H5:["\n\n##### ",""],H6:["\n\n###### ",""],STRONG:["**","**"],EM:["*","*"],DEL:["~~","~~"],B:["[b]","[/b]"],U:["[u]","[/u]"],I:["[i]","[/i]"],SUB:["[sub]","[/sub]"],SUP:["[sup]","[/sup]"]},A=function(t,e){var n=t.dataset||{};if(t.nodeType===Node.TEXT_NODE)return t.textContent||"";if(t.nodeType===Node.ELEMENT_NODE){if(n.quote)return n.quote||"";if("1"===n.noquote)return""}if(t.nodeType===Node.ELEMENT_NODE&&n.quote&&n.quote.trim())return"";if("HR"===t.nodeName)return"\n\n- - -";if(P[t.nodeName]){var a=(0,_.Z)(P[t.nodeName],2),i=a[0],o=a[1];return i+O(t.childNodes,[].concat((0,k.Z)(e),[t.nodeName]))+o}if("A"===t.nodeName){var r=t.href,s=O(t.childNodes,[].concat((0,k.Z)(e),[t.nodeName]));return s?"[".concat(s,"](").concat(r,")"):"!(".concat(r,")")}if("IMG"===t.nodeName){var l=t.src,c=t.alt;return c?"![".concat(c,"](").concat(l,")"):"!(".concat(l,")")}if("DIV"===t.nodeName||"ASIDE"===t.nodeName){var u=n.block&&n.block.toUpperCase();if(u&&P[u]){var d=(0,_.Z)(P[u],2),p=d[0],h=d[1];return p+O(t.childNodes,[].concat((0,k.Z)(e),[u]))+h}return O(t.childNodes,e)}if("BLOCKQUOTE"===t.nodeName){if("spoiler"===n.block){var m=O(t.childNodes,[].concat((0,k.Z)(e),["SPOILER"])).trim();if(!m)return"";var v="\n[spoiler]\n";return(v+=m)+"\n[/spoiler]"}var f=O(t.childNodes,[].concat((0,k.Z)(e),["QUOTE"])).trim();if(!f)return"";var Z=C(t),g=Z?"\n[quote=".concat(Z,"]\n"):"\n\n[quote]\n";return(g+=f)+"\n[/quote]"}if("PRE"===t.nodeName){var y=n.syntax||null,b=t.querySelector("code"),x=b&&b.innerText||"";return x.trim()?"\n[code"+(y?"="+y:"")+"]"+x+"[/code]":""}if("CODE"===t.nodeName)return"`"+t.innerText+"`";if("P"===t.nodeName)return"\n"+O(t.childNodes,[].concat((0,k.Z)(e),[t.nodeName]));if("UL"===t.nodeName||"OL"===t.nodeName)return(0===e.filter((function(t){return"OL"===t||"UL"===t})).length?"\n":"")+O(t.childNodes,[].concat((0,k.Z)(e),[t.nodeName]));if("LI"===t.nodeName){for(var N="",w=e.filter((function(t){return"OL"===t||"UL"===t})).length,R=1;R<w;R++)N+="    ";N+="OL"===e[e.length-1]?n.index?n.index+". ":"1. ":"- ";var E=O(t.childNodes,[].concat((0,k.Z)(e),[t.nodeName]));return E.trim()?"\n"+N+E:""}return"SPAN"===t.nodeName?O(t.childNodes,e):""};function T(){return window.misagoReply}function I(t,e){window.misagoReply={disabled:t,quote:e}}function B(){window.misagoReply=null}var j=n(57026),D=n(43345),U=n(30381),z=n.n(U);function q(t){return t.filter((function(t){return t.id&&!t.isRemoved})).map((function(t){return t.id}))}var M,F=n(12891),H=n(78657),V=n(53904),Y=n(94184),G=n.n(Y),W=n(34458),$=n(69092),Q=n(59801),K=n(48772);function X(t){var e=t.attachment;return(0,r.Z)("div",{className:"modal-dialog modal-lg",role:"document"},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,M||(M=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("markup editor","Attachment details"))),(0,r.Z)("div",{className:"modal-body"},void 0,!!e.is_image&&(0,r.Z)("div",{className:"markup-editor-attachment-modal-preview"},void 0,(0,r.Z)("a",{href:e.url.index+"?shva=1",target:"_blank"},void 0,(0,r.Z)("img",{src:e.url.index+"?shva=1",alt:""}))),(0,r.Z)("div",{className:"markup-editor-attachment-modal-filename"},void 0,e.filename),(0,r.Z)("div",{className:"row markup-editor-attachment-modal-details"},void 0,(0,r.Z)("div",{className:"col-xs-12 col-md-3"},void 0,(0,r.Z)("strong",{},void 0,e.filetype+", "+(0,K.Z)(e.size)),(0,r.Z)("div",{className:"text-muted"},void 0,(0,r.Z)("small",{},void 0,pgettext("markup editor","Type and size")))),(0,r.Z)("div",{className:"col-xs-12 col-md-4"},void 0,(0,r.Z)("strong",{},void 0,(0,r.Z)("abbr",{title:e.uploaded_on.format("LLL")},void 0,e.uploaded_on.fromNow())),(0,r.Z)("div",{className:"text-muted"},void 0,(0,r.Z)("small",{},void 0,pgettext("markup editor","Uploaded at")))),(0,r.Z)("div",{className:"col-xs-12 col-md-3"},void 0,e.url.uploader?(0,r.Z)("a",{href:e.url.uploader,target:"_blank",className:"item-title"},void 0,e.uploader_name):(0,r.Z)("span",{className:"item-title"},void 0,e.uploader_name),(0,r.Z)("div",{className:"text-muted"},void 0,(0,r.Z)("small",{},void 0,pgettext("markup editor","Uploader")))))),(0,r.Z)("div",{className:"modal-footer"},void 0,(0,r.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,pgettext("modal","Close")))))}var J,tt,et,nt,at=function(t,e,n,a,i){var o=t.text||i||"",r=t.prefix;r+=n+o+a,e(r+=t.suffix),window.setTimeout((function(){st(t.textarea);var e=t.start+n.length;t.textarea.setSelectionRange(e,e+o.length)}),250)},it=function(t,e,n){var a=t.prefix;a+=n,e(a+=t.suffix),window.setTimeout((function(){st(t.textarea);var e=t.end+n.length;t.textarea.setSelectionRange(e,e)}),250)},ot=function(t){if(document.selection){t.focus();var e=document.selection.createRange(),n=e.text.length;return e.moveStart("character",-t.value.length),rt(t,e.text.length-n,e.text.length)}if(t.selectionStart||"0"==t.selectionStart)return rt(t,t.selectionStart,t.selectionEnd)},rt=function(t,e,n){return{textarea:t,start:e,end:n,text:t.value.substring(e,n),prefix:t.value.substring(0,e),suffix:t.value.substring(n)}};function st(t){var e=t.scrollTop;t.focus(),t.scrollTop=e}const lt=function(t){var e,n=t.attachment,a=t.disabled,i=t.element,o=t.setState,s=t.update;return(0,r.Z)("div",{className:"markup-editor-attachments-item"},void 0,(0,r.Z)("div",{className:"markup-editor-attachment"},void 0,(0,r.Z)("div",{className:"markup-editor-attachment-details"},void 0,n.id?(0,r.Z)("a",{className:"item-title",href:n.url.index+"?shva=1",target:"_blank",onClick:function(t){t.preventDefault(),Q.Z.show(e||(e=(0,r.Z)(X,{attachment:n})))}},void 0,n.filename):(0,r.Z)("strong",{className:"item-title"},void 0,n.filename),(0,r.Z)("div",{className:"text-muted"},void 0,(0,r.Z)("ul",{className:"list-unstyled list-inline"},void 0,!n.id&&(0,r.Z)("li",{},void 0,n.progress+"%"),!!n.filetype&&(0,r.Z)("li",{},void 0,n.filetype),n.size>0&&(0,r.Z)("li",{},void 0,(0,K.Z)(n.size))))),!!n.id&&(0,r.Z)("div",{className:"markup-editor-attachment-buttons"},void 0,(0,r.Z)("button",{className:"btn btn-markup-editor-attachment btn-icon",title:pgettext("markup editor","Insert into message"),type:"button",disabled:a,onClick:function(){var t=function(t){var e="[";return t.is_image?(e+="!["+t.filename+"]",e+="("+(t.url.thumb||t.url.index)+"?shva=1)"):e+=t.filename,e+"]("+t.url.index+"?shva=1)"}(n),e=ot(i);it(e,s,t)}},void 0,J||(J=(0,r.Z)("span",{className:"material-icon"},void 0,"flip_to_front"))),(0,r.Z)("button",{className:"btn btn-markup-editor-attachment btn-icon",title:pgettext("markup editor","Remove attachment"),type:"button",disabled:a,onClick:function(){o((function(t){var e=t.attachments;if(window.confirm(pgettext("markup editor","Remove this attachment?")))return{attachments:e.filter((function(t){return t.id!==n.id}))}}))}},void 0,tt||(tt=(0,r.Z)("span",{className:"material-icon"},void 0,"close")))),!n.id&&!!n.key&&(0,r.Z)("div",{className:"markup-editor-attachment-buttons"},void 0,n.error&&(0,r.Z)("button",{className:"btn btn-markup-editor-attachment btn-icon",title:pgettext("markup editor","See error"),type:"button",onClick:function(){V.Z.error(interpolate(pgettext("markup editor","%(filename)s: %(error)s"),{filename:n.filename,error:n.error},!0))}},void 0,et||(et=(0,r.Z)("span",{className:"material-icon"},void 0,"warning"))),(0,r.Z)("button",{className:"btn btn-markup-editor-attachment btn-icon",title:pgettext("markup editor","Remove attachment"),type:"button",disabled:a,onClick:function(){o((function(t){return{attachments:t.attachments.filter((function(t){return t.key!==n.key}))}}))}},void 0,nt||(nt=(0,r.Z)("span",{className:"material-icon"},void 0,"close"))))))},ct=function(t){var e=t.attachments,n=t.disabled,a=t.element,i=t.setState,o=t.update;return(0,r.Z)("div",{className:"markup-editor-attachments"},void 0,(0,r.Z)("div",{className:"markup-editor-attachments-container"},void 0,e.map((function(t){return(0,r.Z)(lt,{attachment:t,disabled:n,element:a,setState:i,update:o},t.key||t.id)}))))};var ut,dt=n(82211);const pt=function(t){var e=t.canProtect,n=t.disabled,a=t.empty,i=t.preview,o=t.isProtected,s=t.submitText,l=t.showPreview,c=t.closePreview,u=t.enableProtection,d=t.disableProtection;return(0,r.Z)("div",{className:"markup-editor-footer"},void 0,!!e&&(0,r.Z)(dt.Z,{className:"btn-default btn-icon hidden-sm hidden-md hidden-lg",title:o?pgettext("markup editor","Protected"):pgettext("markup editor","Protect"),type:"button",disabled:n,onClick:function(){o?d():u()}},void 0,(0,r.Z)("span",{className:"material-icon"},void 0,o?"lock":"lock_open")),!!e&&(0,r.Z)("div",{},void 0,(0,r.Z)(dt.Z,{className:"btn-default hidden-xs",type:"button",disabled:n,onClick:function(){o?d():u()}},void 0,(0,r.Z)("span",{className:"material-icon"},void 0,o?"lock":"lock_open"),o?pgettext("markup editor","Protected"):pgettext("markup editor","Protect"))),ut||(ut=(0,r.Z)("div",{className:"markup-editor-spacer"})),i?(0,r.Z)(dt.Z,{className:"btn-default btn-auto",type:"button",onClick:c},void 0,pgettext("markup editor","Edit")):(0,r.Z)(dt.Z,{className:"btn-default btn-auto",disabled:n||a,type:"button",onClick:l},void 0,pgettext("markup editor","Preview")),(0,r.Z)(dt.Z,{className:"btn-primary btn-auto",disabled:n||a},void 0,s||pgettext("markup editor","Post")))};var ht,mt=n(96359);var vt=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(t){var e;return(0,l.Z)(this,i),e=a.call(this,t),(0,h.Z)((0,c.Z)(e),"handleSubmit",(function(t){t.preventDefault();var n=e.props,a=n.selection,i=n.update,o=e.state.syntax.trim(),r=e.state.text.trim();if(0===r.length)return e.setState({error:gettext("This field is required.")}),!1;var s=a.prefix.trim().length?"\n\n":"";return it(Object.assign({},a,{text:r}),i,s+"```"+o+"\n"+r+"\n```\n\n"),Q.Z.hide(),!1})),e.state={error:null,syntax:"",text:t.selection.text},e}return(0,s.Z)(i,[{key:"render",value:function(){var t=this;return(0,r.Z)("div",{className:"modal-dialog modal-lg",role:"document"},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,ht||(ht=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("markup editor","Code"))),(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"modal-body"},void 0,(0,r.Z)(mt.Z,{for:"markup_code_syntax",label:pgettext("markup editor","Syntax highlighting")},void 0,(0,r.Z)("select",{id:"markup_code_syntax",className:"form-control",value:this.state.syntax,onChange:function(e){return t.setState({syntax:e.target.value})}},void 0,(0,r.Z)("option",{value:""},void 0,pgettext("markup editor","No syntax highlighting")),ft.map((function(t){var e=t.value,n=t.name;return(0,r.Z)("option",{value:e},e,n)})))),(0,r.Z)(mt.Z,{for:"markup_code_text",label:pgettext("markup editor","Code to insert"),validation:this.state.error?[this.state.error]:void 0},void 0,(0,r.Z)("textarea",{id:"markup_code_text",className:"form-control",rows:"8",value:this.state.text,onChange:function(e){return t.setState({text:e.target.value})}}))),(0,r.Z)("div",{className:"modal-footer"},void 0,(0,r.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,pgettext("markup editor","Cancel")),(0,r.Z)("button",{className:"btn btn-primary"},void 0,pgettext("markup editor","Insert code"))))))}}]),i}(o().Component),ft=[{value:"bash",name:"Bash"},{value:"c",name:"C"},{value:"c#",name:"C#"},{value:"c++",name:"C++"},{value:"css",name:"CSS"},{value:"diff",name:"Diff"},{value:"go",name:"Go"},{value:"graphql",name:"GraphQL"},{value:"html,",name:"HTML"},{value:"xml",name:"XML"},{value:"json",name:"JSON"},{value:"java",name:"Java"},{value:"javascript",name:"JavaScript"},{value:"kotlin",name:"Kotlin"},{value:"less",name:"Less"},{value:"lua",name:"Lua"},{value:"makefile",name:"Makefile"},{value:"markdown",name:"Markdown"},{value:"objective-C",name:"Objective-C"},{value:"php",name:"PHP"},{value:"perl",name:"Perl"},{value:"plain",name:"Plain"},{value:"text",name:"text"},{value:"python",name:"Python"},{value:"repl",name:"REPL"},{value:"r",name:"R"},{value:"ruby",name:"Ruby"},{value:"rust",name:"Rust"},{value:"scss",name:"SCSS"},{value:"sql",name:"SQL"},{value:"shell",name:"Shell Session"},{value:"swift",name:"Swift"},{value:"toml",name:"TOML"},{value:"ini",name:"INI"},{value:"typescript",name:"TypeScript"},{value:"visualbasic",name:"Visual Basic .NET"},{value:"webassembly",name:"WebAssembly"},{value:"yaml",name:"YAML"}];const Zt=vt;var gt,yt,bt,kt,_t,xt,Nt,wt,Ct,Rt,Et,St,Lt,Ot,Pt,At,Tt,It,Bt,jt,Dt,Ut,zt,qt,Mt,Ft,Ht,Vt,Yt,Gt,Wt,$t,Qt,Kt,Xt,Jt,te,ee,ne,ae,ie,oe,re,se,le;function ce(){return(0,r.Z)("div",{className:"modal-dialog modal-lg",role:"document"},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,gt||(gt=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("markup help","Formatting help"))),(0,r.Z)("div",{className:"modal-body formatting-help"},void 0,(0,r.Z)("h4",{},void 0,pgettext("markup help","Emphasis text")),(0,r.Z)(ue,{markup:pgettext("markup help","_This text will have emphasis_"),result:(0,r.Z)("p",{},void 0,(0,r.Z)("em",{},void 0,pgettext("markup help","This text will have emphasis")))}),yt||(yt=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Bold text")),(0,r.Z)(ue,{markup:pgettext("markup help","**This text will be bold**"),result:(0,r.Z)("p",{},void 0,(0,r.Z)("strong",{},void 0,pgettext("markup help","This text will be bold")))}),bt||(bt=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Removed text")),(0,r.Z)(ue,{markup:pgettext("markup help","~~This text will be removed~~"),result:(0,r.Z)("p",{},void 0,(0,r.Z)("del",{},void 0,pgettext("markup help","This text will be removed")))}),kt||(kt=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Bold text (BBCode)")),(0,r.Z)(ue,{markup:pgettext("markup help","[b]This text will be bold[/b]"),result:(0,r.Z)("p",{},void 0,(0,r.Z)("b",{},void 0,pgettext("markup help","This text will be bold")))}),_t||(_t=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Underlined text (BBCode)")),(0,r.Z)(ue,{markup:pgettext("markup help","[u]This text will be underlined[/u]"),result:(0,r.Z)("p",{},void 0,(0,r.Z)("u",{},void 0,pgettext("markup help","This text will be underlined")))}),xt||(xt=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Italics text (BBCode)")),(0,r.Z)(ue,{markup:pgettext("markup help","[i]This text will be in italics[/i]"),result:(0,r.Z)("p",{},void 0,(0,r.Z)("i",{},void 0,pgettext("markup help","This text will be in italics")))}),Nt||(Nt=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Link")),wt||(wt=(0,r.Z)(ue,{markup:"<http://example.com>",result:(0,r.Z)("p",{},void 0,(0,r.Z)("a",{href:"#"},void 0,"example.com"))})),Ct||(Ct=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Link with text")),(0,r.Z)(ue,{markup:"["+pgettext("markup help","Link text")+"](http://example.com)",result:(0,r.Z)("p",{},void 0,(0,r.Z)("a",{href:"#"},void 0,pgettext("markup help","Link text")))}),Rt||(Rt=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Link (BBCode)")),Et||(Et=(0,r.Z)(ue,{markup:"[url]http://example.com[/url]",result:(0,r.Z)("p",{},void 0,(0,r.Z)("a",{href:"#"},void 0,"example.com"))})),St||(St=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Link with text (BBCode)")),(0,r.Z)(ue,{markup:"[url=http://example.com]"+pgettext("markup help","Link text")+"[/url]",result:(0,r.Z)("p",{},void 0,(0,r.Z)("a",{href:"#"},void 0,pgettext("markup help","Link text")))}),Lt||(Lt=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Image")),Ot||(Ot=(0,r.Z)(ue,{markup:"!(http://dummyimage.com/38/38)",result:(0,r.Z)("p",{},void 0,(0,r.Z)("img",{alt:"",src:"http://dummyimage.com/38/38"}))})),Pt||(Pt=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Image with alternate text")),(0,r.Z)(ue,{markup:"!["+pgettext("markup help","Image text")+"](http://dummyimage.com/38/38)",result:(0,r.Z)("p",{},void 0,(0,r.Z)("img",{alt:pgettext("markup help","Image text"),src:"http://dummyimage.com/38/38"}))}),At||(At=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Image (BBCode)")),Tt||(Tt=(0,r.Z)(ue,{markup:"[img]http://dummyimage.com/38/38[/img]",result:(0,r.Z)("p",{},void 0,(0,r.Z)("img",{alt:"",src:"http://dummyimage.com/38/38"}))})),It||(It=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Mention user by their name")),Bt||(Bt=(0,r.Z)(ue,{markup:"@username",result:(0,r.Z)("p",{},void 0,(0,r.Z)("a",{href:"#"},void 0,"@username"))})),jt||(jt=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Heading 1")),(0,r.Z)(ue,{markup:pgettext("markup help","# First level heading"),result:(0,r.Z)("h1",{},void 0,pgettext("markup help","First level heading"))}),Dt||(Dt=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Heading 2")),(0,r.Z)(ue,{markup:pgettext("markup help","## Second level heading"),result:(0,r.Z)("h2",{},void 0,pgettext("markup help","Second level heading"))}),Ut||(Ut=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Heading 3")),(0,r.Z)(ue,{markup:pgettext("markup help","### Third level heading"),result:(0,r.Z)("h3",{},void 0,pgettext("markup help","Third level heading"))}),zt||(zt=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Heading 4")),(0,r.Z)(ue,{markup:pgettext("markup help","#### Fourth level heading"),result:(0,r.Z)("h4",{},void 0,pgettext("markup help","Fourth level heading"))}),qt||(qt=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Heading 5")),(0,r.Z)(ue,{markup:pgettext("markup help","##### Fifth level heading"),result:(0,r.Z)("h5",{},void 0,pgettext("markup help","Fifth level heading"))}),Mt||(Mt=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Unordered list")),Ft||(Ft=(0,r.Z)(ue,{markup:"- Lorem ipsum\n- Dolor met\n- Vulputate lectus",result:(0,r.Z)("ul",{},void 0,(0,r.Z)("li",{},void 0,"Lorem ipsum"),(0,r.Z)("li",{},void 0,"Dolor met"),(0,r.Z)("li",{},void 0,"Vulputate lectus"))})),Ht||(Ht=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Ordered list")),Vt||(Vt=(0,r.Z)(ue,{markup:"1. Lorem ipsum\n2. Dolor met\n3. Vulputate lectus",result:(0,r.Z)("ol",{},void 0,(0,r.Z)("li",{},void 0,"Lorem ipsum"),(0,r.Z)("li",{},void 0,"Dolor met"),(0,r.Z)("li",{},void 0,"Vulputate lectus"))})),Yt||(Yt=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Quote text")),(0,r.Z)(ue,{markup:"> "+pgettext("markup help","Quoted text"),result:(0,r.Z)("blockquote",{},void 0,(0,r.Z)("p",{},void 0,pgettext("markup help","Quoted text")))}),Gt||(Gt=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Quote text (BBCode)")),(0,r.Z)(ue,{markup:"[quote]\n"+pgettext("markup help","Quoted text")+"\n[/quote]",result:(0,r.Z)("aside",{className:"quote-block"},void 0,(0,r.Z)("div",{className:"quote-heading"},void 0,gettext("Quoted message:")),(0,r.Z)("blockquote",{className:"quote-body"},void 0,(0,r.Z)("p",{},void 0,pgettext("markup help","Quoted text"))))}),Wt||(Wt=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Quote text with author (BBCode)")),(0,r.Z)(ue,{markup:'[quote="'+pgettext("markup help","Quote author")+'"]\n'+pgettext("markup help","Quoted text")+"\n[/quote]",result:(0,r.Z)("aside",{className:"quote-block"},void 0,(0,r.Z)("div",{className:"quote-heading"},void 0,pgettext("markup help","Quote author has written:")),(0,r.Z)("blockquote",{className:"quote-body"},void 0,(0,r.Z)("p",{},void 0,pgettext("markup help","Quoted text"))))}),$t||($t=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Spoiler")),(0,r.Z)(ue,{markup:"[spoiler]\n"+pgettext("markup help","Secret text")+"\n[/spoiler]",result:(0,r.Z)(pe,{},void 0,pgettext("markup help","Secret text"))}),Qt||(Qt=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Inline code")),(0,r.Z)(ue,{markup:pgettext("markup help","`Inline code`"),result:(0,r.Z)("p",{},void 0,(0,r.Z)("code",{},void 0,pgettext("markup help","Inline code")))}),Kt||(Kt=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Code block")),Xt||(Xt=(0,r.Z)(ue,{markup:'```\nalert("Hello world!");\n```',result:(0,r.Z)("pre",{},void 0,(0,r.Z)("code",{className:"hljs"},void 0,'alert("Hello world!");'))})),Jt||(Jt=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Code block with syntax highlighting")),te||(te=(0,r.Z)(ue,{markup:'```python\nprint("Hello world!");\n```',result:(0,r.Z)("pre",{},void 0,(0,r.Z)("code",{className:"hljs language-python"},void 0,(0,r.Z)("span",{className:"hljs-built_in"},void 0,"print"),'("Hello world!");'))})),ee||(ee=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Code block (BBCode)")),ne||(ne=(0,r.Z)(ue,{markup:'[code]\nalert("Hello world!");\n[/code]',result:(0,r.Z)("pre",{},void 0,(0,r.Z)("code",{className:"hljs"},void 0,'alert("Hello world!");'))})),ae||(ae=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Code block with syntax highlighting (BBCode)")),ie||(ie=(0,r.Z)(ue,{markup:'[code="python"]\nprint("Hello world!");\n[/code]',result:(0,r.Z)("pre",{},void 0,(0,r.Z)("code",{className:"hljs language-python"},void 0,(0,r.Z)("span",{className:"hljs-built_in"},void 0,"print"),'("Hello world!");'))})),oe||(oe=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Horizontal rule")),re||(re=(0,r.Z)(ue,{markup:"Lorem ipsum\n- - -\nDolor met",result:(0,r.Z)("div",{},void 0,(0,r.Z)("p",{},void 0,"Lorem ipsum"),(0,r.Z)("hr",{}),(0,r.Z)("p",{},void 0,"Dolor met"))})),se||(se=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Horizontal rule (BBCode)")),le||(le=(0,r.Z)(ue,{markup:"Lorem ipsum\n[hr]\nDolor met",result:(0,r.Z)("div",{},void 0,(0,r.Z)("p",{},void 0,"Lorem ipsum"),(0,r.Z)("hr",{}),(0,r.Z)("p",{},void 0,"Dolor met"))}))),(0,r.Z)("div",{className:"modal-footer"},void 0,(0,r.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,pgettext("modal","Close")))))}function ue(t){var e=t.markup,n=t.result;return(0,r.Z)("div",{className:"formatting-help-item"},void 0,(0,r.Z)("div",{className:"formatting-help-item-markup"},void 0,(0,r.Z)("pre",{},void 0,(0,r.Z)("code",{},void 0,e))),(0,r.Z)("div",{className:"formatting-help-item-preview"},void 0,(0,r.Z)("article",{className:"misago-markup"},void 0,n)))}var de,pe=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(t){var e;return(0,l.Z)(this,i),(e=a.call(this,t)).state={reveal:!1},e}return(0,s.Z)(i,[{key:"render",value:function(){var t=this;return(0,r.Z)("aside",{className:this.state.reveal?"spoiler-block revealed":"spoiler-block"},void 0,(0,r.Z)("blockquote",{className:"spoiler-body"},void 0,(0,r.Z)("p",{},void 0,this.props.children)),!this.state.reveal&&(0,r.Z)("div",{className:"spoiler-overlay"},void 0,(0,r.Z)("button",{className:"spoiler-reveal",type:"button",onClick:function(){t.setState({reveal:!0})}},void 0,gettext("Reveal spoiler"))))}}]),i}(o().Component),he=new RegExp("^(((ftps?)|(https?))://)","i");function me(t){return he.test(t.trim())}const ve=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(t){var e;(0,l.Z)(this,i),e=a.call(this,t),(0,h.Z)((0,c.Z)(e),"handleSubmit",(function(t){t.preventDefault();var n=e.props,a=n.selection,i=n.update,o=e.state.text.trim(),r=e.state.url.trim();return 0===r.length?(e.setState({error:gettext("This field is required.")}),!1):(o.length>0?it(a,i,"!["+o+"]("+r+")"):it(a,i,"!("+r+")"),Q.Z.hide(),!1)}));var n=t.selection.text.trim(),o=me(n);return e.state={error:null,text:o?"":n,url:o?n:""},e}return(0,s.Z)(i,[{key:"render",value:function(){var t=this;return(0,r.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,de||(de=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("markup editor","Image"))),(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"modal-body"},void 0,(0,r.Z)(mt.Z,{for:"markup_image_text",label:pgettext("markup editor","Image description"),helpText:pgettext("markup editor","Optional but recommended . Will be displayed instead of image when it fails to load.")},void 0,(0,r.Z)("input",{id:"markup_image_text",className:"form-control",type:"text",value:this.state.text,onChange:function(e){return t.setState({text:e.target.value})}})),(0,r.Z)(mt.Z,{for:"markup_image_url",label:pgettext("markup editor","Image URL"),validation:this.state.error?[this.state.error]:void 0},void 0,(0,r.Z)("input",{id:"markup_image_url",className:"form-control",type:"text",value:this.state.url,placeholder:"http://domain.com/image.png",onChange:function(e){return t.setState({url:e.target.value})}}))),(0,r.Z)("div",{className:"modal-footer"},void 0,(0,r.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,pgettext("markup editor","Cancel")),(0,r.Z)("button",{className:"btn btn-primary"},void 0,pgettext("markup editor","Insert image"))))))}}]),i}(o().Component);var fe;const Ze=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(t){var e;(0,l.Z)(this,i),e=a.call(this,t),(0,h.Z)((0,c.Z)(e),"handleSubmit",(function(t){t.preventDefault();var n=e.props,a=n.selection,i=n.update,o=e.state.text.trim(),r=e.state.url.trim();return 0===r.length?(e.setState({error:gettext("This field is required.")}),!1):(o.length>0?it(a,i,"["+o+"]("+r+")"):it(a,i,"<"+r+">"),Q.Z.hide(),!1)}));var n=t.selection.text.trim(),o=me(n);return e.state={error:null,text:o?"":n,url:o?n:""},e}return(0,s.Z)(i,[{key:"render",value:function(){var t=this;return(0,r.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,fe||(fe=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("markup editor","Link"))),(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"modal-body"},void 0,(0,r.Z)(mt.Z,{for:"markup_link_url",label:pgettext("markup editor","Link text"),helpText:pgettext("markup editor","Optional. Will be displayed instead of link's address.")},void 0,(0,r.Z)("input",{id:"markup_link_text",className:"form-control",type:"text",value:this.state.text,onChange:function(e){return t.setState({text:e.target.value})}})),(0,r.Z)(mt.Z,{for:"markup_link_url",label:pgettext("markup editor","Link address"),validation:this.state.error?[this.state.error]:void 0},void 0,(0,r.Z)("input",{id:"markup_link_url",className:"form-control",type:"text",value:this.state.url,onChange:function(e){return t.setState({url:e.target.value})}}))),(0,r.Z)("div",{className:"modal-footer"},void 0,(0,r.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,pgettext("markup editor","Cancel")),(0,r.Z)("button",{className:"btn btn-primary"},void 0,pgettext("markup editor","Insert link"))))))}}]),i}(o().Component);var ge;const ye=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(t){var e;return(0,l.Z)(this,i),e=a.call(this,t),(0,h.Z)((0,c.Z)(e),"handleSubmit",(function(t){t.preventDefault();var n=e.props,a=n.selection,i=n.update,o=e.state.author.trim(),r=e.state.text.trim();if(0===r.length)return e.setState({error:gettext("This field is required.")}),!1;var s=a.prefix.trim().length?"\n\n":"";return it(a,i,o?s+'[quote="'+o+'"]\n'+r+"\n[/quote]\n\n":s+"[quote]\n"+r+"\n[/quote]\n\n"),Q.Z.hide(),!1})),e.state={error:null,author:"",text:t.selection.text},e}return(0,s.Z)(i,[{key:"render",value:function(){var t=this;return(0,r.Z)("div",{className:"modal-dialog modal-lg",role:"document"},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,ge||(ge=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("markup editor","Quote"))),(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"modal-body"},void 0,(0,r.Z)(mt.Z,{for:"markup_quote_author",label:pgettext("markup editor","Quote's author or source"),helpText:pgettext("markup editor",'Optional. If it\'s username, put "@" before it ("@JohnDoe").')},void 0,(0,r.Z)("input",{id:"markup_quote_author",className:"form-control",type:"text",value:this.state.author,onChange:function(e){return t.setState({author:e.target.value})}})),(0,r.Z)(mt.Z,{for:"markup_quote_text",label:pgettext("markup editor","Quoted text"),validation:this.state.error?[this.state.error]:void 0},void 0,(0,r.Z)("textarea",{id:"markup_quote_text",className:"form-control",rows:"8",value:this.state.text,onChange:function(e){return t.setState({text:e.target.value})}}))),(0,r.Z)("div",{className:"modal-footer"},void 0,(0,r.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,pgettext("markup editor","Cancel")),(0,r.Z)("button",{className:"btn btn-primary"},void 0,pgettext("markup editor","Insert quote"))))))}}]),i}(o().Component),be=function(t){var e=t.disabled,n=t.icon,a=t.title,i=t.onClick;return(0,r.Z)("button",{className:"btn btn-markup-editor",title:a,type:"button",disabled:e,onClick:i},void 0,(0,r.Z)("span",{className:"material-icon"},void 0,n))};var ke=n(54031);const _e=function(t,e){var n=1024*W.Z.get("user").acl.max_attachment_size;if(t.size>n)V.Z.error(interpolate(pgettext("markup editor","File %(filename)s is bigger than %(limit)s."),{filename:t.name,limit:(0,K.Z)(n)},!0));else{var a={id:null,key:(0,ke.ZP)(32),error:null,uploaded_on:null,progress:0,filename:t.name,filetype:null,is_image:!1,size:t.size,url:null,uploader_name:null};e((function(t){var e=t.attachments;return{attachments:[a].concat(e)}}));var i=function(){e((function(t){return{attachments:t.attachments.concat()}}))},o=new FormData;o.append("upload",t),H.Z.upload(W.Z.get("ATTACHMENTS_API"),o,(function(t){a.progress=t,i()})).then((function(t){Object.assign(a,t,{uploaded_on:z()(t.uploaded_on)}),i()}),(function(t){400===t.status||413===t.status?(a.error=t.detail,V.Z.error(t.detail),i()):V.Z.apiError(t)}))}};var xe,Ne;const we=function(t){var e=t.disabled,n=t.element,a=t.update,i=t.updateAttachments,o=[{name:pgettext("markup editor","Strong"),icon:"format_bold",onClick:function(){at(ot(n),a,"**","**",pgettext("example markup","Strong text"))}},{name:pgettext("markup editor","Emphasis"),icon:"format_italic",onClick:function(){at(ot(n),a,"*","*",pgettext("example markup","Text with emphasis"))}},{name:pgettext("markup editor","Strikethrough"),icon:"format_strikethrough",onClick:function(){at(ot(n),a,"~~","~~",pgettext("example markup","Text with strikethrough"))}},{name:pgettext("markup editor","Horizontal ruler"),icon:"remove",onClick:function(){it(ot(n),a,"\n\n- - -\n\n")}},{name:pgettext("markup editor","Link"),icon:"insert_link",onClick:function(){var t=ot(n);Q.Z.show((0,r.Z)(Ze,{selection:t,element:n,update:a}))}},{name:pgettext("markup editor","Image"),icon:"insert_photo",onClick:function(){var t=ot(n);Q.Z.show((0,r.Z)(ve,{selection:t,element:n,update:a}))}},{name:pgettext("markup editor","Quote"),icon:"format_quote",onClick:function(){var t=ot(n);Q.Z.show((0,r.Z)(ye,{selection:t,element:n,update:a}))}},{name:pgettext("markup editor","Spoiler"),icon:"visibility_off",onClick:function(){!function(t,e){var n=ot(t),a=n.prefix.trim().length?"\n\n":"";at(n,e,a+"[spoiler]\n","\n[/spoiler]\n\n",pgettext("markup editor","Spoiler text"))}(n,a)}},{name:pgettext("markup editor","Code"),icon:"code",onClick:function(){var t=ot(n);Q.Z.show((0,r.Z)(Zt,{selection:t,element:n,update:a}))}}];return W.Z.get("user").acl.max_attachment_size&&o.push({name:pgettext("markup editor","Upload file"),icon:"file_upload",onClick:function(){return t=i,(e=document.createElement("input")).type="file",e.multiple="multiple",e.addEventListener("change",(function(){for(var n=0;n<e.files.length;n++)_e(e.files[n],t)})),void e.click();var t,e}}),(0,r.Z)("div",{className:"markup-editor-toolbar"},void 0,(0,r.Z)("div",{className:"markup-editor-toolbar-left"},void 0,o.map((function(t){var a=t.name,i=t.icon,o=t.onClick;return(0,r.Z)(be,{title:a,icon:i,disabled:e||!n,onClick:o},i)}))),(0,r.Z)("div",{className:"markup-editor-toolbar-right"},void 0,(0,r.Z)("div",{className:"markup-editor-controls-dropdown"},void 0,(0,r.Z)("button",{type:"button",className:"btn btn-markup-editor dropdown-toggle","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",disabled:e||!n},void 0,xe||(xe=(0,r.Z)("span",{className:"material-icon"},void 0,"more_vert"))),(0,r.Z)("ul",{className:"dropdown-menu dropdown-menu-right stick-to-bottom"},void 0,o.map((function(t){var a=t.name,i=t.icon,o=t.onClick;return(0,r.Z)("li",{},i,(0,r.Z)("button",{type:"button",className:"btn-link",disabled:e||!n,onClick:o},void 0,(0,r.Z)("span",{className:"material-icon"},void 0,i),a))})))),(0,r.Z)(be,{title:pgettext("markup editor","Open formatting help"),icon:"help_outline",onClick:function(){Q.Z.show(Ne||(Ne=(0,r.Z)(ce,{})))}})))};var Ce=n(19755);const Re=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(t){var e;return(0,l.Z)(this,i),e=a.call(this,t),(0,h.Z)((0,c.Z)(e),"showPreview",(function(){e.state.loading||(e.setState({loading:!0,preview:!0,element:null}),H.Z.post(W.Z.get("PARSE_MARKUP_API"),{post:e.props.value}).then((function(t){e.setState({loading:!1,parsed:t.parsed})}),(function(t){400===t.status?V.Z.error(t.detail):V.Z.apiError(t),e.setState({loading:!1,preview:!1})})))})),(0,h.Z)((0,c.Z)(e),"closePreview",(function(){e.setState({loading:!1,preview:!1})})),(0,h.Z)((0,c.Z)(e),"onDrop",(function(t){if(t.preventDefault(),t.stopPropagation(),t.dataTransfer.files){var n=e.props.onAttachmentsChange;if(W.Z.get("user").acl.max_attachment_size)for(var a=0;a<t.dataTransfer.files.length;a++){var i=t.dataTransfer.files[a];_e(i,n)}}})),(0,h.Z)((0,c.Z)(e),"onPaste",(function(t){for(var n=e.props.onAttachmentsChange,a=[],i=0;i<t.clipboardData.items.length;i++){var o=t.clipboardData.items[i];"file"===o.kind&&a.push(o.getAsFile())}if(a.length&&(t.preventDefault(),t.stopPropagation(),W.Z.get("user").acl.max_attachment_size))for(var r=0;r<a.length;r++)_e(a[r],n)})),(0,h.Z)((0,c.Z)(e),"render",(function(){return(0,r.Z)("div",{className:G()("markup-editor",{"markup-editor-focused":e.state.focused&&!e.state.preview})},void 0,(0,r.Z)(we,{disabled:e.props.disabled||e.state.preview,element:e.state.element,update:function(t){return e.props.onChange({target:{value:t}})},updateAttachments:e.props.onAttachmentsChange}),e.state.preview?(0,r.Z)("div",{className:"markup-editor-preview"},void 0,e.state.loading?(0,r.Z)("div",{className:"markup-editor-preview-loading"},void 0,(0,r.Z)("div",{className:"ui-preview"},void 0,(0,r.Z)("span",{className:"ui-preview-text",style:{width:"240px"}}))):(0,r.Z)($.Z,{className:"markup-editor-preview-contents",markup:e.state.parsed})):o().createElement("textarea",{className:"markup-editor-textarea form-control",placeholder:e.props.placeholder,value:e.props.value,disabled:e.props.disabled||e.state.loading,rows:6,ref:function(t){t&&e.state.element!==t&&(e.setState({element:t}),function(t,e){Ce(e).atwho({at:"@",displayTpl:'<li><img src="${avatar}" alt="">${username}</li>',insertTpl:"@${username}",searchKey:"username",callbacks:{remoteFilter:function(t,e){Ce.getJSON(W.Z.get("MENTION_API"),{q:t},e)}}}),Ce(e).on("inserted.atwho",(function(e,n,a,i){var o=i.query,r=a.target.innerText.trim(),s=e.target.value.substr(0,o.headPos),l=e.target.value.substr(o.endPos);e.target.value=s+r+l,t.onChange(e);var c=o.headPos+r.length;e.target.setSelectionRange(c,c),e.target.focus()}))}(e.props,t))},onChange:e.props.onChange,onDrop:e.onDrop,onFocus:function(){return e.setState({focused:!0})},onPaste:e.onPaste,onBlur:function(){return e.setState({focused:!1})}}),e.props.attachments.length>0&&(0,r.Z)(ct,{attachments:e.props.attachments,disabled:e.props.disabled||e.state.preview,element:e.state.element,setState:e.props.onAttachmentsChange,update:function(t){return e.props.onChange({target:{value:t}})}}),(0,r.Z)(pt,{preview:e.state.preview,canProtect:e.props.canProtect,isProtected:e.props.isProtected,disabled:e.props.disabled,empty:e.props.value.trim().length<W.Z.get("SETTINGS").post_length_min||e.state.loading,enableProtection:e.props.enableProtection,disableProtection:e.props.disableProtection,showPreview:e.showPreview,closePreview:e.closePreview,submitText:e.props.submitText}))})),e.state={element:null,focused:!1,loading:!1,preview:!1,parsed:null},e}return(0,s.Z)(i)}(o().Component);var Ee=n(92490);var Se="posting-active",Le="posting-default",Oe="posting-minimized",Pe="posting-fullscreen";const Ae=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(){return(0,l.Z)(this,i),a.apply(this,arguments)}return(0,s.Z)(i,[{key:"componentDidMount",value:function(){document.body.classList.add(Se,Le)}},{key:"componentWillUnmount",value:function(){document.body.classList.remove(Se,Le,Oe,Pe)}},{key:"componentWillReceiveProps",value:function(t){var e=t.fullscreen;t.minimized?(document.body.classList.remove(Le,Pe),document.body.classList.add(Oe)):e?(document.body.classList.remove(Le,Oe),document.body.classList.add(Pe)):(document.body.classList.remove(Pe,Oe),document.body.classList.add(Le))}},{key:"render",value:function(){var t=this.props,e=t.children,n=t.fullscreen,a=t.minimized;return(0,r.Z)("div",{className:G()("posting-dialog",{"posting-dialog-minimized":a,"posting-dialog-fullscreen":n&&!a})},void 0,(0,r.Z)("div",{className:"posting-dialog-container"},void 0,e))}}]),i}(o().Component),Te=function(t){var e=t.children;return(0,r.Z)("div",{className:"posting-dialog-body"},void 0,e)};var Ie;const Be=function(t){var e=t.close,n=t.message;return(0,r.Z)("div",{className:"posting-dialog-error"},void 0,Ie||(Ie=(0,r.Z)("div",{className:"posting-dialog-error-icon"},void 0,(0,r.Z)("span",{className:"material-icon"},void 0,"error_outlined"))),(0,r.Z)("div",{className:"posting-dialog-error-detail"},void 0,(0,r.Z)("p",{},void 0,n),(0,r.Z)("button",{type:"button",className:"btn btn-default",onClick:e},void 0,pgettext("modal","Close"))))};var je,De,Ue,ze,qe;const Me=function(t){var e=t.children,n=t.close,a=t.fullscreen,i=t.minimize,o=t.minimized,s=t.fullscreenEnter,l=t.fullscreenExit,c=t.open;return(0,r.Z)("div",{className:"posting-dialog-header"},void 0,(0,r.Z)("div",{className:"posting-dialog-caption"},void 0,e),o?(0,r.Z)("button",{className:"btn btn-posting-dialog",title:pgettext("dialog","Open"),type:"button",onClick:c},void 0,je||(je=(0,r.Z)("span",{className:"material-icon"},void 0,"expand_less"))):(0,r.Z)("button",{className:"btn btn-posting-dialog",title:pgettext("dialog","Minimize"),type:"button",onClick:i},void 0,De||(De=(0,r.Z)("span",{className:"material-icon"},void 0,"expand_more"))),a?(0,r.Z)("button",{className:"btn btn-posting-dialog hidden-xs",title:pgettext("dialog","Exit the fullscreen mode"),type:"button",onClick:l},void 0,Ue||(Ue=(0,r.Z)("span",{className:"material-icon"},void 0,"fullscreen_exit"))):(0,r.Z)("button",{className:"btn btn-posting-dialog hidden-xs",title:pgettext("dialog","Enter the fullscreen mode"),type:"button",onClick:s},void 0,ze||(ze=(0,r.Z)("span",{className:"material-icon"},void 0,"fullscreen"))),(0,r.Z)("button",{className:"btn btn-posting-dialog",title:pgettext("dialog","Cancel"),type:"button",onClick:n},void 0,qe||(qe=(0,r.Z)("span",{className:"material-icon"},void 0,"close"))))};var Fe,He,Ve,Ye,Ge,We,$e,Qe,Ke;function Xe(t){var e=t.isClosed,n=t.isHidden,a=t.isPinned,i=t.disabled,o=t.options,s=t.close,l=t.open,c=t.hide,u=t.unhide,d=t.pinGlobally,p=t.pinLocally,h=t.unpin,m=function(t,e,n){var a=[];return 2===n&&a.push("bookmark"),1===n&&a.push("bookmark_outline"),t&&a.push("lock"),e&&a.push("visibility_off"),a}(e,n,a);return(0,r.Z)("div",{className:"dropdown"},void 0,(0,r.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:pgettext("post thread","Options"),"aria-expanded":"true","aria-haspopup":"true","data-toggle":"dropdown",type:"button",disabled:i},void 0,m.length>0?(0,r.Z)("span",{className:"btn-icons-family"},void 0,m.map((function(t){return(0,r.Z)("span",{className:"material-icon"},t,t)}))):Fe||(Fe=(0,r.Z)("span",{className:"material-icon"},void 0,"more_horiz"))),(0,r.Z)("ul",{className:"dropdown-menu dropdown-menu-right stick-to-bottom"},void 0,2===o.pin&&2!==a&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:d,type:"button",disabled:i},void 0,He||(He=(0,r.Z)("span",{className:"material-icon"},void 0,"bookmark")),pgettext("post thread","Pinned globally"))),o.pin>=a&&1!==a&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:p,type:"button",disabled:i},void 0,Ve||(Ve=(0,r.Z)("span",{className:"material-icon"},void 0,"bookmark_outline")),pgettext("post thread","Pinned in category"))),o.pin>=a&&0!==a&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:h,type:"button",disabled:i},void 0,Ye||(Ye=(0,r.Z)("span",{className:"material-icon"},void 0,"radio_button_unchecked")),pgettext("post thread","Not pinned"))),o.close&&!!e&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:l,type:"button",disabled:i},void 0,Ge||(Ge=(0,r.Z)("span",{className:"material-icon"},void 0,"lock_outline")),pgettext("post thread","Open"))),o.close&&!e&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:s,type:"button",disabled:i},void 0,We||(We=(0,r.Z)("span",{className:"material-icon"},void 0,"lock")),pgettext("post thread","Closed"))),o.hide&&!!n&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:u,type:"button",disabled:i},void 0,$e||($e=(0,r.Z)("span",{className:"material-icon"},void 0,"visibility")),pgettext("post thread","Visible"))),o.hide&&!n&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:c,type:"button",disabled:i},void 0,Qe||(Qe=(0,r.Z)("span",{className:"material-icon"},void 0,"visibility_off")),pgettext("post thread","Hidden")))))}var Je=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(t){var e;return(0,l.Z)(this,i),e=a.call(this,t),(0,h.Z)((0,c.Z)(e),"loadSuccess",(function(t){var n=null,a=null,i=t.map((function(t){return!1===t.post||n&&t.id!=e.state.category||(n=t.id,a=t.post),Object.assign(t,{disabled:!1===t.post,label:t.name,value:t.id})}));e.setState({isReady:!0,options:a,categories:i,category:n})})),(0,h.Z)((0,c.Z)(e),"loadError",(function(t){e.setState({error:t.detail})})),(0,h.Z)((0,c.Z)(e),"onCancel",(function(){if(0===e.state.post.length&&0===e.state.title.length&&0===e.state.attachments.length)return e.minimize(),m.Z.close();window.confirm(pgettext("post thread","Are you sure you want to discard thread?"))&&(e.minimize(),m.Z.close())})),(0,h.Z)((0,c.Z)(e),"onTitleChange",(function(t){e.changeValue("title",t.target.value)})),(0,h.Z)((0,c.Z)(e),"onCategoryChange",(function(t){var n=e.state.categories.find((function(e){return t.target.value==e.value})),a=e.state.pin;n.post.pin&&n.post.pin<a&&(a=n.post.pin),e.setState({category:n.id,categoryOptions:n.post,pin:a})})),(0,h.Z)((0,c.Z)(e),"onPostChange",(function(t){e.changeValue("post",t.target.value)})),(0,h.Z)((0,c.Z)(e),"onAttachmentsChange",(function(t){e.setState(t)})),(0,h.Z)((0,c.Z)(e),"onClose",(function(){e.changeValue("close",!0)})),(0,h.Z)((0,c.Z)(e),"onOpen",(function(){e.changeValue("close",!1)})),(0,h.Z)((0,c.Z)(e),"onPinGlobally",(function(){e.changeValue("pin",2)})),(0,h.Z)((0,c.Z)(e),"onPinLocally",(function(){e.changeValue("pin",1)})),(0,h.Z)((0,c.Z)(e),"onUnpin",(function(){e.changeValue("pin",0)})),(0,h.Z)((0,c.Z)(e),"onHide",(function(){e.changeValue("hide",!0)})),(0,h.Z)((0,c.Z)(e),"onUnhide",(function(){e.changeValue("hide",!1)})),(0,h.Z)((0,c.Z)(e),"close",(function(){e.minimize(),m.Z.close()})),(0,h.Z)((0,c.Z)(e),"minimize",(function(){e.setState({fullscreen:!1,minimized:!0})})),(0,h.Z)((0,c.Z)(e),"open",(function(){e.setState({minimized:!1}),e.state.fullscreen})),(0,h.Z)((0,c.Z)(e),"fullscreenEnter",(function(){e.setState({fullscreen:!0,minimized:!1})})),(0,h.Z)((0,c.Z)(e),"fullscreenExit",(function(){e.setState({fullscreen:!1,minimized:!1})})),e.state={isReady:!1,isLoading:!1,error:null,minimized:!1,fullscreen:!1,options:null,title:"",category:t.category||null,categories:[],post:"",attachments:[],close:!1,hide:!1,pin:0,validators:{title:(0,F.jn)(),post:(0,F.Jh)()},errors:{}},e}return(0,s.Z)(i,[{key:"componentDidMount",value:function(){H.Z.get(this.props.config).then(this.loadSuccess,this.loadError)}},{key:"clean",value:function(){if(!this.state.title.trim().length)return V.Z.error(pgettext("posting form","You have to enter thread title.")),!1;if(!this.state.post.trim().length)return V.Z.error(pgettext("posting form","You have to enter a message.")),!1;var t=this.validate();return t.title?(V.Z.error(t.title[0]),!1):!t.post||(V.Z.error(t.post[0]),!1)}},{key:"send",value:function(){return H.Z.post(this.props.submit,{title:this.state.title,category:this.state.category,post:this.state.post,attachments:q(this.state.attachments),close:this.state.close,hide:this.state.hide,pin:this.state.pin})}},{key:"handleSuccess",value:function(t){this.setState({isLoading:!0}),this.close(),V.Z.success(pgettext("post thread","Your thread has been posted.")),window.location=t.url}},{key:"handleError",value:function(t){if(400===t.status){var e=[].concat(t.non_field_errors||[],t.category||[],t.title||[],t.post||[],t.attachments||[]);V.Z.error(e[0])}else V.Z.apiError(t)}},{key:"render",value:function(){var t={minimized:this.state.minimized,minimize:this.minimize,open:this.open,fullscreen:this.state.fullscreen,fullscreenEnter:this.fullscreenEnter,fullscreenExit:this.fullscreenExit,close:this.onCancel};if(this.state.error)return o().createElement(tn,t,(0,r.Z)(Be,{message:this.state.error,close:this.close}));if(!this.state.isReady)return o().createElement(tn,t,(0,r.Z)("div",{className:"posting-loading ui-preview"},void 0,Ke||(Ke=(0,r.Z)(Ee.o8,{className:"posting-dialog-toolbar"},void 0,(0,r.Z)(Ee.Z2,{className:"posting-dialog-thread-title",auto:!0},void 0,(0,r.Z)(Ee.Eg,{auto:!0},void 0,(0,r.Z)("input",{className:"form-control",disabled:!0,type:"text"}))),(0,r.Z)(Ee.Z2,{className:"posting-dialog-category-select",auto:!0},void 0,(0,r.Z)(Ee.Eg,{},void 0,(0,r.Z)("input",{className:"form-control",disabled:!0,type:"text"}))))),(0,r.Z)(Re,{attachments:[],value:"",submitText:pgettext("post thread submit","Start thread"),disabled:!0,onAttachmentsChange:function(){},onChange:function(){}})));var e=!!(this.state.options.close||this.state.options.hide||this.state.options.pin);return o().createElement(tn,t,(0,r.Z)("form",{className:"posting-dialog-form",onSubmit:this.handleSubmit},void 0,(0,r.Z)(Ee.o8,{className:"posting-dialog-toolbar"},void 0,(0,r.Z)(Ee.Z2,{className:"posting-dialog-thread-title",auto:!0},void 0,(0,r.Z)(Ee.Eg,{auto:!0},void 0,(0,r.Z)("input",{className:"form-control",disabled:this.state.isLoading,onChange:this.onTitleChange,placeholder:pgettext("post thread","Thread title"),type:"text",value:this.state.title}))),(0,r.Z)(Ee.Z2,{className:"posting-dialog-category-select",auto:!0},void 0,(0,r.Z)(Ee.Eg,{},void 0,(0,r.Z)(j.Z,{choices:this.state.categories,disabled:this.state.isLoading,onChange:this.onCategoryChange,value:this.state.category})),e&&(0,r.Z)(Ee.Eg,{shrink:!0},void 0,(0,r.Z)(Xe,{isClosed:this.state.close,isHidden:this.state.hide,isPinned:this.state.pin,disabled:this.state.isLoading,options:this.state.options,close:this.onClose,open:this.onOpen,hide:this.onHide,unhide:this.onUnhide,pinGlobally:this.onPinGlobally,pinLocally:this.onPinLocally,unpin:this.onUnpin})))),(0,r.Z)(Re,{attachments:this.state.attachments,value:this.state.post,submitText:pgettext("post thread submit","Start thread"),disabled:this.state.isLoading,onAttachmentsChange:this.onAttachmentsChange,onChange:this.onPostChange})))}}]),i}(D.Z),tn=function(t){var e=t.children,n=t.close,a=t.minimized,i=t.minimize,o=t.open,s=t.fullscreen,l=t.fullscreenEnter,c=t.fullscreenExit;return(0,r.Z)(Ae,{fullscreen:s,minimized:a},void 0,(0,r.Z)(Me,{fullscreen:s,fullscreenEnter:l,fullscreenExit:c,minimized:a,minimize:i,open:o,close:n},void 0,pgettext("post thread","Start new thread")),(0,r.Z)(Te,{},void 0,e))};function en(t){var e=t.split(",").map((function(t){return t.trim().toLowerCase()})).filter((function(t){return t.length>0}));return e.filter((function(t,n){return e.indexOf(t)==n}))}var nn=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(t){var e;(0,l.Z)(this,i),e=a.call(this,t),(0,h.Z)((0,c.Z)(e),"onCancel",(function(){if(0===e.state.post.length&&0===e.state.title.length&&0===e.state.to.length&&0===e.state.attachments.length)return e.close();window.confirm(pgettext("post thread","Are you sure you want to discard private thread?"))&&e.close()})),(0,h.Z)((0,c.Z)(e),"onToChange",(function(t){e.changeValue("to",t.target.value)})),(0,h.Z)((0,c.Z)(e),"onTitleChange",(function(t){e.changeValue("title",t.target.value)})),(0,h.Z)((0,c.Z)(e),"onPostChange",(function(t){e.changeValue("post",t.target.value)})),(0,h.Z)((0,c.Z)(e),"onAttachmentsChange",(function(t){e.setState(t)})),(0,h.Z)((0,c.Z)(e),"close",(function(){e.minimize(),m.Z.close()})),(0,h.Z)((0,c.Z)(e),"minimize",(function(){e.setState({fullscreen:!1,minimized:!0})})),(0,h.Z)((0,c.Z)(e),"open",(function(){e.setState({minimized:!1}),e.state.fullscreen})),(0,h.Z)((0,c.Z)(e),"fullscreenEnter",(function(){e.setState({fullscreen:!0,minimized:!1})})),(0,h.Z)((0,c.Z)(e),"fullscreenExit",(function(){e.setState({fullscreen:!1,minimized:!1})}));var n=(t.to||[]).map((function(t){return t.username})).join(", ");return e.state={isLoading:!1,error:null,minimized:!1,fullscreen:!1,to:n,title:"",post:"",attachments:[],validators:{title:(0,F.jn)(),post:(0,F.Jh)()},errors:{}},e}return(0,s.Z)(i,[{key:"clean",value:function(){if(!en(this.state.to).length)return V.Z.error(pgettext("posting form","You have to enter at least one recipient.")),!1;if(!this.state.title.trim().length)return V.Z.error(pgettext("posting form","You have to enter thread title.")),!1;if(!this.state.post.trim().length)return V.Z.error(pgettext("posting form","You have to enter a message.")),!1;var t=this.validate();return t.title?(V.Z.error(t.title[0]),!1):!t.post||(V.Z.error(t.post[0]),!1)}},{key:"send",value:function(){return H.Z.post(this.props.submit,{to:en(this.state.to),title:this.state.title,post:this.state.post,attachments:q(this.state.attachments)})}},{key:"handleSuccess",value:function(t){this.setState({isLoading:!0}),this.close(),V.Z.success(pgettext("post thread","Your thread has been posted.")),window.location=t.url}},{key:"handleError",value:function(t){if(400===t.status){var e=[].concat(t.non_field_errors||[],t.to||[],t.title||[],t.post||[],t.attachments||[]);V.Z.error(e[0])}else V.Z.apiError(t)}},{key:"render",value:function(){var t={minimized:this.state.minimized,minimize:this.minimize,open:this.open,fullscreen:this.state.fullscreen,fullscreenEnter:this.fullscreenEnter,fullscreenExit:this.fullscreenExit,close:this.onCancel};return o().createElement(an,t,(0,r.Z)("form",{className:"posting-dialog-form",onSubmit:this.handleSubmit},void 0,(0,r.Z)(Ee.o8,{className:"posting-dialog-toolbar"},void 0,(0,r.Z)(Ee.Z2,{className:"posting-dialog-thread-recipients",auto:!0},void 0,(0,r.Z)(Ee.Eg,{auto:!0},void 0,(0,r.Z)("input",{className:"form-control",disabled:this.state.isLoading,onChange:this.onToChange,placeholder:pgettext("post thread","Recipients, eg.: Danny, Lisa, Alice"),type:"text",value:this.state.to}))),(0,r.Z)(Ee.Z2,{className:"posting-dialog-thread-title",auto:!0},void 0,(0,r.Z)(Ee.Eg,{auto:!0},void 0,(0,r.Z)("input",{className:"form-control",disabled:this.state.isLoading,onChange:this.onTitleChange,placeholder:pgettext("post thread","Thread title"),type:"text",value:this.state.title})))),(0,r.Z)(Re,{attachments:this.state.attachments,value:this.state.post,submitText:pgettext("post thread submit","Start thread"),disabled:this.state.isLoading,onAttachmentsChange:this.onAttachmentsChange,onChange:this.onPostChange})))}}]),i}(D.Z),an=function(t){var e=t.children,n=t.close,a=t.minimized,i=t.minimize,o=t.open,s=t.fullscreen,l=t.fullscreenEnter,c=t.fullscreenExit;return(0,r.Z)(Ae,{fullscreen:s,minimized:a},void 0,(0,r.Z)(Me,{fullscreen:s,fullscreenEnter:l,fullscreenExit:c,minimized:a,minimize:i,open:o,close:n},void 0,pgettext("post thread","Start private thread")),(0,r.Z)(Te,{},void 0,e))};var on=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(t){var e;return(0,l.Z)(this,i),e=a.call(this,t),(0,h.Z)((0,c.Z)(e),"loadSuccess",(function(t){e.setState({isReady:!0,post:t.post?'[quote="@'+t.poster+'"]\n'+t.post+"\n[/quote]":e.state.post}),e.quoteText=t.post?'[quote="@'+t.poster+'"]\n'+t.post+"\n[/quote]":e.state.post})),(0,h.Z)((0,c.Z)(e),"loadError",(function(t){e.setState({error:t.detail})})),(0,h.Z)((0,c.Z)(e),"appendData",(function(t){var n=t.post?'[quote="@'+t.poster+'"]\n'+t.post+"\n[/quote]\n\n":"";e.setState((function(t,e){return t.post.length>0?{post:t.post.trim()+"\n\n"+n}:{post:n}})),e.open()})),(0,h.Z)((0,c.Z)(e),"onCancel",(function(){if(e.state.post===e.quoteText&&0===e.state.attachments.length)return e.close();window.confirm(pgettext("post reply","Are you sure you want to discard your reply?"))&&e.close()})),(0,h.Z)((0,c.Z)(e),"onPostChange",(function(t){e.changeValue("post",t.target.value)})),(0,h.Z)((0,c.Z)(e),"onAttachmentsChange",(function(t){e.setState(t)})),(0,h.Z)((0,c.Z)(e),"onQuote",(function(t){e.setState((function(e){var n=e.post;return n.length>0?{post:n.trim()+"\n\n"+t}:{post:t}})),e.open()})),(0,h.Z)((0,c.Z)(e),"close",(function(){e.minimize(),m.Z.close()})),(0,h.Z)((0,c.Z)(e),"minimize",(function(){e.setState({fullscreen:!1,minimized:!0})})),(0,h.Z)((0,c.Z)(e),"open",(function(){e.setState({minimized:!1}),e.state.fullscreen})),(0,h.Z)((0,c.Z)(e),"fullscreenEnter",(function(){e.setState({fullscreen:!0,minimized:!1})})),(0,h.Z)((0,c.Z)(e),"fullscreenExit",(function(){e.setState({fullscreen:!1,minimized:!1})})),e.state={isReady:!1,isLoading:!1,error:null,minimized:!1,fullscreen:!1,post:e.props.default||"",attachments:[],validators:{post:(0,F.Jh)()},errors:{}},e.quoteText="",e}return(0,s.Z)(i,[{key:"componentDidMount",value:function(){H.Z.get(this.props.config,this.props.context||null).then(this.loadSuccess,this.loadError),I(!1,this.onQuote)}},{key:"componentWillUnmount",value:function(){B()}},{key:"componentWillReceiveProps",value:function(t){var e=this.props.context,n=t.context;e&&n&&!n.reply||H.Z.get(t.config,t.context||null).then(this.appendData,V.Z.apiError)}},{key:"clean",value:function(){if(!this.state.post.trim().length)return V.Z.error(pgettext("posting form","You have to enter a message.")),!1;var t=this.validate();return!t.post||(V.Z.error(t.post[0]),!1)}},{key:"send",value:function(){return I(!0,this.onQuote),H.Z.post(this.props.submit,{post:this.state.post,attachments:q(this.state.attachments)})}},{key:"handleSuccess",value:function(t){this.setState({isLoading:!0}),this.close(),I(!1,this.onQuote),V.Z.success(pgettext("post reply","Your reply has been posted.")),window.location=t.url.index}},{key:"handleError",value:function(t){if(400===t.status){var e=[].concat(t.non_field_errors||[],t.post||[],t.attachments||[]);V.Z.error(e[0])}else V.Z.apiError(t);I(!1,this.onQuote)}},{key:"render",value:function(){var t={thread:this.props.thread,minimized:this.state.minimized,minimize:this.minimize,open:this.open,fullscreen:this.state.fullscreen,fullscreenEnter:this.fullscreenEnter,fullscreenExit:this.fullscreenExit,close:this.onCancel};return this.state.error?o().createElement(rn,t,(0,r.Z)(Be,{message:this.state.error,close:this.close})):this.state.isReady?o().createElement(rn,t,(0,r.Z)("form",{className:"posting-dialog-form",method:"POST",onSubmit:this.handleSubmit},void 0,(0,r.Z)(Re,{attachments:this.state.attachments,value:this.state.post,submitText:pgettext("post reply submit","Post reply"),disabled:this.state.isLoading,onAttachmentsChange:this.onAttachmentsChange,onChange:this.onPostChange}))):o().createElement(rn,t,(0,r.Z)("div",{className:"posting-loading ui-preview"},void 0,(0,r.Z)(Re,{attachments:[],value:"",submitText:pgettext("post reply submit","Post reply"),disabled:!0,onAttachmentsChange:function(){},onChange:function(){}})))}}]),i}(D.Z),rn=function(t){var e=t.children,n=t.close,a=t.minimized,i=t.minimize,o=t.open,s=t.fullscreen,l=t.fullscreenEnter,c=t.fullscreenExit,u=t.thread;return(0,r.Z)(Ae,{fullscreen:s,minimized:a},void 0,(0,r.Z)(Me,{fullscreen:s,fullscreenEnter:l,fullscreenExit:c,minimized:a,minimize:i,open:o,close:n},void 0,interpolate(pgettext("post reply","Reply to: %(thread)s"),{thread:u.title},!0)),(0,r.Z)(Te,{},void 0,e))};var sn=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(t){var e;return(0,l.Z)(this,i),e=a.call(this,t),(0,h.Z)((0,c.Z)(e),"loadSuccess",(function(t){var n;e.originalPost=t.post,e.setState({isReady:!0,post:t.post,attachments:(n=t.attachments,n.map((function(t){return Object.assign({},t,{uploaded_on:z()(t.uploaded_on)})}))),protect:t.is_protected,canProtect:t.can_protect})})),(0,h.Z)((0,c.Z)(e),"loadError",(function(t){e.setState({error:t.detail})})),(0,h.Z)((0,c.Z)(e),"appendData",(function(t){var n=t.post?'[quote="@'+t.poster+'"]\n'+t.post+"\n[/quote]\n\n":"";e.setState((function(t,e){return t.post.length>0?{post:t.post.trim()+"\n\n"+n}:{post:n}})),e.open()})),(0,h.Z)((0,c.Z)(e),"onCancel",(function(){var t=e.state.originalPost===e.state.post,n=0===e.state.attachments.length;if(t&&n)return e.close();window.confirm(pgettext("edit reply","Are you sure you want to discard changes?"))&&e.close()})),(0,h.Z)((0,c.Z)(e),"onProtect",(function(){e.setState({protect:!0})})),(0,h.Z)((0,c.Z)(e),"onUnprotect",(function(){e.setState({protect:!1})})),(0,h.Z)((0,c.Z)(e),"onPostChange",(function(t){e.changeValue("post",t.target.value)})),(0,h.Z)((0,c.Z)(e),"onAttachmentsChange",(function(t){e.setState(t)})),(0,h.Z)((0,c.Z)(e),"onQuote",(function(t){e.setState((function(e){var n=e.post;return n.length>0?{post:n.trim()+"\n\n"+t}:{post:t}})),e.open()})),(0,h.Z)((0,c.Z)(e),"close",(function(){e.minimize(),m.Z.close()})),(0,h.Z)((0,c.Z)(e),"minimize",(function(){e.setState({fullscreen:!1,minimized:!0})})),(0,h.Z)((0,c.Z)(e),"open",(function(){e.setState({minimized:!1}),e.state.fullscreen})),(0,h.Z)((0,c.Z)(e),"fullscreenEnter",(function(){e.setState({fullscreen:!0,minimized:!1})})),(0,h.Z)((0,c.Z)(e),"fullscreenExit",(function(){e.setState({fullscreen:!1,minimized:!1})})),e.state={isReady:!1,isLoading:!1,error:!1,minimized:!1,fullscreen:!1,post:"",attachments:[],protect:!1,canProtect:!1,validators:{post:(0,F.Jh)()},errors:{}},e.originalPost="",e}return(0,s.Z)(i,[{key:"componentDidMount",value:function(){H.Z.get(this.props.config).then(this.loadSuccess,this.loadError),I(!1,this.onQuote)}},{key:"componentWillUnmount",value:function(){B()}},{key:"componentWillReceiveProps",value:function(t){var e=this.props.context,n=t.context;e&&n&&e.reply===n.reply||H.Z.get(t.config,t.context||null).then(this.appendData,V.Z.apiError)}},{key:"clean",value:function(){if(!this.state.post.trim().length)return V.Z.error(pgettext("posting form","You have to enter a message.")),!1;var t=this.validate();return!t.post||(V.Z.error(t.post[0]),!1)}},{key:"send",value:function(){return I(!0,this.onQuote),H.Z.put(this.props.submit,{post:this.state.post,attachments:q(this.state.attachments),protect:this.state.protect})}},{key:"handleSuccess",value:function(t){this.setState({isLoading:!0}),this.close(),I(!1,this.onQuote),V.Z.success(pgettext("edit reply","Reply has been edited.")),window.location=t.url.index}},{key:"handleError",value:function(t){if(400===t.status){var e=[].concat(t.non_field_errors||[],t.category||[],t.title||[],t.post||[],t.attachments||[]);V.Z.error(e[0])}else V.Z.apiError(t);I(!1,this.onQuote)}},{key:"render",value:function(){var t=this,e={post:this.props.post,minimized:this.state.minimized,minimize:this.minimize,open:this.open,fullscreen:this.state.fullscreen,fullscreenEnter:this.fullscreenEnter,fullscreenExit:this.fullscreenExit,close:this.onCancel};return this.state.error?o().createElement(ln,e,(0,r.Z)(Be,{message:this.state.error,close:this.close})):this.state.isReady?o().createElement(ln,e,(0,r.Z)("form",{className:"posting-dialog-form",method:"POST",onSubmit:this.handleSubmit},void 0,(0,r.Z)(Re,{attachments:this.state.attachments,canProtect:this.state.canProtect,isProtected:this.state.protect,enableProtection:function(){return t.setState({protect:!0})},disableProtection:function(){return t.setState({protect:!1})},value:this.state.post,submitText:pgettext("edit reply submit","Edit reply"),disabled:this.state.isLoading,onAttachmentsChange:this.onAttachmentsChange,onChange:this.onPostChange}))):o().createElement(ln,e,(0,r.Z)("div",{className:"posting-loading ui-preview"},void 0,(0,r.Z)(Re,{attachments:[],value:"",submitText:pgettext("edit reply submit","Edit reply"),disabled:!0,onAttachmentsChange:function(){},onChange:function(){}})))}}]),i}(D.Z),ln=function(t){var e=t.children,n=t.close,a=t.minimized,i=t.minimize,o=t.open,s=t.fullscreen,l=t.fullscreenEnter,c=t.fullscreenExit,u=t.post;return(0,r.Z)(Ae,{fullscreen:s,minimized:a},void 0,(0,r.Z)(Me,{fullscreen:s,fullscreenEnter:l,fullscreenExit:c,minimized:a,minimize:i,open:o,close:n},void 0,interpolate(pgettext("edit reply","Edit reply by %(poster)s from %(date)s"),{poster:u.poster?u.poster.username:u.poster_name,date:u.posted_on.fromNow()},!0)),(0,r.Z)(Te,{},void 0,e))};function cn(t){switch(t.mode){case"START":return o().createElement(Je,t);case"START_PRIVATE":return o().createElement(nn,t);case"REPLY":return o().createElement(on,t);case"EDIT":return o().createElement(sn,t);default:return null}}},12891:(t,e,n)=>{"use strict";n.d(e,{Jh:()=>r,jn:()=>o});var a=n(55210),i=n(34458);function o(){return[(0,a.Ei)(i.Z.get("SETTINGS").thread_title_length_min,(function(t,e){var n=npgettext("thread title length validator","Thread title should be at least %(limit_value)s character long (it has %(show_value)s).","Thread title should be at least %(limit_value)s characters long (it has %(show_value)s).",t);return interpolate(n,{limit_value:t,show_value:e},!0)})),(0,a.BS)(i.Z.get("SETTINGS").thread_title_length_max,(function(t,e){var n=npgettext("thread title length validator","Thread title cannot be longer than %(limit_value)s character (it has %(show_value)s).","Thread title cannot be longer than %(limit_value)s characters (it has %(show_value)s).",t);return interpolate(n,{limit_value:t,show_value:e},!0)}))]}function r(){return i.Z.get("SETTINGS").post_length_max?[s(),(0,a.BS)(i.Z.get("SETTINGS").post_length_max||1e6,(function(t,e){var n=npgettext("post length validator","Posted message cannot be longer than %(limit_value)s character (it has %(show_value)s).","Posted message cannot be longer than %(limit_value)s characters (it has %(show_value)s).",t);return interpolate(n,{limit_value:t,show_value:e},!0)}))]:[s()]}function s(){return(0,a.Ei)(i.Z.get("SETTINGS").post_length_min,(function(t,e){var n=npgettext("post length validator","Posted message should be at least %(limit_value)s character long (it has %(show_value)s).","Posted message should be at least %(limit_value)s characters long (it has %(show_value)s).",t);return interpolate(n,{limit_value:t,show_value:e},!0)}))}},11920:(t,e,n)=>{"use strict";n.d(e,{E:()=>A,F:()=>B});var a=n(22928),i=n(57588),o=n.n(i),r=n(15671),s=n(43144),l=n(79340),c=n(6215),u=n(61120),d=n(60642),p=n(66398);function h(t){var e=t.children;return(0,a.Z)(p.NX,{className:"search-results-list"},void 0,e)}function m(){return(0,a.Z)(h,{},void 0,(0,a.Z)(p.j0,{message:pgettext("search cta","Enter search query (at least 3 characters).")}))}var v=n(16069);function f(t){var e=t.post;return(0,a.Z)(p.WI,{className:"search-result"},void 0,(0,a.Z)("a",{href:e.url.index},void 0,(0,a.Z)("div",{className:"search-result-card"},void 0,(0,a.Z)("div",{className:"search-result-name"},void 0,e.thread.title),(0,a.Z)("div",{className:"search-result-summary",dangerouslySetInnerHTML:{__html:e.headline||e.content}}),(0,a.Z)("ul",{className:"search-result-details"},void 0,(0,a.Z)("li",{},void 0,(0,a.Z)("b",{},void 0,e.category.name)),(0,a.Z)("li",{},void 0,e.poster?e.poster.username:e.poster_name),(0,a.Z)("li",{},void 0,(0,a.Z)(v.Z,{datetime:e.posted_on}))))))}var Z,g,y,b=n(19605);function k(t){var e=t.user,n=e.title||e.rank.title;return(0,a.Z)(p.WI,{className:"search-result"},void 0,(0,a.Z)("a",{href:e.url},void 0,(0,a.Z)(b.ZP,{user:e,size:32}),(0,a.Z)("div",{className:"search-result-card"},void 0,(0,a.Z)("div",{className:"search-result-name"},void 0,e.username),(0,a.Z)("ul",{className:"search-result-details"},void 0,!!n&&(0,a.Z)("li",{},void 0,(0,a.Z)("b",{},void 0,n)),(0,a.Z)("li",{},void 0,e.rank.name),(0,a.Z)("li",{},void 0,(0,a.Z)(v.Z,{datetime:e.joined_on}))))))}function _(t){var e=t.query,n=t.results,i=n[0],o=n[1],r=i.results.count;return(0,a.Z)(h,{},void 0,o.results.results.map((function(t){return(0,a.Z)(k,{user:t},t.id)})),i.results.results.map((function(t){return(0,a.Z)(f,{post:t},t.id)})),r>0&&(0,a.Z)(p.WI,{},void 0,(0,a.Z)("a",{href:i.url+"?q="+encodeURIComponent(e),className:"btn btn-default btn-block"},void 0,npgettext("search results list","See all %(count)s result.","See all %(count)s results.",i.results.count).replace("%(count)s",i.results.count))))}function x(){return(0,a.Z)(h,{},void 0,(0,a.Z)(p.PB,{message:pgettext("search results","The search returned no results.")}))}function N(t){var e=t.error;return(0,a.Z)(h,{},void 0,(0,a.Z)(p.Zn,{message:pgettext("search results","The search could not be completed."),detail:w(e)}))}function w(t){return 0===t.status?gettext("Check your internet connection and try refreshing the site."):t.data&&t.data.detail?t.data.detail:void 0}function C(){return(0,a.Z)(h,{},void 0,(0,a.Z)(p.WE,{message:pgettext("search results","Searching...")}))}var R={},E=function(t){(0,l.Z)(o,t);var e,n,i=(e=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,u.Z)(e);if(n){var i=(0,u.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,c.Z)(this,t)});function o(t){var e;return(0,r.Z)(this,o),(e=i.call(this,t)).state={query:e.props.query.trim()},e.debounce=null,e}return(0,s.Z)(o,[{key:"componentDidUpdate",value:function(){var t=this,e=this.props.query.trim();this.state.query!=e&&(this.debounce&&window.clearTimeout(this.debounce),this.debounce=window.setTimeout((function(){t.setState({query:e})}),750))}},{key:"componentWillUnmount",value:function(){this.debounce&&window.clearTimeout(this.debounce)}},{key:"render",value:function(){var t,e=this;return(0,a.Z)(d.b,{url:(t=this.state.query,misago.get("SEARCH_API")+"?q="+encodeURIComponent(t)),cache:R,disabled:this.state.query.length<3},void 0,(function(t){var n=t.data,i=t.loading,o=t.error;return e.state.query.length<3?Z||(Z=(0,a.Z)(m,{})):i?g||(g=(0,a.Z)(C,{})):o?(0,a.Z)(N,{error:o}):function(t){if(null===t)return!0;var e=0;return t.forEach((function(t){e+=t.results.count})),0===e}(n)?y||(y=(0,a.Z)(x,{})):null!==n?(0,a.Z)(_,{query:e.state.query,results:n}):null}))}}]),o}(o().Component);function S(t){var e=t.query,n=t.setQuery;return(0,a.Z)("div",{className:"search-input"},void 0,(0,a.Z)("input",{className:"form-control form-control-search",type:"text",placeholder:pgettext("cta","Search"),value:e,onChange:function(t){return n(t.target.value)}}))}var L=n(97326),O=n(4942);var P=function(t){(0,l.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,u.Z)(e);if(n){var i=(0,u.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,c.Z)(this,t)});function i(t){var e;return(0,r.Z)(this,i),e=a.call(this,t),(0,O.Z)((0,L.Z)(e),"setQuery",(function(t){e.setState({query:t})})),e.state={query:""},e}return(0,s.Z)(i,[{key:"render",value:function(){return this.props.children({query:this.state.query,setQuery:this.setQuery})}}]),i}(o().Component);function A(){return(0,a.Z)(P,{},void 0,(function(t){var e=t.query,n=t.setQuery;return(0,a.Z)("div",{className:"search-dropdown-body"},void 0,(0,a.Z)(S,{query:e,setQuery:n}),(0,a.Z)(E,{query:e}))}))}var T=n(37424),I=n(64836);const B=(0,T.$j)((function(t){return{open:t.overlay.search}}))((function(t){var e=t.open;return(0,a.Z)(I.a,{open:e,onOpen:function(){window.setTimeout((function(){document.querySelector("#search-mount .form-control-search").focus()}),0)}},void 0,(0,a.Z)(I.i,{},void 0,pgettext("cta","Search")),(0,a.Z)(P,{},void 0,(function(t){var e=t.query,n=t.setQuery;return(0,a.Z)("div",{className:"search-overlay-body"},void 0,(0,a.Z)(S,{query:e,setQuery:n}),(0,a.Z)("div",{className:"search-results-container"},void 0,(0,a.Z)(E,{query:e})))})))}))},60471:(t,e,n)=>{"use strict";n.d(e,{Z:()=>p});var a=n(22928),i=n(15671),o=n(43144),r=n(97326),s=n(79340),l=n(6215),c=n(61120),u=n(4942),d=n(57588);var p=function(t){(0,s.Z)(p,t);var e,n,d=(e=p,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,l.Z)(this,t)});function p(){var t;(0,i.Z)(this,p);for(var e=arguments.length,n=new Array(e),a=0;a<e;a++)n[a]=arguments[a];return t=d.call.apply(d,[this].concat(n)),(0,u.Z)((0,r.Z)(t),"change",(function(e){return function(){t.props.onChange({target:{value:e}})}})),t}return(0,o.Z)(p,[{key:"getChoice",value:function(){var t=this,e=null;return this.props.choices.map((function(n){n.value===t.props.value&&(e=n)})),e}},{key:"getIcon",value:function(){return this.getChoice().icon}},{key:"getLabel",value:function(){return this.getChoice().label}},{key:"render",value:function(){var t=this;return(0,a.Z)("div",{className:"btn-group btn-select-group"},void 0,(0,a.Z)("button",{type:"button",className:"btn btn-select dropdown-toggle",id:this.props.id||null,"data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false","aria-describedby":this.props["aria-describedby"]||null,disabled:this.props.disabled||!1},void 0,(0,a.Z)(h,{icon:this.getIcon()}),this.getLabel()),(0,a.Z)("ul",{className:"dropdown-menu"},void 0,this.props.choices.map((function(e,n){return(0,a.Z)("li",{},n,(0,a.Z)("button",{type:"button",className:"btn-link",onClick:t.change(e.value)},void 0,(0,a.Z)(h,{icon:e.icon}),e.label))}))))}}]),p}(n.n(d)().Component);function h(t){var e=t.icon;return e?(0,a.Z)("span",{className:"material-icon"},void 0,e):null}},14467:(t,e,n)=>{"use strict";n.d(e,{Z:()=>y});var a,i=n(22928),o=n(15671),r=n(43144),s=n(79340),l=n(6215),c=n(61120),u=(n(57588),n(34458)),d=n(82211),p=n(43345),h=n(47235),m=n(78657),v=n(59801),f=n(53904),Z=n(93051),g=n(19755);var y=function(t){(0,s.Z)(y,t);var e,n,p=(e=y,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,l.Z)(this,t)});function y(t){var e;return(0,o.Z)(this,y),(e=p.call(this,t)).state={isLoading:!1,showActivation:!1,username:"",password:"",validators:{username:[],password:[]}},e}return(0,r.Z)(y,[{key:"clean",value:function(){return!!this.isValid()||(f.Z.error(pgettext("sign in modal","Fill out both fields.")),!1)}},{key:"send",value:function(){return m.Z.post(u.Z.get("AUTH_API"),{username:this.state.username,password:this.state.password})}},{key:"handleSuccess",value:function(){var t=g("#hidden-login-form");t.append('<input type="text" name="username" />'),t.append('<input type="password" name="password" />'),t.find('input[type="hidden"]').val(m.Z.getCsrfToken()),t.find('input[name="next"]').val(window.location.pathname),t.find('input[name="username"]').val(this.state.username),t.find('input[name="password"]').val(this.state.password),t.submit(),this.setState({isLoading:!0})}},{key:"handleError",value:function(t){400===t.status?"inactive_admin"===t.code?f.Z.info(t.detail):"inactive_user"===t.code?(f.Z.info(t.detail),this.setState({showActivation:!0})):"banned"===t.code?((0,Z.Z)(t.detail),v.Z.hide()):f.Z.error(t.detail):403===t.status&&t.ban?((0,Z.Z)(t.ban),v.Z.hide()):f.Z.apiError(t)}},{key:"getActivationButton",value:function(){return this.state.showActivation?(0,i.Z)("a",{className:"btn btn-success btn-block",href:u.Z.get("REQUEST_ACTIVATION_URL")},void 0,pgettext("sign in modal btn","Activate account")):null}},{key:"render",value:function(){return(0,i.Z)("div",{className:"modal-dialog modal-sm modal-sign-in",role:"document"},void 0,(0,i.Z)("div",{className:"modal-content"},void 0,(0,i.Z)("div",{className:"modal-header"},void 0,(0,i.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,a||(a=(0,i.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,i.Z)("h4",{className:"modal-title"},void 0,pgettext("sign in modal title","Sign in"))),(0,i.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,i.Z)("div",{className:"modal-body"},void 0,(0,i.Z)(h.Z,{buttonLabel:pgettext("sign in modal","Sign in with %(site)s"),formLabel:pgettext("sign in modal","Or use your forum account:"),labelClassName:"text-center"}),(0,i.Z)("div",{className:"form-group"},void 0,(0,i.Z)("div",{className:"control-input"},void 0,(0,i.Z)("input",{className:"form-control input-lg",disabled:this.state.isLoading,id:"id_username",onChange:this.bindInput("username"),placeholder:pgettext("sign in modal field","Username or e-mail"),type:"text",value:this.state.username}))),(0,i.Z)("div",{className:"form-group"},void 0,(0,i.Z)("div",{className:"control-input"},void 0,(0,i.Z)("input",{className:"form-control input-lg",disabled:this.state.isLoading,id:"id_password",onChange:this.bindInput("password"),placeholder:pgettext("sign in modal field","Password"),type:"password",value:this.state.password})))),(0,i.Z)("div",{className:"modal-footer"},void 0,this.getActivationButton(),(0,i.Z)(d.Z,{className:"btn-primary btn-block",loading:this.state.isLoading},void 0,pgettext("sign in modal btn","Sign in")),(0,i.Z)("a",{className:"btn btn-default btn-block",href:u.Z.get("FORGOTTEN_PASSWORD_URL")},void 0,pgettext("sign in modal btn","Forgot password?"))))))}}]),y}(p.Z)},24678:(t,e,n)=>{"use strict";n.d(e,{Jj:()=>h,ZP:()=>p,pg:()=>m});var a=n(22928),i=n(15671),o=n(43144),r=n(79340),s=n(6215),l=n(61120),c=n(57588),u=n.n(c);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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,a=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,s.Z)(this,n)}}var p=function(t){(0,r.Z)(n,t);var e=d(n);function n(){return(0,i.Z)(this,n),e.apply(this,arguments)}return(0,o.Z)(n,[{key:"getClass",value:function(){return t=this.props.status,e="",t.is_banned?e="banned":t.is_hidden?e="offline":t.is_online_hidden?e="online":t.is_offline_hidden?e="offline":t.is_online?e="online":t.is_offline&&(e="offline"),"user-status user-"+e;var t,e}},{key:"render",value:function(){return(0,a.Z)("span",{className:this.getClass()},void 0,this.props.children)}}]),n}(u().Component),h=function(t){(0,r.Z)(n,t);var e=d(n);function n(){return(0,i.Z)(this,n),e.apply(this,arguments)}return(0,o.Z)(n,[{key:"getIcon",value:function(){return this.props.status.is_banned?"remove_circle_outline":this.props.status.is_hidden?"help_outline":this.props.status.is_online_hidden?"label":this.props.status.is_offline_hidden?"label_outline":this.props.status.is_online?"lens":this.props.status.is_offline?"panorama_fish_eye":void 0}},{key:"render",value:function(){return(0,a.Z)("span",{className:"material-icon status-icon"},void 0,this.getIcon())}}]),n}(u().Component),m=function(t){(0,r.Z)(n,t);var e=d(n);function n(){return(0,i.Z)(this,n),e.apply(this,arguments)}return(0,o.Z)(n,[{key:"getHelp",value:function(){return t=this.props.user,(e=this.props.status).is_banned?e.banned_until?interpolate(pgettext("user status","%(username)s is banned until %(ban_expires)s"),{username:t.username,ban_expires:e.banned_until.format("LL, LT")},!0):interpolate(pgettext("user status","%(username)s is banned"),{username:t.username},!0):e.is_hidden?interpolate(pgettext("user status","%(username)s is hiding presence"),{username:t.username},!0):e.is_online_hidden?interpolate(pgettext("user status","%(username)s is online (hidden)"),{username:t.username},!0):e.is_offline_hidden?interpolate(pgettext("user status","%(username)s was last seen %(last_click)s (hidden)"),{username:t.username,last_click:e.last_click.fromNow()},!0):e.is_online?interpolate(pgettext("user status","%(username)s is online"),{username:t.username},!0):e.is_offline?interpolate(pgettext("user status","%(username)s was last seen %(last_click)s"),{username:t.username,last_click:e.last_click.fromNow()},!0):void 0;var t,e}},{key:"getLabel",value:function(){return this.props.status.is_banned?pgettext("user status","Banned"):this.props.status.is_hidden?pgettext("user status","Hidden"):this.props.status.is_online_hidden?pgettext("user status","Online (hidden)"):this.props.status.is_offline_hidden?pgettext("user status","Offline (hidden)"):this.props.status.is_online?pgettext("user status","Online"):this.props.status.is_offline?pgettext("user status","Offline"):void 0}},{key:"render",value:function(){return(0,a.Z)("span",{className:this.props.className||"status-label",title:this.getHelp()},void 0,this.getLabel())}}]),n}(u().Component)},40429:(t,e,n)=>{"use strict";n.d(e,{Z:()=>L});var a,i=n(22928),o=n(57588),r=n.n(o),s=n(19605),l=n(24678);function c(t){var e=t.showStatus,n=t.user;return(0,i.Z)("ul",{className:"list-unstyled"},void 0,(0,i.Z)(u,{showStatus:e,user:n}),(0,i.Z)(d,{user:n}),a||(a=(0,i.Z)("li",{className:"user-stat-divider"})),(0,i.Z)(p,{user:n}),(0,i.Z)(h,{user:n}),(0,i.Z)(m,{user:n}))}function u(t){var e=t.showStatus,n=t.user;return e?(0,i.Z)("li",{className:"user-stat-status"},void 0,(0,i.Z)(l.ZP,{status:n.status},void 0,(0,i.Z)(l.pg,{status:n.status,user:n}))):null}function d(t){var e=t.user.joined_on,n=interpolate(pgettext("users list item","Joined on %(joined_on)s"),{joined_on:e.format("LL, LT")},!0),a=interpolate(pgettext("users list item","Joined %(joined_on)s"),{joined_on:e.fromNow()},!0);return(0,i.Z)("li",{className:"user-stat-join-date"},void 0,(0,i.Z)("abbr",{title:n},void 0,a))}function p(t){var e=t.user,n=v("user-stat-posts",e.posts),a=npgettext("users list item","%(posts)s post","%(posts)s posts",e.posts);return(0,i.Z)("li",{className:n},void 0,interpolate(a,{posts:e.posts},!0))}function h(t){var e=t.user,n=v("user-stat-threads",e.threads),a=npgettext("users list item","%(threads)s thread","%(threads)s threads",e.threads);return(0,i.Z)("li",{className:n},void 0,interpolate(a,{threads:e.threads},!0))}function m(t){var e=t.user,n=v("user-stat-followers",e.followers),a=npgettext("users list item","%(followers)s follower","%(followers)s followers",e.followers);return(0,i.Z)("li",{className:n},void 0,interpolate(a,{followers:e.followers},!0))}function v(t,e){return 0===e?t+" user-stat-empty":t}function f(t){var e=t.rank,n=t.title||e.title||e.name,a="user-title";return e.css_class&&(a+=" user-title-"+e.css_class),e.is_tab?(0,i.Z)("a",{className:a,href:e.url},void 0,n):(0,i.Z)("span",{className:a},void 0,n)}function Z(t){var e=t.showStatus,n=t.user,a=n.rank,o="panel user-card";return a.css_class&&(o+=" user-card-"+a.css_class),(0,i.Z)("div",{className:o},void 0,(0,i.Z)("div",{className:"panel-body"},void 0,(0,i.Z)("div",{className:"row"},void 0,(0,i.Z)("div",{className:"col-xs-3 user-card-left"},void 0,(0,i.Z)("div",{className:"user-card-small-avatar"},void 0,(0,i.Z)("a",{href:n.url},void 0,(0,i.Z)(s.ZP,{size:"50",size2x:"80",user:n})))),(0,i.Z)("div",{className:"col-xs-9 col-sm-12 user-card-body"},void 0,(0,i.Z)("div",{className:"user-card-avatar"},void 0,(0,i.Z)("a",{href:n.url},void 0,(0,i.Z)(s.ZP,{size:"150",size2x:"200",user:n}))),(0,i.Z)("div",{className:"user-card-username"},void 0,(0,i.Z)("a",{href:n.url},void 0,n.username)),(0,i.Z)("div",{className:"user-card-title"},void 0,(0,i.Z)(f,{rank:a,title:n.title})),(0,i.Z)("div",{className:"user-card-stats"},void 0,(0,i.Z)(c,{showStatus:e,user:n}))))))}var g,y,b,k=n(15671),_=n(43144),x=n(79340),N=n(6215),w=n(61120),C=n(44039);var R,E=function(t){(0,x.Z)(o,t);var e,n,a=(e=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,w.Z)(e);if(n){var i=(0,w.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,N.Z)(this,t)});function o(){return(0,k.Z)(this,o),a.apply(this,arguments)}return(0,_.Z)(o,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"render",value:function(){return(0,i.Z)("div",{className:"panel user-card user-card-preview"},void 0,(0,i.Z)("div",{className:"panel-body"},void 0,(0,i.Z)("div",{className:"row"},void 0,g||(g=(0,i.Z)("div",{className:"col-xs-3 user-card-left"},void 0,(0,i.Z)("div",{className:"user-card-small-avatar"},void 0,(0,i.Z)("span",{},void 0,(0,i.Z)(s.ZP,{size:"50",size2x:"80"}))))),(0,i.Z)("div",{className:"col-xs-9 col-sm-12 user-card-body"},void 0,y||(y=(0,i.Z)("div",{className:"user-card-avatar"},void 0,(0,i.Z)("span",{},void 0,(0,i.Z)(s.ZP,{size:"150",size2x:"200"})))),(0,i.Z)("div",{className:"user-card-username"},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:C.e(60,150)+"px"}},void 0," ")),(0,i.Z)("div",{className:"user-card-title"},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:C.e(60,150)+"px"}},void 0," ")),(0,i.Z)("div",{className:"user-card-stats"},void 0,(0,i.Z)("ul",{className:"list-unstyled"},void 0,(0,i.Z)("li",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:C.e(30,70)+"px"}},void 0," ")),(0,i.Z)("li",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:C.e(30,70)+"px"}},void 0," ")),b||(b=(0,i.Z)("li",{className:"user-stat-divider"})),(0,i.Z)("li",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:C.e(30,70)+"px"}},void 0," ")),(0,i.Z)("li",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:C.e(30,70)+"px"}},void 0," "))))))))}}]),o}(r().Component);function S(t){var e=t.colClassName,n=t.cols,a=Array.apply(null,{length:n}).map(Number.call,Number);return(0,i.Z)("div",{className:"users-cards-list ui-preview"},void 0,(0,i.Z)("div",{className:"row"},void 0,a.map((function(t){var n=e;return 0!==t&&(n+=" hidden-xs"),3===t&&(n+=" hidden-sm"),(0,i.Z)("div",{className:n},t,R||(R=(0,i.Z)(E,{})))}))))}function L(t){var e=t.cols,n=t.isReady,a=t.showStatus,o=t.users,r="col-xs-12 col-sm-4";return 4===e&&(r+=" col-md-3"),n?(0,i.Z)("div",{className:"users-cards-list ui-ready"},void 0,(0,i.Z)("div",{className:"row"},void 0,o.map((function(t){return(0,i.Z)("div",{className:r},t.id,(0,i.Z)(Z,{showStatus:a,user:t}))})))):(0,i.Z)(S,{colClassName:r,cols:e})}},82125:(t,e,n)=>{"use strict";n.d(e,{Z:()=>d});var a=n(15671),i=n(43144),o=n(97326),r=n(79340),s=n(6215),l=n(61120),c=n(4942),u=n(57588);var d=function(t){(0,r.Z)(d,t);var e,n,u=(e=d,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,l.Z)(e);if(n){var i=(0,l.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,s.Z)(this,t)});function d(t){var e;return(0,a.Z)(this,d),e=u.call(this,t),(0,c.Z)((0,o.Z)(e),"toggleNav",(function(){e.setState({dropdown:!e.state.dropdown})})),(0,c.Z)((0,o.Z)(e),"hideNav",(function(){e.setState({dropdown:!1})})),e.state={dropdown:!1},e}return(0,i.Z)(d,[{key:"getCompactNavClassName",value:function(){return this.state.dropdown?"compact-nav open":"compact-nav"}}]),d}(n.n(u)().Component)},7227:(t,e,n)=>{"use strict";n.d(e,{Z:()=>p});var a=n(22928),i=n(15671),o=n(43144),r=n(97326),s=n(79340),l=n(6215),c=n(61120),u=n(4942),d=n(57588);var p=function(t){(0,s.Z)(p,t);var e,n,d=(e=p,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,l.Z)(this,t)});function p(){var t;(0,i.Z)(this,p);for(var e=arguments.length,n=new Array(e),a=0;a<e;a++)n[a]=arguments[a];return t=d.call.apply(d,[this].concat(n)),(0,u.Z)((0,r.Z)(t),"toggle",(function(){t.props.onChange({target:{value:!t.props.value}})})),t}return(0,o.Z)(p,[{key:"getClassName",value:function(){return this.props.value?"btn btn-yes-no btn-yes-no-on":"btn btn-yes-no btn-yes-no-off"}},{key:"getIcon",value:function(){return this.props.value?this.props.iconOn||"check_box":this.props.iconOff||"check_box_outline_blank"}},{key:"getLabel",value:function(){return this.props.value?this.props.labelOn||pgettext("yesno switch choice","yes"):this.props.labelOff||pgettext("yesno switch choice","no")}},{key:"render",value:function(){return(0,a.Z)("button",{type:"button",onClick:this.toggle,className:this.getClassName(),id:this.props.id||null,"aria-describedby":this.props["aria-describedby"]||null,disabled:this.props.disabled||!1},void 0,(0,a.Z)("span",{className:"material-icon"},void 0,this.getIcon()),(0,a.Z)("span",{className:"btn-text"},void 0,this.getLabel()))}}]),p}(n.n(d)().Component)},41761:()=>{document.body.addEventListener("click",(function(t){var e=t.target.getAttribute("misago-focus-on");if(e){t.preventDefault();var n=document.querySelector(e);n&&n.focus()}}))},75557:(t,e,n)=>{"use strict";n.d(e,{SW:()=>k,ry:()=>m,xn:()=>x});var a=window.misago_locale||"en-us",i=pgettext("time ago","moment ago"),o=pgettext("time ago","now"),r=pgettext("day at time","%(day)s at %(time)s"),s=pgettext("day at time","Today at %(time)s"),l=pgettext("day at time","Tomorrow at %(time)s"),c=pgettext("day at time","Yesterday at %(time)s"),u=pgettext("short minutes","%(time)sm"),d=pgettext("short hours","%(time)sh"),p=pgettext("short days","%(time)sd"),h=new Intl.RelativeTimeFormat(a,{numeric:"always",style:"long"}),m=new Intl.DateTimeFormat(a,{dateStyle:"full",timeStyle:"medium"}),v=new Intl.DateTimeFormat(a,{month:"long",day:"numeric"}),f=new Intl.DateTimeFormat(a,{year:"numeric",month:"long",day:"numeric"}),Z=(new Intl.DateTimeFormat(a,{year:"2-digit",month:"short",day:"numeric"}),new Intl.DateTimeFormat(a,{weekday:"long"})),g=new Intl.DateTimeFormat(a,{timeStyle:"short"}),y=new Intl.DateTimeFormat(a,{month:"short",day:"numeric"}),b=new Intl.DateTimeFormat(a,{month:"short",year:"numeric"});function k(t){var e=new Date,n=Math.round((t-e)/1e3),a=Math.abs(n),o=n<1?-1:1;if(a<90)return i;if(a<2820){var u=Math.round(a/60)*o;return h.format(u,"minute")}if(a<10800){var d=Math.round(a/3600)*o;return h.format(d,"hour")}return _(e,t)?n>0?s.replace("%(time)s",g.format(t)):g.format(t):function(t){var e=new Date;return e.setDate(e.getDate()-1),_(e,t)}(t)?c.replace("%(time)s",g.format(t)):function(t){var e=new Date;return e.setDate(e.getDate()+1),_(e,t)}(t)?l.replace("%(time)s",g.format(t)):n<0&&a<518400?function(t,e){return r.replace("%(day)s",t).replace("%(time)s",g.format(e))}(Z.format(t),t):e.getFullYear()==t.getFullYear()?v.format(t):f.format(t)}function _(t,e){return t.getFullYear()==e.getFullYear()&&t.getMonth()==e.getMonth()&&t.getDate()==e.getDate()}function x(t){var e=new Date,n=Math.abs(Math.round((t-e)/1e3));if(n<60)return o;if(n<3300){var a=Math.round(n/60);return u.replace("%(time)s",a)}if(n<86400){var i=Math.round(n/3600);return d.replace("%(time)s",i)}if(n<604800){var r=Math.round(n/86400);return p.replace("%(time)s",r)}return t.getFullYear()===e.getFullYear()?y.format(t):b.format(t)}},34458:(t,e,n)=>{"use strict";n.d(e,{Z:()=>ht});var a=n(15671),i=n(43144),o=n(4942),r=(n(58294),n(95377),n(68852),n(39737),n(14316),n(43204),n(7023),n(38914));const s=function(){function t(e){(0,a.Z)(this,t),this.isOrdered=!1,this._items=e||[]}return(0,i.Z)(t,[{key:"add",value:function(t,e,n){this._items.push({key:t,item:e,after:n&&n.after||null,before:n&&n.before||null})}},{key:"get",value:function(t,e){for(var n=0;n<this._items.length;n++)if(this._items[n].key===t)return this._items[n].item;return e}},{key:"has",value:function(t){return void 0!==this.get(t)}},{key:"values",value:function(){for(var t=[],e=0;e<this._items.length;e++)t.push(this._items[e].item);return t}},{key:"order",value:function(t){return this.isOrdered||(this._items=this._order(this._items),this.isOrdered=!0),t||void 0===t?this.values():this._items}},{key:"orderedValues",value:function(){return this.order(!0)}},{key:"_order",value:function(t){var e=[];t.forEach((function(t){e.push(t.key)}));var n=[],a=[];function i(t){var e=-1;-1===a.indexOf(t.key)&&(t.after?-1!==(e=a.indexOf(t.after))&&(e+=1):t.before&&(e=a.indexOf(t.before)),-1!==e&&(n.splice(e,0,t),a.splice(e,0,t.key)))}t.forEach((function(t){t.after||t.before||(n.push(t),a.push(t.key))})),t.forEach((function(t){"_end"===t.before&&(n.push(t),a.push(t.key))}));for(var o=200;o>0&&e.length!==a.length;)o-=1,t.forEach(i);return n}}]),t}();function l(t){var e=t.closest("[hx-silent]");return!e||"true"!==e.getAttribute("hx-silent")}const c=(0,i.Z)((function t(){var e=this;(0,a.Z)(this,t),(0,o.Z)(this,"show",(function(){e.requests+=1,e.update()})),(0,o.Z)(this,"hide",(function(){e.requests&&(e.requests-=1,e.update())})),(0,o.Z)(this,"update",(function(){e.timeout&&window.clearTimeout(e.timeout),e.requests?(e.element.classList.add("busy"),e.element.classList.remove("complete")):(e.element.classList.remove("busy"),e.element.classList.add("complete"),e.timeout=setTimeout((function(){e.element.classList.remove("complete")}),1500))})),this.element=document.getElementById("misago-ajax-loader"),this.requests=0,this.timeout=null}));var u=n(19755);const d=(0,i.Z)((function t(e){var n=this;(0,a.Z)(this,t),(0,o.Z)(this,"registerActions",(function(){n.actions.forEach((function(t){"remove-selection"===t.getAttribute("moderation-action")?t.addEventListener("click",n.onRemoveSelection):t.addEventListener("click",n.onAction)}))})),(0,o.Z)(this,"onAction",(function(t){var e=document.querySelector(n.form),a={};new FormData(e).forEach((function(t,e){void 0===a[e]&&(a[e]=[]),a[e].push(t)}));var i=t.target;a.moderation=i.getAttribute("moderation-action"),"true"===i.getAttribute("moderation-multistage")?r.Z.ajax("POST",document.location.href,{target:n.modal,swap:"innerHTML",values:a}).then((function(){u(n.modal).modal("show")})):r.Z.ajax("POST",document.location.href,{target:"#misago-htmx-root",swap:"outerHTML",values:a})})),(0,o.Z)(this,"onRemoveSelection",(function(t){document.querySelectorAll(n.selection).forEach((function(t){t.checked=!1})),n.update()})),(0,o.Z)(this,"registerEvents",(function(){document.body.addEventListener("click",(function(t){var e=t.target;"INPUT"===e.tagName&&"checkbox"===e.type&&n.update()})),r.Z.onLoad((function(){return n.update()}))})),(0,o.Z)(this,"update",(function(){var t=document.querySelectorAll(n.selection).length;n.control.innerText=n.text.replace("%(number)s",t),n.control.disabled=!t,n.menu&&(t?n.menu.classList.add("visible"):n.menu.classList.remove("visible"))})),this.menu=e.menu?document.querySelector(e.menu):null,this.form=e.form,this.modal=e.modal,this.actions=document.querySelectorAll(e.actions),this.selection=e.selection,this.control=document.querySelector(e.button.selector),this.text=e.button.text,this.update(),this.registerEvents(),this.registerActions()}));n(41761);var p=n(15861),h=n(64687),m=n.n(h),v={};function f(t){if(!t.getAttribute("misago-validate-active")){var e=t.getAttribute("misago-validate"),n=t.getAttribute("misago-validate-user"),a="false"!=t.getAttribute("misago-validate-strip"),i=t.querySelector("input"),o=i.closest("form").querySelector("input[type=hidden]");if(e&&i){v[e]||(v[e]={}),t.setAttribute("misago-validate-active","true");var r=null;i.addEventListener("keyup",(function(s){var l=s.target.value;a&&(l=l.trim()),0!==l.trim().length?v[e][l]?Z(t,i,v[e][l]):(r&&window.clearTimeout(r),r=window.setTimeout((0,p.Z)(m().mark((function a(){var r,s;return m().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,y(e,o,l,n);case 2:r=a.sent,s=r.errors,v[e][l]=s,Z(t,i,s);case 6:case"end":return a.stop()}}),a)}))),1e3)):function(t){t.classList.remove("has-error"),t.classList.remove("has-success"),g(t)}(t)}))}}}function Z(t,e,n){n.length?function(t,e,n){t.classList.remove("has-success"),t.classList.add("has-error"),g(t),n.forEach((function(t){var n=document.createElement("p");n.className="help-block",n.setAttribute("misago-dynamic-message","true"),n.innerText=t,e.after(n)}))}(t,e,n):function(t){t.classList.remove("has-error"),t.classList.add("has-success"),g(t)}(t)}function g(t){t.querySelectorAll("[misago-dynamic-message]").forEach((function(t){return t.remove()}))}function y(t,e,n,a){return b.apply(this,arguments)}function b(){return(b=(0,p.Z)(m().mark((function t(e,n,a,i){var o,r;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(o=new FormData).set(n.name,n.value),o.set("value",a),i&&o.set("user",i),t.next=6,fetch(e,{method:"POST",mode:"cors",credentials:"same-origin",body:o});case 6:return r=t.sent,t.next=9,r.json();case 9:return t.abrupt("return",t.sent);case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}r.Z.onLoad((function(t){(t||document).querySelectorAll("[misago-validate]").forEach(f)}));var k=document.getElementById("misago-snackbars"),_=null;function x(){k.replaceChildren()}function N(){_&&window.clearTimeout(_),k.querySelectorAll(".snackbar").forEach((function(t){t.classList.add("in")})),_=window.setTimeout((function(){k.querySelectorAll(".snackbar").forEach((function(t){t.classList.add("out"),_=window.setTimeout(x,1e3)}))}),6e3)}function w(t,e){x(),_&&window.clearTimeout(_);var n=document.createElement("div");n.classList.add("snackbar"),n.classList.add("snackbar-"+t),n.innerText=e,n.role="alert",k.appendChild(n),_=window.setTimeout(N,100)}function C(t){w("danger",t)}function R(t){var e,n,a=t.detail;return!("true"===(e=a.target,n=e.closest("[hx-silent]"),n?n.getAttribute("hx-silent"):null)&&"get"===a.requestConfig.verb)}r.Z.onLoad(N),document.addEventListener("htmx:responseError",(function(t){R(t)&&C(function(t){if("application/json"===t.getResponseHeader("content-type")){var e=JSON.parse(t.response);if(e.error)return e.error}return 404===t.status?pgettext("htmx response error","Page not found"):403===t.status?pgettext("htmx response error","Permission denied"):pgettext("htmx response error","Unexpected error")}(t.detail.xhr))})),document.addEventListener("htmx:sendError",(function(t){R(t)&&C(pgettext("htmx response error","Site could not be reached"))})),document.addEventListener("htmx:timeout",(function(t){R(t)&&C(pgettext("htmx response error","Site took too long to reply"))}));var E=n(75557),S={};function L(t){var e=t.getAttribute("misago-timestamp"),n=t.getAttribute("misago-timestamp-format");S[e]||(S[e]=new Date(e)),"full"===n||t.hasAttribute("misago-timestamp-title")||(t.setAttribute("misago-timestamp-title","true"),t.setAttribute("title",E.ry.format(S[e]))),"short"===n?t.textContent=(0,E.xn)(S[e]):"full"===n?(console.log(n),t.textContent=E.ry.format(S[e])):t.textContent=(0,E.SW)(S[e])}function O(t){(t||document).querySelectorAll("[misago-timestamp]").forEach(L)}document.querySelectorAll("[misago-timestamp]").forEach(L),O(),window.setInterval(O,55e3),r.Z.onLoad(O);var P=n(19755),A=function(){function t(){var e=this;(0,a.Z)(this,t),(0,o.Z)(this,"_onDOMContentLoaded",(function(){e.modal=document.getElementById("misago-lightbox-modal"),e.modal&&(e.pager=e.modal.querySelector("[misago-lightbox-pager]"),e.details=e.modal.querySelector("[misago-lightbox-details]"),e.zoom=e.modal.querySelector("[misago-lightbox-zoom]"),e.download=e.modal.querySelector("[misago-lightbox-download]"),e.link=e.modal.querySelector("[misago-lightbox-link]"),e.container=e.modal.querySelector("[misago-lightbox-container]"),e.caption=e.modal.querySelector("[misago-lightbox-caption]"),e.template=document.getElementById("lightbox-image-caption"),e._registerEvents())})),this.modal=null,this.pager=null,this.details=null,this.zoom=null,this.download=null,this.link=null,this.container=null,this.caption=null,this.state=null,this.template=null,document.addEventListener("DOMContentLoaded",this._onDOMContentLoaded)}return(0,i.Z)(t,[{key:"_registerEvents",value:function(){var t=this;document.addEventListener("click",(function(e){var n=e.target.closest("img[misago-lightbox-media]");if(n)t.onImageClick(e,n);else{var a=e.target.closest("[misago-lightbox-button]");a&&t.onMediaButtonClick(e,a)}})),this.modal.querySelector("[data-dismiss]").addEventListener("click",(function(){t.onHideLightbox()})),this.modal.querySelector("[misago-lightbox-previous]").addEventListener("click",(function(){t.state.index=(t.state.index||t.state.total)-1,t.state.media=t.state.items[t.state.index],t.updateLightbox()})),this.modal.querySelector("[misago-lightbox-next]").addEventListener("click",(function(){t.state.index+=1,t.state.index===t.state.total&&(t.state.index=0),t.state.media=t.state.items[t.state.index],t.updateLightbox()}))}},{key:"onImageClick",value:function(t,e){t.preventDefault();var n=e.closest("[misago-lightbox-root]");this.state=this.getInitialState(n,e),this.updateLightbox(),this.showLightbox()}},{key:"onMediaButtonClick",value:function(t,e){t.preventDefault();var n=e.closest("[misago-lightbox-root]"),a=e.closest("[misago-lightbox-context]").querySelector("[misago-lightbox-media]");this.state=this.getInitialState(n,a),this.updateLightbox(),this.showLightbox()}},{key:"getInitialState",value:function(t,e){var n=this.getRootMedia(t,e),a=n.map((function(t){return t.active})).indexOf(!0);return{items:n,media:n[a],index:a,total:n.length}}},{key:"getRootMedia",value:function(t,e){var n=[];return t.querySelectorAll("[misago-lightbox-media]").forEach((function(t){var a=t.closest("[misago-lightbox-context]"),i=t.closest("a");n.push({element:t,active:t===e,video:"VIDEO"===t.tagName,image:"IMG"===t.tagName,caption:a?a.querySelector("template"):null,details:a?a.getAttribute("misago-lightbox-details"):null,download:a?a.getAttribute("misago-lightbox-download"):null,link:!a&&i,url:a?a.getAttribute("misago-lightbox-url"):t.getAttribute("src")})})),n}},{key:"updateLightbox",value:function(){this.updateLightboxPager(),this.updateLightboxOptions(),this.updateLightboxButtons(),this.updateLightboxContainer(),this.updateLightboxCaption()}},{key:"updateLightboxPager",value:function(){var t=this.state,e=this.pager;t.total?(e.textContent=e.getAttribute("misago-lightbox-pager").replace("%(total)s",t.total).replace("%(index)s",t.index+1),e.classList.remove("d-none")):(e.textContent="",e.classList.add("d-none"))}},{key:"updateLightboxOptions",value:function(){var t=this.state.media;this.updateLightboxOption(this.details,t.details),this.updateLightboxOption(this.download,t.download&&t.url),this.updateLightboxOption(this.link,t.link&&t.link.href),this.updateLightboxOption(this.zoom,t.url)}},{key:"updateLightboxOption",value:function(t,e){e?(t.setAttribute("href",e),t.classList.remove("d-none")):t.classList.add("d-none")}},{key:"updateLightboxButtons",value:function(){var t=this.state;this.container.querySelectorAll("button").forEach((function(e){t.total?e.classList.remove("d-none"):e.classList.add("d-none")}))}},{key:"updateLightboxContainer",value:function(){var t=this.state,e=this.container,n=t.media;n.image?this.updateLightboxContainerWithImage(e,n):n.video&&this.updateLightboxContainerWithVideo(e,n)}},{key:"updateLightboxContainerWithImage",value:function(t,e){var n=document.createElement("img");n.setAttribute("src",e.url),n.setAttribute("alt","");var a=document.createElement("a");a.setAttribute("href",e.url),a.setAttribute("target","_blank"),a.appendChild(n),t.replaceChildren(a)}},{key:"updateLightboxContainerWithVideo",value:function(t,e){var n=document.createElement("video");n.innerHTML=e.element.innerHTML,n.setAttribute("controls","true"),n.setAttribute("preload","metadata"),t.replaceChildren(n)}},{key:"updateLightboxCaption",value:function(){var t=this.state,e=this.caption,n=t.media;if(n.caption){var a=n.caption.content.cloneNode(!0);O(a),e.replaceChildren(a)}else{var i=this.template.content.cloneNode(!0),o=i.querySelector("[lightbox-image-caption-name]"),r=i.querySelector("[lightbox-image-caption-description]");o.removeAttribute("lightbox-image-caption-name"),r.removeAttribute("lightbox-image-caption-description");var s=(n.element.getAttribute("alt")||"").trim(),l=(n.element.getAttribute("title")||"").trim(),c=n.element.getAttribute("src"),u=l&&s?l+" — "+s:l||s||this.cleanDisplayFilename(c);if(o.textContent=this.shortenLongString(u),o.textContent!==u&&o.setAttribute("title",u),n.link){var d=document.createElement("a"),p=n.link.getAttribute("href");d.setAttribute("href",p),d.setAttribute("target","_blank"),d.textContent=this.cleanDisplayUrl(p),r.appendChild(d)}else l||s?r.textContent=this.cleanDisplayUrl(c):r.remove();e.replaceChildren(i)}}},{key:"cleanDisplayFilename",value:function(t){var e=t.lastIndexOf("/");if(-1===e)return this.cleanDisplayUrl(t);var n=t.substring(e+1).trim();return n?this.shortenLongString(n):this.cleanDisplayUrl(t)}},{key:"cleanDisplayUrl",value:function(t){var e=t;return e.startsWith("https://")?e=e.substring(8):e.startsWith("http://")&&(e=e.substring(7)),this.shortenLongString(e)}},{key:"shortenLongString",value:function(t){return console.log(t,t.length),t.length<=80?t:t.substring(0,35)+"..."+t.substring(t.length-40)}},{key:"showLightbox",value:function(){document.querySelectorAll("video").forEach((function(t){return t.pause()})),P(this.modal).modal("show")}},{key:"onHideLightbox",value:function(){this.modal.querySelectorAll("video").forEach((function(t){return t.pause()}))}}]),t}();function T(t,e){t.classList.remove("animation-fade-in"),t.querySelectorAll("button, input, select, textarea").forEach((function(t){t.setAttribute("disabled","")})),t.addEventListener("animationend",(function(n){"deleteElementAnimation"===n.animationName&&(t.remove(),e&&e())})),t.classList.add("animation-delete")}var I="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",B=I.length;function j(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n<e;n++)a[n]=t[n];return a}function D(t,e){var n=t.content.cloneNode(!0);return n.querySelectorAll("[misago-tpl-if]").forEach((function(t){var n=t.getAttribute("misago-tpl-if");U(e,n)?t.removeAttribute("misago-tpl-if"):t.remove()})),n.querySelectorAll("[misago-tpl-ifnot]").forEach((function(t){var n=t.getAttribute("misago-tpl-ifnot");U(e,n)?t.remove():t.removeAttribute("misago-tpl-ifnot")})),n.querySelectorAll("[misago-tpl-var]").forEach((function(t){var n=t.getAttribute("misago-tpl-var");t.innerText=U(e,n)||"",t.removeAttribute("misago-tpl-var")})),n.querySelectorAll("[misago-tpl-attr]").forEach((function(t){var n=t.getAttribute("misago-tpl-attr");if(":"!==n.indexOf(":")){var a=n.substring(0,n.indexOf(":")).trim(),i=n.substring(n.indexOf(":")+1).trim(),o=i?U(e,i):void 0;a&&o&&t.setAttribute(a,o)}t.removeAttribute("misago-tpl-attr")})),n}function U(t,e){if(-1===e.indexOf("."))return t[e];var n,a=t,i=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return j(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?j(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var a=0,i=function(){};return{s:i,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,r=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return r=t.done,t},e:function(t){s=!0,o=t},f:function(){try{r||null==n.return||n.return()}finally{if(s)throw o}}}}(e.split("."));try{for(i.s();!(n=i.n()).done;){var o=n.value;if(!o||void 0===a[o])return;a=a[o]}}catch(t){i.e(t)}finally{i.f()}return a}function z(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return q(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?q(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var a=0,i=function(){};return{s:i,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,r=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return r=t.done,t},e:function(t){s=!0,o=t},f:function(){try{r||null==n.return||n.return()}finally{if(s)throw o}}}}function q(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n<e;n++)a[n]=t[n];return a}var M=function(){function t(e,n){(0,a.Z)(this,t),this.editor=e,this.element=n,this.textarea=e.getTextarea(n),this.lists={media:n.querySelector('[misago-editor-attachments="media"]'),other:n.querySelector('[misago-editor-attachments="other"]')},this.templates={error:document.getElementById("attachment-upload-error-template"),media:document.getElementById("attachment-media-template"),mediaFooter:document.getElementById("attachment-media-footer-template"),mediaFailedFooter:document.getElementById("attachment-media-failed-footer-template"),other:document.getElementById("attachment-other-template"),otherFailed:document.getElementById("attachment-other-failed-template"),otherUploaded:document.getElementById("attachment-other-uploaded-template")};var i=n.querySelector("[misago-editor-attachments]");this.field={name:n.getAttribute("misago-editor-attachments-name"),element:i},this.accept={all:this._getAcceptedExtensions(i.getAttribute("misago-editor-accept-attachments")),image:this._getAcceptedExtensions(i.getAttribute("misago-editor-accept-image")),video:this._getAcceptedExtensions(i.getAttribute("misago-editor-accept-video"))},this.uploadUrl=this._getUploadUrl(n),this.canUpload=!!this.uploadUrl&&!!this.accept.all}return(0,i.Z)(t,[{key:"_getUploadUrl",value:function(t){return t.getAttribute("misago-editor-attachments-url")||null}},{key:"_getAcceptedExtensions",value:function(t){return t.split(",").map((function(t){return t.trim()}))}},{key:"showPermissionDeniedError",value:function(){C(pgettext("markup editor upload","You can't upload attachments"))}},{key:"prompt",value:function(t){var e=this,n=t?t.accept:"all",a=!!t&&t.insert,i=document.createElement("input");i.setAttribute("type","file"),i.setAttribute("accept",(this.accept[n]||this.accept.all).join(",")),i.setAttribute("multiple",!0),i.classList.add("d-none"),i.addEventListener("change",(function(t){var n=t.target.files;n.length&&e.uploadFiles(n,a),i.remove()})),this.element.appendChild(i),i.click()}},{key:"_getAcceptAttributeStr",value:function(t){return(this.accept[t]||this.accept.all).join(",")}},{key:"uploadFiles",value:function(t,e){for(var n=this,a=[],i=0;i<t.length;i++){var o=t[i];this._isFileTypeAccepted(o)?a.push(o):C(pgettext("markup editor upload","%(name)s: uploaded file type is not allowed.").replace("%(name)s",o.name))}if(!a)return{keys:[],files:[]};var r,s=[],l={},c=new FormData;c.append("csrfmiddlewaretoken",(r=document.querySelector('input[name="csrfmiddlewaretoken"]'))?r.value:null),a.forEach((function(t){var e=function(t){for(var e="",n=0;n<16;n++)e+=I[Math.floor(Math.random()*B)];return e}();s.push(e),c.append("keys",e),c.append("upload",t),l[e]=n._createUploadUI(t,e)})),e&&this._insertAttachmentsInTextarea(s,a);var u=new XMLHttpRequest;return this._addOnLoadedEventListener(u,s,l),this._addOnProgressEventListener(u,s,l),u.open("POST",this.uploadUrl),u.send(c),{keys:s,files:a}}},{key:"_isFileTypeAccepted",value:function(t){return this._isFileTypeInList(t,this.accept.all)}},{key:"_isFileTypeImage",value:function(t){return this._isFileTypeInList(t,this.accept.image)}},{key:"_isFileTypeVideo",value:function(t){return this._isFileTypeInList(t,this.accept.video)}},{key:"_isFileTypeInList",value:function(t,e){var n,a=t.name.toLowerCase(),i=z(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(a.substring(a.length-o.length)===o)return!0}}catch(t){i.e(t)}finally{i.f()}return!1}},{key:"_insertAttachmentsInTextarea",value:function(t,e){for(var n=[],a=0;a<t.length;a++){var i=t[a],o=e[a];n.push("<attachment="+o.name+":"+i+">")}n&&this.editor.getSelection(this.textarea).insert(n.join("\n"),{whitespace:"\n\n"})}},{key:"_addOnLoadedEventListener",value:function(t,e,n){var a=this;t.addEventListener("loadend",(function(){t.readyState===XMLHttpRequest.DONE&&(200===t.status?a._handleUploadSuccess(t,e,n):a._handleUploadError(t,e),e.forEach((function(t){return n[t]=null})))}))}},{key:"_handleUploadSuccess",value:function(t,e,n){var a=this;try{var i=JSON.parse(t.response),o=i.attachments,r=i.errors;if(this._replaceTextareaPlaceholders(this.textarea,e,o),r){var s=this.element.querySelector("[misago-editor-attachments-help]");e.forEach((function(t){var e=r[t];e&&a._updateUploadUIWithError(t,s,e)}))}o&&o.forEach((function(t){try{a._updateUploadUI(t,n[t.key]),a._createAttachmentIDField(t)}catch(t){console.error(t)}}))}catch(t){C(pgettext("markup editor upload","Unexpected upload API response")),console.error(t)}}},{key:"_handleUploadError",value:function(t,e){var n=this;if(0===t.status)C(pgettext("markup editor upload","Site could not be reached"));else if(t.status>=400&&t.status<500)try{C(JSON.parse(t.response).error)}catch(t){C(pgettext("markup editor upload","Unexpected upload API error response")),console.error(t)}else C(pgettext("markup editor upload","Unexpected error during upload"));e.forEach((function(t){n._updateUploadUIWithError(t)}))}},{key:"_addOnProgressEventListener",value:function(t,e,n){t.upload.addEventListener("progress",(function(t){if(t.lengthComputable){var a,i=Math.ceil(100*t.loaded/t.total),o=z(e);try{for(o.s();!(a=o.n()).done;){var r=a.value,s=n[r].querySelector(".progress-bar");s.setAttribute("aria-valuenow",i),s.style.width=i+"%"}}catch(t){o.e(t)}finally{o.f()}}}))}},{key:"_replaceTextareaPlaceholders",value:function(t,e,n){var a={};e.forEach((function(t){return a[t]=null})),n&&n.forEach((function(t){return a[t.key]=t})),this.editor.getSelection(t).replaceAttachments((function(t){var e=t.id,n=a[e];return n?"<attachment="+n.name+":"+n.id+">":null===n?"":void 0}))}},{key:"_createUploadUI",value:function(t,e){var n={key:e,file:t,name:t.name,isImage:!1,isVideo:!1};return this._isFileTypeImage(t)?(n.isImage=!0,this._createMediaUploadUI(n)):this._isFileTypeVideo(t)?(n.isVideo=!0,this._createMediaUploadUI(n)):this._createOtherUploadUI(n),this.editor.getAttachmentByKey(e)}},{key:"_createMediaUploadUI",value:function(t){var e=D(this.templates.media,t);if(t.isImage){var n=e.querySelector("[misago-tpl-image]"),a=new FileReader;a.onload=function(){n.style.backgroundImage="url('"+a.result+"')"},a.readAsDataURL(t.file)}else if(t.isVideo){var i=e.querySelector("video"),o=new FileReader;o.onload=function(){var e=document.createElement("source");e.setAttribute("src",o.result),e.setAttribute("type",t.file.type),i.append(e)},o.readAsDataURL(t.file)}this._addUIToAttachmentsList(this.lists.media,e)}},{key:"_createOtherUploadUI",value:function(t){var e=D(this.templates.other,t);this._addUIToAttachmentsList(this.lists.other,e)}},{key:"_addUIToAttachmentsList",value:function(t,e){t.querySelector("ul").prepend(e),t.classList.remove("d-none")}},{key:"_createAttachmentIDField",value:function(t){var e=document.createElement("input");e.setAttribute("type","hidden"),e.setAttribute("name",this.field.name),e.setAttribute("value",t.id),this.field.element.appendChild(e)}},{key:"_updateUploadUI",value:function(t,e){t.filetype.is_media?this._updateMediaUploadUI(t,e):this._updateOtherUploadUI(t,e)}},{key:"_updateMediaUploadUI",value:function(t,e){var n=D(this.templates.mediaFooter,t);n.querySelector("[misago-editor-attachment]").setAttribute("misago-editor-attachment",t.name+":"+t.id),e.querySelector("[misago-tpl-footer]").replaceWith(n)}},{key:"_updateOtherUploadUI",value:function(t,e){var n=D(this.templates.otherUploaded,t);n.querySelector("[misago-editor-attachment]").setAttribute("misago-editor-attachment",t.name+":"+t.id),e.replaceWith(n)}},{key:"_updateUploadUIWithError",value:function(t,e,n){n&&this._createErrorMessage(t,n,e);var a=this.editor.getAttachmentByKey(t),i=a.querySelector("[misago-tpl-footer]");if(i){var o=D(this.templates.mediaFailedFooter,{key:t});i.replaceWith(o)}else{var r=a.querySelector("[misago-tpl-upload]"),s=r.closest("li").querySelector("button");s.setAttribute("misago-editor-action","attachment-error-dismiss"),s.setAttribute("misago-editor-attachment-key",t),s.removeAttribute("disabled"),r.replaceWith(D(this.templates.otherFailed))}}},{key:"_createErrorMessage",value:function(t,e,n){var a=D(this.templates.error,{key:t,error:e});n.after(a)}}]),t}(),F=n(79340),H=n(6215),V=n(61120),Y=n(19755);function G(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,a=(0,V.Z)(t);if(e){var i=(0,V.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,H.Z)(this,n)}}var W=function(){function t(){var e=this;(0,a.Z)(this,t),this.selection=null,this.element=null,this.form=null,document.addEventListener("DOMContentLoaded",(function(){e.element=e.getElement(),e.element&&(e.form=e.element.querySelector("form"),e.initForm(e.form))}))}return(0,i.Z)(t,[{key:"getElement",value:function(){throw"Subclasses of 'MarkupEditorModal' must implement 'getElement' method"}},{key:"initForm",value:function(t){var e=this;t.addEventListener("submit",(function(t){t.preventDefault();var n=new FormData(t.target);return e.submit(n,e.selection),!1}))}},{key:"reset",value:function(){this.element.querySelectorAll("input").forEach((function(t){t.value=""}))}},{key:"setData",value:function(t,e){}},{key:"submit",value:function(t,e){}},{key:"show",value:function(t){this.reset(),this.selection=t,this.setData(this.form,t),Y(this.element).modal("show")}},{key:"hide",value:function(){Y(this.element).modal("hide")}}]),t}(),$=function(t){(0,F.Z)(n,t);var e=G(n);function n(){return(0,a.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n,[{key:"getElement",value:function(){return document.getElementById("markup-editor-link-modal")}},{key:"setData",value:function(t,e){t.querySelector('[name="text"]').value=e.text().trim()}},{key:"submit",value:function(t,e){var n=X(t.get("url").trim()),a=t.get("text").trim();n&&(a?K(n,a)?e.replace("[url="+n+"]"+a+"[/url]"):e.replace("["+a+"]("+n+")"):e.replace("<"+n+">"),this.hide())}}]),n}(W),Q=function(t){(0,F.Z)(n,t);var e=G(n);function n(){return(0,a.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n,[{key:"getElement",value:function(){return document.getElementById("markup-editor-image-modal")}},{key:"submit",value:function(t,e){var n=X(t.get("url").trim()),a=t.get("text").trim();n&&(a?K(n,a)?e.replace("[img="+n+"]"+a+"[/img]"):e.replace("!["+a+"]("+n+")"):K(n,a)?e.replace("[img]"+n+"[/img]"):e.replace("!("+n+")"),this.hide())}}]),n}(W);function K(t,e){return t.indexOf("(")>=0||t.indexOf(")")>=0||e.indexOf("[")>=0||e.indexOf("]")>=0}function X(t){return J(t,"http://")||J(t,"https://")?t:"http://"+t}function J(t,e){return t.toLowerCase().substring(0,e.length)===e}var tt=function(t){(0,F.Z)(n,t);var e=G(n);function n(){return(0,a.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n,[{key:"getElement",value:function(){return document.getElementById("markup-editor-quote-modal")}},{key:"setData",value:function(t,e){t.querySelector('[name="text"]').value=e.text().trim()}},{key:"submit",value:function(t,e){var n=t.get("author").trim(),a=t.get("text").trim();if(a){var i=this.getQuotePrefix(e,n),o="\n[/quote]\n\n";e.replace(i+a+o,{start:i.length,end:o.length}),this.hide()}}},{key:"getQuotePrefix",value:function(t,e){var n=t.prefix().trim().length?"\n\n":"";return e?n+"[quote="+e+"]\n":n+"[quote]\n"}}]),n}(W),et=function(t){(0,F.Z)(n,t);var e=G(n);function n(){return(0,a.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n,[{key:"getElement",value:function(){return document.getElementById("markup-editor-code-modal")}},{key:"setData",value:function(t,e){t.querySelector('[name="code"]').value=e.text().trim()}},{key:"submit",value:function(t,e){var n=t.get("syntax").trim(),a=t.get("code").trim();if(a){var i=this.getQuotePrefix(e,n),o="\n[/code]\n\n";e.replace(i+a+o,{start:i.length,end:o.length}),this.hide()}}},{key:"getQuotePrefix",value:function(t,e){var n=t.prefix().trim().length?"\n\n":"";return e?n+"[code="+e+"]\n":n+"[code]\n"}}]),n}(W),nt=n(19755),at=function(){function t(){var e=this;(0,a.Z)(this,t),(0,o.Z)(this,"_onWindowResize",(function(){document.querySelectorAll("[misago-editor-active]").forEach(e._resizeEditor)})),(0,o.Z)(this,"_resizeEditor",(function(t){for(var n=e._getResizeConstraints(t),a=t.querySelector(".markup-editor-toolbar-left"),i=t.querySelector(".markup-editor-toolbar-secondary"),o=t.querySelector("[misago-editor-more]"),r=0,s=[],l=0;l<a.children.length;l++){var c=a.children[l];"true"!==c.getAttribute("misago-editor-more")&&(s.push({index:l,priority:parseInt(c.getAttribute("misago-editor-priority")||0),display:!0}),c.clientWidth&&(r+=n.btn))}if(r>n.toolbar){var u=n.toolbar-n.btn;s.sort((function(t,e){return t.priority>e.priority?1:t.priority<e.priority?-1:0})),s.forEach((function(t){r>u?(a.children[t.index].classList.add("d-none"),i.children[t.index].classList.remove("d-none"),t.display=!1,r-=n.btn):(a.children[t.index].classList.remove("d-none"),i.children[t.index].classList.add("d-none"),t.display=!0)}))}else if(r+n.btn<n.toolbar){r=0;var d=n.toolbar;s.sort((function(t,e){return t.priority>e.priority?-1:t.priority<e.priority?1:0})),s.forEach((function(t){r+n.btn<d?(a.children[t.index].classList.remove("d-none"),i.children[t.index].classList.add("d-none"),t.display=!0,r+=n.btn):(a.children[t.index].classList.add("d-none"),i.children[t.index].classList.remove("d-none"),t.display=!1)}))}0===s.filter((function(t){return!t.display})).length?(o.classList.add("d-none"),i.classList.remove("show")):o.classList.remove("d-none")})),(0,o.Z)(this,"_getResizeConstraints",(function(t){var e=t.querySelector(".markup-editor-toolbar-left"),n=0;e.querySelectorAll("button").forEach((function(t){var e=t.clientWidth,a=window.getComputedStyle(t);e+=parseInt(parseFloat(a.borderLeftWidth)),e+=parseInt(parseFloat(a.borderRightWidth)),e+=parseInt(parseFloat(a.marginLeft)),(e+=parseInt(parseFloat(a.marginRight)))>n&&(n=e)}));var a=e.parentElement.clientWidth-n;return{btn:n,toolbar:a}})),(0,o.Z)(this,"setAction",(function(t,n){e.actions[t]=n})),(0,o.Z)(this,"activate",(function(t){"true"!==t.getAttribute("misago-editor-active")&&(e._setEditorActive(t),e._setEditorFocus(t),e._setEditorActions(t),e._setEditorPasteUpload(t),e._setEditorDropUpload(t),e._resizeEditor(t))})),(0,o.Z)(this,"_setEditorPasteUpload",(function(t){t.addEventListener("paste",(function(n){if(n.clipboardData.files.length){var a=new M(e,t);if(a.canUpload){n.preventDefault();var i=n.target.closest("textarea");a.uploadFiles(n.clipboardData.files,i)}else a.showPermissionDeniedError()}}))})),(0,o.Z)(this,"_setEditorDropUpload",(function(t){var n="markup-editor-drag-drop",a=[t.querySelector("textarea")],i=t.querySelector("[misago-editor-attachments]");i&&a.push(i),a.forEach((function(a){a.addEventListener("drop",(function(i){var o=new M(e,t);if(i.dataTransfer.files.length)if(i.preventDefault(),o.canUpload){if(i.dataTransfer.files){var r=i.target.closest("textarea");o.uploadFiles(i.dataTransfer.files,r)}}else o.showPermissionDeniedError();a.classList.remove(n)})),a.addEventListener("dragenter",(function(t){t.preventDefault()})),a.addEventListener("dragleave",(function(){a.classList.remove(n)})),a.addEventListener("dragover",(function(t){a.classList.add(n),t.preventDefault()}))}))})),this.actions={},this.codeModal=new et,this.linkModal=new $,this.imageModal=new Q,this.quoteModal=new tt,this.resizeDebounce=null,window.addEventListener("resize",(function(t){e.resizeDebounce&&window.clearTimeout(e.resizeDebounce),e.resizeDebounce=window.setTimeout(e._onWindowResize,200)}))}return(0,i.Z)(t,[{key:"_setEditorActive",value:function(t){t.setAttribute("misago-editor-active","true")}},{key:"_setEditorFocus",value:function(t){var e=["focusin","click"],n="markup-editor-focused";e.forEach((function(e){t.addEventListener(e,(function(){t.classList.add(n)}))})),e.forEach((function(e){document.addEventListener(e,(function(e){t.contains(e.target)||t.classList.remove(n)}))}))}},{key:"_setEditorActions",value:function(t){var e=this,n=this.getTextarea(t);t.addEventListener("click",(function(t){var a=t.target.closest("[misago-editor-action]");if(!a)return null;var i=a.getAttribute("misago-editor-action");if(!i)return null;t.preventDefault();var o=e.actions[i];o?o({textarea:n,target:a,editor:e,selection:new it(n)}):console.warn("Undefined editor action: "+i)})),t.querySelector("[misago-editor-more]").addEventListener("click",(function(){var e=t.querySelector(".markup-editor-toolbar-secondary");e.classList.contains("show")?e.classList.remove("show"):e.classList.add("show")}))}},{key:"getTextarea",value:function(t){return t.querySelector("textarea")}},{key:"getSelection",value:function(t){return new it(t)}},{key:"showFilePrompt",value:function(t,e){var n=new M(this,t.closest("[misago-editor-active]"));n.canUpload?n.prompt(e):n.showPermissionDeniedError()}},{key:"showCodeModal",value:function(t){this.codeModal.show(t)}},{key:"showLinkModal",value:function(t){this.linkModal.show(t)}},{key:"showImageModal",value:function(t){this.imageModal.show(t)}},{key:"showQuoteModal",value:function(t){this.quoteModal.show(t)}},{key:"getAttachmentByKey",value:function(t){return document.querySelector('[misago-editor-upload-key="'+t+'"]')}},{key:"removeAttachmentElement",value:function(t){var e=t.closest("ul");T(t,(function(){e.querySelector("li")||e.closest(".markup-editor-attachments-list").classList.add("d-none")}))}}]),t}(),it=function(){function t(e){(0,a.Z)(this,t),this.textarea=e,this._range=this._getRange()}return(0,i.Z)(t,[{key:"get",value:function(){return this._range}},{key:"prefix",value:function(){return this._range.prefix}},{key:"suffix",value:function(){return this._range.suffix}},{key:"zero",value:function(){return 0===this._range.length}},{key:"empty",value:function(){return 0===this._range.text.trim().length}},{key:"text",value:function(){return this._range.text}},{key:"wrap",value:function(t,e){var n=this._range.prefix;n+=t+this._range.text+e,n+=this._range.suffix,this.textarea.value=n,this._range.start+=t.length,this._range.end+=t.length,this._range.length=this._range.end-this._range.start,this.refocus()}},{key:"replace",value:function(t,e){var n=this._range.prefix+t+this._range.suffix;this.textarea.value=n,e&&e.start&&(this._range.start+=e.start),this._range.end=this._range.start+t.length,e&&(e.start&&(this._range.end-=e.start),e.end&&(this._range.end-=e.end)),this._range.length=this._range.end-this._range.start,this.refocus()}},{key:"insert",value:function(t,e){var n=e&&e.whitespace||"",a=n?this._range.prefix.trimEnd():this._range.prefix,i=n?this._range.suffix.trim():this._range.suffix,o=1,r=a;a.length&&n&&(r+=n,o+=1),r+=t+n+i,this.textarea.value=r;var s=a.length+t.length+n.length*o;this._range.end=this._range.start=s,this._range.length=0,this.refocus()}},{key:"replaceAttachments",value:function(t){this.textarea.value=this.textarea.value.replace(/<attachment=(.+?)>/gi,(function(e,n){if(1!==n.match(/:/g).length)return e;for(var a=n.trim();'"'===a.substring(0,1);)a=a.substring(1);for(;'"'===a.substring(a.length-1);)a=a.substring(0,a.length-1);var i=a.substring(0,a.indexOf(":")).trim(),o=a.substring(a.indexOf(":")+1).trim();if(o){var r=t({match:e,name:i,id:o});if("string"==typeof r||r instanceof String)return r}return e}))}},{key:"refocus",value:function(){var t=this;window.setTimeout((function(){var e=t.textarea.scrollTop;t.textarea.focus(),t.textarea.scrollTop=e;var n=t._range.start;t.textarea.setSelectionRange(n,n+t._range.length)}),250)}},{key:"_getRange",value:function(){if(document.selection){this.textarea.focus();var t=document.selection.createRange(),e=t.text.length;return t.moveStart("character",-this.textarea.value.length),this._createRange(this.textarea,t.text.length-e,t.text.length)}if(this.textarea.selectionStart||"0"==this.textarea.selectionStart)return this._createRange(this.textarea,this.textarea.selectionStart,this.textarea.selectionEnd)}},{key:"_createRange",value:function(t,e,n){return{start:e,end:n,length:n-e,text:t.value.substring(e,n),prefix:t.value.substring(0,e),suffix:t.value.substring(n)}}}]),t}(),ot=new at;const rt=ot;ot.setAction("strong",(function(t){var e=t.selection;e.empty()?e.replace("**"+pgettext("example markup","Strong text")+"**",{start:2,end:2}):e.wrap("**","**")})),ot.setAction("emphasis",(function(t){var e=t.selection;e.empty()?e.replace("_"+pgettext("example markup","Text with emphasis")+"_",{start:1,end:1}):e.wrap("_","_")})),ot.setAction("strikethrough",(function(t){var e=t.selection;e.empty()?e.replace("~~"+pgettext("example markup","Text with strikethrough")+"~~",{start:2,end:2}):e.wrap("~~","~~")})),ot.setAction("horizontal-ruler",(function(t){t.selection.insert("- - -",{whitespace:"\n\n"})})),ot.setAction("link",(function(t){var e=t.editor,n=t.selection;e.showLinkModal(n)})),ot.setAction("image",(function(t){var e=t.editor,n=t.selection;e.showImageModal(n)})),ot.setAction("quote",(function(t){var e=t.editor,n=t.selection;e.showQuoteModal(n)})),ot.setAction("spoiler",(function(t){var e=t.selection,n=e.prefix().trim().length?"\n\n[spoiler]\n":"[spoiler]\n",a="\n[/spoiler]\n\n";e.empty()?e.replace(n+pgettext("example markup","Spoiler text")+a,{start:n.length,end:a.length}):e.wrap(n,a)})),ot.setAction("code",(function(t){var e=t.editor,n=t.selection;e.showCodeModal(n)})),ot.setAction("attachment",(function(t){var e=t.target,n=t.selection,a=e.getAttribute("misago-editor-attachment");a&&n.insert("<attachment="+a+">",{whitespace:"\n\n"})})),ot.setAction("image-upload",(function(t){var e=t.editor,n=t.target;e.showFilePrompt(n,{accept:"image",insert:!0})})),ot.setAction("attachment-upload",(function(t){var e=t.editor,n=t.target;e.showFilePrompt(n)})),ot.setAction("attachment-delete",(function(t){var e=t.editor,n=t.target,a=t.selection,i=n.getAttribute("misago-editor-attachment"),o=n.closest("[misago-editor-deleted-attachments-name]").getAttribute("misago-editor-deleted-attachments-name");a.replaceAttachments((function(t){return t.id===i&&""}));var r=n.closest("li");e.removeAttachmentElement(r);var s=document.createElement("input");s.setAttribute("type","hidden"),s.setAttribute("name",o),s.setAttribute("value",i),n.closest("[misago-editor-attachments]").appendChild(s)})),ot.setAction("attachment-error-dismiss",(function(t){var e=t.editor,n=t.target,a=t.selection,i=n.getAttribute("misago-editor-attachment-key");a.replaceAttachments((function(t){return t.id===i&&""}));var o=document.querySelector('[misago-editor-attachment-error="'+i+'"]');o&&T(o);var r=e.getAttachmentByKey(i);r&&e.removeAttachmentElement(r)})),ot.setAction("formatting-help",(function(t){var e=t.target,n=document.getElementById("markup-editor-formatting-help"),a=e.closest("a");r.Z.ajax("GET",a.href,{target:n,swap:"innerHTML"}).then((function(){nt(n).modal("show")}))}));const st=rt;var lt=n(19755);r.Z.onLoad((function(){document.querySelectorAll("[misago-page-form]").forEach((function(t){var e;""===t.getAttribute("misago-page-form")&&((e=t).setAttribute("misago-page-form","true"),e.addEventListener("submit",(function(t){var n=e.getAttribute("misago-page"),a=t.target.querySelector("input"),i=a.value;if(i>=a.min&&i<=a.max&&i!=n){var o=e.getAttribute("misago-page-url");i>1&&(o+=i+"/"),window.history.pushState({},"",o),document.getElementById("misago-page-scroll-target").scrollIntoView(),r.Z.ajax("GET",o,{target:"#misago-htmx-root",swap:"outerHTML"})}return e.closest(".dropdown").querySelector("[data-toggle]")&&lt().dropdown("toggle"),t.preventDefault(),!1})))}))})),n(59180);var ct=n(19755),ut=new c,dt=new A,pt=new(function(){function t(){(0,a.Z)(this,t),(0,o.Z)(this,"hideMarkAsReadModal",(function(){ct("#mark-as-read").modal("hide")})),this._initializers=[],this._context={},this.loader=ut,this.editor=st,this.lightbox=dt}return(0,i.Z)(t,[{key:"addInitializer",value:function(t){this._initializers.push({key:t.name,item:t.initializer,after:t.after,before:t.before})}},{key:"init",value:function(t){var e=this;this._context=t,new s(this._initializers).orderedValues().forEach((function(t){t(e)}))}},{key:"has",value:function(t){return!!this._context[t]}},{key:"get",value:function(t,e){return this.has(t)?this._context[t]:e||void 0}},{key:"pop",value:function(t){if(this.has(t)){var e=this._context[t];return this._context[t]=null,e}}},{key:"snackbar",value:function(t,e){w(t,e)}},{key:"snackbarInfo",value:function(t){!function(t){w("info",t)}(t)}},{key:"snackbarSuccess",value:function(t){!function(t){w("success",t)}(t)}},{key:"snackbarWarning",value:function(t){!function(t){w("warning",t)}(t)}},{key:"snackbarError",value:function(t){C(t)}},{key:"bulkModeration",value:function(t){return new d(t)}}]),t}());window.misago=pt;const ht=pt;document.addEventListener("htmx:beforeRequest",(function(t){l(t.target)&&ut.show()})),document.addEventListener("htmx:afterRequest",(function(t){l(t.target)&&ut.hide()})),document.addEventListener("htmx:load",(function(){document.querySelectorAll("[misago-editor-active='false']").forEach(rt.activate)})),document.addEventListener("misago:afterModeration",(function(){ct("#threads-moderation-modal").modal("hide")})),document.addEventListener("submit",(function(t){var e=t.target.closest("form[misago-confirm]");e&&!window.confirm(e.getAttribute("misago-confirm"))&&t.preventDefault()}))},58339:(t,e,n)=>{"use strict";var a=n(34458),i=n(78657);a.Z.addInitializer({name:"ajax",initializer:function(){i.Z.init(a.Z.get("CSRF_COOKIE_NAME"))}})},64109:(t,e,n)=>{"use strict";var a=n(34458),i=n(35486),o=n(78657),r=n(53904),s=n(90287);a.Z.addInitializer({name:"auth-sync",initializer:function(t){t.get("isAuthenticated")&&window.setInterval((function(){o.Z.get(t.get("AUTH_API")).then((function(t){s.Z.dispatch((0,i.r$)(t))}),(function(t){r.Z.apiError(t)}))}),45e3)},after:"auth"})},46226:(t,e,n)=>{"use strict";var a=n(34458),i=n(98274),o=n(59801),r=n(90287),s=n(62833);a.Z.addInitializer({name:"auth",initializer:function(){i.Z.init(r.Z,s.Z,o.Z)},after:"store"})},93240:(t,e,n)=>{"use strict";var a=n(34458),i=n(78657),o=n(93825),r=n(96142),s=n(53904);a.Z.addInitializer({name:"captcha",initializer:function(t){o.ZP.init(t,i.Z,r.Z,s.Z)}})},75147:(t,e,n)=>{"use strict";var a=n(22928),i=n(57588),o=n.n(i),r=n(34458),s=n(15671),l=n(43144),c=n(97326),u=n(79340),d=n(6215),p=n(61120),h=n(4942),m=n(78657);var v=function(t){(0,u.Z)(o,t);var e,n,i=(e=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function o(t){var e;return(0,s.Z)(this,o),e=i.call(this,t),(0,h.Z)((0,c.Z)(e),"handleDecline",(function(){e.state.submiting||window.confirm(pgettext("accept agreement prompt","Declining will result in immediate deactivation and deletion of your account. This action is not reversible."))&&(e.setState({submiting:!0}),m.Z.post(e.props.api,{accept:!1}).then((function(){window.location.reload(!0)})))})),(0,h.Z)((0,c.Z)(e),"handleAccept",(function(){e.state.submiting||(e.setState({submiting:!0}),m.Z.post(e.props.api,{accept:!0}).then((function(){window.location.reload(!0)})))})),e.state={submiting:!1},e}return(0,l.Z)(o,[{key:"render",value:function(){return(0,a.Z)("div",{},void 0,(0,a.Z)("button",{className:"btn btn-default",disabled:this.state.submiting,type:"buton",onClick:this.handleDecline},void 0,pgettext("accept agreement choice","Decline")),(0,a.Z)("button",{className:"btn btn-primary",disabled:this.state.submiting,type:"buton",onClick:this.handleAccept},void 0,pgettext("accept agreement choice","Accept and continue")))}}]),o}(o().Component),f=n(4869);r.Z.addInitializer({name:"component:accept-agreement",initializer:function(t){document.getElementById("required-agreement-mount")&&(0,f.Z)((0,a.Z)(v,{api:t.get("REQUIRED_AGREEMENT_API")}),"required-agreement-mount",!1)},after:"store"})},4894:(t,e,n)=>{"use strict";var a=n(37424),i=n(34458),o=n(22928),r=n(15671),s=n(43144),l=n(79340),c=n(6215),u=n(61120),d=n(57588);var p=function(t){(0,l.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,u.Z)(e);if(n){var i=(0,u.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,c.Z)(this,t)});function i(){return(0,r.Z)(this,i),a.apply(this,arguments)}return(0,s.Z)(i,[{key:"refresh",value:function(){window.location.reload()}},{key:"getMessage",value:function(){return this.props.signedIn?interpolate(pgettext("auth message","You have signed in as %(username)s. Please refresh the page before continuing."),{username:this.props.signedIn.username},!0):this.props.signedOut?interpolate(pgettext("auth message","%(username)s, you have been signed out. Please refresh the page before continuing."),{username:this.props.user.username},!0):void 0}},{key:"render",value:function(){var t="auth-message";return(this.props.signedIn||this.props.signedOut)&&(t+=" show"),(0,o.Z)("div",{className:t},void 0,(0,o.Z)("div",{className:"container"},void 0,(0,o.Z)("p",{className:"lead"},void 0,this.getMessage()),(0,o.Z)("p",{},void 0,(0,o.Z)("button",{className:"btn btn-default",type:"button",onClick:this.refresh},void 0,pgettext("auth message","Reload page")),(0,o.Z)("span",{className:"hidden-xs hidden-sm"},void 0," "+pgettext("auth message","or press F5 key.")))))}}]),i}(n.n(d)().Component);function h(t){return{user:t.auth.user,signedIn:t.auth.signedIn,signedOut:t.auth.signedOut}}var m=n(4869);i.Z.addInitializer({name:"component:auth-message",initializer:function(){(0,m.Z)((0,a.$j)(h)(p),"auth-message-mount")},after:"store"})},29223:(t,e,n)=>{"use strict";var a=n(34458),i=n(93051);a.Z.addInitializer({name:"component:banmed-page",initializer:function(t){t.has("BAN_MESSAGE")&&(0,i.Z)(t.get("BAN_MESSAGE"),!1)},after:"store"})},73806:(t,e,n)=>{"use strict";var a,i=n(22928),o=n(57588),r=n.n(o),s=n(73935),l=n.n(s),c=n(37424),u=n(993),d=n(40689),p=n(80261),h=n(15671),m=n(43144),v=n(79340),f=n(6215),Z=n(61120),g=n(59801),y=n(14467);const b=function(t){(0,v.Z)(r,t);var e,n,o=(e=r,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,Z.Z)(e);if(n){var i=(0,Z.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,f.Z)(this,t)});function r(){return(0,h.Z)(this,r),o.apply(this,arguments)}return(0,m.Z)(r,[{key:"componentDidMount",value:function(){"?modal=login"===window.document.location.search&&window.setTimeout((function(){return g.Z.show(a||(a=(0,i.Z)(y.Z,{})))}),300)}},{key:"render",value:function(){return null}}]),r}(r().Component);function k(t){var e=t.logo,n=t.logoXs,a=t.text,o=t.url;return e?(0,i.Z)("div",{className:"navbar-branding"},void 0,(0,i.Z)("a",{href:o,className:"navbar-branding-logo"},void 0,(0,i.Z)("img",{src:e,alt:a}))):(0,i.Z)("div",{className:"navbar-branding"},void 0,!!n&&(0,i.Z)("a",{href:o,className:"navbar-branding-logo-xs"},void 0,(0,i.Z)("img",{src:n,alt:a})),!!a&&(0,i.Z)("a",{href:o,className:"navbar-branding-text"},void 0,a))}function _(t){var e=t.items;return(0,i.Z)("ul",{className:"navbar-extra-menu",role:"nav"},void 0,e.map((function(t,e){return(0,i.Z)("li",{className:t.className},e,(0,i.Z)("a",{href:t.url,target:t.targetBlank?"_blank":null,rel:t.rel},void 0,t.title))})))}var x,N=n(49021),w=n(97326),C=n(4942),R=n(63026),E=n(66462),S=n(94184),L=n.n(S);function O(t){var e=t.children,n=t.showAll,a=t.showUnread,o=t.unread;return(0,i.Z)("div",{className:"notifications-dropdown-body"},void 0,(0,i.Z)(N.Aw,{},void 0,pgettext("notifications title","Notifications")),(0,i.Z)(N.KE,{},void 0,(0,i.Z)(P,{active:!o,onClick:n},void 0,pgettext("notifications dropdown","All")),(0,i.Z)(P,{active:o,onClick:a},void 0,pgettext("notifications dropdown","Unread"))),e,(0,i.Z)(N.kE,{},void 0,(0,i.Z)("a",{className:"btn btn-default btn-block",href:misago.get("NOTIFICATIONS_URL")},void 0,pgettext("notifications","See all notifications"))))}function P(t){var e=t.active,n=t.children,a=t.onClick;return(0,i.Z)("button",{className:L()("btn",{"btn-primary":e,"btn-default":!e}),type:"button",onClick:a},void 0,n)}const A=function(t){(0,v.Z)(o,t);var e,n,a=(e=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,Z.Z)(e);if(n){var i=(0,Z.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,f.Z)(this,t)});function o(t){var e;return(0,h.Z)(this,o),e=a.call(this,t),(0,C.Z)((0,w.Z)(e),"render",(function(){return(0,i.Z)(O,{unread:e.state.unread,showAll:function(){return e.setState({unread:!1})},showUnread:function(){return e.setState({unread:!0})}},void 0,(0,i.Z)(R.Z,{filter:e.state.unread?"unread":"all",disabled:!e.props.active},void 0,(function(t){var n=t.data,a=t.loading,o=t.error;return a?x||(x=(0,i.Z)(E.Pu,{})):o?(0,i.Z)(E.lb,{error:o}):(0,i.Z)(E.uE,{filter:e.state.unread?"unread":"all",items:n?n.results:[]})})))})),e.state={unread:!1,url:""},e}return(0,m.Z)(o,[{key:"getApiUrl",value:function(){return misago.get("NOTIFICATIONS_API")+"?limit=20"+(this.state.unread?"&filter=unread":"")}}]),o}(r().Component);function T(t){var e=t.id,n=t.className,a=t.badge,o=t.url,r=t.active,s=t.onClick,l=a?pgettext("navbar","You have unread notifications!"):pgettext("navbar","Open notifications");return(0,i.Z)("a",{id:e,className:L()("btn btn-navbar-icon",n,{active:r}),href:o,title:l,onClick:s},void 0,!!a&&(0,i.Z)("span",{className:"navbar-item-badge"},void 0,a),(0,i.Z)("span",{className:"material-icon"},void 0,a?"notifications_active":"notifications_none"))}function I(t){var e=t.id,n=t.className,a=t.badge,o=t.url;return(0,i.Z)(N.Lt,{id:e,toggle:function(t){var e=t.isOpen,r=t.toggle;return(0,i.Z)(T,{className:n,active:e,badge:a,url:o,onClick:function(t){t.preventDefault(),r()}})},menuClassName:"notifications-dropdown",menuAlignRight:!0},void 0,(function(t){var e=t.isOpen;return(0,i.Z)(A,{active:e})}))}var B;function j(t){var e=t.id,n=t.className,a=t.badge,o=t.url,r=t.active,s=t.onClick,l=a?pgettext("navbar","You have unread private threads!"):pgettext("navbar","Open private threads");return(0,i.Z)("a",{id:e,className:L()("btn btn-navbar-icon",n,{active:r}),href:o,title:l,onClick:s},void 0,!!a&&(0,i.Z)("span",{className:"navbar-item-badge"},void 0,a),B||(B=(0,i.Z)("span",{className:"material-icon"},void 0,"inbox")))}var D,U,z,q=n(11920);function M(t){var e=t.id,n=t.className,a=t.url,o=t.active,r=t.onClick;return(0,i.Z)("a",{id:e,className:L()("btn btn-navbar-icon",n,{active:o}),href:a,title:pgettext("navbar","Open search"),onClick:r},void 0,D||(D=(0,i.Z)("span",{className:"material-icon"},void 0,"search")))}function F(t){var e=t.id,n=t.className,a=t.url;return(0,i.Z)(N.Lt,{id:e,toggle:function(t){var e=t.isOpen,o=t.toggle;return(0,i.Z)(M,{className:n,active:e,url:a,onClick:function(t){t.preventDefault(),o(),window.setTimeout((function(){document.querySelector(".search-dropdown .form-control-search").focus()}),0)}})},menuClassName:"search-dropdown",menuAlignRight:!0},void 0,(function(){return U||(U=(0,i.Z)(q.E,{}))}))}function H(t){var e=t.id,n=t.className,a=t.active,o=t.onClick;return(0,i.Z)("button",{id:e,className:L()("btn btn-navbar-icon",n,{active:a}),title:pgettext("navbar","Open menu"),type:"button",onClick:o},void 0,z||(z=(0,i.Z)("span",{className:"material-icon"},void 0,"menu")))}var V=n(6333);function Y(t){var e=t.id,n=t.className;return(0,i.Z)(N.Lt,{id:e,toggle:function(t){var e=t.isOpen,a=t.toggle;return(0,i.Z)(H,{className:n,active:e,onClick:a})},menuClassName:"site-nav-dropdown",menuAlignRight:!0},void 0,(function(t){t.isOpen;var e=t.close;return(0,i.Z)(V.bS,{close:e})}))}var G=n(19605);function W(t){var e=t.id,n=t.className,a=t.user,o=t.active,r=t.onClick;return(0,i.Z)("a",{id:e,className:L()("btn-navbar-image",n,{active:o}),href:a.url,title:pgettext("navbar","Open your options"),onClick:r},void 0,(0,i.Z)(G.ZP,{user:a,size:34}))}var $,Q,K,X,J=n(28166);function tt(t){var e=t.id,n=t.className,a=t.user;return(0,i.Z)(N.Lt,{id:e,toggle:function(t){var e=t.isOpen,o=t.toggle;return(0,i.Z)(W,{className:n,active:e,user:a,onClick:function(t){t.preventDefault(),o()}})},menuClassName:"user-nav-dropdown",menuAlignRight:!0},void 0,(function(t){t.isOpen;var e=t.close;return(0,i.Z)(J.o4,{close:e})}))}const et=(0,c.$j)((function(t){var e=misago.get("SETTINGS"),n=t.auth.user;return{branding:{logo:e.logo,logoXs:e.logo_small,text:e.logo_text,url:misago.get("MISAGO_PATH")},extraMenuItems:misago.get("extraMenuItems"),user:n.id?{id:n.id,username:n.username,email:n.email,avatars:n.avatars,unreadNotifications:n.unreadNotifications,unreadPrivateThreads:n.unread_private_threads,url:n.url}:null,searchUrl:misago.get("SEARCH_URL"),notificationsUrl:misago.get("NOTIFICATIONS_URL"),privateThreadsUrl:misago.get("PRIVATE_THREADS_URL"),authDelegated:e.enable_oauth2_client,showSearch:!!n.acl.can_search,showPrivateThreads:!!n&&!!n.acl.can_use_private_threads}}))((function(t){var e=t.dispatch,n=t.branding,a=t.extraMenuItems,o=t.authDelegated,s=t.user,l=t.searchUrl,c=t.notificationsUrl,h=t.privateThreadsUrl,m=t.showSearch,v=t.showPrivateThreads;return(0,i.Z)("div",{className:"container navbar-container"},void 0,r().createElement(k,n),(0,i.Z)("div",{className:"navbar-right"},void 0,a.length>0&&(0,i.Z)(_,{items:a}),!!m&&(0,i.Z)(F,{id:"navbar-search-dropdown",url:l}),!!m&&(0,i.Z)(M,{id:"navbar-search-overlay",url:l,onClick:function(t){e(u.UL()),t.preventDefault()}}),$||($=(0,i.Z)(Y,{id:"navbar-site-nav-dropdown"})),(0,i.Z)(H,{id:"navbar-site-nav-overlay",onClick:function(){e(u.AU())}}),!!v&&(0,i.Z)(j,{id:"navbar-private-threads",badge:s.unreadPrivateThreads,url:h}),!!s&&(0,i.Z)(I,{id:"navbar-notifications-dropdown",badge:s.unreadNotifications,url:c}),!!s&&(0,i.Z)(T,{id:"navbar-notifications-overlay",badge:s.unreadNotifications,url:c,onClick:function(t){e(u.hN()),t.preventDefault()}}),!!s&&(0,i.Z)(tt,{id:"navbar-user-nav-dropdown",user:s}),!!s&&(0,i.Z)(W,{id:"navbar-user-nav-overlay",user:s,onClick:function(t){e(u.T5()),t.preventDefault()}}),!s&&(Q||(Q=(0,i.Z)(p.Z,{className:"btn-navbar-sign-in"}))),!s&&!o&&(K||(K=(0,i.Z)(d.Z,{className:"btn-navbar-register"}))),!s&&!o&&(X||(X=(0,i.Z)(b,{})))))}));var nt,at=n(90287);misago.addInitializer({name:"component:navbar",initializer:function(t){var e=document.getElementById("misago-navbar");l().render((0,i.Z)(c.zt,{store:at.Z.getStore()},void 0,nt||(nt=(0,i.Z)(et,{}))),e)},after:"store"})},27015:(t,e,n)=>{"use strict";var a,i=n(22928),o=n(57588),r=n.n(o),s=n(73935),l=n.n(s),c=n(37424),u=n(15671),d=n(43144),p=n(97326),h=n(79340),m=n(6215),v=n(61120),f=n(4942),Z=n(63026),g=n(66462),y=n(94184),b=n.n(y),k=n(49021),_=n(64836);function x(t){var e=t.children,n=t.open,a=t.showAll,o=t.showUnread,r=t.unread;return(0,i.Z)(_.a,{open:n},void 0,(0,i.Z)(_.i,{},void 0,pgettext("notifications title","Notifications")),(0,i.Z)(k.KE,{},void 0,(0,i.Z)(N,{active:!r,onClick:a},void 0,pgettext("notifications dropdown","All")),(0,i.Z)(N,{active:r,onClick:o},void 0,pgettext("notifications dropdown","Unread"))),e,(0,i.Z)(k.kE,{},void 0,(0,i.Z)("a",{className:"btn btn-default btn-block",href:misago.get("NOTIFICATIONS_URL")},void 0,pgettext("notifications","See all notifications"))))}function N(t){var e=t.active,n=t.children,a=t.onClick;return(0,i.Z)("button",{className:b()("btn",{"btn-primary":e,"btn-default":!e}),type:"button",onClick:a},void 0,n)}var w=function(t){(0,h.Z)(r,t);var e,n,o=(e=r,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,v.Z)(e);if(n){var i=(0,v.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,m.Z)(this,t)});function r(t){var e;return(0,u.Z)(this,r),e=o.call(this,t),(0,f.Z)((0,p.Z)(e),"render",(function(){return(0,i.Z)(x,{open:e.props.open,unread:e.state.unread,showAll:function(){return e.setState({unread:!1})},showUnread:function(){return e.setState({unread:!0})}},void 0,(0,i.Z)(Z.Z,{filter:e.state.unread?"unread":"all",disabled:!e.props.open},void 0,(function(t){var n=t.data,o=t.loading,r=t.error;return o?a||(a=(0,i.Z)(g.Pu,{})):r?(0,i.Z)(g.lb,{error:r}):(0,i.Z)(g.uE,{filter:e.state.unread?"unread":"all",items:n?n.results:[]})})))})),e.body=document.body,e.state={unread:!1,url:""},e}return(0,d.Z)(r,[{key:"getApiUrl",value:function(){return misago.get("NOTIFICATIONS_API")+"?limit=20"+(this.state.unread?"&filter=unread":"")}},{key:"componentDidUpdate",value:function(t,e){t.open!==this.props.open&&(this.props.open?this.body.classList.add("notifications-fullscreen"):this.body.classList.remove("notifications-fullscreen"))}}]),r}(r().Component);const C=(0,c.$j)((function(t){return{open:t.overlay.notifications}}))(w);var R,E=n(90287);misago.addInitializer({name:"component:notifications-overlay",initializer:function(t){if(t.get("isAuthenticated")){var e=document.getElementById("notifications-mount");l().render((0,i.Z)(c.zt,{store:E.Z.getStore()},void 0,R||(R=(0,i.Z)(C,{}))),e)}},after:"store"})},88097:(t,e,n)=>{"use strict";var a=n(22928),i=n(57588),o=n.n(i),r=n(73935),s=n.n(r),l=n(37424),c=n(69987),u=n(99755);function d(){return(0,a.Z)(u.Iv,{header:pgettext("notifications title","Notifications"),styleName:"notifications"})}var p=n(87462),h=n(15861),m=n(64687),v=n.n(m),f=n(35486),Z=n(53904),g=n(60642),y=n(63026);const b=function(t){var e=t.title,n=t.subtitle,a=[];return n&&a.push(n),e&&a.push(e),a.push(misago.get("SETTINGS").forum_name),document.title=a.join(" | "),null};var k=n(59131),_=n(66462);function x(t){var e=t.children;return(0,a.Z)("ul",{className:"nav nav-pills"},void 0,e)}var N=n(94184),w=n.n(N);function C(t){var e=t.active,n=t.link,i=t.icon,o=t.children;return(0,a.Z)("li",{className:w()({active:e})},void 0,(0,a.Z)(c.rU,{to:n,activeClassName:""},void 0,!!i&&(0,a.Z)("span",{className:"material-icon"},void 0,i),o))}var R=n(92490);function E(t){var e=t.filter,n=misago.get("NOTIFICATIONS_URL");return(0,a.Z)(R.o8,{},void 0,(0,a.Z)(R.Z2,{auto:!0},void 0,(0,a.Z)(R.Eg,{},void 0,(0,a.Z)(x,{},void 0,(0,a.Z)(C,{active:"all"===e,link:n},void 0,pgettext("notifications nav","All")),(0,a.Z)(C,{active:"unread"===e,link:n+"unread/"},void 0,pgettext("notifications nav","Unread")),(0,a.Z)(C,{active:"read"===e,link:n+"read/"},void 0,pgettext("notifications nav","Read"))))))}var S,L,O,P=n(82211);function A(t){var e=t.baseUrl,n=t.data,i=t.disabled;return(0,a.Z)("div",{className:"misago-pagination"},void 0,(0,a.Z)(T,{url:e,disabled:i||!n||!n.hasPrevious},void 0,pgettext("notifications pagination","Latest")),(0,a.Z)(T,{url:e+"?before="+(n?n.firstCursor:""),disabled:i||!n||!n.hasPrevious},void 0,pgettext("notifications pagination","Newer")),(0,a.Z)(T,{url:e+"?after="+(n?n.lastCursor:""),disabled:i||!n||!n.hasNext},void 0,pgettext("notifications pagination","Older")))}function T(t){var e=t.disabled,n=t.children,i=t.url;return e?(0,a.Z)("button",{className:"btn btn-default",type:"disabled",disabled:!0},void 0,n):(0,a.Z)(c.rU,{to:i,className:"btn btn-default",activeClassName:""},void 0,n)}function I(t){var e=t.baseUrl,n=t.data,i=t.disabled,o=t.bottom,r=t.markAllAsRead;return(0,a.Z)(R.o8,{},void 0,(0,a.Z)(R.Z2,{},void 0,(0,a.Z)(R.Eg,{},void 0,(0,a.Z)(A,{baseUrl:e,data:n,disabled:i}))),S||(S=(0,a.Z)(R.tw,{})),(0,a.Z)(R.Z2,{className:w()({"hidden-xs":!o})},void 0,(0,a.Z)(R.Eg,{},void 0,(0,a.Z)(P.Z,{className:"btn-default btn-block",type:"button",disabled:i||!n||!n.unreadNotifications,onClick:r},void 0,L||(L=(0,a.Z)("span",{className:"material-icon"},void 0,"done_all")),pgettext("notifications","Mark all as read")))))}function B(t){return"unread"===t?pgettext("notifications title","Unread notifications"):"read"===t?pgettext("notifications title","Read notifications"):null}const j=(0,l.$j)()((function(t){var e=t.dispatch,n=t.location,i=t.route,r=n.query,s=i.props.filter,l=function(t){var e=misago.get("NOTIFICATIONS_URL");return"all"!==t&&(e+=t+"/"),e}(s);return(0,a.Z)(k.Z,{},void 0,(0,a.Z)(b,{title:pgettext("notifications title","Notifications"),subtitle:B(s)}),(0,a.Z)(E,{filter:s}),(0,a.Z)(y.Z,{filter:s,query:r},void 0,(function(t){var n,i=t.data,c=t.loading,u=t.error,d=t.refetch;return(0,a.Z)(g.D,{url:misago.get("NOTIFICATIONS_API")+"read-all/"},void 0,(function(t,m){var g,y=m.loading,b={baseUrl:l,data:i,disabled:c||y||!i||0===i.results.length,markAllAsRead:(g=(0,h.Z)(v().mark((function n(){return v().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:window.confirm(pgettext("notifications","Mark all notifications as read?"))&&t({onSuccess:function(){var t=(0,h.Z)(v().mark((function t(){return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:d(),e((0,f.yH)({unreadNotifications:null})),Z.Z.success(pgettext("notifications","All notifications have been marked as read."));case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),onError:Z.Z.apiError});case 2:case"end":return n.stop()}}),n)}))),function(){return g.apply(this,arguments)})};return c||y?(0,a.Z)("div",{},void 0,o().createElement(I,b),O||(O=(0,a.Z)(_.Pu,{})),o().createElement(I,(0,p.Z)({},b,{bottom:!0}))):u?(0,a.Z)("div",{},void 0,o().createElement(I,b),n||(n=(0,a.Z)(_.lb,{error:u})),o().createElement(I,(0,p.Z)({},b,{bottom:!0}))):i?(!i.hasPrevious&&r&&window.history.replaceState({},"",l),(0,a.Z)("div",{},void 0,o().createElement(I,b),(0,a.Z)(_.uE,{filter:s,items:i.results,hasNext:i.hasNext,hasPrevious:i.hasPrevious}),o().createElement(I,(0,p.Z)({},b,{bottom:!0})))):null}))})))}));var D;n(4517);const U=function(){var t=misago.get("NOTIFICATIONS_URL");return(0,a.Z)("div",{className:"page page-notifications"},void 0,D||(D=(0,a.Z)(d,{})),(0,a.Z)(c.F0,{history:c.mW,routes:[{path:t,component:j,props:{filter:"all"}},{path:t+"unread/",component:j,props:{filter:"unread"}},{path:t+"read/",component:j,props:{filter:"read"}}]}))};var z,q=n(90287);misago.addInitializer({name:"component:notifications",initializer:function(t){var e=misago.get("NOTIFICATIONS_URL");if(document.location.pathname.startsWith(e)&&!document.location.pathname.startsWith(e+"disable-email/")&&t.get("isAuthenticated")){var n=document.getElementById("page-mount");s().render((0,a.Z)(l.zt,{store:q.Z.getStore()},void 0,z||(z=(0,a.Z)(U,{}))),n)}},after:"store"})},46016:(t,e,n)=>{"use strict";var a,i=n(37424),o=n(22928),r=n(15671),s=n(43144),l=n(97326),c=n(79340),u=n(6215),d=n(61120),p=n(4942),h=n(57588),m=n.n(h),v=n(30381),f=n.n(v),Z=n(37848);var g,y=function(t){(0,c.Z)(l,t);var e,n,i=(e=l,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,d.Z)(e);if(n){var i=(0,d.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,u.Z)(this,t)});function l(){return(0,r.Z)(this,l),i.apply(this,arguments)}return(0,s.Z)(l,[{key:"render",value:function(){return a||(a=(0,o.Z)("div",{className:"panel-body panel-body-loading"},void 0,(0,o.Z)(Z.Z,{className:"loader loader-spaced"})))}}]),l}(m().Component),b=n(33556),k=n(34458),_=n(55547),x=n(53328);var N,w=function(t){(0,c.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,d.Z)(e);if(n){var i=(0,d.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,u.Z)(this,t)});function i(t){var e;return(0,r.Z)(this,i),e=a.call(this,t),(0,p.Z)((0,l.Z)(e),"update",(function(t){t.expires_on&&(t.expires_on=f()(t.expires_on)),e.setState({isLoaded:!0,error:null,ban:t})})),(0,p.Z)((0,l.Z)(e),"error",(function(t){e.setState({isLoaded:!0,error:t.detail,ban:null})})),k.Z.has("PROFILE_BAN")?e.initWithPreloadedData(k.Z.pop("PROFILE_BAN")):e.initWithoutPreloadedData(),e.startPolling(t.profile.api.ban),e}return(0,s.Z)(i,[{key:"initWithPreloadedData",value:function(t){t.expires_on&&(t.expires_on=f()(t.expires_on)),this.state={isLoaded:!0,ban:t}}},{key:"initWithoutPreloadedData",value:function(){this.state={isLoaded:!1}}},{key:"startPolling",value:function(t){_.Z.start({poll:"ban-details",url:t,frequency:9e4,update:this.update,error:this.error})}},{key:"componentDidMount",value:function(){x.Z.set({title:pgettext("profile ban details title","Ban details"),parent:this.props.profile.username})}},{key:"componentWillUnmount",value:function(){_.Z.stop("ban-details")}},{key:"getUserMessage",value:function(){return this.state.ban.user_message?(0,o.Z)("div",{className:"panel-body ban-message ban-user-message"},void 0,(0,o.Z)("h4",{},void 0,pgettext("profile ban details","User-shown ban message")),(0,o.Z)("div",{className:"lead",dangerouslySetInnerHTML:{__html:this.state.ban.user_message.html}})):null}},{key:"getStaffMessage",value:function(){return this.state.ban.staff_message?(0,o.Z)("div",{className:"panel-body ban-message ban-staff-message"},void 0,(0,o.Z)("h4",{},void 0,pgettext("profile ban details","Team-shown ban message")),(0,o.Z)("div",{className:"lead",dangerouslySetInnerHTML:{__html:this.state.ban.staff_message.html}})):null}},{key:"getExpirationMessage",value:function(){if(this.state.ban.expires_on){if(this.state.ban.expires_on.isAfter(f()())){var t=interpolate(pgettext("profile ban details","This ban expires on %(expires_on)s."),{expires_on:this.state.ban.expires_on.format("LL, LT")},!0),e=interpolate(pgettext("profile ban details","This ban expires %(expires_on)s."),{expires_on:this.state.ban.expires_on.fromNow()},!0);return(0,o.Z)("abbr",{title:t},void 0,e)}return pgettext("profile ban details","This ban has expired.")}return interpolate(pgettext("profile ban details","%(username)s's ban is permanent."),{username:this.props.profile.username},!0)}},{key:"getPanelBody",value:function(){return this.state.ban?Object.keys(this.state.ban).length?(0,o.Z)("div",{},void 0,this.getUserMessage(),this.getStaffMessage(),(0,o.Z)("div",{className:"panel-body ban-expires"},void 0,(0,o.Z)("h4",{},void 0,pgettext("profile ban details","Ban expiration")),(0,o.Z)("p",{className:"lead"},void 0,this.getExpirationMessage()))):(0,o.Z)("div",{},void 0,(0,o.Z)(b.Z,{message:pgettext("profile ban details","No ban is active at the moment.")})):this.state.error?(0,o.Z)("div",{},void 0,(0,o.Z)(b.Z,{icon:"error_outline",message:this.state.error})):g||(g=(0,o.Z)("div",{},void 0,(0,o.Z)(y,{})))}},{key:"render",value:function(){return(0,o.Z)("div",{className:"profile-ban-details"},void 0,(0,o.Z)("div",{className:"panel panel-default"},void 0,(0,o.Z)("div",{className:"panel-heading"},void 0,(0,o.Z)("h3",{className:"panel-title"},void 0,pgettext("profile ban details title","Ban details"))),this.getPanelBody()))}}]),i}(m().Component);function C(t){return t.display?(0,o.Z)(b.Z,{helpText:pgettext("user profile details","No profile details are editable at this time."),message:pgettext("user profile details","This option is currently unavailable.")}):null}function R(t){return t.display?N||(N=(0,o.Z)("div",{className:"panel-body"},void 0,(0,o.Z)(Z.Z,{}))):null}var E=n(60471);var S=function(t){(0,c.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,d.Z)(e);if(n){var i=(0,d.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,u.Z)(this,t)});function i(){var t;(0,r.Z)(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t=a.call.apply(a,[this].concat(n)),(0,p.Z)((0,l.Z)(t),"onChange",(function(e){var n=t.props,a=n.field;(0,n.onChange)(a.fieldname,e.target.value)})),t}return(0,s.Z)(i,[{key:"render",value:function(){var t=this.props,e=t.disabled,n=t.field,a=t.value,i=n.input;return"select"===i.type?(0,o.Z)(E.Z,{choices:i.choices,disabled:e,id:"id_"+n.fieldname,onChange:this.onChange,value:a}):"textarea"===i.type?(0,o.Z)("textarea",{className:"form-control",disabled:e,id:"id_"+n.fieldname,onChange:this.onChange,rows:"4",type:"text",value:a}):"text"===i.type?(0,o.Z)("input",{className:"form-control",disabled:e,id:"id_"+n.fieldname,onChange:this.onChange,type:"text",value:a}):null}}]),i}(m().Component),L=n(96359);function O(t){var e=t.disabled,n=t.errors,a=t.fields,i=t.name,r=t.onChange,s=t.value;return(0,o.Z)("fieldset",{},void 0,(0,o.Z)("legend",{},void 0,i),a.map((function(t){return(0,o.Z)(L.Z,{for:"id_"+t.fieldname,helpText:t.help_text,label:t.label,validation:n[t.fieldname]},t.fieldname,(0,o.Z)(S,{disabled:e,field:t,onChange:r,value:s[t.fieldname]}))})))}var P=n(82211),A=n(43345),T=n(78657),I=n(53904);var B=function(t){(0,c.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,d.Z)(e);if(n){var i=(0,d.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,u.Z)(this,t)});function i(t){var e;(0,r.Z)(this,i),e=a.call(this,t),(0,p.Z)((0,l.Z)(e),"onChange",(function(t,n){e.setState((0,p.Z)({},t,n))})),e.state={isLoading:!1,errors:{}};for(var n=t.groups.length,o=0;o<n;o++)for(var s=t.groups[o],c=s.fields.length,u=0;u<c;u++){var d=s.fields[u].fieldname,h=s.fields[u].initial;e.state[d]=h}return e}return(0,s.Z)(i,[{key:"send",value:function(){var t=Object.assign({},this.state,{errors:null,isLoading:null});return T.Z.post(this.props.api,t)}},{key:"handleSuccess",value:function(t){this.props.onSuccess(t)}},{key:"handleError",value:function(t){400===t.status?(I.Z.error(gettext("Form contains errors.")),this.setState({errors:t})):I.Z.apiError(t)}},{key:"render",value:function(){var t=this;return(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"panel-body"},void 0,this.props.groups.map((function(e,n){return(0,o.Z)(O,{disabled:t.state.isLoading,errors:t.state.errors,fields:e.fields,name:e.name,onChange:t.onChange,value:t.state},n)}))),(0,o.Z)("div",{className:"panel-footer text-right"},void 0,(0,o.Z)(j,{disabled:this.state.isLoading,onCancel:this.props.onCancel})," ",(0,o.Z)(P.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,pgettext("user profile details form btn","Save changes"))))}}]),i}(A.Z);function j(t){var e=t.onCancel,n=t.disabled;return e?(0,o.Z)("button",{className:"btn btn-default",disabled:n,onClick:e,type:"button"},void 0,pgettext("user profile details form btn","Cancel")):null}var D,U=function(t){(0,c.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,d.Z)(e);if(n){var i=(0,d.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,u.Z)(this,t)});function i(t){var e;return(0,r.Z)(this,i),(e=a.call(this,t)).state={loading:!0,groups:null},e}return(0,s.Z)(i,[{key:"componentDidMount",value:function(){var t=this;T.Z.get(this.props.api).then((function(e){t.setState({loading:!1,groups:e})}),(function(e){I.Z.apiError(e),t.props.cancel&&t.props.cancel()}))}},{key:"render",value:function(){var t=this.state,e=t.groups,n=t.loading;return(0,o.Z)("div",{className:"panel panel-default panel-form"},void 0,(0,o.Z)("div",{className:"panel-heading"},void 0,(0,o.Z)("h3",{className:"panel-title"},void 0,pgettext("user profile details form title","Edit details"))),(0,o.Z)(R,{display:n}),(0,o.Z)(C,{display:!n&&!e.length}),(0,o.Z)(z,{api:this.props.api,display:!n&&e.length,groups:e,onCancel:this.props.onCancel,onSuccess:this.props.onSuccess}))}}]),i}(m().Component);function z(t){var e=t.api,n=t.display,a=t.groups,i=t.onCancel,r=t.onSuccess;return n?(0,o.Z)(B,{api:e,groups:a,onCancel:i,onSuccess:r}):null}function q(t){var e=t.api,n=t.display,a=t.onCancel,i=t.onSuccess;return n?(0,o.Z)(U,{api:e,onCancel:a,onSuccess:i}):null}function M(t){var e,n=t.isAuthenticated,a=t.profile;return e=n?pgettext("profile details empty","You are not sharing any details with others."):interpolate(pgettext("profile details empty","%(username)s is not sharing any details with others."),{username:a.username},!0),(0,o.Z)("div",{className:"panel panel-default"},void 0,(0,o.Z)("div",{className:"panel-body text-center lead"},void 0,e))}function F(t){var e=t.html,n=t.text,a=t.url;return e?(0,o.Z)("div",{className:"form-control-static col-md-9",dangerouslySetInnerHTML:{__html:e}}):(0,o.Z)("div",{className:"form-control-static col-md-9"},void 0,(0,o.Z)(H,{text:n,url:a}))}function H(t){var e=t.text,n=t.url;return n?(0,o.Z)("p",{},void 0,(0,o.Z)("a",{href:n,target:"_blank",rel:"nofollow"},void 0,e||n)):e?(0,o.Z)("p",{},void 0,e):null}function V(t){return(0,o.Z)("div",{className:"form-group"},void 0,(0,o.Z)("strong",{className:"control-label col-md-3"},void 0,t.name,":"),m().createElement(F,t))}function Y(t){var e=t.fields,n=t.name;return(0,o.Z)("div",{className:"panel panel-default panel-profile-details-group"},void 0,(0,o.Z)("div",{className:"panel-heading"},void 0,(0,o.Z)("h3",{className:"panel-title"},void 0,n)),(0,o.Z)("div",{className:"panel-body"},void 0,(0,o.Z)("div",{className:"form-horizontal"},void 0,e.map((function(t){var e=t.fieldname,n=t.html,a=t.name,i=t.text,r=t.url;return(0,o.Z)(V,{name:a,html:n,text:i,url:r},e)})))))}function G(t){var e=t.display,n=t.groups,a=t.isAuthenticated,i=t.loading,r=t.profile;return e?i?D||(D=(0,o.Z)(Z.Z,{})):n.length?(0,o.Z)("div",{},void 0,n.map((function(t,e){return(0,o.Z)(Y,{fields:t.fields,name:t.name},e)}))):(0,o.Z)(M,{isAuthenticated:a,profile:r}):null}var W=n(92490);const $=function(t){var e=t.onEdit,n=t.showEditButton;return(0,o.Z)(W.o8,{},void 0,(0,o.Z)(W.Z2,{auto:!0},void 0,(0,o.Z)(W.Eg,{auto:!0},void 0,(0,o.Z)("h3",{},void 0,pgettext("profile details title","Details")))),n&&(0,o.Z)(W.Z2,{},void 0,(0,o.Z)(W.Eg,{},void 0,(0,o.Z)("button",{className:"btn btn-default btn-outline btn-block",onClick:e,type:"button"},void 0,pgettext("profile details edit btn","Edit")))))};var Q=n(58598);var K=function(t){(0,c.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,d.Z)(e);if(n){var i=(0,d.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,u.Z)(this,t)});function i(){return(0,r.Z)(this,i),a.apply(this,arguments)}return(0,s.Z)(i,[{key:"componentDidMount",value:function(){var t=this.props,e=t.data,n=t.dispatch,a=t.user;e&&e.id===a.id||T.Z.get(this.props.user.api.details).then((function(t){n((0,Q.zD)(t))}),(function(t){I.Z.apiError(t)}))}},{key:"render",value:function(){return this.props.children}}]),i}(m().Component);var X=function(t){(0,c.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,d.Z)(e);if(n){var i=(0,d.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,u.Z)(this,t)});function i(t){var e;return(0,r.Z)(this,i),e=a.call(this,t),(0,p.Z)((0,l.Z)(e),"onCancel",(function(){e.setState({editing:!1})})),(0,p.Z)((0,l.Z)(e),"onEdit",(function(){e.setState({editing:!0})})),(0,p.Z)((0,l.Z)(e),"onSuccess",(function(t){var n,a=e.props,i=a.dispatch,o=a.isAuthenticated,r=a.profile;n=o?pgettext("profile details form","Your details have been changed."):interpolate(pgettext("profile details form","%(username)s's details have been changed."),{username:r.username},!0),I.Z.info(n),i((0,Q.zD)(t)),e.setState({editing:!1})})),e.state={editing:!1},e}return(0,s.Z)(i,[{key:"componentDidMount",value:function(){x.Z.set({title:pgettext("profile details title","Details"),parent:this.props.profile.username})}},{key:"render",value:function(){var t=this.props,e=t.dispatch,n=t.isAuthenticated,a=t.profile,i=t.profileDetails,r=i.id!==a.id;return(0,o.Z)(K,{data:i,dispatch:e,user:a},void 0,(0,o.Z)("div",{className:"profile-details"},void 0,(0,o.Z)($,{onEdit:this.onEdit,showEditButton:!!i.edit&&!this.state.editing}),(0,o.Z)(G,{display:!this.state.editing,groups:i.groups,isAuthenticated:n,loading:r,profile:a}),(0,o.Z)(q,{api:a.api.edit_details,dispatch:e,display:this.state.editing,onCancel:this.onCancel,onSuccess:this.onSuccess})))}}]),i}(m().Component),J=n(87462),tt=n(11005),et=n(21981),nt=n(90287);var at,it=function(t){(0,c.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,d.Z)(e);if(n){var i=(0,d.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,u.Z)(this,t)});function i(t){var e;return(0,r.Z)(this,i),e=a.call(this,t),(0,p.Z)((0,l.Z)(e),"loadMore",(function(){e.setState({isLoading:!0}),e.loadItems(e.props.posts.next)})),e.state={isLoading:!1},e}return(0,s.Z)(i,[{key:"loadItems",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;T.Z.get(this.props.api,{start:e||0}).then((function(n){0===e?nt.Z.dispatch(et.zD(n)):nt.Z.dispatch(et.R3(n)),t.setState({isLoading:!1})}),(function(e){t.setState({isLoading:!1}),I.Z.apiError(e)}))}},{key:"componentDidMount",value:function(){x.Z.set({title:this.props.title,parent:this.props.profile.username}),this.loadItems()}},{key:"render",value:function(){return(0,o.Z)("div",{className:"profile-feed"},void 0,(0,o.Z)(W.o8,{},void 0,(0,o.Z)(W.Z2,{auto:!0},void 0,(0,o.Z)(W.Eg,{auto:!0},void 0,(0,o.Z)("h3",{},void 0,this.props.header)))),m().createElement(ot,(0,J.Z)({isLoading:this.state.isLoading,loadMore:this.loadMore},this.props)))}}]),i}(m().Component);function ot(t){return t.posts.isLoaded&&!t.posts.results.length?(0,o.Z)("p",{className:"lead"},void 0,t.emptyMessage):(0,o.Z)("div",{},void 0,(0,o.Z)(tt.Z,{isReady:t.posts.isLoaded,posts:t.posts.results,poster:t.profile}),(0,o.Z)(rt,{isLoading:t.isLoading,loadMore:t.loadMore,next:t.posts.next}))}function rt(t){return t.next?(0,o.Z)("div",{className:"pager-more"},void 0,(0,o.Z)(P.Z,{className:"btn btn-default btn-outline",loading:t.isLoading,onClick:t.loadMore},void 0,pgettext("profile load more btn","Show older activity"))):null}var st=function(t){(0,c.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,d.Z)(e);if(n){var i=(0,d.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,u.Z)(this,t)});function i(){return(0,r.Z)(this,i),a.apply(this,arguments)}return(0,s.Z)(i,[{key:"getClassName",value:function(){return this.props.className?"form-search "+this.props.className:"form-search"}},{key:"render",value:function(){return(0,o.Z)("div",{className:this.getClassName()},void 0,(0,o.Z)("input",{type:"text",className:"form-control",value:this.props.value,onChange:this.props.onChange,placeholder:this.props.placeholder||pgettext("quick search placeholder","Search...")}),at||(at=(0,o.Z)("span",{className:"material-icon"},void 0,"search")))}}]),i}(m().Component),lt=n(40429),ct=n(6935);var ut=function(t){(0,c.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,d.Z)(e);if(n){var i=(0,d.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,u.Z)(this,t)});function i(t){var e;return(0,r.Z)(this,i),e=a.call(this,t),(0,p.Z)((0,l.Z)(e),"loadMore",(function(){e.setState({isBusy:!0}),e.loadUsers(e.state.page+1,e.state.search)})),(0,p.Z)((0,l.Z)(e),"search",(function(t){e.setState({isLoaded:!1,isBusy:!0,search:t.target.value,count:0,more:0,page:1,pages:1}),e.loadUsers(1,t.target.value)})),e.setSpecialProps(),k.Z.has(e.PRELOADED_DATA_KEY)?e.initWithPreloadedData(k.Z.pop(e.PRELOADED_DATA_KEY)):e.initWithoutPreloadedData(),e}return(0,s.Z)(i,[{key:"setSpecialProps",value:function(){this.PRELOADED_DATA_KEY="PROFILE_FOLLOWERS",this.TITLE=pgettext("profile followers title","Followers"),this.API_FILTER="followers"}},{key:"initWithPreloadedData",value:function(t){this.state={isLoaded:!0,isBusy:!1,search:"",count:t.count,more:t.more,page:t.page,pages:t.pages},nt.Z.dispatch((0,ct.ZB)(t.results))}},{key:"initWithoutPreloadedData",value:function(){this.state={isLoaded:!1,isBusy:!1,search:"",count:0,more:0,page:1,pages:1},this.loadUsers()}},{key:"loadUsers",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=this.props.profile.api[this.API_FILTER];T.Z.get(a,{search:n,page:e||1},"user-"+this.API_FILTER).then((function(n){1===e?nt.Z.dispatch((0,ct.ZB)(n.results)):nt.Z.dispatch((0,ct.R3)(n.results)),t.setState({isLoaded:!0,isBusy:!1,count:n.count,more:n.more,page:n.page,pages:n.pages})}),(function(t){I.Z.apiError(t)}))}},{key:"componentDidMount",value:function(){x.Z.set({title:this.TITLE,parent:this.props.profile.username})}},{key:"getLabel",value:function(){if(this.state.isLoaded){if(this.state.search){var t=npgettext("profile followers","Found %(users)s user.","Found %(users)s users.",this.state.count);return interpolate(t,{users:this.state.count},!0)}if(this.props.profile.id===this.props.user.id){var e=npgettext("profile followers","You have %(users)s follower.","You have %(users)s followers.",this.state.count);return interpolate(e,{users:this.state.count},!0)}var n=npgettext("profile followers","%(username)s has %(users)s follower.","%(username)s has %(users)s followers.",this.state.count);return interpolate(n,{username:this.props.profile.username,users:this.state.count},!0)}return pgettext("Loading...")}},{key:"getEmptyMessage",value:function(){return this.state.search?pgettext("profile followers","Search returned no users matching specified criteria."):this.props.user.id===this.props.profile.id?pgettext("profile followers","You have no followers."):interpolate(pgettext("profile followers","%(username)s has no followers."),{username:this.props.profile.username},!0)}},{key:"getMoreButton",value:function(){return this.state.more?(0,o.Z)("div",{className:"pager-more"},void 0,(0,o.Z)(P.Z,{className:"btn btn-default btn-outline",loading:this.state.isBusy,onClick:this.loadMore},void 0,interpolate(pgettext("profile followers","Show more (%(more)s)"),{more:this.state.more},!0))):null}},{key:"getListBody",value:function(){return this.state.isLoaded&&0===this.state.count?(0,o.Z)("p",{className:"lead"},void 0,this.getEmptyMessage()):(0,o.Z)("div",{},void 0,(0,o.Z)(lt.Z,{cols:3,isReady:this.state.isLoaded,users:this.props.users}),this.getMoreButton())}},{key:"getClassName",value:function(){return"profile-"+this.API_FILTER}},{key:"render",value:function(){return(0,o.Z)("div",{className:this.getClassName()},void 0,(0,o.Z)(W.o8,{},void 0,(0,o.Z)(W.Z2,{auto:!0},void 0,(0,o.Z)(W.Eg,{auto:!0},void 0,(0,o.Z)("h3",{},void 0,this.getLabel()))),(0,o.Z)(W.Z2,{},void 0,(0,o.Z)(W.Eg,{},void 0,(0,o.Z)(st,{value:this.state.search,onChange:this.search,placeholder:pgettext("profile followers search","Search users...")})))),this.getListBody())}}]),i}(m().Component);var dt=function(t){(0,c.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,d.Z)(e);if(n){var i=(0,d.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,u.Z)(this,t)});function i(){return(0,r.Z)(this,i),a.apply(this,arguments)}return(0,s.Z)(i,[{key:"setSpecialProps",value:function(){this.PRELOADED_DATA_KEY="PROFILE_FOLLOWS",this.TITLE=pgettext("profile follows title","Follows"),this.API_FILTER="follows"}},{key:"getLabel",value:function(){if(this.state.isLoaded){if(this.state.search){var t=npgettext("profile follows","Found %(users)s user.","Found %(users)s users.",this.state.count);return interpolate(t,{users:this.state.count},!0)}if(this.props.profile.id===this.props.user.id){var e=npgettext("profile follows","You are following %(users)s user.","You are following %(users)s users.",this.state.count);return interpolate(e,{users:this.state.count},!0)}var n=npgettext("profile follows","%(username)s is following %(users)s user.","%(username)s is following %(users)s users.",this.state.count);return interpolate(n,{username:this.props.profile.username,users:this.state.count},!0)}return pgettext("profile follows","Loading...")}},{key:"getEmptyMessage",value:function(){return this.state.search?pgettext("profile follows","Search returned no users matching specified criteria."):this.props.user.id===this.props.profile.id?pgettext("profile follows","You are not following any users."):interpolate(pgettext("profile follows","%(username)s is not following any users."),{username:this.props.profile.username},!0)}}]),i}(ut);var pt,ht,mt=function(t){(0,c.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,d.Z)(e);if(n){var i=(0,d.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,u.Z)(this,t)});function i(){return(0,r.Z)(this,i),a.apply(this,arguments)}return(0,s.Z)(i,[{key:"getEmptyMessage",value:function(){return this.props.emptyMessage?this.props.emptyMessage:pgettext("username history empty","Your account has no history of name changes.")}},{key:"render",value:function(){return(0,o.Z)("div",{className:"username-history ui-ready"},void 0,(0,o.Z)("ul",{className:"list-group"},void 0,(0,o.Z)("li",{className:"list-group-item empty-message"},void 0,this.getEmptyMessage())))}}]),i}(m().Component),vt=n(19605);var ft=function(t){(0,c.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,d.Z)(e);if(n){var i=(0,d.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,u.Z)(this,t)});function i(){return(0,r.Z)(this,i),a.apply(this,arguments)}return(0,s.Z)(i,[{key:"renderUserAvatar",value:function(){return this.props.change.changed_by?(0,o.Z)("a",{href:this.props.change.changed_by.url,className:"user-avatar-wrapper"},void 0,(0,o.Z)(vt.ZP,{user:this.props.change.changed_by,size:"100"})):pt||(pt=(0,o.Z)("span",{className:"user-avatar-wrapper"},void 0,(0,o.Z)(vt.ZP,{size:"100"})))}},{key:"renderUsername",value:function(){return this.props.change.changed_by?(0,o.Z)("a",{href:this.props.change.changed_by.url,className:"item-title"},void 0,this.props.change.changed_by.username):(0,o.Z)("span",{className:"item-title"},void 0,this.props.change.changed_by_username)}},{key:"render",value:function(){return(0,o.Z)("li",{className:"list-group-item"},this.props.change.id,(0,o.Z)("div",{className:"change-avatar"},void 0,this.renderUserAvatar()),(0,o.Z)("div",{className:"change-author"},void 0,this.renderUsername()),(0,o.Z)("div",{className:"change"},void 0,(0,o.Z)("span",{className:"old-username"},void 0,this.props.change.old_username),ht||(ht=(0,o.Z)("span",{className:"material-icon"},void 0,"arrow_forward")),(0,o.Z)("span",{className:"new-username"},void 0,this.props.change.new_username)),(0,o.Z)("div",{className:"change-date"},void 0,(0,o.Z)("abbr",{title:this.props.change.changed_on.format("LLL")},void 0,this.props.change.changed_on.fromNow())))}}]),i}(m().Component);var Zt,gt,yt=function(t){(0,c.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,d.Z)(e);if(n){var i=(0,d.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,u.Z)(this,t)});function i(){return(0,r.Z)(this,i),a.apply(this,arguments)}return(0,s.Z)(i,[{key:"render",value:function(){return(0,o.Z)("div",{className:"username-history ui-ready"},void 0,(0,o.Z)("ul",{className:"list-group"},void 0,this.props.changes.map((function(t){return(0,o.Z)(ft,{change:t},t.id)}))))}}]),i}(m().Component),bt=n(44039);var kt=function(t){(0,c.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,d.Z)(e);if(n){var i=(0,d.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,u.Z)(this,t)});function i(){return(0,r.Z)(this,i),a.apply(this,arguments)}return(0,s.Z)(i,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"getClassName",value:function(){return this.props.hiddenOnMobile?"list-group-item hidden-xs hidden-sm":"list-group-item"}},{key:"render",value:function(){return(0,o.Z)("li",{className:this.getClassName()},void 0,Zt||(Zt=(0,o.Z)("div",{className:"change-avatar"},void 0,(0,o.Z)("span",{className:"user-avatar"},void 0,(0,o.Z)(vt.ZP,{size:"100"})))),(0,o.Z)("div",{className:"change-author"},void 0,(0,o.Z)("span",{className:"ui-preview-text",style:{width:bt.e(30,100)+"px"}},void 0," ")),(0,o.Z)("div",{className:"change"},void 0,(0,o.Z)("span",{className:"ui-preview-text",style:{width:bt.e(30,70)+"px"}},void 0," "),gt||(gt=(0,o.Z)("span",{className:"material-icon"},void 0,"arrow_forward")),(0,o.Z)("span",{className:"ui-preview-text",style:{width:bt.e(30,70)+"px"}},void 0," ")),(0,o.Z)("div",{className:"change-date"},void 0,(0,o.Z)("span",{className:"ui-preview-text",style:{width:bt.e(80,140)+"px"}},void 0," ")))}}]),i}(m().Component);var _t,xt=function(t){(0,c.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,d.Z)(e);if(n){var i=(0,d.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,u.Z)(this,t)});function i(){return(0,r.Z)(this,i),a.apply(this,arguments)}return(0,s.Z)(i,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"render",value:function(){return(0,o.Z)("div",{className:"username-history ui-preview"},void 0,(0,o.Z)("ul",{className:"list-group"},void 0,[0,1,2].map((function(t){return(0,o.Z)(kt,{hiddenOnMobile:t>0},t)}))))}}]),i}(m().Component);var Nt=function(t){(0,c.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,d.Z)(e);if(n){var i=(0,d.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,u.Z)(this,t)});function i(){return(0,r.Z)(this,i),a.apply(this,arguments)}return(0,s.Z)(i,[{key:"render",value:function(){return this.props.isLoaded?this.props.changes.length?(0,o.Z)(yt,{changes:this.props.changes}):(0,o.Z)(mt,{emptyMessage:this.props.emptyMessage}):_t||(_t=(0,o.Z)(xt,{}))}}]),i}(m().Component),wt=n(48927);var Ct=function(t){(0,c.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,d.Z)(e);if(n){var i=(0,d.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,u.Z)(this,t)});function i(t){var e;return(0,r.Z)(this,i),e=a.call(this,t),(0,p.Z)((0,l.Z)(e),"loadMore",(function(){e.setState({isBusy:!0}),e.loadChanges(e.state.page+1,e.state.search)})),(0,p.Z)((0,l.Z)(e),"search",(function(t){e.setState({isLoaded:!1,isBusy:!0,search:t.target.value,count:0,more:0,page:1,pages:1}),e.loadChanges(1,t.target.value)})),k.Z.has("PROFILE_NAME_HISTORY")?e.initWithPreloadedData(k.Z.pop("PROFILE_NAME_HISTORY")):e.initWithoutPreloadedData(),e}return(0,s.Z)(i,[{key:"initWithPreloadedData",value:function(t){this.state={isLoaded:!0,isBusy:!1,search:"",count:t.count,more:t.more,page:t.page,pages:t.pages},nt.Z.dispatch((0,wt.ZB)(t.results))}},{key:"initWithoutPreloadedData",value:function(){this.state={isLoaded:!1,isBusy:!1,search:"",count:0,more:0,page:1,pages:1},this.loadChanges()}},{key:"loadChanges",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;T.Z.get(k.Z.get("USERNAME_CHANGES_API"),{user:this.props.profile.id,search:n,page:e||1},"search-username-history").then((function(n){1===e?nt.Z.dispatch((0,wt.ZB)(n.results)):nt.Z.dispatch((0,wt.R3)(n.results)),t.setState({isLoaded:!0,isBusy:!1,count:n.count,more:n.more,page:n.page,pages:n.pages})}),(function(t){I.Z.apiError(t)}))}},{key:"componentDidMount",value:function(){x.Z.set({title:pgettext("profile username history title","Username history"),parent:this.props.profile.username})}},{key:"getLabel",value:function(){if(this.state.isLoaded){if(this.state.search){var t=npgettext("profile username history","Found %(changes)s username change.","Found %(changes)s username changes.",this.state.count);return interpolate(t,{changes:this.state.count},!0)}if(this.props.profile.id===this.props.user.id){var e=npgettext("profile username history","Your username was changed %(changes)s time.","Your username was changed %(changes)s times.",this.state.count);return interpolate(e,{changes:this.state.count},!0)}var n=npgettext("profile username history","%(username)s's username was changed %(changes)s time.","%(username)s's username was changed %(changes)s times.",this.state.count);return interpolate(n,{username:this.props.profile.username,changes:this.state.count},!0)}return pgettext("profile username history","Loading...")}},{key:"getEmptyMessage",value:function(){return this.state.search?pgettext("profile username history","Search returned no username changes matching specified criteria."):this.props.user.id===this.props.profile.id?pgettext("username history empty","Your account has no history of name changes."):interpolate(pgettext("profile username history","%(username)s's username was never changed."),{username:this.props.profile.username},!0)}},{key:"getMoreButton",value:function(){return this.state.more?(0,o.Z)("div",{className:"pager-more"},void 0,(0,o.Z)(P.Z,{className:"btn btn-default btn-outline",loading:this.state.isBusy,onClick:this.loadMore},void 0,interpolate(pgettext("profile username history","Show older (%(more)s)"),{more:this.state.more},!0))):null}},{key:"render",value:function(){return(0,o.Z)("div",{className:"profile-username-history"},void 0,(0,o.Z)(W.o8,{},void 0,(0,o.Z)(W.Z2,{auto:!0},void 0,(0,o.Z)(W.Eg,{auto:!0},void 0,(0,o.Z)("h3",{},void 0,this.getLabel()))),(0,o.Z)(W.Z2,{},void 0,(0,o.Z)(W.Eg,{},void 0,(0,o.Z)(st,{value:this.state.search,onChange:this.search,placeholder:pgettext("profile username history search input","Search history...")})))),(0,o.Z)(Nt,{isLoaded:this.state.isLoaded,emptyMessage:this.getEmptyMessage(),changes:this.props["username-history"]}),this.getMoreButton())}}]),i}(m().Component),Rt=n(82125),Et=n(27519),St=n(59131),Lt=n(98936),Ot=n(99755);var Pt,At=function(t){(0,c.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,d.Z)(e);if(n){var i=(0,d.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,u.Z)(this,t)});function i(t){var e;return(0,r.Z)(this,i),e=a.call(this,t),(0,p.Z)((0,l.Z)(e),"action",(function(){e.setState({isLoading:!0}),e.props.profile.is_followed?nt.Z.dispatch((0,Et.r$)({is_followed:!1,followers:e.props.profile.followers-1})):nt.Z.dispatch((0,Et.r$)({is_followed:!0,followers:e.props.profile.followers+1})),T.Z.post(e.props.profile.api.follow).then((function(t){e.setState({isLoading:!1}),nt.Z.dispatch((0,Et.r$)(t))}),(function(t){e.setState({isLoading:!1}),I.Z.apiError(t)}))})),e.state={isLoading:!1},e}return(0,s.Z)(i,[{key:"getClassName",value:function(){return this.props.profile.is_followed?this.props.className+" btn-default btn-following":this.props.className+" btn-default btn-follow"}},{key:"getIcon",value:function(){return this.props.profile.is_followed?"favorite":"favorite_border"}},{key:"getLabel",value:function(){return this.props.profile.is_followed?pgettext("user profile follow btn","Following"):pgettext("user profile follow btn","Follow")}},{key:"render",value:function(){return(0,o.Z)(P.Z,{className:this.getClassName(),disabled:this.state.isLoading,onClick:this.action},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,this.getIcon()),this.getLabel())}}]),i}(m().Component),Tt=n(64646);var It,Bt,jt=function(t){(0,c.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,d.Z)(e);if(n){var i=(0,d.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,u.Z)(this,t)});function i(){var t;(0,r.Z)(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t=a.call.apply(a,[this].concat(n)),(0,p.Z)((0,l.Z)(t),"onClick",(function(){Tt.Z.open({mode:"START_PRIVATE",submit:k.Z.get("PRIVATE_THREADS_API"),to:[t.props.profile]})})),t}return(0,s.Z)(i,[{key:"render",value:function(){var t=this.props.user.acl.can_start_private_threads,e=this.props.user.id===this.props.profile.id;return!t||e?null:(0,o.Z)("button",{className:this.props.className,onClick:this.onClick,type:"button"},void 0,Pt||(Pt=(0,o.Z)("span",{className:"material-icon"},void 0,"comment")),pgettext("profile message btn","Message"))}}]),i}(m().Component),Dt=n(3784),Ut=n(7227),zt=n(30337);var qt,Mt,Ft=function(t){(0,c.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,d.Z)(e);if(n){var i=(0,d.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,u.Z)(this,t)});function i(t){var e;return(0,r.Z)(this,i),(e=a.call(this,t)).state={isLoaded:!1,isLoading:!1,error:null,is_avatar_locked:"",avatar_lock_user_message:"",avatar_lock_staff_message:""},e}return(0,s.Z)(i,[{key:"componentDidMount",value:function(){var t=this;T.Z.get(this.props.profile.api.moderate_avatar).then((function(e){t.setState({isLoaded:!0,is_avatar_locked:e.is_avatar_locked,avatar_lock_user_message:e.avatar_lock_user_message||"",avatar_lock_staff_message:e.avatar_lock_staff_message||""})}),(function(e){t.setState({isLoaded:!0,error:e.detail})}))}},{key:"clean",value:function(){return!!this.isValid()||(I.Z.error(this.validate().username[0]),!1)}},{key:"send",value:function(){return T.Z.post(this.props.profile.api.moderate_avatar,{is_avatar_locked:this.state.is_avatar_locked,avatar_lock_user_message:this.state.avatar_lock_user_message,avatar_lock_staff_message:this.state.avatar_lock_staff_message})}},{key:"handleSuccess",value:function(t){nt.Z.dispatch((0,ct.n1)(this.props.profile,t.avatar_hash)),I.Z.success(pgettext("profile avatar moderation","Avatar controls have been changed."))}},{key:"getFormBody",value:function(){return(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(L.Z,{label:pgettext("profile avatar moderation field","Lock avatar"),helpText:pgettext("profile avatar moderation field","Locking user avatar will prohibit user from changing his avatar and will reset his/her avatar to default one."),for:"id_is_avatar_locked"},void 0,(0,o.Z)(Ut.Z,{id:"id_is_avatar_locked",disabled:this.state.isLoading,iconOn:"lock_outline",iconOff:"lock_open",labelOn:pgettext("profile avatar moderation field","Disallow user from changing avatar"),labelOff:pgettext("profile avatar moderation field","Allow user to change avatar"),onChange:this.bindInput("is_avatar_locked"),value:this.state.is_avatar_locked})),(0,o.Z)(L.Z,{label:pgettext("profile avatar moderation field","User message"),helpText:pgettext("profile avatar moderation field","Optional message for user explaining why they are prohibited from changing their avatar."),for:"id_avatar_lock_user_message"},void 0,(0,o.Z)("textarea",{id:"id_avatar_lock_user_message",className:"form-control",rows:"4",disabled:this.state.isLoading,onChange:this.bindInput("avatar_lock_user_message"),value:this.state.avatar_lock_user_message})),(0,o.Z)(L.Z,{label:pgettext("profile avatar moderation field","Staff message"),helpText:pgettext("profile avatar moderation field","Optional message for forum team members explaining why the user is prohibited form changing their avatar."),for:"id_avatar_lock_staff_message"},void 0,(0,o.Z)("textarea",{id:"id_avatar_lock_staff_message",className:"form-control",rows:"4",disabled:this.state.isLoading,onChange:this.bindInput("avatar_lock_staff_message"),value:this.state.avatar_lock_staff_message}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-default","data-dismiss":"modal"},void 0,pgettext("profile avatar moderation btn","Close")),(0,o.Z)(P.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,pgettext("profile avatar moderation btn","Save changes"))))}},{key:"getModalBody",value:function(){return this.state.error?(0,o.Z)(zt.Z,{icon:"remove_circle_outline",message:this.state.error}):this.state.isLoaded?this.getFormBody():It||(It=(0,o.Z)(Dt.Z,{}))}},{key:"getClassName",value:function(){return this.state.error?"modal-dialog modal-message modal-avatar-controls":"modal-dialog modal-avatar-controls"}},{key:"render",value:function(){return(0,o.Z)("div",{className:this.getClassName(),role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":pgettext("modal","Close")},void 0,Bt||(Bt=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,pgettext("profile avatar moderation title","Avatar controls"))),this.getModalBody()))}}]),i}(A.Z),Ht=n(55210);var Vt,Yt,Gt,Wt=function(t){(0,c.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,d.Z)(e);if(n){var i=(0,d.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,u.Z)(this,t)});function i(t){var e;return(0,r.Z)(this,i),(e=a.call(this,t)).state={isLoaded:!1,isLoading:!1,error:null,username:"",validators:{username:[Ht.lG()]}},e}return(0,s.Z)(i,[{key:"componentDidMount",value:function(){var t=this;T.Z.get(this.props.profile.api.moderate_username).then((function(){t.setState({isLoaded:!0})}),(function(e){t.setState({isLoaded:!0,error:e.detail})}))}},{key:"clean",value:function(){return!!this.isValid()||(I.Z.error(this.validate().username[0]),!1)}},{key:"send",value:function(){return T.Z.post(this.props.profile.api.moderate_username,{username:this.state.username})}},{key:"handleSuccess",value:function(t){this.setState({username:""}),nt.Z.dispatch((0,wt.KP)(t,this.props.profile,this.props.user)),nt.Z.dispatch((0,ct._S)(this.props.profile,t.username,t.slug)),I.Z.success(pgettext("profile username moderation","Username has been changed."))}},{key:"getFormBody",value:function(){return(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(L.Z,{label:pgettext("profile username moderation field","New username"),for:"id_username"},void 0,(0,o.Z)("input",{type:"text",id:"id_username",className:"form-control",disabled:this.state.isLoading,onChange:this.bindInput("username"),value:this.state.username}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,pgettext("profile username moderation btn","Cancel")),(0,o.Z)(P.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,pgettext("profile username moderation btn","Change username"))))}},{key:"getModalBody",value:function(){return this.state.error?(0,o.Z)(zt.Z,{icon:"remove_circle_outline",message:this.state.error}):this.state.isLoaded?this.getFormBody():qt||(qt=(0,o.Z)(Dt.Z,{}))}},{key:"getClassName",value:function(){return this.state.error?"modal-dialog modal-message modal-rename-user":"modal-dialog modal-rename-user"}},{key:"render",value:function(){return(0,o.Z)("div",{className:this.getClassName(),role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":pgettext("modal","Close")},void 0,Mt||(Mt=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,pgettext("profile username moderation title","Change username"))),this.getModalBody()))}}]),i}(A.Z);var $t,Qt,Kt,Xt=function(t){(0,c.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,d.Z)(e);if(n){var i=(0,d.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,u.Z)(this,t)});function i(t){var e;return(0,r.Z)(this,i),e=a.call(this,t),(0,p.Z)((0,l.Z)(e),"countdown",(function(){window.setTimeout((function(){e.state.countdown>1?(e.setState({countdown:e.state.countdown-1}),e.countdown()):e.state.confirm||e.setState({confirm:!0})}),1e3)})),e.state={isLoaded:!1,isLoading:!1,isDeleted:!1,error:null,countdown:5,confirm:!1,with_content:!1},e}return(0,s.Z)(i,[{key:"componentDidMount",value:function(){var t=this;T.Z.get(this.props.profile.api.delete).then((function(){t.setState({isLoaded:!0}),t.countdown()}),(function(e){t.setState({isLoaded:!0,error:e.detail})}))}},{key:"send",value:function(){return T.Z.post(this.props.profile.api.delete,{with_content:this.state.with_content})}},{key:"handleSuccess",value:function(){_.Z.stop("user-profile"),this.state.with_content?this.setState({isDeleted:interpolate(pgettext("profile delete","%(username)s's account, threads, posts and other content has been deleted."),{username:this.props.profile.username},!0)}):this.setState({isDeleted:interpolate(pgettext("profile delete","%(username)s's account has been deleted and other content has been hidden."),{username:this.props.profile.username},!0)})}},{key:"getButtonLabel",value:function(){return this.state.confirm?interpolate(pgettext("profile delete btn","Delete %(username)s"),{username:this.props.profile.username},!0):interpolate(pgettext("profile delete btn","Please wait... (%(countdown)ss)"),{countdown:this.state.countdown},!0)}},{key:"getForm",value:function(){return(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(L.Z,{label:pgettext("profile delete","User content"),for:"id_with_content"},void 0,(0,o.Z)(Ut.Z,{id:"id_with_content",disabled:this.state.isLoading,labelOn:pgettext("profile delete content","Delete together with user's account"),labelOff:pgettext("profile delete content","Hide after deleting user's account"),onChange:this.bindInput("with_content"),value:this.state.with_content}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-default","data-dismiss":"modal"},void 0,pgettext("profile delete btn","Cancel")),(0,o.Z)(P.Z,{className:"btn-danger",loading:this.state.isLoading,disabled:!this.state.confirm},void 0,this.getButtonLabel())))}},{key:"getDeletedBody",value:function(){return(0,o.Z)("div",{className:"modal-body"},void 0,Vt||(Vt=(0,o.Z)("div",{className:"message-icon"},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,o.Z)("div",{className:"message-body"},void 0,(0,o.Z)("p",{className:"lead"},void 0,this.state.isDeleted),(0,o.Z)("p",{},void 0,(0,o.Z)("a",{href:k.Z.get("USERS_LIST_URL")},void 0,pgettext("profile delete link","Return to users list")))))}},{key:"getModalBody",value:function(){return this.state.error?(0,o.Z)(zt.Z,{icon:"remove_circle_outline",message:this.state.error}):this.state.isLoaded?this.state.isDeleted?this.getDeletedBody():this.getForm():Yt||(Yt=(0,o.Z)(Dt.Z,{}))}},{key:"getClassName",value:function(){return this.state.error||this.state.isDeleted?"modal-dialog modal-message modal-delete-account":"modal-dialog modal-delete-account"}},{key:"render",value:function(){return(0,o.Z)("div",{className:this.getClassName(),role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":pgettext("modal","Close")},void 0,Gt||(Gt=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,pgettext("profile delete title","Delete user account"))),this.getModalBody()))}}]),i}(A.Z),Jt=n(59801);var te=function(t){return{tick:t.tick,user:t.auth,profile:t.profile}},ee=function(t){(0,c.Z)(h,t);var e,n,a=(e=h,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,d.Z)(e);if(n){var i=(0,d.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,u.Z)(this,t)});function h(){var t;(0,r.Z)(this,h);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t=a.call.apply(a,[this].concat(n)),(0,p.Z)((0,l.Z)(t),"showAvatarDialog",(function(){Jt.Z.show((0,i.$j)(te)(Ft))})),(0,p.Z)((0,l.Z)(t),"showRenameDialog",(function(){Jt.Z.show((0,i.$j)(te)(Wt))})),(0,p.Z)((0,l.Z)(t),"showDeleteDialog",(function(){Jt.Z.show((0,i.$j)(te)(Xt))})),t}return(0,s.Z)(h,[{key:"render",value:function(){var t=this.props.moderation;return(0,o.Z)("ul",{className:"dropdown-menu dropdown-menu-right",role:"menu"},void 0,!!t.avatar&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-link",onClick:this.showAvatarDialog},void 0,$t||($t=(0,o.Z)("span",{className:"material-icon"},void 0,"portrait")),pgettext("profile moderation menu","Avatar controls"))),!!t.rename&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-link",onClick:this.showRenameDialog},void 0,Qt||(Qt=(0,o.Z)("span",{className:"material-icon"},void 0,"credit_card")),pgettext("profile moderation menu","Change username"))),!!t.delete&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-link",onClick:this.showDeleteDialog},void 0,Kt||(Kt=(0,o.Z)("span",{className:"material-icon"},void 0,"clear")),pgettext("profile moderation menu","Delete account"))))}}]),h}(m().Component),ne=n(24678);const ae=function(t){var e=t.profile;return(0,o.Z)("ul",{className:"profile-data-list"},void 0,!1===e.is_active&&(0,o.Z)("li",{className:"user-account-disabled"},void 0,(0,o.Z)("abbr",{title:pgettext("profile data list","This user's account has been disabled by administrator.")},void 0,pgettext("profile data list","Account disabled"))),(0,o.Z)("li",{className:"user-status-display"},void 0,(0,o.Z)(ne.ZP,{user:e,status:e.status},void 0,(0,o.Z)(ne.Jj,{user:e,status:e.status}),(0,o.Z)(ne.pg,{user:e,status:e.status,className:"status-label"}))),e.rank.is_tab?(0,o.Z)("li",{className:"user-rank"},void 0,(0,o.Z)("a",{href:e.rank.url,className:"item-title"},void 0,e.rank.name)):(0,o.Z)("li",{className:"user-rank"},void 0,(0,o.Z)("span",{className:"item-title"},void 0,e.rank.name)),(e.title||e.rank.title)&&(0,o.Z)("li",{className:"user-title"},void 0,e.title||e.rank.title),(0,o.Z)("li",{className:"user-joined-on"},void 0,(0,o.Z)("abbr",{title:interpolate(pgettext("profile data list","Joined on %(joined_on)s"),{joined_on:e.joined_on.format("LL, LT")},!0)},void 0,interpolate(pgettext("profile data list","Joined %(joined_on)s"),{joined_on:e.joined_on.fromNow()},!0))),e.email&&(0,o.Z)("li",{className:"user-email"},void 0,(0,o.Z)("a",{href:"mailto:"+e.email,className:"item-title"},void 0,e.email)))};var ie,oe,re,se,le,ce=function(){return(0,o.Z)("button",{className:"btn btn-default btn-icon btn-outline dropdown-toggle",type:"button",title:pgettext("profile options btn","Options"),"data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},void 0,le||(le=(0,o.Z)("span",{className:"material-icon"},void 0,"settings")))};const ue=function(t){var e=t.profile,n=t.user,a=t.moderation,i=t.message,r=t.follow;return(0,o.Z)(Ot.sP,{},void 0,(0,o.Z)(Ot.mr,{styleName:e.rank.css_class?"rank-"+e.rank.css_class:"profile"},void 0,(0,o.Z)(Ot.gC,{styleName:e.rank.css_class?"rank-"+e.rank.css_class:"profile"},void 0,(0,o.Z)("div",{className:"profile-page-header"},void 0,(0,o.Z)("div",{className:"profile-page-header-avatar"},void 0,(0,o.Z)(vt.ZP,{className:"user-avatar hidden-sm hidden-md hidden-lg",user:e,size:200,size2x:400}),(0,o.Z)(vt.ZP,{className:"user-avatar hidden-xs hidden-md hidden-lg",user:e,size:64,size2x:128}),(0,o.Z)(vt.ZP,{className:"user-avatar hidden-xs hidden-sm",user:e,size:128,size2x:256})),(0,o.Z)("h1",{},void 0,e.username))),(0,o.Z)(Ot.eA,{className:"profile-page-header-details"},void 0,(0,o.Z)(Lt.gq,{},void 0,(0,o.Z)(Lt.kw,{auto:!0},void 0,(0,o.Z)(Lt.Z6,{},void 0,(0,o.Z)(ae,{profile:e}))),i&&(0,o.Z)(Lt.kw,{},void 0,(0,o.Z)(Lt.Z6,{},void 0,(0,o.Z)(jt,{className:"btn btn-default btn-block btn-outline",profile:e,user:n})),a.available&&!r&&(0,o.Z)(Lt.Z6,{shrink:!0},void 0,(0,o.Z)("div",{className:"dropdown"},void 0,ie||(ie=(0,o.Z)(ce,{})),(0,o.Z)(ee,{profile:e,moderation:a})))),r&&(0,o.Z)(Lt.kw,{},void 0,(0,o.Z)(Lt.Z6,{},void 0,(0,o.Z)(At,{className:"btn btn-block btn-outline",profile:e})),a.available&&(0,o.Z)(Lt.Z6,{shrink:!0},void 0,(0,o.Z)("div",{className:"dropdown"},void 0,oe||(oe=(0,o.Z)(ce,{})),(0,o.Z)(ee,{profile:e,moderation:a})))),a.available&&!r&&!i&&(0,o.Z)(Lt.kw,{},void 0,(0,o.Z)(Lt.Z6,{className:"hidden-xs",shrink:!0},void 0,(0,o.Z)("div",{className:"dropdown"},void 0,re||(re=(0,o.Z)(ce,{})),(0,o.Z)(ee,{profile:e,moderation:a}))),(0,o.Z)(Lt.Z6,{className:"hidden-sm hidden-md hidden-lg"},void 0,(0,o.Z)("div",{className:"dropdown"},void 0,(0,o.Z)("button",{className:"btn btn-default btn-block btn-outline dropdown-toggle",type:"button","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},void 0,se||(se=(0,o.Z)("span",{className:"material-icon"},void 0,"settings")),pgettext("profile options btn","Options")),(0,o.Z)(ee,{profile:e,moderation:a}))))))))};var de=n(69987),pe=n(94417);const he=function(t){var e=t.baseUrl,n=t.page,a=t.pages;return(0,o.Z)("div",{className:"nav-container"},void 0,(0,o.Z)("div",{className:"dropdown hidden-sm hidden-md hidden-lg"},void 0,(0,o.Z)("button",{className:"btn btn-default btn-block btn-outline dropdown-toggle",type:"button","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,n.icon),n.name),(0,o.Z)("ul",{className:"dropdown-menu stick-to-bottom"},void 0,a.map((function(t){return(0,o.Z)("li",{},t.component,(0,o.Z)(de.rU,{to:e+t.component+"/"},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,t.icon),t.name))})))),(0,o.Z)("ul",{className:"nav nav-pills hidden-xs",role:"menu"},void 0,a.map((function(t){return(0,o.Z)(pe.Z,{path:e+t.component+"/"},t.component,(0,o.Z)(de.rU,{to:e+t.component+"/"},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,t.icon),t.name))}))))};var me=function(t){(0,c.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,d.Z)(e);if(n){var i=(0,d.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,u.Z)(this,t)});function i(t){var e;return(0,r.Z)(this,i),e=a.call(this,t),(0,p.Z)((0,l.Z)(e),"update",(function(t){nt.Z.dispatch((0,Et.ZB)(t))})),e.startPolling(t.profile.api.index),e}return(0,s.Z)(i,[{key:"startPolling",value:function(t){_.Z.start({poll:"user-profile",url:t,frequency:9e4,update:this.update})}},{key:"render",value:function(){var t=this,e=k.Z.get("PROFILE").url,n=k.Z.get("PROFILE_PAGES"),a=n.filter((function(n){var a=e+n.component+"/";return t.props.location.pathname===a}))[0],i=this.props,r=i.profile,s=i.user,l=ve(r,s),c=!!s.acl.can_start_private_threads&&r.id!==s.id,u=!!r.acl.can_follow&&r.id!==s.id;return(0,o.Z)("div",{className:"page page-user-profile"},void 0,(0,o.Z)(ue,{profile:this.props.profile,user:this.props.user,moderation:l,message:c,follow:u}),(0,o.Z)(St.Z,{},void 0,(0,o.Z)(he,{baseUrl:e,page:a,pages:n}),this.props.children))}}]),i}(Rt.Z),ve=function(t,e){var n={available:!1,rename:!1,avatar:!1,delete:!1};return e.is_anonymous||(n.rename=t.acl.can_rename,n.avatar=t.acl.can_moderate_avatar,n.delete=t.acl.can_delete,n.available=!!(n.rename||n.avatar||n.delete)),n};function fe(t){return{isAuthenticated:t.auth.user.id===t.profile.id,tick:t.tick.tick,user:t.auth.user,users:t.users,posts:t.posts,profile:t.profile,profileDetails:t["profile-details"],"username-history":t["username-history"]}}var Ze={posts:function(t){var e;e=t.user.id===t.profile.id?pgettext("profile posts","You have posted no messages."):interpolate(pgettext("profile posts","%(username)s posted no messages."),{username:t.profile.username},!0);var n=null;if(t.posts.isLoaded)if(t.profile.id===t.user.id){var a=npgettext("profile posts","You have posted %(posts)s message.","You have posted %(posts)s messages.",t.profile.posts);n=interpolate(a,{posts:t.profile.posts},!0)}else{var i=npgettext("profile posts","%(username)s has posted %(posts)s message.","%(username)s has posted %(posts)s messages.",t.profile.posts);n=interpolate(i,{username:t.profile.username,posts:t.profile.posts},!0)}else n=pgettext("profile posts","Loading...");return m().createElement(it,(0,J.Z)({api:t.profile.api.posts,emptyMessage:e,header:n,title:pgettext("profile posts title","Posts")},t))},threads:function(t){var e;e=t.user.id===t.profile.id?pgettext("profile threads","You haven't started any threads."):interpolate(pgettext("profile threads","%(username)s hasn't started any threads"),{username:t.profile.username},!0);var n=null;if(t.posts.isLoaded)if(t.profile.id===t.user.id){var a=npgettext("profile threads","You have started %(threads)s thread.","You have started %(threads)s threads.",t.profile.threads);n=interpolate(a,{threads:t.profile.threads},!0)}else{var i=npgettext("profile threads","%(username)s has started %(threads)s thread.","%(username)s has started %(threads)s threads.",t.profile.threads);n=interpolate(i,{username:t.profile.username,threads:t.profile.threads},!0)}else n=pgettext("profile threads","Loading...");return m().createElement(it,(0,J.Z)({api:t.profile.api.threads,emptyMessage:e,header:n,title:pgettext("profile threads title","Threads")},t))},followers:ut,follows:dt,details:X,"username-history":Ct,"ban-details":w};function ge(){var t=[];return k.Z.get("PROFILE_PAGES").forEach((function(e){t.push(Object.assign({},e,{path:k.Z.get("PROFILE").url+e.component+"/",component:(0,i.$j)(fe)(Ze[e.component])}))})),t}var ye=n(39633);k.Z.addInitializer({name:"component:profile",initializer:function(t){t.has("PROFILE")&&t.has("PROFILE_PAGES")&&(0,ye.Z)({root:k.Z.get("PROFILE").url,component:(0,i.$j)(fe)(me),paths:ge()})},after:"reducer:profile-hydrate"})},32488:(t,e,n)=>{"use strict";var a,i=n(34458),o=n(97326),r=n(4942),s=n(22928),l=n(15671),c=n(43144),u=n(79340),d=n(6215),p=n(61120),h=n(57588),m=n.n(h),v=n(82211),f=n(43345),Z=n(78657),g=n(53904),y=n(55210),b=n(93051);function k(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,a=(0,p.Z)(t);if(e){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}var _=function(t){(0,u.Z)(n,t);var e=k(n);function n(t){var a;return(0,l.Z)(this,n),(a=e.call(this,t)).state={isLoading:!1,email:"",validators:{email:[y.Do()]}},a}return(0,c.Z)(n,[{key:"clean",value:function(){return!!this.isValid()||(g.Z.error(pgettext("request activation link form","Enter a valid e-mail address.")),!1)}},{key:"send",value:function(){return Z.Z.post(i.Z.get("SEND_ACTIVATION_API"),{email:this.state.email})}},{key:"handleSuccess",value:function(t){this.props.callback(t)}},{key:"handleError",value:function(t){["already_active","inactive_admin"].indexOf(t.code)>-1?g.Z.info(t.detail):403===t.status&&t.ban?(0,b.Z)(t.ban):g.Z.apiError(t)}},{key:"render",value:function(){return(0,s.Z)("div",{className:"well well-form well-form-request-activation-link"},void 0,(0,s.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,s.Z)("div",{className:"form-group"},void 0,(0,s.Z)("div",{className:"control-input"},void 0,(0,s.Z)("input",{type:"text",className:"form-control",placeholder:pgettext("request activation link form field","Your e-mail address"),disabled:this.state.isLoading,onChange:this.bindInput("email"),value:this.state.email}))),(0,s.Z)(v.Z,{className:"btn-primary btn-block",loading:this.state.isLoading},void 0,pgettext("request activation link form btn","Send link"))))}}]),n}(f.Z),x=function(t){(0,u.Z)(n,t);var e=k(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"getMessage",value:function(){return interpolate(pgettext("request activation link form","Activation link was sent to %(email)s"),{email:this.props.user.email},!0)}},{key:"render",value:function(){return(0,s.Z)("div",{className:"well well-form well-form-request-activation-link well-done"},void 0,(0,s.Z)("div",{className:"done-message"},void 0,a||(a=(0,s.Z)("div",{className:"message-icon"},void 0,(0,s.Z)("span",{className:"material-icon"},void 0,"check"))),(0,s.Z)("div",{className:"message-body"},void 0,(0,s.Z)("p",{},void 0,this.getMessage())),(0,s.Z)("button",{className:"btn btn-primary btn-block",type:"button",onClick:this.props.callback},void 0,pgettext("request activation link form btn","Request another link"))))}}]),n}(m().Component),N=function(t){(0,u.Z)(n,t);var e=k(n);function n(t){var a;return(0,l.Z)(this,n),a=e.call(this,t),(0,r.Z)((0,o.Z)(a),"complete",(function(t){a.setState({complete:t})})),(0,r.Z)((0,o.Z)(a),"reset",(function(){a.setState({complete:!1})})),a.state={complete:!1},a}return(0,c.Z)(n,[{key:"render",value:function(){return this.state.complete?(0,s.Z)(x,{user:this.state.complete,callback:this.reset}):(0,s.Z)(_,{callback:this.complete})}}]),n}(m().Component),w=n(4869);i.Z.addInitializer({name:"component:request-activation-link",initializer:function(){document.getElementById("request-activation-link-mount")&&(0,w.Z)(N,"request-activation-link-mount",!1)},after:"store"})},11768:(t,e,n)=>{"use strict";var a,i,o=n(34458),r=n(97326),s=n(4942),l=n(22928),c=n(15671),u=n(43144),d=n(79340),p=n(6215),h=n(61120),m=n(57588),v=n.n(m),f=n(73935),Z=n.n(f),g=n(82211),y=n(43345),b=n(78657),k=n(53904),_=n(55210),x=n(93051);function N(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,a=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,p.Z)(this,n)}}var w=function(t){(0,d.Z)(n,t);var e=N(n);function n(t){var a;return(0,c.Z)(this,n),(a=e.call(this,t)).state={isLoading:!1,email:"",validators:{email:[_.Do()]}},a}return(0,u.Z)(n,[{key:"clean",value:function(){return!!this.isValid()||(k.Z.error(pgettext("request password reset form","Enter a valid e-mail address.")),!1)}},{key:"send",value:function(){return b.Z.post(o.Z.get("SEND_PASSWORD_RESET_API"),{email:this.state.email})}},{key:"handleSuccess",value:function(t){this.props.callback(t)}},{key:"handleError",value:function(t){["inactive_user","inactive_admin"].indexOf(t.code)>-1?this.props.showInactivePage(t):403===t.status&&t.ban?(0,x.Z)(t.ban):k.Z.apiError(t)}},{key:"render",value:function(){return(0,l.Z)("div",{className:"well well-form well-form-request-password-reset"},void 0,(0,l.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,l.Z)("div",{className:"form-group"},void 0,(0,l.Z)("div",{className:"control-input"},void 0,(0,l.Z)("input",{type:"text",className:"form-control",placeholder:pgettext("request password reset form field","Your e-mail address"),disabled:this.state.isLoading,onChange:this.bindInput("email"),value:this.state.email}))),(0,l.Z)(g.Z,{className:"btn-primary btn-block",loading:this.state.isLoading},void 0,pgettext("request password reset form btn","Send link"))))}}]),n}(y.Z),C=function(t){(0,d.Z)(n,t);var e=N(n);function n(){return(0,c.Z)(this,n),e.apply(this,arguments)}return(0,u.Z)(n,[{key:"getMessage",value:function(){return interpolate(pgettext("request password reset form","Reset password link was sent to %(email)s"),{email:this.props.user.email},!0)}},{key:"render",value:function(){return(0,l.Z)("div",{className:"well well-form well-form-request-password-reset well-done"},void 0,(0,l.Z)("div",{className:"done-message"},void 0,a||(a=(0,l.Z)("div",{className:"message-icon"},void 0,(0,l.Z)("span",{className:"material-icon"},void 0,"check"))),(0,l.Z)("div",{className:"message-body"},void 0,(0,l.Z)("p",{},void 0,this.getMessage())),(0,l.Z)("button",{type:"button",className:"btn btn-primary btn-block",onClick:this.props.callback},void 0,pgettext("request password reset form btn","Request another link"))))}}]),n}(v().Component),R=function(t){(0,d.Z)(n,t);var e=N(n);function n(){return(0,c.Z)(this,n),e.apply(this,arguments)}return(0,u.Z)(n,[{key:"getActivateButton",value:function(){return"inactive_user"===this.props.activation?(0,l.Z)("p",{},void 0,(0,l.Z)("a",{href:o.Z.get("REQUEST_ACTIVATION_URL")},void 0,pgettext("request password reset form error","Activate your account."))):null}},{key:"render",value:function(){return(0,l.Z)("div",{className:"page page-message page-message-info page-forgotten-password-inactive"},void 0,(0,l.Z)("div",{className:"container"},void 0,(0,l.Z)("div",{className:"message-panel"},void 0,i||(i=(0,l.Z)("div",{className:"message-icon"},void 0,(0,l.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,l.Z)("div",{className:"message-body"},void 0,(0,l.Z)("p",{className:"lead"},void 0,pgettext("request password reset form error","Your account is inactive.")),(0,l.Z)("p",{},void 0,this.props.message),this.getActivateButton()))))}}]),n}(v().Component),E=function(t){(0,d.Z)(n,t);var e=N(n);function n(t){var a;return(0,c.Z)(this,n),a=e.call(this,t),(0,s.Z)((0,r.Z)(a),"complete",(function(t){a.setState({complete:t})})),(0,s.Z)((0,r.Z)(a),"reset",(function(){a.setState({complete:!1})})),a.state={complete:!1},a}return(0,u.Z)(n,[{key:"showInactivePage",value:function(t){Z().render((0,l.Z)(R,{activation:t.code,message:t.detail}),document.getElementById("page-mount"))}},{key:"render",value:function(){return this.state.complete?(0,l.Z)(C,{callback:this.reset,user:this.state.complete}):(0,l.Z)(w,{callback:this.complete,showInactivePage:this.showInactivePage})}}]),n}(v().Component),S=n(4869);o.Z.addInitializer({name:"component:request-password-reset",initializer:function(){document.getElementById("request-password-reset-mount")&&(0,S.Z)(E,"request-password-reset-mount",!1)},after:"store"})},61323:(t,e,n)=>{"use strict";var a,i=n(34458),o=n(97326),r=n(4942),s=n(22928),l=n(15671),c=n(43144),u=n(79340),d=n(6215),p=n(61120),h=n(57588),m=n.n(h),v=n(73935),f=n.n(v),Z=n(82211),g=n(43345),y=n(14467),b=n(78657),k=n(98274),_=n(59801),x=n(53904),N=n(93051),w=n(19755);function C(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,a=(0,p.Z)(t);if(e){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}var R=function(t){(0,u.Z)(n,t);var e=C(n);function n(t){var a;return(0,l.Z)(this,n),(a=e.call(this,t)).state={isLoading:!1,password:""},a}return(0,c.Z)(n,[{key:"clean",value:function(){return!!this.state.password.trim().length||(x.Z.error(pgettext("password reset form","Enter new password.")),!1)}},{key:"send",value:function(){return b.Z.post(i.Z.get("CHANGE_PASSWORD_API"),{password:this.state.password})}},{key:"handleSuccess",value:function(t){this.props.callback(t)}},{key:"handleError",value:function(t){403===t.status&&t.ban?(0,N.Z)(t.ban):x.Z.apiError(t)}},{key:"render",value:function(){return(0,s.Z)("div",{className:"well well-form well-form-reset-password"},void 0,(0,s.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,s.Z)("div",{className:"form-group"},void 0,(0,s.Z)("div",{className:"control-input"},void 0,(0,s.Z)("input",{type:"password",className:"form-control",placeholder:pgettext("password reset form field","Enter new password"),disabled:this.state.isLoading,onChange:this.bindInput("password"),value:this.state.password}))),(0,s.Z)(Z.Z,{className:"btn-primary btn-block",loading:this.state.isLoading},void 0,pgettext("password reset form btn","Change password"))))}}]),n}(g.Z),E=function(t){(0,u.Z)(n,t);var e=C(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"getMessage",value:function(){return interpolate(pgettext("password reset form","%(username)s, your password has been changed."),{username:this.props.user.username},!0)}},{key:"showSignIn",value:function(){_.Z.show(y.Z)}},{key:"render",value:function(){return(0,s.Z)("div",{className:"page page-message page-message-success page-forgotten-password-changed"},void 0,(0,s.Z)("div",{className:"container"},void 0,(0,s.Z)("div",{className:"message-panel"},void 0,a||(a=(0,s.Z)("div",{className:"message-icon"},void 0,(0,s.Z)("span",{className:"material-icon"},void 0,"check"))),(0,s.Z)("div",{className:"message-body"},void 0,(0,s.Z)("p",{className:"lead"},void 0,this.getMessage()),(0,s.Z)("p",{},void 0,pgettext("password reset form","Sign in using new password to continue.")),(0,s.Z)("p",{},void 0,(0,s.Z)("button",{type:"button",className:"btn btn-primary",onClick:this.showSignIn},void 0,pgettext("password reset form btn","Sign in")))))))}}]),n}(m().Component),S=function(t){(0,u.Z)(n,t);var e=C(n);function n(){var t;(0,l.Z)(this,n);for(var a=arguments.length,i=new Array(a),c=0;c<a;c++)i[c]=arguments[c];return t=e.call.apply(e,[this].concat(i)),(0,r.Z)((0,o.Z)(t),"complete",(function(t){k.Z.softSignOut(),w('#hidden-login-form input[name="next"]').remove(),f().render((0,s.Z)(E,{user:t}),document.getElementById("page-mount"))})),t}return(0,c.Z)(n,[{key:"render",value:function(){return(0,s.Z)(R,{callback:this.complete})}}]),n}(m().Component),L=n(4869);i.Z.addInitializer({name:"component:reset-password-form",initializer:function(){document.getElementById("reset-password-form-mount")&&(0,L.Z)(S,"reset-password-form-mount",!1)},after:"store"})},64752:(t,e,n)=>{"use strict";var a,i=n(22928),o=(n(57588),n(73935)),r=n.n(o),s=n(37424),l=n(11920),c=n(90287);misago.addInitializer({name:"component:search-overlay",initializer:function(t){var e=document.getElementById("search-mount");r().render((0,i.Z)(s.zt,{store:c.Z.getStore()},void 0,a||(a=(0,i.Z)(l.F,{}))),e)},after:"store"})},40949:(t,e,n)=>{"use strict";var a,i=n(37424),o=n(22928),r=n(87462),s=n(57588),l=n.n(s),c=n(59131),u=n(15671),d=n(43144),p=n(97326),h=n(79340),m=n(6215),v=n(61120),f=n(4942),Z=n(34458),g=n(43345),y=n(21981),b=n(16427),k=n(6935),_=n(78657),x=n(53904),N=n(90287),w=n(98936),C=n(99755);var R=function(t){(0,h.Z)(r,t);var e,n,i=(e=r,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,v.Z)(e);if(n){var i=(0,v.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,m.Z)(this,t)});function r(t){var e;return(0,u.Z)(this,r),e=i.call(this,t),(0,f.Z)((0,p.Z)(e),"onQueryChange",(function(t){e.changeValue("query",t.target.value)})),e.state={isLoading:!1,query:t.search.query},e}return(0,d.Z)(r,[{key:"componentDidMount",value:function(){this.state.query.length&&this.handleSubmit()}},{key:"clean",value:function(){return!!this.state.query.trim().length||(x.Z.error(pgettext("search form","You have to enter search query.")),!1)}},{key:"send",value:function(){N.Z.dispatch((0,b.Vx)({isLoading:!0}));var t=this.state.query.trim(),e=window.location.href,n=e.indexOf("?q=");return n>0&&(e=e.substring(0,n+3)),window.history.pushState({},"",e+encodeURIComponent(t)),_.Z.get(Z.Z.get("SEARCH_API"),{q:t})}},{key:"handleSuccess",value:function(t){N.Z.dispatch((0,b.Vx)({query:this.state.query.trim(),isLoading:!1,providers:t})),t.forEach((function(t){"users"===t.id?N.Z.dispatch((0,k.ZB)(t.results.results)):"threads"===t.id&&N.Z.dispatch((0,y.zD)(t.results))}))}},{key:"handleError",value:function(t){x.Z.apiError(t),N.Z.dispatch((0,b.Vx)({isLoading:!1}))}},{key:"render",value:function(){return(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)(C.sP,{},void 0,(0,o.Z)(C.mr,{styleName:"site-search"},void 0,(0,o.Z)(C.gC,{styleName:"site-search"},void 0,(0,o.Z)("h1",{},void 0,pgettext("search form title","Search"))),(0,o.Z)(C.eA,{className:"page-header-search-form"},void 0,(0,o.Z)(w.gq,{},void 0,(0,o.Z)(w.kw,{auto:!0},void 0,(0,o.Z)(w.Z6,{},void 0,(0,o.Z)("input",{className:"form-control",disabled:this.state.isLoading,type:"text",value:this.state.query,placeholder:pgettext("search form input","Search"),onChange:this.onQueryChange})),(0,o.Z)(w.Z6,{shrink:!0},void 0,(0,o.Z)("button",{className:"btn btn-secondary btn-icon btn-outline",title:pgettext("search form btn","Search"),disabled:this.state.isLoading},void 0,a||(a=(0,o.Z)("span",{className:"material-icon"},void 0,"search"))))))))))}}]),r}(g.Z),E=n(69987);function S(t){return(0,o.Z)("div",{className:"list-group nav-side"},void 0,t.providers.map((function(t){return(0,o.Z)(E.rU,{activeClassName:"active",className:"list-group-item",to:t.url},t.id,(0,o.Z)("span",{className:"material-icon"},void 0,t.icon),t.name,(0,o.Z)(L,{results:t.results}))})))}function L(t){if(!t.results)return null;var e=t.results.count;return e>1e6?e=Math.ceil(e/1e6)+"KK":e>1e3&&(e=Math.ceil(e/1e3)+"K"),(0,o.Z)("span",{className:"badge"},void 0,e)}function O(t){return(0,o.Z)("div",{className:"page page-search"},void 0,(0,o.Z)(R,{provider:t.provider,search:t.search}),(0,o.Z)(c.Z,{},void 0,(0,o.Z)("div",{className:"row"},void 0,(0,o.Z)("div",{className:"col-md-3"},void 0,(0,o.Z)(S,{providers:t.search.providers})),(0,o.Z)("div",{className:"col-md-9"},void 0,t.children,(0,o.Z)(P,{provider:t.provider,search:t.search})))))}function P(t){var e=null;if(t.search.providers.forEach((function(n){n.id===t.provider.id&&(e=n.time)})),null===e)return null;var n=pgettext("search time","Search took %(time)s s");return(0,o.Z)("footer",{className:"search-footer"},void 0,(0,o.Z)("p",{},void 0,interpolate(n,{time:e},!0)))}var A=n(11005),T=n(82211);function I(t){return(0,o.Z)("div",{},void 0,(0,o.Z)(A.Z,{isReady:!0,posts:t.results}),l().createElement(B,t))}n(69092);var B=function(t){(0,h.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,v.Z)(e);if(n){var i=(0,v.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,m.Z)(this,t)});function i(){var t;(0,u.Z)(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t=a.call.apply(a,[this].concat(n)),(0,f.Z)((0,p.Z)(t),"onClick",(function(){N.Z.dispatch((0,y.Vx)({isBusy:!0})),_.Z.get(t.props.provider.api,{q:t.props.query,page:t.props.next}).then((function(t){t.forEach((function(t){"threads"===t.id&&(N.Z.dispatch((0,y.R3)(t.results)),N.Z.dispatch((0,b.P0)(t)))})),N.Z.dispatch((0,y.Vx)({isBusy:!1}))}),(function(t){x.Z.apiError(t),N.Z.dispatch((0,y.Vx)({isBusy:!1}))}))})),t}return(0,d.Z)(i,[{key:"render",value:function(){return this.props.more?(0,o.Z)("div",{className:"pager-more"},void 0,(0,o.Z)(T.Z,{className:"btn btn-default btn-outline",loading:this.props.isBusy,onClick:this.onClick},void 0,pgettext("search threads btn","Show more"))):null}}]),i}(l().Component);function j(t){var e=t.children,n=t.loading,a=t.posts,i=t.query;return a&&a.count?e:i.length?(0,o.Z)("p",{className:"lead"},void 0,n?pgettext("search threads","Loading results..."):pgettext("search threads","No threads matching search query have been found.")):(0,o.Z)("p",{className:"lead"},void 0,pgettext("search threads","Enter at least two characters to search threads."))}var D=n(40429);function U(t){var e=t.children,n=t.loading,a=t.query;return t.users.length?e:a.length?(0,o.Z)("p",{className:"lead"},void 0,n?pgettext("search users","Loading results..."):pgettext("search users","No users matching search query have been found.")):(0,o.Z)("p",{className:"lead"},void 0,pgettext("search users","Enter at least two characters to search users."))}var z={threads:function(t){return(0,o.Z)(O,{provider:t.route.provider,search:t.search},void 0,(0,o.Z)(j,{loading:t.search.isLoading,query:t.search.query,posts:t.posts},void 0,l().createElement(I,(0,r.Z)({provider:t.route.provider,query:t.search.query},t.posts))))},users:function(t){return(0,o.Z)(O,{provider:t.route.provider,search:t.search},void 0,(0,o.Z)(U,{loading:t.search.isLoading,query:t.search.query,users:t.users},void 0,(0,o.Z)(D.Z,{cols:3,isReady:!t.search.isLoading,users:t.users})))}};function q(t){return{posts:t.posts,search:t.search,tick:t.tick.tick,user:t.auth.user,users:t.users}}var M=n(39633);Z.Z.addInitializer({name:"component:search",initializer:function(t){var e;"misago:search"===t.get("CURRENT_LINK")&&(0,M.Z)({paths:(e=Z.Z.get("SEARCH_PROVIDERS"),e.map((function(t){return{path:t.url,component:(0,i.$j)(q)(z[t.id]),provider:t}})))})},after:"store"})},78679:(t,e,n)=>{"use strict";var a,i=n(22928),o=(n(57588),n(73935)),r=n.n(o),s=n(37424),l=n(6333),c=n(90287);misago.addInitializer({name:"component:site-nav-overlay",initializer:function(t){var e=document.getElementById("site-nav-mount");r().render((0,i.Z)(s.zt,{store:c.Z.getStore()},void 0,a||(a=(0,i.Z)(l.Or,{}))),e)},after:"store"})},61814:(t,e,n)=>{"use strict";var a=n(37424),i=n(34458),o=n(22928),r=n(15671),s=n(43144),l=n(79340),c=n(6215),u=n(61120),d=n(57588);var p={info:"alert-info",success:"alert-success",warning:"alert-warning",error:"alert-danger"},h=function(t){(0,l.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,u.Z)(e);if(n){var i=(0,u.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,c.Z)(this,t)});function i(){return(0,r.Z)(this,i),a.apply(this,arguments)}return(0,s.Z)(i,[{key:"getSnackbarClass",value:function(){var t="alerts-snackbar";return this.props.isVisible?t+=" in":t+=" out",t}},{key:"render",value:function(){return(0,o.Z)("div",{className:this.getSnackbarClass()},void 0,(0,o.Z)("p",{className:"alert "+p[this.props.type]},void 0,this.props.message))}}]),i}(n.n(d)().Component);function m(t){return t.snackbar}var v=n(4869);i.Z.addInitializer({name:"component:snackbar",initializer:function(){(0,v.Z)((0,a.$j)(m)(h),"snackbar-mount")},after:"snackbar"})},95920:(t,e,n)=>{"use strict";var a=n(57588),i=n.n(a),o=n(22928),r=n(15671),s=n(43144),l=n(97326),c=n(79340),u=n(6215),d=n(61120),p=n(4942),h=n(34458),m=n(26106),v=n(82211),f=n(43345),Z=n(96359),g=n(78657),y=n(53904),b=n(55210),k=n(59131),_=n(99755);const x=function(t){var e=t.backendName,n=pgettext("social auth title","Sign in with %(backend)s"),a=interpolate(n,{backend:e},!0);return(0,o.Z)(_.sP,{},void 0,(0,o.Z)(_.mr,{styleName:"social-auth"},void 0,(0,o.Z)(_.gC,{styleName:"social-auth"},void 0,(0,o.Z)("h1",{},void 0,a))))};function N(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function w(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?N(Object(n),!0).forEach((function(e){(0,p.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var C=function(t){(0,c.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,d.Z)(e);if(n){var i=(0,d.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,u.Z)(this,t)});function i(t){var e;(0,r.Z)(this,i),e=a.call(this,t),(0,p.Z)((0,l.Z)(e),"handlePrivacyPolicyChange",(function(t){var n=t.target.value;e.handleToggleAgreement("privacyPolicy",n)})),(0,p.Z)((0,l.Z)(e),"handleTermsOfServiceChange",(function(t){var n=t.target.value;e.handleToggleAgreement("termsOfService",n)})),(0,p.Z)((0,l.Z)(e),"handleToggleAgreement",(function(t,n){e.setState((function(a,i){if(null===a[t]){var o=w(w({},a.errors),{},(0,p.Z)({},t,null));return(0,p.Z)({errors:o},t,n)}var r=e.state.validators[t][0],s=w(w({},a.errors),{},(0,p.Z)({},t,[r(null)]));return(0,p.Z)({errors:s},t,null)}))}));var n={email:[b.Do()],username:[b.lG()]};return h.Z.get("TERMS_OF_SERVICE_ID")&&(n.termsOfService=[b.fT()]),h.Z.get("PRIVACY_POLICY_ID")&&(n.privacyPolicy=[b.jA()]),e.state={email:t.email||"",emailProtected:!!t.email,username:t.username||"",termsOfService:null,privacyPolicy:null,validators:n,errors:{},isLoading:!1},e}return(0,s.Z)(i,[{key:"clean",value:function(){if(this.validate(),-1!==[this.state.email.trim().length,this.state.username.trim().length].indexOf(0))return y.Z.error(pgettext("social auth form","Fill out all fields.")),!1;var t=this.state.validators;return h.Z.get("TERMS_OF_SERVICE_ID")&&null===this.state.termsOfService?(y.Z.error(t.termsOfService[0](null)),!1):!h.Z.get("PRIVACY_POLICY_ID")||null!==this.state.privacyPolicy||(y.Z.error(t.privacyPolicy[0](null)),!1)}},{key:"send",value:function(){return g.Z.post(this.props.url,{email:this.state.email,username:this.state.username,terms_of_service:this.state.termsOfService,privacy_policy:this.state.privacyPolicy})}},{key:"handleSuccess",value:function(t){(0,this.props.onRegistrationComplete)(t)}},{key:"handleError",value:function(t){if(200===t.status)(0,this.props.onRegistrationComplete)({activation:"active",step:"done",username:this.state.username});else if(400===t.status){var e={errors:t};t.email&&(e.emailProtected=!1),this.setState(e)}else y.Z.apiError(t)}},{key:"render",value:function(){var t=this.props.backend_name,e=this.state,n=e.email,a=e.emailProtected,i=e.username,r=e.isLoading,s=null;if(a){var l=pgettext("social auth form","Your e-mail address has been verified by %(backend)s.");s=interpolate(l,{backend:t},!0)}return(0,o.Z)("div",{className:"page page-social-auth page-social-auth-register"},void 0,(0,o.Z)(x,{backendName:t}),(0,o.Z)(k.Z,{},void 0,(0,o.Z)("div",{className:"row"},void 0,(0,o.Z)("div",{className:"col-md-6 col-md-offset-3"},void 0,(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"panel panel-default panel-form"},void 0,(0,o.Z)("div",{className:"panel-heading"},void 0,(0,o.Z)("h3",{className:"panel-title"},void 0,pgettext("social auth form title","Complete your account"))),(0,o.Z)("div",{className:"panel-body"},void 0,(0,o.Z)(Z.Z,{for:"id_username",label:pgettext("social auth form field","Username"),validation:this.state.errors.username},void 0,(0,o.Z)("input",{type:"text",id:"id_username",className:"form-control",disabled:r,onChange:this.bindInput("username"),value:i})),(0,o.Z)(Z.Z,{for:"id_email",label:pgettext("social auth form field","E-mail address"),helpText:s,validation:a?null:this.state.errors.email},void 0,(0,o.Z)("input",{type:"email",id:"id_email",className:"form-control",disabled:r||a,onChange:this.bindInput("email"),value:n})),(0,o.Z)(m.Z,{errors:this.state.errors,privacyPolicy:this.state.privacyPolicy,termsOfService:this.state.termsOfService,onPrivacyPolicyChange:this.handlePrivacyPolicyChange,onTermsOfServiceChange:this.handleTermsOfServiceChange})),(0,o.Z)("div",{className:"panel-footer"},void 0,(0,o.Z)(v.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,pgettext("social auth form btn","Sign in")))))))))}}]),i}(f.Z);const R=function(t){var e,n,a=t.activation,i=t.backend_name,r=t.username;return n="user"===a?pgettext("account activation required","%(username)s, your account has been created but you need to activate it before you will be able to sign in."):"admin"===a?pgettext("account activation required","%(username)s, your account has been created but the site administrator will have to activate it before you will be able to sign in."):pgettext("social auth complete","%(username)s, your account has been created and you have been signed in to it."),e="active"===a?"check":"info_outline",(0,o.Z)("div",{className:"page page-social-auth page-social-auth-register"},void 0,(0,o.Z)(x,{backendName:i}),(0,o.Z)(k.Z,{},void 0,(0,o.Z)("div",{className:"row"},void 0,(0,o.Z)("div",{className:"col-md-6 col-md-offset-3"},void 0,(0,o.Z)("div",{className:"panel panel-default panel-form"},void 0,(0,o.Z)("div",{className:"panel-heading"},void 0,(0,o.Z)("h3",{className:"panel-title"},void 0,pgettext("social auth complete title","Registration completed!"))),(0,o.Z)("div",{className:"panel-body panel-message-body"},void 0,(0,o.Z)("div",{className:"message-icon"},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,e)),(0,o.Z)("div",{className:"message-body"},void 0,(0,o.Z)("p",{className:"lead"},void 0,interpolate(n,{username:r},!0)),(0,o.Z)("p",{className:"help-block"},void 0,(0,o.Z)("a",{className:"btn btn-default",href:h.Z.get("MISAGO_PATH")},void 0,pgettext("social auth complete link","Return to forum index"))))))))))};var E=function(t){(0,c.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,d.Z)(e);if(n){var i=(0,d.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,u.Z)(this,t)});function i(t){var e;return(0,r.Z)(this,i),e=a.call(this,t),(0,p.Z)((0,l.Z)(e),"handleRegistrationComplete",(function(t){var n=t.activation,a=t.email,i=t.step,o=t.username;e.setState({activation:n,email:a,step:i,username:o})})),e.state={step:t.step,activation:t.activation||"",email:t.email||"",username:t.username||""},e}return(0,s.Z)(i,[{key:"render",value:function(){var t=this.props,e=t.backend_name,n=t.url,a=this.state,i=a.activation,r=a.email,s=a.step,l=a.username;return"register"===s?(0,o.Z)(C,{backend_name:e,email:r,url:n,username:l,onRegistrationComplete:this.handleRegistrationComplete}):(0,o.Z)(R,{activation:i,backend_name:e,email:r,url:n,username:l})}}]),i}(i().Component),S=n(4869);h.Z.addInitializer({name:"component:social-auth",initializer:function(t){if("misago:social-complete"===t.get("CURRENT_LINK")){var e=t.get("SOCIAL_AUTH_FORM");(0,S.Z)(i().createElement(E,e),"page-mount")}},after:"store"})},44095:(t,e,n)=>{"use strict";var a,i,o=n(37424),r=n(22928),s=n(15671),l=n(43144),c=n(97326),u=n(79340),d=n(6215),p=n(61120),h=n(4942),m=n(57588),v=n.n(m),f=n(87462),Z=n(43345),g=n(96359),y=n(8154),b=n(7738),k=n(78657),_=n(59801),x=n(53904),N=n(90287);var w,C=function(t){(0,u.Z)(o,t);var e,n,i=(e=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function o(t){var e;return(0,s.Z)(this,o),e=i.call(this,t),(0,h.Z)((0,c.Z)(e),"onUsernameChange",(function(t){e.changeValue("username",t.target.value)})),e.state={isLoading:!1,username:""},e}return(0,l.Z)(o,[{key:"clean",value:function(){return!!this.state.username.trim().length||(x.Z.error(pgettext("add private thread participant","You have to enter user name.")),!1)}},{key:"send",value:function(){return k.Z.patch(this.props.thread.api.index,[{op:"add",path:"participants",value:this.state.username},{op:"add",path:"acl",value:1}])}},{key:"handleSuccess",value:function(t){N.Z.dispatch((0,b.y8)(t)),N.Z.dispatch(y.gx(t.participants)),x.Z.success(pgettext("add private thread participant","New participant has been added to thread.")),_.Z.hide()}},{key:"render",value:function(){return(0,r.Z)("div",{className:"modal-dialog modal-sm",role:"document"},void 0,(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,a||(a=(0,r.Z)(R,{})),(0,r.Z)("div",{className:"modal-body"},void 0,(0,r.Z)(g.Z,{for:"id_username",label:pgettext("add private thread participant field","User to add")},void 0,(0,r.Z)("input",{id:"id_username",className:"form-control",disabled:this.state.isLoading,onChange:this.onUsernameChange,type:"text",value:this.state.username}))),(0,r.Z)("div",{className:"modal-footer"},void 0,(0,r.Z)("button",{className:"btn btn-block btn-primary",disabled:this.state.isLoading},void 0,pgettext("add private thread participant btn","Add participant")),(0,r.Z)("button",{className:"btn btn-block btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,pgettext("add private thread participant btn","Cancel"))))))}}]),o}(Z.Z);function R(t){return(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,i||(i=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("add private thread participant modal title","Add participant")))}var E=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(){var t;(0,s.Z)(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t=a.call.apply(a,[this].concat(n)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){_.Z.show((0,r.Z)(C,{thread:t.props.thread}))})),t}return(0,l.Z)(i,[{key:"render",value:function(){return this.props.thread.acl.can_add_participants?(0,r.Z)("div",{className:"col-xs-12 col-sm-3"},void 0,(0,r.Z)("button",{className:"btn btn-default btn-block",onClick:this.onClick,type:"button"},void 0,w||(w=(0,r.Z)("span",{className:"material-icon"},void 0,"person_add")),pgettext("add participant btn","Add participant"))):null}}]),i}(v().Component),S=n(34458);var L=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(t){var e;return(0,s.Z)(this,i),e=a.call(this,t),(0,h.Z)((0,c.Z)(e),"onClick",(function(){var t,n,a=!1;if(e.isUser)a=window.confirm(pgettext("private thread owner change","Are you sure you want to take over this thread?"));else{var i=pgettext("private thread owner change","Are you sure you want to change thread owner to %(user)s?");a=window.confirm(interpolate(i,{user:e.props.participant.username},!0))}a&&(t=e.props.thread,n=e.props.participant,k.Z.patch(t.api.index,[{op:"replace",path:"owner",value:n.id},{op:"add",path:"acl",value:1}]).then((function(t){N.Z.dispatch((0,b.y8)(t)),N.Z.dispatch(y.gx(t.participants));var e=pgettext("thread participants actions","%(user)s has been made new thread owner.");x.Z.success(interpolate(e,{user:n.username},!0))}),(function(t){x.Z.apiError(t)})))})),e.isUser=t.participant.id===t.user.id,e}return(0,l.Z)(i,[{key:"render",value:function(){return this.props.participant.is_owner?null:this.props.thread.acl.can_change_owner?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,pgettext("private thread owner change btn","Make owner"))):null}}]),i}(v().Component);var O,P,A,T=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(t){var e;return(0,s.Z)(this,i),e=a.call(this,t),(0,h.Z)((0,c.Z)(e),"onClick",(function(){var t,n,a=!1;if(e.isUser)a=window.confirm(pgettext("private thread leave","Are you sure you want to leave this thread?"));else{var i=pgettext("private thread leave","Are you sure you want to remove %(user)s from this thread?");a=window.confirm(interpolate(i,{user:e.props.participant.username},!0))}a&&(e.isUser?(t=e.props.thread,n=e.props.participant,k.Z.patch(t.api.index,[{op:"remove",path:"participants",value:n.id}]).then((function(){x.Z.success(pgettext("thread participants actions","You have left this thread.")),window.setTimeout((function(){window.location=S.Z.get("PRIVATE_THREADS_URL")}),3e3)}),(function(t){x.Z.apiError(t)}))):function(t,e){k.Z.patch(t.api.index,[{op:"remove",path:"participants",value:e.id},{op:"add",path:"acl",value:1}]).then((function(t){N.Z.dispatch((0,b.y8)(t)),N.Z.dispatch(y.gx(t.participants));var n=pgettext("thread participants actions","%(user)s has been removed from this thread.");x.Z.success(interpolate(n,{user:e.username},!0))}),(function(t){x.Z.apiError(t)}))}(e.props.thread,e.props.participant))})),e.isUser=t.participant.id===t.user.id,e}return(0,l.Z)(i,[{key:"render",value:function(){var t=this.props.user.acl.can_moderate_private_threads;return this.props.userIsOwner||this.isUser||t?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,this.isUser?pgettext("private thread leave btn","Leave thread"):pgettext("private thread leave btn","Remove"))):null}}]),i}(v().Component),I=n(19605);function B(t){var e=t.participant,n="btn btn-default";return e.is_owner&&(n="btn btn-primary"),n+=" btn-user btn-block",(0,r.Z)("div",{className:"col-xs-12 col-sm-3 col-md-2 participant-card"},void 0,(0,r.Z)("div",{className:"dropdown"},void 0,(0,r.Z)("button",{"aria-haspopup":"true","aria-expanded":"false",className:n,"data-toggle":"dropdown",type:"button"},void 0,(0,r.Z)(I.ZP,{size:"34",user:e}),(0,r.Z)("span",{className:"btn-text"},void 0,e.username)),(0,r.Z)("ul",{className:"dropdown-menu stick-to-bottom"},void 0,(0,r.Z)(j,{isOwner:e.is_owner}),O||(O=(0,r.Z)("li",{className:"dropdown-header"})),(0,r.Z)("li",{},void 0,(0,r.Z)("a",{href:e.url},void 0,pgettext("thread participants profile link","See profile"))),P||(P=(0,r.Z)("li",{role:"separator",className:"divider"})),v().createElement(L,t),v().createElement(T,t))))}function j(t){return t.isOwner?(0,r.Z)("li",{className:"dropdown-header dropdown-header-owner"},void 0,A||(A=(0,r.Z)("span",{className:"material-icon"},void 0,"start")),(0,r.Z)("span",{className:"icon-text"},void 0,pgettext("thread participants owner status","Thread owner"))):null}function D(t){var e=t.participants,n=t.thread,a=t.user,i=t.userIsOwner;return(0,r.Z)("div",{className:"participants-cards"},void 0,(0,r.Z)("div",{className:"row"},void 0,e.map((function(t){return(0,r.Z)(B,{participant:t,thread:n,user:a,userIsOwner:i},t.id)}))))}function U(t){return t.participants.length?(0,r.Z)("div",{className:"panel panel-default panel-participants"},void 0,(0,r.Z)("div",{className:"panel-body"},void 0,v().createElement(D,(0,f.Z)({userIsOwner:z(t.user,t.participants)},t)),(0,r.Z)("div",{className:"row"},void 0,(0,r.Z)(E,{thread:t.thread}),(0,r.Z)("div",{className:"col-xs-12 col-sm-9"},void 0,(0,r.Z)("p",{},void 0,function(t){var e=t.length,n=npgettext("thread participants stat","This thread has %(users)s participant.","This thread has %(users)s participants.",e);return interpolate(n,{users:e},!0)}(t.participants)))))):null}function z(t,e){return e[0].id===t.id}var q,M=n(30381),F=n.n(M);function H(t){return(0,r.Z)("div",{className:"poll-choices-bars"},void 0,t.poll.choices.map((function(e){return(0,r.Z)(V,{choice:e,poll:t.poll},e.hash)})))}function V(t){var e=0;return t.choice.votes&&t.poll.votes&&(e=Math.ceil(100*t.choice.votes/t.poll.votes)),(0,r.Z)("dl",{className:"dl-horizontal"},void 0,(0,r.Z)("dt",{},void 0,t.choice.label),(0,r.Z)("dd",{},void 0,(0,r.Z)("div",{className:"progress"},void 0,(0,r.Z)("div",{className:"progress-bar",role:"progressbar","aria-valuenow":e,"aria-valuemin":"0","aria-valuemax":"100",style:{width:e+"%"}},void 0,(0,r.Z)("span",{className:"sr-only"},void 0,G(t.votes,t.proc)))),(0,r.Z)("ul",{className:"list-unstyled list-inline poll-chart"},void 0,(0,r.Z)(Y,{proc:e,votes:t.choice.votes}),(0,r.Z)(W,{selected:t.choice.selected}))))}function Y(t){return(0,r.Z)("li",{className:"poll-chart-votes"},void 0,G(t.votes,t.proc))}function G(t,e){var n=npgettext("thread poll","%(votes)s vote, %(proc)s% of total.","%(votes)s votes, %(proc)s% of total.",t);return interpolate(n,{votes:t,proc:e},!0)}function W(t){return t.selected?(0,r.Z)("li",{className:"poll-chart-selected"},void 0,q||(q=(0,r.Z)("span",{className:"material-icon"},void 0,"check_box")),pgettext("thread poll","You've voted on this choice.")):null}var $,Q,K,X=n(30337),J=n(3784);var tt=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(t){var e;return(0,s.Z)(this,i),(e=a.call(this,t)).state={isLoading:!0,error:null,data:[]},e}return(0,l.Z)(i,[{key:"componentDidMount",value:function(){var t=this;k.Z.get(this.props.poll.api.votes).then((function(e){var n=e.map((function(t){return Object.assign({},t,{voters:t.voters.map((function(t){return Object.assign({},t,{voted_on:F()(t.voted_on)})}))})}));t.setState({isLoading:!1,data:n})}),(function(e){t.setState({isLoading:!1,error:e.detail})}))}},{key:"render",value:function(){return(0,r.Z)("div",{className:"modal-dialog"+(this.state.error?" modal-message":" modal-sm"),role:"document"},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":pgettext("modal","Close")},void 0,$||($=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("thread poll","Poll votes"))),(0,r.Z)(et,{data:this.state.data,error:this.state.error,isLoading:this.state.isLoading})))}}]),i}(v().Component);function et(t){return t.isLoading?Q||(Q=(0,r.Z)(J.Z,{})):t.error?(0,r.Z)(X.Z,{icon:"error_outline",message:t.error}):(0,r.Z)(nt,{data:t.data})}function nt(t){return(0,r.Z)("div",{className:"modal-body modal-poll-votes"},void 0,(0,r.Z)("ul",{className:"list-unstyled votes-details"},void 0,t.data.map((function(t){return v().createElement(at,(0,f.Z)({key:t.hash},t))}))))}function at(t){return(0,r.Z)("li",{},void 0,(0,r.Z)("h4",{},void 0,t.label),(0,r.Z)(it,{votes:t.votes}),(0,r.Z)(ot,{voters:t.voters}),K||(K=(0,r.Z)("hr",{})))}function it(t){var e=npgettext("thread poll","%(votes)s user has voted for this choice.","%(votes)s users have voted for this choice.",t.votes),n=interpolate(e,{votes:t.votes},!0);return(0,r.Z)("p",{},void 0,n)}function ot(t){return t.voters.length?(0,r.Z)("ul",{className:"list-unstyled"},void 0,t.voters.map((function(t){return v().createElement(rt,(0,f.Z)({key:t.username},t))}))):null}function rt(t){return t.url?(0,r.Z)("li",{},void 0,(0,r.Z)("a",{className:"item-title",href:t.url},void 0,t.username)," ",(0,r.Z)(st,{voted_on:t.voted_on})):(0,r.Z)("li",{},void 0,(0,r.Z)("strong",{},void 0,t.username)," ",(0,r.Z)(st,{voted_on:t.voted_on}))}function st(t){return(0,r.Z)("abbr",{className:"text-muted",title:t.voted_on.format("LLL")},void 0,t.voted_on.fromNow())}var lt=n(59752),ct=n(64646);function ut(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,a=(0,p.Z)(t);if(e){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}function dt(t){var e=t.isPollOver,n=t.poll,a=t.showVoting,i=t.thread;if(!function(t,e,n){return n.is_public||e.can_delete||e.can_edit||e.can_see_votes||e.can_vote&&!t&&(!n.hasSelectedChoices||n.allow_revotes)}(e,n.acl,n))return null;var o=[],s=n.acl.can_vote,l=!n.hasSelectedChoices||n.allow_revotes;return s&&l&&o.push(0),(n.is_public||n.acl.can_see_votes)&&o.push(1),n.acl.can_edit&&o.push(2),n.acl.can_delete&&o.push(3),(0,r.Z)("div",{className:"row poll-options"},void 0,(0,r.Z)(ht,{controls:o,isPollOver:e,poll:n,showVoting:a}),(0,r.Z)(mt,{controls:o,poll:n}),(0,r.Z)(vt,{controls:o,poll:n,thread:i,onClick:t.edit}),(0,r.Z)(ft,{controls:o,poll:n}))}function pt(t,e){var n="col-xs-6";return 1===t.length&&(n="col-xs-12"),3===t.length&&t[0]===e&&(n="col-xs-12"),n+" col-sm-3 col-md-2"}function ht(t){var e=t.poll.acl.can_vote,n=!t.poll.hasSelectedChoices||t.poll.allow_revotes;return e&&n?(0,r.Z)("div",{className:pt(t.controls,0)},void 0,(0,r.Z)("button",{className:"btn btn-default btn-block btn-sm",disabled:t.poll.isBusy,onClick:t.showVoting,type:"button"},void 0,pgettext("thread poll","Vote"))):null}var mt=function(t){(0,u.Z)(n,t);var e=ut(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){_.Z.show((0,r.Z)(tt,{poll:t.props.poll}))})),t}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.poll.is_public||this.props.poll.acl.can_see_votes?(0,r.Z)("div",{className:pt(this.props.controls,1)},void 0,(0,r.Z)("button",{className:"btn btn-default btn-block btn-sm",disabled:this.props.poll.isBusy,onClick:this.onClick,type:"button"},void 0,pgettext("thread poll","See votes"))):null}}]),n}(v().Component);function vt(t){return t.poll.acl.can_edit?(0,r.Z)("div",{className:pt(t.controls,2)},void 0,(0,r.Z)("button",{className:"btn btn-default btn-block btn-sm",disabled:t.poll.isBusy,onClick:t.onClick,type:"button"},void 0,pgettext("thread poll","Edit"))):null}var ft=function(t){(0,u.Z)(n,t);var e=ut(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){if(!window.confirm(pgettext("thread poll","Are you sure you want to delete this poll? This action is not reversible.")))return!1;N.Z.dispatch(lt.n6()),k.Z.delete(t.props.poll.api.index).then(t.handleSuccess,t.handleError)})),(0,h.Z)((0,c.Z)(t),"handleSuccess",(function(t){x.Z.success(pgettext("thread poll","Poll has been deleted")),N.Z.dispatch(lt.Od()),N.Z.dispatch(b.y8(t))})),(0,h.Z)((0,c.Z)(t),"handleError",(function(t){x.Z.apiError(t),N.Z.dispatch(lt.Ar())})),t}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.poll.acl.can_delete?(0,r.Z)("div",{className:pt(this.props.controls,3)},void 0,(0,r.Z)("button",{className:"btn btn-default btn-block btn-sm",disabled:this.props.poll.isBusy,onClick:this.onClick,type:"button"},void 0,pgettext("thread poll","Delete"))):null}}]),n}(v().Component),Zt=n(89627),gt='<abbr title="%(absolute)s">%(relative)s</abbr>';function yt(t){return(0,r.Z)("ul",{className:"list-unstyled list-inline poll-details"},void 0,(0,r.Z)(wt,{votes:t.poll.votes}),(0,r.Z)(xt,{poll:t.poll}),(0,r.Z)(Ct,{poll:t.poll}),(0,r.Z)(bt,{poll:t.poll}))}function bt(t){var e=interpolate((0,Zt.Z)(pgettext("thread poll","Started by %(poster)s %(posted_on)s.")),{poster:kt(t.poll),posted_on:_t(t.poll)},!0);return(0,r.Z)("li",{className:"poll-info-creation",dangerouslySetInnerHTML:{__html:e}})}function kt(t){return t.url.poster?interpolate('<a href="%(url)s" class="item-title">%(user)s</a>',{url:(0,Zt.Z)(t.url.poster),user:(0,Zt.Z)(t.poster_name)},!0):interpolate('<span class="item-title">%(user)s</span>',{user:(0,Zt.Z)(t.poster_name)},!0)}function _t(t){return interpolate(gt,{absolute:(0,Zt.Z)(t.posted_on.format("LLL")),relative:(0,Zt.Z)(t.posted_on.fromNow())},!0)}function xt(t){if(!t.poll.length)return null;var e=interpolate((0,Zt.Z)(pgettext("thread poll","Voting ends %(ends_on)s.")),{ends_on:Nt(t.poll)},!0);return(0,r.Z)("li",{className:"poll-info-ends-on",dangerouslySetInnerHTML:{__html:e}})}function Nt(t){return interpolate(gt,{absolute:(0,Zt.Z)(t.endsOn.format("LLL")),relative:(0,Zt.Z)(t.endsOn.fromNow())},!0)}function wt(t){var e=npgettext("thread poll","%(votes)s vote.","%(votes)s votes.",t.votes),n=interpolate(e,{votes:t.votes},!0);return(0,r.Z)("li",{className:"poll-info-votes"},void 0,n)}function Ct(t){return t.poll.is_public?(0,r.Z)("li",{className:"poll-info-public"},void 0,pgettext("thread poll","Voting is public.")):null}function Rt(t){return(0,r.Z)("div",{className:"panel panel-default panel-poll"},void 0,(0,r.Z)("div",{className:"panel-body"},void 0,(0,r.Z)("h2",{},void 0,t.poll.question),(0,r.Z)(yt,{poll:t.poll}),(0,r.Z)(H,{poll:t.poll}),(0,r.Z)(dt,{isPollOver:t.isPollOver,poll:t.poll,edit:t.edit,showVoting:t.showVoting,thread:t.thread})))}function Et(t){return(0,r.Z)("ul",{className:"list-unstyled list-inline poll-help"},void 0,(0,r.Z)(St,{choicesLeft:t.choicesLeft}),(0,r.Z)(Lt,{poll:t.poll}))}function St(t){var e=t.choicesLeft;if(0===e)return(0,r.Z)("li",{className:"poll-help-choices-left"},void 0,pgettext("thread poll","You can't select any more choices."));var n=npgettext("thread poll","You can select %(choices)s more choice.","You can select %(choices)s more choices.",e),a=interpolate(n,{choices:e},!0);return(0,r.Z)("li",{className:"poll-help-choices-left"},void 0,a)}function Lt(t){return t.poll.allow_revotes?(0,r.Z)("li",{className:"poll-help-allow-revotes"},void 0,pgettext("thread poll","You can change your vote later.")):(0,r.Z)("li",{className:"poll-help-no-revotes"},void 0,pgettext("thread poll","Votes are final."))}function Ot(t){return(0,r.Z)("ul",{className:"list-unstyled poll-select-choices"},void 0,t.choices.map((function(e){return(0,r.Z)(Pt,{choice:e,toggleChoice:t.toggleChoice},e.hash)})))}var Pt=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(){var t;(0,s.Z)(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t=a.call.apply(a,[this].concat(n)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){t.props.toggleChoice(t.props.choice.hash)})),t}return(0,l.Z)(i,[{key:"render",value:function(){return(0,r.Z)("li",{className:"poll-select-choice"},void 0,(0,r.Z)("button",{className:this.props.choice.selected?"btn btn-selected":"btn",onClick:this.onClick,type:"button"},void 0,(0,r.Z)("span",{className:"material-icon"},void 0,this.props.choice.selected?"check_box":"check_box_outline_blank"),(0,r.Z)("strong",{},void 0,this.props.choice.label)))}}]),i}(v().Component);function At(t,e){var n=[];for(var a in e){var i=e[a];i.selected&&n.push(i)}return t.allowed_choices-n.length}var Tt=n(82211);var It=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(t){var e;return(0,s.Z)(this,i),e=a.call(this,t),(0,h.Z)((0,c.Z)(e),"toggleChoice",(function(t){var n,a=function(t,e){for(var n in t){var a=t[n];if(a.hash===e)return a}return null}(e.state.choices,t);n=a.selected?e.deselectChoice(a,t):e.selectChoice(a,t),e.setState({choices:n,choicesLeft:At(e.props.poll,n)})})),(0,h.Z)((0,c.Z)(e),"selectChoice",(function(t,n){if(!At(e.props.poll,e.state.choices))for(var a in e.state.choices.slice()){var i=e.state.choices[a];if(i.selected&&i.hash!=n){i.selected=!1;break}}return e.state.choices.map((function(t){return Object.assign({},t,{selected:t.hash==n||t.selected})}))})),(0,h.Z)((0,c.Z)(e),"deselectChoice",(function(t,n){return e.state.choices.map((function(t){return Object.assign({},t,{selected:t.hash!=n&&t.selected})}))})),e.state={isLoading:!1,choices:t.poll.choices,choicesLeft:At(t.poll,t.poll.choices)},e}return(0,l.Z)(i,[{key:"clean",value:function(){return this.state.choicesLeft!==this.props.poll.allowed_choices||(x.Z.error(pgettext("thread poll vote","You need to select at least one choice.")),!1)}},{key:"send",value:function(){var t=[];for(var e in this.state.choices.slice()){var n=this.state.choices[e];n.selected&&t.push(n.hash)}return k.Z.post(this.props.poll.api.votes,t)}},{key:"handleSuccess",value:function(t){N.Z.dispatch(lt.gx(t)),x.Z.success(pgettext("thread poll vote","Your vote has been saved.")),this.props.showResults()}},{key:"handleError",value:function(t){400===t.status?x.Z.error(t.detail):x.Z.apiError(t)}},{key:"render",value:function(){var t=[];return this.props.poll.acl.can_vote&&t.push(0),(this.props.poll.is_public||this.props.poll.acl.can_see_votes)&&t.push(1),this.props.poll.acl.can_edit&&t.push(2),this.props.poll.acl.can_delete&&t.push(3),(0,r.Z)("div",{className:"panel panel-default panel-poll"},void 0,(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"panel-body"},void 0,(0,r.Z)("h2",{},void 0,this.props.poll.question),(0,r.Z)(yt,{poll:this.props.poll}),(0,r.Z)(Ot,{choices:this.state.choices,toggleChoice:this.toggleChoice}),(0,r.Z)(Et,{choicesLeft:this.state.choicesLeft,poll:this.props.poll})),(0,r.Z)("div",{className:"panel-footer"},void 0,(0,r.Z)("div",{className:"row"},void 0,(0,r.Z)("div",{className:pt(t,0)},void 0,(0,r.Z)(Tt.Z,{className:"btn-primary btn-block btn-sm",loading:this.state.isLoading},void 0,pgettext("thread poll vote btn","Save your vote"))),(0,r.Z)("div",{className:pt(t,1)},void 0,(0,r.Z)("button",{className:"btn btn-default btn-block btn-sm",disabled:this.state.isLoading,onClick:this.props.showResults,type:"button"},void 0,pgettext("thread poll vote btn","See results"))),(0,r.Z)(vt,{controls:t,poll:this.props.poll,thread:this.props.thread,onClick:this.props.edit}),(0,r.Z)(ft,{controls:t,poll:this.props.poll})))))}}]),i}(Z.Z);var Bt,jt=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(t){var e;(0,s.Z)(this,i),e=a.call(this,t),(0,h.Z)((0,c.Z)(e),"showResults",(function(){e.setState({showResults:!0})})),(0,h.Z)((0,c.Z)(e),"showVoting",(function(){e.setState({showResults:!1})}));var n=!0;return t.user.id&&!t.poll.hasSelectedChoices&&(n=!1),e.state={showResults:n},e}return(0,l.Z)(i,[{key:"render",value:function(){if(!this.props.thread.poll)return null;var t=function(t){return!!t.length&&F()().isAfter(t.endsOn)}(this.props.poll);return t||!this.props.poll.acl.can_vote||this.state.showResults?v().createElement(Rt,(0,f.Z)({isPollOver:t,showVoting:this.showVoting},this.props)):v().createElement(It,(0,f.Z)({showResults:this.showResults},this.props))}}]),i}(v().Component),Dt=n(54031);function Ut(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,a=(0,p.Z)(t);if(e){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}var zt=function(t){(0,u.Z)(n,t);var e=Ut(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onAdd",(function(){var e=t.props.choices.slice();e.push({hash:(0,Dt.ZP)(12),label:""}),t.props.setChoices(e)})),(0,h.Z)((0,c.Z)(t),"onChange",(function(e,n){var a=t.props.choices.map((function(t){return t.hash===e&&(t.label=n),t}));t.props.setChoices(a)})),(0,h.Z)((0,c.Z)(t),"onDelete",(function(e){var n=t.props.choices.filter((function(t){return t.hash!==e}));t.props.setChoices(n)})),t}return(0,l.Z)(n,[{key:"render",value:function(){var t=this;return(0,r.Z)("div",{className:"poll-choices-control"},void 0,(0,r.Z)("ul",{className:"list-group"},void 0,this.props.choices.map((function(e){return(0,r.Z)(qt,{canDelete:t.props.choices.length>2,choice:e,disabled:t.props.disabled,onChange:t.onChange,onDelete:t.onDelete},e.hash)}))),(0,r.Z)("button",{className:"btn btn-default btn-sm",disabled:this.props.disabled,onClick:this.onAdd,type:"button"},void 0,pgettext("thread poll","Add choice")))}}]),n}(v().Component),qt=function(t){(0,u.Z)(n,t);var e=Ut(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onChange",(function(e){t.props.onChange(t.props.choice.hash,e.target.value)})),(0,h.Z)((0,c.Z)(t),"onDelete",(function(){(0===t.props.choice.label.length||window.confirm(pgettext("thread poll","Are you sure you want to remove this choice?")))&&t.props.onDelete(t.props.choice.hash)})),t}return(0,l.Z)(n,[{key:"render",value:function(){return(0,r.Z)("li",{className:"list-group-item"},void 0,(0,r.Z)("button",{className:"btn",disabled:!this.props.canDelete||this.props.disabled,onClick:this.onDelete,title:pgettext("thread poll","Remove this choice"),type:"button"},void 0,Bt||(Bt=(0,r.Z)("span",{className:"material-icon"},void 0,"close"))),(0,r.Z)("input",{disabled:this.props.disabled,maxLength:"255",placeholder:pgettext("thread poll","Poll choice"),type:"text",onChange:this.onChange,value:this.props.choice.label}))}}]),n}(v().Component),Mt=n(7227);var Ft=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(t){var e;(0,s.Z)(this,i),e=a.call(this,t),(0,h.Z)((0,c.Z)(e),"setChoices",(function(t){e.setState((function(e){return{choices:t,errors:Object.assign({},e.errors,{choices:null})}}))})),(0,h.Z)((0,c.Z)(e),"onCancel",(function(){if(""===e.state.question&&e.state.choices&&e.state.choices.every((function(t){return""===t.label}))&&0===e.state.length&&1===e.state.allowed_choices)return e.props.close();(e.props.poll?window.confirm(pgettext("thread poll","Are you sure you want to discard changes?")):window.confirm(pgettext("thread poll","Are you sure you want to discard new poll?")))&&e.props.close()}));var n=t.poll.id?t.poll:{question:"",choices:[{hash:"choice-10000",label:""},{hash:"choice-20000",label:""}],length:0,allowed_choices:1,allow_revotes:0,is_public:0};return e.state={isLoading:!1,isEdit:!!n.id,question:n.question,choices:n.choices,length:n.length,allowed_choices:n.allowed_choices,allow_revotes:n.allow_revotes,is_public:n.is_public,validators:{question:[],choices:[],length:[],allowed_choices:[]},errors:{}},e}return(0,l.Z)(i,[{key:"send",value:function(){var t={question:this.state.question,choices:this.state.choices,length:this.state.length,allowed_choices:this.state.allowed_choices,allow_revotes:this.state.allow_revotes,is_public:this.state.is_public};return this.state.isEdit?k.Z.put(this.props.poll.api.index,t):k.Z.post(this.props.thread.api.poll,t)}},{key:"handleSuccess",value:function(t){N.Z.dispatch(lt.gx(t)),this.state.isEdit?x.Z.success(pgettext("thread poll","Poll has been edited.")):x.Z.success(pgettext("thread poll","Poll has been posted.")),this.props.close()}},{key:"handleError",value:function(t){400===t.status?(t.non_field_errors&&(t.allowed_choices=t.non_field_errors),this.setState({errors:Object.assign({},t)}),x.Z.error(gettext("Form contains errors."))):x.Z.apiError(t)}},{key:"render",value:function(){return(0,r.Z)("div",{className:"poll-form"},void 0,(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"panel panel-default panel-form"},void 0,(0,r.Z)("div",{className:"panel-heading"},void 0,(0,r.Z)("h3",{className:"panel-title"},void 0,this.state.isEdit?pgettext("thread poll","Edit poll"):pgettext("thread poll","Add poll"))),(0,r.Z)("div",{className:"panel-body"},void 0,(0,r.Z)("fieldset",{},void 0,(0,r.Z)("legend",{},void 0,pgettext("thread poll","Question and choices")),(0,r.Z)(g.Z,{label:pgettext("thread poll","Poll question"),for:"id_questions",validation:this.state.errors.question},void 0,(0,r.Z)("input",{className:"form-control",disabled:this.state.isLoading,id:"id_questions",onChange:this.bindInput("question"),type:"text",maxLength:"255",value:this.state.question})),(0,r.Z)(g.Z,{label:pgettext("thread poll","Available choices"),validation:this.state.errors.choices},void 0,(0,r.Z)(zt,{choices:this.state.choices,disabled:this.state.isLoading,setChoices:this.setChoices}))),(0,r.Z)("fieldset",{},void 0,(0,r.Z)("legend",{},void 0,pgettext("thread poll","Voting")),(0,r.Z)("div",{className:"row"},void 0,(0,r.Z)("div",{className:"col-xs-12 col-sm-6"},void 0,(0,r.Z)(g.Z,{label:pgettext("thread poll","Poll length"),helpText:pgettext("thread poll","Enter number of days for which voting in this poll should be possible or zero to run this poll indefinitely."),for:"id_length",validation:this.state.errors.length},void 0,(0,r.Z)("input",{className:"form-control",disabled:this.state.isLoading,id:"id_length",onChange:this.bindInput("length"),type:"text",value:this.state.length}))),(0,r.Z)("div",{className:"col-xs-12 col-sm-6"},void 0,(0,r.Z)(g.Z,{label:pgettext("thread poll","Allowed choices"),for:"id_allowed_choices",validation:this.state.errors.allowed_choices},void 0,(0,r.Z)("input",{className:"form-control",disabled:this.state.isLoading,id:"id_allowed_choices",onChange:this.bindInput("allowed_choices"),type:"text",maxLength:"255",value:this.state.allowed_choices})))),(0,r.Z)("div",{className:"row"},void 0,(0,r.Z)(Ht,{bindInput:this.bindInput,disabled:this.state.isLoading,isEdit:this.state.isEdit,value:this.state.is_public}),(0,r.Z)("div",{className:"col-xs-12 col-sm-6"},void 0,(0,r.Z)(g.Z,{label:pgettext("thread poll","Allow vote changes"),for:"id_allow_revotes"},void 0,(0,r.Z)(Mt.Z,{id:"id_allow_revotes",disabled:this.state.isLoading,iconOn:"check",iconOff:"close",labelOn:pgettext("thread poll","Allow participants to change their vote"),labelOff:pgettext("thread poll","Don't allow participants to change their vote"),onChange:this.bindInput("allow_revotes"),value:this.state.allow_revotes})))))),(0,r.Z)("div",{className:"panel-footer text-right"},void 0,(0,r.Z)("button",{className:"btn btn-default",disabled:this.state.isLoading,onClick:this.onCancel,type:"button"},void 0,pgettext("thread poll","Cancel"))," ",(0,r.Z)(Tt.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,this.state.isEdit?pgettext("thread poll","Save changes"):pgettext("thread poll","Post poll"))))))}}]),i}(Z.Z);function Ht(t){return t.isEdit?null:(0,r.Z)("div",{className:"col-xs-12 col-sm-6"},void 0,(0,r.Z)(g.Z,{label:pgettext("thread poll","Make voting public"),helpText:pgettext("thread poll","Making voting public will allow everyone to access detailed list of votes, showing which users voted for which choices and at which times. This option can't be changed after poll's creation. Moderators may see voting details for all polls."),for:"id_is_public"},void 0,(0,r.Z)(Mt.Z,{id:"id_is_public",disabled:t.disabled,iconOn:"visibility",iconOff:"visibility_off",labelOn:pgettext("thread poll","Votes are public"),labelOff:pgettext("thread poll","Votes are hidden"),onChange:t.bindInput("is_public"),value:t.value})))}var Vt={changed_title:"edit",pinned_globally:"bookmark",pinned_locally:"bookmark_border",unpinned:"panorama_fish_eye",moved:"arrow_forward",merged:"call_merge",approved:"done",opened:"lock_open",closed:"lock_outline",unhid:"visibility",hid:"visibility_off",changed_owner:"grade",tookover:"grade",added_participant:"person_add",owner_left:"person_outline",participant_left:"person_outline",removed_participant:"remove_circle_outline"};const Yt=function(t){return(0,r.Z)("span",{className:"event-icon-bg"},void 0,(0,r.Z)("span",{className:"material-icon"},void 0,Vt[t.post.event_type]))};var Gt=n(92747);function Wt(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,a=(0,p.Z)(t);if(e){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}function $t(t){return t.post.acl.can_hide?(0,r.Z)("li",{className:"event-controls"},void 0,v().createElement(Qt,t),v().createElement(Kt,t),v().createElement(Xt,t)):null}var Qt=function(t){(0,u.Z)(n,t);var e=Wt(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){N.Z.dispatch(Gt.r$(t.props.post,{is_hidden:!0,hidden_on:F()(),hidden_by_name:t.props.user.username,url:Object.assign(t.props.post.url,{hidden_by:t.props.user.url})})),k.Z.patch(t.props.post.api.index,[{op:"replace",path:"is-hidden",value:!0}]).then((function(e){N.Z.dispatch(Gt.r$(t.props.post,e))}),(function(e){400===e.status?x.Z.error(e.detail[0]):x.Z.apiError(e),N.Z.dispatch(Gt.r$(t.props.post,{is_hidden:!1}))}))})),t}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.is_hidden?null:(0,r.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,pgettext("event hide btn","Hide"))}}]),n}(v().Component),Kt=function(t){(0,u.Z)(n,t);var e=Wt(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){N.Z.dispatch(Gt.r$(t.props.post,{is_hidden:!1})),k.Z.patch(t.props.post.api.index,[{op:"replace",path:"is-hidden",value:!1}]).then((function(e){N.Z.dispatch(Gt.r$(t.props.post,e))}),(function(e){400===e.status?x.Z.error(e.detail[0]):x.Z.apiError(e),N.Z.dispatch(Gt.r$(t.props.post,{is_hidden:!0}))}))})),t}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.is_hidden?(0,r.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,pgettext("event reveal btn","Unhide")):null}}]),n}(v().Component),Xt=function(t){(0,u.Z)(n,t);var e=Wt(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){window.confirm(pgettext("event delete","Are you sure you wish to delete this event? This action is not reversible!"))&&t.delete()})),(0,h.Z)((0,c.Z)(t),"delete",(function(){N.Z.dispatch(Gt.r$(t.props.post,{isDeleted:!0})),k.Z.delete(t.props.post.api.index).then((function(){x.Z.success(pgettext("event delete","Event has been deleted."))}),(function(e){400===e.status?x.Z.error(e.detail[0]):x.Z.apiError(e),N.Z.dispatch(Gt.r$(t.props.post,{isDeleted:!1}))}))})),t}return(0,l.Z)(n,[{key:"render",value:function(){return(0,r.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,pgettext("event delete btn","Delete"))}}]),n}(v().Component),Jt='<span class="item-title">%(user)s</span>',te='<a href="%(url)s" class="item-title">%(user)s</a>';function ee(t){return(0,r.Z)("ul",{className:"list-inline event-info"},void 0,v().createElement(ne,t),v().createElement(ae,t),v().createElement($t,t))}function ne(t){if(t.post.is_hidden){var e;e=t.post.url.hidden_by?interpolate(te,{url:(0,Zt.Z)(t.post.url.hidden_by),user:(0,Zt.Z)(t.post.hidden_by_name)},!0):interpolate(Jt,{user:(0,Zt.Z)(t.post.hidden_by_name)},!0);var n=interpolate('<abbr title="%(absolute)s">%(relative)s</abbr>',{absolute:(0,Zt.Z)(t.post.hidden_on.format("LLL")),relative:(0,Zt.Z)(t.post.hidden_on.fromNow())},!0),a=interpolate((0,Zt.Z)(pgettext("event info","Hidden by %(event_by)s %(event_on)s.")),{event_by:e,event_on:n},!0);return(0,r.Z)("li",{className:"event-hidden-message",dangerouslySetInnerHTML:{__html:a}})}return null}function ae(t){var e;e=t.post.poster?interpolate(te,{url:(0,Zt.Z)(t.post.poster.url),user:(0,Zt.Z)(t.post.poster_name)},!0):interpolate(Jt,{user:(0,Zt.Z)(t.post.poster_name)},!0);var n=interpolate('<a href="%(url)s" title="%(absolute)s">%(relative)s</a>',{url:(0,Zt.Z)(t.post.url.index),absolute:(0,Zt.Z)(t.post.posted_on.format("LLL")),relative:(0,Zt.Z)(t.post.posted_on.fromNow())},!0),a=interpolate((0,Zt.Z)(pgettext("event info","By %(event_by)s %(event_on)s.")),{event_by:e,event_on:n},!0);return(0,r.Z)("li",{className:"event-posters",dangerouslySetInnerHTML:{__html:a}})}var ie={pinned_globally:pgettext("event message","Thread has been pinned globally."),pinned_locally:pgettext("event message","Thread has been pinned in category."),unpinned:pgettext("event message","Thread has been unpinned."),approved:pgettext("event message","Thread has been approved."),opened:pgettext("event message","Thread has been opened."),closed:pgettext("event message","Thread has been closed."),unhid:pgettext("event message","Thread has been revealed."),hid:pgettext("event message","Thread has been made hidden."),tookover:pgettext("event message","Took thread over."),owner_left:pgettext("event message","Owner has left thread. This thread is now closed."),participant_left:pgettext("event message","Participant has left thread.")},oe='<a href="%(url)s" class="item-title">%(name)s</a>',re='<span class="item-title">%(name)s</span>';function se(t){return ie[t.post.event_type]?(0,r.Z)("p",{className:"event-message"},void 0,ie[t.post.event_type]):"changed_title"===t.post.event_type?v().createElement(le,t):"moved"===t.post.event_type?v().createElement(ce,t):"merged"===t.post.event_type?v().createElement(ue,t):"changed_owner"===t.post.event_type?v().createElement(de,t):"added_participant"===t.post.event_type?v().createElement(pe,t):"removed_participant"===t.post.event_type?v().createElement(he,t):null}function le(t){var e=(0,Zt.Z)(pgettext("event message","Thread title has been changed from %(old_title)s.")),n=interpolate(re,{name:(0,Zt.Z)(t.post.event_context.old_title)},!0),a=interpolate(e,{old_title:n},!0);return(0,r.Z)("p",{className:"event-message",dangerouslySetInnerHTML:{__html:a}})}function ce(t){var e=(0,Zt.Z)(pgettext("event message","Thread has been moved from %(from_category)s.")),n=interpolate(oe,{url:(0,Zt.Z)(t.post.event_context.from_category.url),name:(0,Zt.Z)(t.post.event_context.from_category.name)},!0),a=interpolate(e,{from_category:n},!0);return(0,r.Z)("p",{className:"event-message",dangerouslySetInnerHTML:{__html:a}})}function ue(t){var e=(0,Zt.Z)(pgettext("event message","The %(merged_thread)s thread has been merged into this thread.")),n=interpolate(re,{name:(0,Zt.Z)(t.post.event_context.merged_thread)},!0),a=interpolate(e,{merged_thread:n},!0);return(0,r.Z)("p",{className:"event-message",dangerouslySetInnerHTML:{__html:a}})}function de(t){var e=(0,Zt.Z)(pgettext("event message","Changed thread owner to %(user)s.")),n=interpolate(oe,{url:(0,Zt.Z)(t.post.event_context.user.url),name:(0,Zt.Z)(t.post.event_context.user.username)},!0),a=interpolate(e,{user:n},!0);return(0,r.Z)("p",{className:"event-message",dangerouslySetInnerHTML:{__html:a}})}function pe(t){var e=(0,Zt.Z)(pgettext("event message","Added %(user)s to thread.")),n=interpolate(oe,{url:(0,Zt.Z)(t.post.event_context.user.url),name:(0,Zt.Z)(t.post.event_context.user.username)},!0),a=interpolate(e,{user:n},!0);return(0,r.Z)("p",{className:"event-message",dangerouslySetInnerHTML:{__html:a}})}function he(t){var e=(0,Zt.Z)(pgettext("event message","Removed %(user)s from thread.")),n=interpolate(oe,{url:(0,Zt.Z)(t.post.event_context.user.url),name:(0,Zt.Z)(t.post.event_context.user.username)},!0),a=interpolate(e,{user:n},!0);return(0,r.Z)("p",{className:"event-message",dangerouslySetInnerHTML:{__html:a}})}function me(t){return t.post.is_read?null:(0,r.Z)("div",{className:"event-label"},void 0,(0,r.Z)("span",{className:"label label-unread"},void 0,pgettext("event unread label","New event")))}var ve=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(t){var e;return(0,s.Z)(this,i),e=a.call(this,t),(0,h.Z)((0,c.Z)(e),"initialize",(function(t){e.initialized=!0,e.observer=new IntersectionObserver((function(t){return t.forEach(e.callback)})),e.observer.observe(t)})),(0,h.Z)((0,c.Z)(e),"callback",(function(t){!t.isIntersecting||e.props.post.is_read||e.primed||(window.setTimeout((function(){k.Z.post(e.props.post.api.read)}),0),e.primed=!0,e.destroy())})),e.initialized=!1,e.primed=!1,e.observer=null,e}return(0,l.Z)(i,[{key:"destroy",value:function(){this.observer&&(this.observer.disconnect(),this.observer=null)}},{key:"componentWillUnmount",value:function(){this.destroy()}},{key:"render",value:function(){var t=this,e=!this.initialized&&!this.primed&&!this.props.post.is_read;return v().createElement("div",{className:this.props.className,ref:function(n){n&&e&&t.initialize(n)}},this.props.children)}}]),i}(v().Component);function fe(t){var e="event";return t.post.isDeleted?e="hide":t.post.is_hidden&&(e="event post-hidden"),(0,r.Z)("li",{id:"post-"+t.post.id,className:e},void 0,(0,r.Z)(me,{post:t.post}),(0,r.Z)("div",{className:"event-body"},void 0,(0,r.Z)("div",{className:"event-icon"},void 0,v().createElement(Yt,t)),(0,r.Z)(ve,{className:"event-content",post:t.post},void 0,v().createElement(se,t),v().createElement(ee,t))))}var Ze=n(69130),ge=n(48772);function ye(t){return(0,r.Z)("div",{className:"col-xs-12 col-md-6"},void 0,v().createElement(be,t),(0,r.Z)("div",{className:"post-attachment"},void 0,(0,r.Z)("a",{href:t.attachment.url.index,className:"attachment-name item-title",target:"_blank"},void 0,t.attachment.filename),v().createElement(xe,t)))}function be(t){return t.attachment.is_image?(0,r.Z)("div",{className:"post-attachment-preview"},void 0,v().createElement(_e,t)):(0,r.Z)("div",{className:"post-attachment-preview"},void 0,v().createElement(ke,t))}function ke(t){return(0,r.Z)("a",{href:t.attachment.url.index,className:"material-icon"},void 0,"insert_drive_file")}function _e(t){var e=t.attachment.url.thumb||t.attachment.url.index;return(0,r.Z)("a",{className:"post-thumbnail",href:t.attachment.url.index,target:"_blank",style:{backgroundImage:'url("'+(0,Zt.Z)(e)+'")'}})}function xe(t){var e;e=t.attachment.url.uploader?interpolate('<a href="%(url)s" class="item-title">%(user)s</a>',{url:(0,Zt.Z)(t.attachment.url.uploader),user:(0,Zt.Z)(t.attachment.uploader_name)},!0):interpolate('<span class="item-title">%(user)s</span>',{user:(0,Zt.Z)(t.attachment.uploader_name)},!0);var n=interpolate('<abbr title="%(absolute)s">%(relative)s</abbr>',{absolute:(0,Zt.Z)(t.attachment.uploaded_on.format("LLL")),relative:(0,Zt.Z)(t.attachment.uploaded_on.fromNow())},!0),a=interpolate((0,Zt.Z)(pgettext("post attachment","%(filetype)s, %(size)s, uploaded by %(uploader)s %(uploaded_on)s.")),{filetype:t.attachment.filetype,size:(0,ge.Z)(t.attachment.size),uploader:e,uploaded_on:n},!0);return(0,r.Z)("p",{className:"post-attachment-description",dangerouslySetInnerHTML:{__html:a}})}function Ne(t){return function(t){return(!t.is_hidden||t.acl.can_see_hidden)&&t.attachments}(t.post)?(0,r.Z)("div",{className:"post-attachments"},void 0,(0,Ze.Z)(t.post.attachments,2).map((function(t){var e=t.map((function(t){return t?t.id:0})).join("_");return(0,r.Z)(we,{row:t},e)}))):null}function we(t){return(0,r.Z)("div",{className:"row"},void 0,t.row.map((function(t){return(0,r.Z)(ye,{attachment:t},t?t.id:0)})))}var Ce,Re,Ee,Se,Le,Oe,Pe,Ae=n(69092);function Te(t){return t.post.is_hidden&&!t.post.acl.can_see_hidden?v().createElement(Be,t):t.post.content?v().createElement(Ie,t):v().createElement(je,t)}function Ie(t){var e=t.post,n="@"+(e.poster?e.poster.username:e.poster_name);return(0,r.Z)(ve,{className:"post-body",post:e},void 0,(0,r.Z)(Ae.Z,{author:n,markup:e.content}))}function Be(t){var e;e=t.post.hidden_by?interpolate('<a href="%(url)s" class="item-title">%(user)s</a>',{url:(0,Zt.Z)(t.post.url.hidden_by),user:(0,Zt.Z)(t.post.hidden_by_name)},!0):interpolate('<span class="item-title">%(user)s</span>',{user:(0,Zt.Z)(t.post.hidden_by_name)},!0);var n=interpolate('<abbr class="last-title" title="%(absolute)s">%(relative)s</abbr>',{absolute:(0,Zt.Z)(t.post.hidden_on.format("LLL")),relative:(0,Zt.Z)(t.post.hidden_on.fromNow())},!0),a=interpolate((0,Zt.Z)(pgettext("post body hidden","Hidden by %(hidden_by)s %(hidden_on)s.")),{hidden_by:e,hidden_on:n},!0);return(0,r.Z)(ve,{className:"post-body post-body-hidden",post:t.post},void 0,(0,r.Z)("p",{className:"lead"},void 0,pgettext("post body hidden","This post is hidden. You cannot see its contents.")),(0,r.Z)("p",{className:"text-muted",dangerouslySetInnerHTML:{__html:a}}))}function je(t){return(0,r.Z)(ve,{className:"post-body post-body-invalid",post:t.post},void 0,(0,r.Z)("p",{className:"lead"},void 0,pgettext("post body invalid","This post's contents cannot be displayed.")),(0,r.Z)("p",{className:"text-muted"},void 0,pgettext("post body invalid","This error is caused by invalid post content manipulation.")))}function De(t){var e=t.post,n=t.thread,a=t.user;if(!Me(e)||e.id!==n.best_answer)return null;var i;return i=a.id&&n.best_answer_marked_by===a.id?interpolate(pgettext("post best answer flag","Marked as best answer by you %(marked_on)s."),{marked_on:n.best_answer_marked_on.fromNow()},!0):interpolate(pgettext("post best answer flag","Marked as best answer by %(marked_by)s %(marked_on)s."),{marked_by:n.best_answer_marked_by_name,marked_on:n.best_answer_marked_on.fromNow()},!0),(0,r.Z)("div",{className:"post-status-message post-status-best-answer"},void 0,Ce||(Ce=(0,r.Z)("span",{className:"material-icon"},void 0,"check_box")),(0,r.Z)("p",{},void 0,i))}function Ue(t){return Me(t.post)&&t.post.is_hidden?(0,r.Z)("div",{className:"post-status-message post-status-hidden"},void 0,Re||(Re=(0,r.Z)("span",{className:"material-icon"},void 0,"visibility_off")),(0,r.Z)("p",{},void 0,pgettext("post hidden flag","This post is hidden. Only users with permission may see its contents."))):null}function ze(t){return Me(t.post)&&t.post.is_unapproved?(0,r.Z)("div",{className:"post-status-message post-status-unapproved"},void 0,Ee||(Ee=(0,r.Z)("span",{className:"material-icon"},void 0,"remove_circle_outline")),(0,r.Z)("p",{},void 0,pgettext("post unapproved flag","This post is unapproved. Only users with permission to approve posts and its author may see its contents."))):null}function qe(t){return Me(t.post)&&t.post.is_protected?(0,r.Z)("div",{className:"post-status-message post-status-protected visible-xs-block"},void 0,Se||(Se=(0,r.Z)("span",{className:"material-icon"},void 0,"lock_outline")),(0,r.Z)("p",{},void 0,pgettext("post protected flag","This post is protected. Only moderators may change it."))):null}function Me(t){return!t.is_hidden||t.acl.can_see_hidden}function Fe(t){N.Z.dispatch(Gt.r$(t.post,{is_unapproved:!1})),Qe(t,[{op:"replace",path:"is-unapproved",value:!1}],{is_unapproved:t.post.is_unapproved})}function He(t){N.Z.dispatch(Gt.r$(t.post,{is_protected:!0})),Qe(t,[{op:"replace",path:"is-protected",value:!0}],{is_protected:t.post.is_protected})}function Ve(t){N.Z.dispatch(Gt.r$(t.post,{is_protected:!1})),Qe(t,[{op:"replace",path:"is-protected",value:!1}],{is_protected:t.post.is_protected})}function Ye(t){N.Z.dispatch(Gt.r$(t.post,{is_hidden:!0,hidden_on:F()(),hidden_by_name:t.user.username,url:Object.assign(t.post.url,{hidden_by:t.user.url})})),Qe(t,[{op:"replace",path:"is-hidden",value:!0}],{is_hidden:t.post.is_hidden,hidden_on:t.post.hidden_on,hidden_by_name:t.post.hidden_by_name,url:t.post.url})}function Ge(t){N.Z.dispatch(Gt.r$(t.post,{is_hidden:!1})),Qe(t,[{op:"replace",path:"is-hidden",value:!1}],{is_hidden:t.post.is_hidden})}function We(t){var e=t.post.last_likes||[],n=[t.user].concat(e),a=n.length>3?n.slice(0,-1):n;N.Z.dispatch(Gt.r$(t.post,{is_liked:!0,likes:t.post.likes+1,last_likes:a})),Qe(t,[{op:"replace",path:"is-liked",value:!0}],{is_liked:t.post.is_liked,likes:t.post.likes,last_likes:t.post.last_likes})}function $e(t){N.Z.dispatch(Gt.r$(t.post,{is_liked:!1,likes:t.post.likes-1,last_likes:t.post.last_likes.filter((function(e){return!e.id||e.id!==t.user.id}))}));var e={is_liked:t.post.is_liked,likes:t.post.likes,last_likes:t.post.last_likes};Qe(t,[{op:"replace",path:"is-liked",value:!1}],e)}function Qe(t,e,n){k.Z.patch(t.post.api.index,e).then((function(e){N.Z.dispatch(Gt.r$(t.post,e))}),(function(e){400===e.status?x.Z.error(e.detail[0]):x.Z.apiError(e),N.Z.dispatch(Gt.r$(t.post,n))}))}function Ke(t){window.confirm(pgettext("post delete","Are you sure you want to delete this post? This action is not reversible!"))&&(N.Z.dispatch(Gt.r$(t.post,{isDeleted:!0})),k.Z.delete(t.post.api.index).then((function(){x.Z.success(pgettext("post delete","Post has been deleted."))}),(function(e){400===e.status?x.Z.error(e.detail):x.Z.apiError(e),N.Z.dispatch(Gt.r$(t.post,{isDeleted:!1}))})))}function Xe(t){var e=t.post,n=t.user;N.Z.dispatch(b.Vx({best_answer:e.id,best_answer_is_protected:e.is_protected,best_answer_marked_on:F()(),best_answer_marked_by:n.id,best_answer_marked_by_name:n.username,best_answer_marked_by_slug:n.slug})),tn(t,[{op:"replace",path:"best-answer",value:e.id},{op:"add",path:"acl",value:!0}],{best_answer:t.thread.best_answer,best_answer_is_protected:t.thread.best_answer_is_protected,best_answer_marked_on:t.thread.best_answer_marked_on,best_answer_marked_by:t.thread.best_answer_marked_by,best_answer_marked_by_name:t.thread.best_answer_marked_by_name,best_answer_marked_by_slug:t.thread.best_answer_marked_by_slug})}function Je(t){var e=t.post;N.Z.dispatch(b.Vx({best_answer:null,best_answer_is_protected:!1,best_answer_marked_on:null,best_answer_marked_by:null,best_answer_marked_by_name:null,best_answer_marked_by_slug:null})),tn(t,[{op:"remove",path:"best-answer",value:e.id},{op:"add",path:"acl",value:!0}],{best_answer:t.thread.best_answer,best_answer_is_protected:t.thread.best_answer_is_protected,best_answer_marked_on:t.thread.best_answer_marked_on,best_answer_marked_by:t.thread.best_answer_marked_by,best_answer_marked_by_name:t.thread.best_answer_marked_by_name,best_answer_marked_by_slug:t.thread.best_answer_marked_by_slug})}function tn(t,e,n){k.Z.patch(t.thread.api.index,e).then((function(t){t.best_answer_marked_on&&(t.best_answer_marked_on=F()(t.best_answer_marked_on)),N.Z.dispatch(b.Vx(t))}),(function(t){400===t.status?x.Z.error(t.detail[0]):x.Z.apiError(t),N.Z.dispatch(b.Vx(n))}))}var en,nn,an,on,rn=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(t){var e;return(0,s.Z)(this,i),(e=a.call(this,t)).state={isReady:!1,error:null,likes:[]},e}return(0,l.Z)(i,[{key:"componentDidMount",value:function(){var t=this;k.Z.get(this.props.post.api.likes).then((function(e){t.setState({isReady:!0,likes:e.map(sn)})}),(function(e){t.setState({isReady:!0,error:e.detail})}))}},{key:"render",value:function(){return this.state.error?(0,r.Z)(ln,{className:"modal-message"},void 0,(0,r.Z)(X.Z,{message:this.state.error})):this.state.isReady?this.state.likes.length?(0,r.Z)(ln,{className:"modal-sm",likes:this.state.likes},void 0,(0,r.Z)(cn,{likes:this.state.likes})):(0,r.Z)(ln,{className:"modal-message"},void 0,(0,r.Z)(X.Z,{message:pgettext("post likes modal","No users have liked this post.")})):Le||(Le=(0,r.Z)(ln,{className:"modal-sm"},void 0,(0,r.Z)(J.Z,{})))}}]),i}(v().Component);function sn(t){return Object.assign({},t,{liked_on:F()(t.liked_on)})}function ln(t){var e=t.className,n=t.children,a=t.likes,i=pgettext("post likes modal title","Post Likes");if(a){var o=a.length,s=npgettext("post likes modal","%(likes)s like","%(likes)s likes",o);i=interpolate(s,{likes:o},!0)}return(0,r.Z)("div",{className:"modal-dialog "+(e||""),role:"document"},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,Oe||(Oe=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,i)),n))}function cn(t){return(0,r.Z)("div",{className:"modal-body modal-post-likers"},void 0,(0,r.Z)("ul",{className:"media-list"},void 0,t.likes.map((function(t){return v().createElement(un,(0,f.Z)({key:t.id},t))}))))}function un(t){if(t.url){var e={id:t.liker_id,avatars:t.avatars};return(0,r.Z)("li",{className:"media"},void 0,(0,r.Z)("div",{className:"media-left"},void 0,(0,r.Z)("a",{className:"user-avatar",href:t.url},void 0,(0,r.Z)(I.ZP,{size:"50",user:e}))),(0,r.Z)("div",{className:"media-body"},void 0,(0,r.Z)("a",{className:"item-title",href:t.url},void 0,t.username)," ",(0,r.Z)(dn,{likedOn:t.liked_on})))}return(0,r.Z)("li",{className:"media"},void 0,Pe||(Pe=(0,r.Z)("div",{className:"media-left"},void 0,(0,r.Z)("span",{className:"user-avatar"},void 0,(0,r.Z)(I.ZP,{size:"50"})))),(0,r.Z)("div",{className:"media-body"},void 0,(0,r.Z)("strong",{},void 0,t.username)," ",(0,r.Z)(dn,{likedOn:t.liked_on})))}function dn(t){return(0,r.Z)("span",{className:"text-muted",title:t.likedOn.format("LLL")},void 0,t.likedOn.fromNow())}function pn(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,a=(0,p.Z)(t);if(e){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}function hn(t){return function(t){return(!t.is_hidden||t.acl.can_see_hidden)&&(t.acl.can_reply||t.acl.can_edit||t.acl.can_see_likes&&(t.last_likes||[]).length||t.acl.can_like)}(t.post)?(0,r.Z)("div",{className:"post-footer"},void 0,v().createElement(mn,t),v().createElement(vn,t),v().createElement(fn,t),v().createElement(Zn,(0,f.Z)({lastLikes:t.post.last_likes,likes:t.post.likes},t)),v().createElement(gn,(0,f.Z)({likes:t.post.likes},t)),v().createElement(_n,t),v().createElement(xn,t),v().createElement(Nn,t)):null}var mn=function(t){(0,u.Z)(n,t);var e=pn(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){Xe(t.props)})),t}return(0,l.Z)(n,[{key:"render",value:function(){var t=this.props,e=t.post,n=t.thread;return n.acl.can_mark_best_answer&&e.acl.can_mark_as_best_answer?n.best_answer&&!n.acl.can_change_best_answer?null:(0,r.Z)("button",{className:"hidden-xs btn btn-default btn-sm pull-left",disabled:this.props.post.isBusy||e.id===n.best_answer,onClick:this.onClick,type:"button"},void 0,en||(en=(0,r.Z)("span",{className:"material-icon"},void 0,"check_box")),pgettext("post footer btn","Best answer")):null}}]),n}(v().Component),vn=function(t){(0,u.Z)(n,t);var e=pn(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){Xe(t.props)})),t}return(0,l.Z)(n,[{key:"render",value:function(){var t=this.props,e=t.post,n=t.thread;return n.acl.can_mark_best_answer&&e.acl.can_mark_as_best_answer?n.best_answer&&!n.acl.can_change_best_answer?null:(0,r.Z)("button",{className:"visible-xs-inline-block btn btn-default btn-sm pull-left",disabled:this.props.post.isBusy||e.id===n.best_answer,onClick:this.onClick,type:"button"},void 0,nn||(nn=(0,r.Z)("span",{className:"material-icon"},void 0,"check_box"))):null}}]),n}(v().Component),fn=function(t){(0,u.Z)(n,t);var e=pn(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){t.props.post.is_liked?$e(t.props):We(t.props)})),t}return(0,l.Z)(n,[{key:"render",value:function(){if(!this.props.post.acl.can_like)return null;var t="btn btn-default btn-sm pull-left";return this.props.post.is_liked&&(t="btn btn-success btn-sm pull-left"),(0,r.Z)("button",{className:t,disabled:this.props.post.isBusy,onClick:this.onClick,type:"button"},void 0,this.props.post.is_liked?pgettext("post footer btn","Liked"):pgettext("post footer btn","Like"))}}]),n}(v().Component),Zn=function(t){(0,u.Z)(n,t);var e=pn(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){_.Z.show((0,r.Z)(rn,{post:t.props.post}))})),t}return(0,l.Z)(n,[{key:"render",value:function(){var t=(this.props.post.last_likes||[]).length>0;return this.props.post.acl.can_see_likes&&t?2===this.props.post.acl.can_see_likes?(0,r.Z)("button",{className:"btn btn-link btn-sm pull-left hidden-xs",onClick:this.onClick,type:"button"},void 0,yn(this.props.likes,this.props.lastLikes)):(0,r.Z)("p",{className:"pull-left hidden-xs"},void 0,yn(this.props.likes,this.props.lastLikes)):null}}]),n}(v().Component),gn=function(t){(0,u.Z)(n,t);var e=pn(n);function n(){return(0,s.Z)(this,n),e.apply(this,arguments)}return(0,l.Z)(n,[{key:"render",value:function(){var t=(this.props.post.last_likes||[]).length>0;return this.props.post.acl.can_see_likes&&t?2===this.props.post.acl.can_see_likes?(0,r.Z)("button",{className:"btn btn-link btn-sm likes-compact pull-left visible-xs-block",onClick:this.onClick,type:"button"},void 0,an||(an=(0,r.Z)("span",{className:"material-icon"},void 0,"favorite")),this.props.likes):(0,r.Z)("p",{className:"likes-compact pull-left visible-xs-block"},void 0,on||(on=(0,r.Z)("span",{className:"material-icon"},void 0,"favorite")),this.props.likes):null}}]),n}(Zn);function yn(t,e){var n=e.slice(0,3).map((function(t){return t.username}));if(1==n.length)return interpolate(pgettext("post likes","%(user)s likes this."),{user:n[0]},!0);var a=t-n.length,i=n.slice(0,-1).join(", "),o=n.slice(-1)[0],r=interpolate(pgettext("post likes","%(users)s and %(last_user)s"),{users:i,last_user:o},!0);if(0===a)return interpolate(pgettext("post likes","%(users)s like this."),{users:r},!0);var s=npgettext("post likes","%(users)s and %(likes)s other user like this.","%(users)s and %(likes)s other users like this.",a);return interpolate(s,{users:n.join(", "),likes:a},!0)}var bn,kn,_n=function(t){(0,u.Z)(n,t);var e=pn(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){ct.Z.open({mode:"REPLY",thread:t.props.thread,config:t.props.thread.api.editor,submit:t.props.thread.api.posts.index})})),t}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_reply?(0,r.Z)("button",{className:"btn btn-default btn-sm pull-right",type:"button",onClick:this.onClick},void 0,pgettext("post footer btn","Reply")):null}}]),n}(v().Component),xn=function(t){(0,u.Z)(n,t);var e=pn(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){ct.Z.open({mode:"QUOTE",thread:t.props.thread,config:t.props.thread.api.editor,submit:t.props.thread.api.posts.index,context:{reply:t.props.post.id}})})),t}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_reply?(0,r.Z)("button",{className:"btn btn-default btn-sm pull-right",type:"button",onClick:this.onClick},void 0,pgettext("post footer btn","Quote")):null}}]),n}(v().Component),Nn=function(t){(0,u.Z)(n,t);var e=pn(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){ct.Z.open({mode:"EDIT",thread:t.props.thread,post:t.props.post,config:t.props.post.api.editor,submit:t.props.post.api.index})})),t}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_edit?(0,r.Z)("button",{className:"hidden-xs btn btn-default btn-sm pull-right",type:"button",onClick:this.onClick},void 0,pgettext("post footer btn","Edit")):null}}]),n}(v().Component);var wn=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(t){var e;return(0,s.Z)(this,i),e=a.call(this,t),(0,h.Z)((0,c.Z)(e),"onUrlChange",(function(t){e.changeValue("url",t.target.value)})),e.state={isLoading:!1,url:"",validators:{url:[]},errors:{}},e}return(0,l.Z)(i,[{key:"clean",value:function(){return!!this.state.url.trim().length||(x.Z.error(pgettext("post move modal","You have to enter link to the other thread.")),!1)}},{key:"send",value:function(){return k.Z.post(this.props.thread.api.posts.move,{new_thread:this.state.url,posts:[this.props.post.id]})}},{key:"handleSuccess",value:function(t){N.Z.dispatch(Gt.r$(this.props.post,{isDeleted:!0})),_.Z.hide(),x.Z.success(pgettext("post move modal","Selected post was moved to the other thread."))}},{key:"handleError",value:function(t){400===t.status?x.Z.error(t.detail):x.Z.apiError(t)}},{key:"render",value:function(){return(0,r.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,bn||(bn=(0,r.Z)(Cn,{})),(0,r.Z)("div",{className:"modal-body"},void 0,(0,r.Z)(g.Z,{for:"id_url",label:pgettext("post move modal field","Link to thread you want to move post to")},void 0,(0,r.Z)("input",{className:"form-control",disabled:this.state.isLoading,id:"id_url",onChange:this.onUrlChange,value:this.state.url}))),(0,r.Z)("div",{className:"modal-footer"},void 0,(0,r.Z)("button",{className:"btn btn-primary",disabled:this.state.isLoading},void 0,pgettext("post move modal btn","Move post"))))))}}]),i}(Z.Z);function Cn(t){return(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,kn||(kn=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("post move modal title","Move post")))}function Rn(t){return(0,r.Z)("div",{className:"modal-body post-changelog-diff"},void 0,(0,r.Z)("ul",{className:"list-unstyled"},void 0,t.diff.map((function(t,e){return(0,r.Z)(En,{item:t},e)}))))}function En(t){return"?"===t.item[0]?null:(0,r.Z)("li",{className:(e=t.item,n="diff-item","-"===e[0]?n+=" diff-item-sub":"+"===e[0]&&(n+=" diff-item-add"),n)},void 0,t.item.substr(2));var e,n}var Sn,Ln,On,Pn=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(){var t;(0,s.Z)(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t=a.call.apply(a,[this].concat(n)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){t.props.revertEdit(t.props.edit.id)})),t}return(0,l.Z)(i,[{key:"render",value:function(){return this.props.canRevert?(0,r.Z)("div",{className:"modal-footer visible-xs-block"},void 0,(0,r.Z)(Tt.Z,{className:"btn-default btn-sm btn-block",disabled:this.props.disabled,onClick:this.onClick,title:pgettext("post revert btn","Revert post to state from before this edit.")},void 0,pgettext("post revert btn","Revert"))):null}}]),i}(v().Component);var An,Tn,In=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(){var t;(0,s.Z)(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t=a.call.apply(a,[this].concat(n)),(0,h.Z)((0,c.Z)(t),"goLast",(function(){t.props.goToEdit()})),(0,h.Z)((0,c.Z)(t),"goForward",(function(){t.props.goToEdit(t.props.edit.next)})),(0,h.Z)((0,c.Z)(t),"goBack",(function(){t.props.goToEdit(t.props.edit.previous)})),(0,h.Z)((0,c.Z)(t),"revertEdit",(function(){t.props.revertEdit(t.props.edit.id)})),t}return(0,l.Z)(i,[{key:"render",value:function(){return(0,r.Z)("div",{className:"modal-toolbar post-changelog-toolbar"},void 0,(0,r.Z)("div",{className:"row"},void 0,(0,r.Z)("div",{className:"col-xs-12 col-sm-4"},void 0,(0,r.Z)("div",{className:"row"},void 0,(0,r.Z)("div",{className:"col-xs-4"},void 0,(0,r.Z)(Bn,{disabled:this.props.disabled,edit:this.props.edit,onClick:this.goBack})),(0,r.Z)("div",{className:"col-xs-4"},void 0,(0,r.Z)(jn,{disabled:this.props.disabled,edit:this.props.edit,onClick:this.goForward})),(0,r.Z)("div",{className:"col-xs-4"},void 0,(0,r.Z)(Dn,{disabled:this.props.disabled,edit:this.props.edit,onClick:this.goLast})))),(0,r.Z)("div",{className:"col-xs-12 col-sm-5 xs-margin-top-half post-change-label"},void 0,(0,r.Z)(zn,{edit:this.props.edit})),(0,r.Z)(Un,{canRevert:this.props.canRevert,disabled:this.props.disabled,onClick:this.revertEdit})))}}]),i}(v().Component);function Bn(t){return(0,r.Z)(Tt.Z,{className:"btn-default btn-block btn-icon btn-sm",disabled:t.disabled||!t.edit.previous,onClick:t.onClick,title:pgettext("post history modal btn","See previous change")},void 0,Sn||(Sn=(0,r.Z)("span",{className:"material-icon"},void 0,"chevron_left")))}function jn(t){return(0,r.Z)(Tt.Z,{className:"btn-default btn-block btn-icon btn-sm",disabled:t.disabled||!t.edit.next,onClick:t.onClick,title:pgettext("post history modal btn","See next change")},void 0,Ln||(Ln=(0,r.Z)("span",{className:"material-icon"},void 0,"chevron_right")))}function Dn(t){return(0,r.Z)(Tt.Z,{className:"btn-default btn-block btn-icon btn-sm",disabled:t.disabled||!t.edit.next,onClick:t.onClick,title:pgettext("post history modal btn","See previous change")},void 0,On||(On=(0,r.Z)("span",{className:"material-icon"},void 0,"last_page")))}function Un(t){return t.canRevert?(0,r.Z)("div",{className:"col-sm-3 hidden-xs"},void 0,(0,r.Z)(Tt.Z,{className:"btn-default btn-sm btn-block",disabled:t.disabled,onClick:t.onClick,title:pgettext("post revert btn","Revert post to state from before this edit.")},void 0,pgettext("post revert btn","Revert"))):null}function zn(t){var e;e=t.edit.url.editor?interpolate('<a href="%(url)s" class="item-title">%(user)s</a>',{url:(0,Zt.Z)(t.edit.url.editor),user:(0,Zt.Z)(t.edit.editor_name)},!0):interpolate('<span class="item-title">%(user)s</span>',{user:(0,Zt.Z)(t.edit.editor_name)},!0);var n=interpolate('<abbr title="%(absolute)s">%(relative)s</abbr>',{absolute:(0,Zt.Z)(t.edit.edited_on.format("LLL")),relative:(0,Zt.Z)(t.edit.edited_on.fromNow())},!0),a=interpolate((0,Zt.Z)(pgettext("post history modal","By %(edited_by)s %(edited_on)s.")),{edited_by:e,edited_on:n},!0);return(0,r.Z)("p",{dangerouslySetInnerHTML:{__html:a}})}function qn(t){return Object.assign({},t,{edited_on:F()(t.edited_on)})}var Mn=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(t){var e;return(0,s.Z)(this,i),e=a.call(this,t),(0,h.Z)((0,c.Z)(e),"goToEdit",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;e.setState({isBusy:!0});var n=e.props.post.api.edits;null!==t&&(n+="?edit="+t),k.Z.get(n).then((function(t){e.setState({isReady:!0,isBusy:!1,edit:qn(t)})}),(function(t){e.setState({isReady:!0,isBusy:!1,error:t.detail})}))})),(0,h.Z)((0,c.Z)(e),"revertEdit",(function(t){if(!e.state.isBusy&&window.confirm(pgettext("post revert","Are you sure you with to revert this post to the state from before this edit?"))){e.setState({isBusy:!0});var n=e.props.post.api.edits+"?edit="+t;k.Z.post(n).then((function(t){var e=Gt.ZB(t);N.Z.dispatch(Gt.r$(t,e)),x.Z.success(pgettext("post revert","Post has been reverted to previous state.")),_.Z.hide()}),(function(t){x.Z.apiError(t),e.setState({isBusy:!1})}))}})),e.state={isReady:!1,isBusy:!0,canRevert:t.post.acl.can_edit,error:null,edit:null},e}return(0,l.Z)(i,[{key:"componentDidMount",value:function(){this.goToEdit()}},{key:"render",value:function(){return this.state.error?(0,r.Z)(Fn,{className:"modal-dialog modal-message"},void 0,(0,r.Z)(X.Z,{message:this.state.error})):this.state.isReady?(0,r.Z)(Fn,{},void 0,(0,r.Z)(In,{canRevert:this.state.canRevert,disabled:this.state.isBusy,edit:this.state.edit,goToEdit:this.goToEdit,revertEdit:this.revertEdit}),(0,r.Z)(Rn,{diff:this.state.edit.diff}),(0,r.Z)(Pn,{canRevert:this.state.canRevert,disabled:this.state.isBusy,edit:this.state.edit,revertEdit:this.revertEdit})):An||(An=(0,r.Z)(Fn,{},void 0,(0,r.Z)(J.Z,{})))}}]),i}(v().Component);function Fn(t){return(0,r.Z)("div",{className:t.className||"modal-dialog",role:"document"},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,Tn||(Tn=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("post history modal title","Post edits history"))),t.children))}var Hn,Vn,Yn,Gn,Wn,$n,Qn=n(57026),Kn=n(60471),Xn=n(55210);function Jn(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,a=(0,p.Z)(t);if(e){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}function ta(t){return v().createElement(ma,(0,f.Z)({},t,{Form:va}))}var ea,na,aa,ia,oa,ra,sa,la,ca,ua,da,pa,ha,ma=function(t){(0,u.Z)(n,t);var e=Jn(n);function n(t){var a;return(0,s.Z)(this,n),(a=e.call(this,t)).state={isLoaded:!1,isError:!1,categories:[]},a}return(0,l.Z)(n,[{key:"componentDidMount",value:function(){var t=this;k.Z.get(misago.get("THREAD_EDITOR_API")).then((function(e){var n=e.map((function(t){return Object.assign(t,{disabled:!1===t.post,label:t.name,value:t.id,post:t.post})}));t.setState({isLoaded:!0,categories:n})}),(function(e){t.setState({isError:e.detail})}))}},{key:"render",value:function(){return this.state.isError?(0,r.Z)(Za,{message:this.state.isError}):this.state.isLoaded?v().createElement(va,(0,f.Z)({},this.props,{categories:this.state.categories})):Hn||(Hn=(0,r.Z)(fa,{}))}}]),n}(v().Component),va=function(t){(0,u.Z)(n,t);var e=Jn(n);function n(t){var a;return(0,s.Z)(this,n),a=e.call(this,t),(0,h.Z)((0,c.Z)(a),"onCategoryChange",(function(t){var e=t.target.value,n={category:e};a.acl[e].can_pin_threads<n.weight&&(n.weight=0),a.acl[e].can_hide_threads||(n.is_hidden=0),a.acl[e].can_close_threads||(n.is_closed=!1),a.setState(n)})),a.state={isLoading:!1,title:"",category:null,categories:t.categories,weight:0,is_hidden:0,is_closed:!1,validators:{title:[Xn.C1()]},errors:{}},a.isHiddenChoices=[{value:0,icon:"visibility",label:pgettext("thread hidden switch choice","No")},{value:1,icon:"visibility_off",label:pgettext("thread hidden switch choice","Yes")}],a.isClosedChoices=[{value:!1,icon:"lock_outline",label:pgettext("thread closed switch choice","No")},{value:!0,icon:"lock",label:pgettext("thread closed switch choice","Yes")}],a.acl={},a.props.categories.forEach((function(t){t.post&&(a.state.category||(a.state.category=t.id),a.acl[t.id]={can_pin_threads:t.post.pin,can_close_threads:t.post.close,can_hide_threads:t.post.hide})})),a}return(0,l.Z)(n,[{key:"clean",value:function(){return!!this.isValid()||(x.Z.error(gettext("Form contains errors.")),this.setState({errors:this.validate()}),!1)}},{key:"send",value:function(){return k.Z.post(this.props.thread.api.posts.split,{title:this.state.title,category:this.state.category,weight:this.state.weight,is_hidden:this.state.is_hidden,is_closed:this.state.is_closed,posts:[this.props.post.id]})}},{key:"handleSuccess",value:function(t){N.Z.dispatch(Gt.r$(this.props.post,{isDeleted:!0})),_.Z.hide(),x.Z.success(pgettext("post split modal","Selected post was split into new thread."))}},{key:"handleError",value:function(t){400===t.status?(this.setState({errors:Object.assign({},this.state.errors,t)}),x.Z.error(gettext("Form contains errors."))):x.Z.apiError(t)}},{key:"getWeightChoices",value:function(){var t=[{value:0,icon:"remove",label:pgettext("thread weight choice","Not pinned")},{value:1,icon:"bookmark_border",label:pgettext("thread weight choice","Pinned in category")}];return 2==this.acl[this.state.category].can_pin_threads&&t.push({value:2,icon:"bookmark",label:pgettext("thread weight choice","Pinned globally")}),t}},{key:"renderWeightField",value:function(){return this.acl[this.state.category].can_pin_threads?(0,r.Z)(g.Z,{label:pgettext("posts split modal field","Thread weight"),for:"id_weight",labelClass:"col-sm-4",controlClass:"col-sm-8"},void 0,(0,r.Z)(Kn.Z,{id:"id_weight",onChange:this.bindInput("weight"),value:this.state.weight,choices:this.getWeightChoices()})):null}},{key:"renderHiddenField",value:function(){return this.acl[this.state.category].can_hide_threads?(0,r.Z)(g.Z,{label:pgettext("posts split modal field","Hide thread"),for:"id_is_hidden",labelClass:"col-sm-4",controlClass:"col-sm-8"},void 0,(0,r.Z)(Kn.Z,{id:"id_is_closed",onChange:this.bindInput("is_hidden"),value:this.state.is_hidden,choices:this.isHiddenChoices})):null}},{key:"renderClosedField",value:function(){return this.acl[this.state.category].can_close_threads?(0,r.Z)(g.Z,{label:pgettext("posts split modal field","Close thread"),for:"id_is_closed",labelClass:"col-sm-4",controlClass:"col-sm-8"},void 0,(0,r.Z)(Kn.Z,{id:"id_is_closed",onChange:this.bindInput("is_closed"),value:this.state.is_closed,choices:this.isClosedChoices})):null}},{key:"render",value:function(){return(0,r.Z)(ga,{className:"modal-dialog"},void 0,(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"modal-body"},void 0,(0,r.Z)(g.Z,{label:pgettext("posts split modal field","Thread title"),for:"id_title",labelClass:"col-sm-4",controlClass:"col-sm-8",validation:this.state.errors.title},void 0,(0,r.Z)("input",{id:"id_title",className:"form-control",type:"text",onChange:this.bindInput("title"),value:this.state.title})),Vn||(Vn=(0,r.Z)("div",{className:"clearfix"})),(0,r.Z)(g.Z,{label:pgettext("posts split modal field","Category"),for:"id_category",labelClass:"col-sm-4",controlClass:"col-sm-8",validation:this.state.errors.category},void 0,(0,r.Z)(Qn.Z,{id:"id_category",onChange:this.onCategoryChange,value:this.state.category,choices:this.state.categories})),Yn||(Yn=(0,r.Z)("div",{className:"clearfix"})),this.renderWeightField(),this.renderHiddenField(),this.renderClosedField()),(0,r.Z)("div",{className:"modal-footer"},void 0,(0,r.Z)(Tt.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,pgettext("posts split modal btn","Split post")))))}}]),n}(Z.Z);function fa(){return Gn||(Gn=(0,r.Z)(ga,{className:"modal-dialog"},void 0,(0,r.Z)(J.Z,{})))}function Za(t){return(0,r.Z)(ga,{className:"modal-dialog modal-message"},void 0,Wn||(Wn=(0,r.Z)("div",{className:"message-icon"},void 0,(0,r.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,r.Z)("div",{className:"message-body"},void 0,(0,r.Z)("p",{className:"lead"},void 0,pgettext("post split modal","You can't move this post at the moment.")),(0,r.Z)("p",{},void 0,t.message)))}function ga(t){return(0,r.Z)("div",{className:t.className,role:"document"},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,$n||($n=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("posts split modal title","Split post into new thread"))),t.children))}function ya(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,a=(0,p.Z)(t);if(e){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}function ba(t){return(0,r.Z)("ul",{className:"dropdown-menu dropdown-menu-right stick-to-bottom"},void 0,v().createElement(_a,t),v().createElement(xa,t),v().createElement(Na,t),v().createElement(wa,t),v().createElement(Ca,t),v().createElement(Ra,t),v().createElement(Ea,t),v().createElement(Sa,t),v().createElement(La,t),v().createElement(Oa,t),v().createElement(Pa,t),v().createElement(Aa,t),v().createElement(Ta,t))}var ka,_a=function(t){(0,u.Z)(n,t);var e=ya(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){var e=window.location.protocol+"//";e+=window.location.host,e+=t.props.post.url.index,prompt(pgettext("post permalink","Permament link to this post:"),e)})),t}return(0,l.Z)(n,[{key:"render",value:function(){return(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,ea||(ea=(0,r.Z)("span",{className:"material-icon"},void 0,"link")),pgettext("post options permalink btn","Permament link")))}}]),n}(v().Component),xa=function(t){(0,u.Z)(n,t);var e=ya(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){ct.Z.open({mode:"EDIT",thread:t.props.thread,post:t.props.post,config:t.props.post.api.editor,submit:t.props.post.api.index})})),t}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_edit?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,na||(na=(0,r.Z)("span",{className:"material-icon"},void 0,"edit")),pgettext("post options edit btn","Edit"))):null}}]),n}(v().Component),Na=function(t){(0,u.Z)(n,t);var e=ya(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){Xe(t.props)})),t}return(0,l.Z)(n,[{key:"render",value:function(){var t=this.props,e=t.post,n=t.thread;return n.acl.can_mark_best_answer&&e.acl.can_mark_as_best_answer?e.id===n.best_answer||n.best_answer&&!n.acl.can_change_best_answer?null:(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,aa||(aa=(0,r.Z)("span",{className:"material-icon"},void 0,"check_box")),pgettext("post options best answer btn","Mark as best answer"))):null}}]),n}(v().Component),wa=function(t){(0,u.Z)(n,t);var e=ya(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){Je(t.props)})),t}return(0,l.Z)(n,[{key:"render",value:function(){var t=this.props,e=t.post,n=t.thread;return e.id!==n.best_answer?null:n.acl.can_unmark_best_answer?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,ia||(ia=(0,r.Z)("span",{className:"material-icon"},void 0,"check_box_outline_blank")),pgettext("post options best answer btn","Unmark best answer"))):null}}]),n}(v().Component),Ca=function(t){(0,u.Z)(n,t);var e=ya(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){_.Z.show((0,r.Z)(Mn,{post:t.props.post}))})),t}return(0,l.Z)(n,[{key:"render",value:function(){var t=this.props.post.is_hidden&&!this.props.post.acl.can_see_hidden,e=0===this.props.post.edits;if(t||e)return null;var n=npgettext("post edits","This post was edited %(edits)s time.","This post was edited %(edits)s times.",this.props.post.edits);return interpolate(n,{edits:this.props.post.edits},!0),(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,oa||(oa=(0,r.Z)("span",{className:"material-icon"},void 0,"edit")),pgettext("post options edit btn","Changes history")))}}]),n}(v().Component),Ra=function(t){(0,u.Z)(n,t);var e=ya(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){Fe(t.props)})),t}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_approve&&this.props.post.is_unapproved?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,ra||(ra=(0,r.Z)("span",{className:"material-icon"},void 0,"done")),pgettext("post options approve btn","Approve"))):null}}]),n}(v().Component),Ea=function(t){(0,u.Z)(n,t);var e=ya(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){_.Z.show(v().createElement(wn,t.props))})),t}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_move?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,sa||(sa=(0,r.Z)("span",{className:"material-icon"},void 0,"arrow_forward")),pgettext("post options move btn","Move"))):null}}]),n}(v().Component),Sa=function(t){(0,u.Z)(n,t);var e=ya(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){_.Z.show(v().createElement(ta,t.props))})),t}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_move?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,la||(la=(0,r.Z)("span",{className:"material-icon"},void 0,"call_split")),pgettext("post options split btn","Split"))):null}}]),n}(v().Component),La=function(t){(0,u.Z)(n,t);var e=ya(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){He(t.props)})),t}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_protect?this.props.post.is_protected?null:(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,ca||(ca=(0,r.Z)("span",{className:"material-icon"},void 0,"lock_outline")),pgettext("post options protect btn","Protect"))):null}}]),n}(v().Component),Oa=function(t){(0,u.Z)(n,t);var e=ya(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){Ve(t.props)})),t}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_protect&&this.props.post.is_protected?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,ua||(ua=(0,r.Z)("span",{className:"material-icon"},void 0,"lock_open")),pgettext("post options protect btn","Remove protection"))):null}}]),n}(v().Component),Pa=function(t){(0,u.Z)(n,t);var e=ya(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){Ye(t.props)})),t}return(0,l.Z)(n,[{key:"render",value:function(){var t=this.props,e=t.post,n=t.thread;return e.id===n.best_answer?null:e.acl.can_hide?e.is_hidden?null:(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,da||(da=(0,r.Z)("span",{className:"material-icon"},void 0,"visibility_off")),pgettext("post options hide btn","Hide"))):null}}]),n}(v().Component),Aa=function(t){(0,u.Z)(n,t);var e=ya(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){Ge(t.props)})),t}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_unhide&&this.props.post.is_hidden?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,pa||(pa=(0,r.Z)("span",{className:"material-icon"},void 0,"visibility")),pgettext("post options hide btn","Unhide"))):null}}]),n}(v().Component),Ta=function(t){(0,u.Z)(n,t);var e=ya(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){Ke(t.props)})),t}return(0,l.Z)(n,[{key:"render",value:function(){var t=this.props,e=t.post,n=t.thread;return e.id===n.best_answer?null:e.acl.can_delete?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,ha||(ha=(0,r.Z)("span",{className:"material-icon"},void 0,"clear")),pgettext("post options delete btn","Delete"))):null}}]),n}(v().Component);function Ia(t){return(0,r.Z)("div",{className:"pull-right dropdown"},void 0,ka||(ka=(0,r.Z)("button",{"aria-expanded":"true","aria-haspopup":"true",className:"btn btn-default btn-icon dropdown-toggle","data-toggle":"dropdown",type:"button"},void 0,(0,r.Z)("span",{className:"material-icon"},void 0,"expand_more"))),v().createElement(ba,t))}var Ba=n(21981);var ja,Da=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(){var t;(0,s.Z)(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t=a.call.apply(a,[this].concat(n)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){t.props.post.isSelected?N.Z.dispatch(Ba._H(t.props.post)):N.Z.dispatch(Ba.Ys(t.props.post))})),t}return(0,l.Z)(i,[{key:"render",value:function(){return this.props.thread.acl.can_merge_posts||(t=this.props.post.acl).can_approve||t.can_hide||t.can_protect||t.can_unhide||t.can_delete||t.can_move?(0,r.Z)("div",{className:"pull-right"},void 0,(0,r.Z)("button",{className:"btn btn-default btn-icon",onClick:this.onClick,type:"button"},void 0,(0,r.Z)("span",{className:"material-icon"},void 0,this.props.post.isSelected?"check_box":"check_box_outline_blank"))):null;var t}}]),i}(v().Component),Ua=n(24678),za=n(16069);function qa(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,a=(0,p.Z)(t);if(e){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}function Ma(t){return(0,r.Z)("div",{className:"post-heading"},void 0,v().createElement(Fa,t),v().createElement(Ha,t),v().createElement(Va,t),v().createElement(Ya,t),v().createElement($a,t),v().createElement(Qa,t),v().createElement(Ka,t),v().createElement(Da,t),v().createElement(Ia,t))}function Fa(t){return t.post.is_read?null:(0,r.Z)("span",{className:"label label-unread hidden-xs"},void 0,pgettext("post unread label","New post"))}function Ha(t){return t.post.is_read?null:(0,r.Z)("span",{className:"label label-unread visible-xs-inline-block"},void 0,pgettext("post unread label","New"))}function Va(t){return(0,r.Z)("a",{href:t.post.url.index,className:"btn btn-link posted-on hidden-xs"},void 0,(0,r.Z)(za.Z,{datetime:t.post.posted_on.toISOString()}))}function Ya(t){return(0,r.Z)("a",{href:t.post.url.index,className:"btn btn-link posted-on visible-xs-inline-block"},void 0,t.post.posted_on.fromNow())}var Ga,Wa,$a=function(t){(0,u.Z)(n,t);var e=qa(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){_.Z.show((0,r.Z)(Mn,{post:t.props.post}))})),t}return(0,l.Z)(n,[{key:"render",value:function(){var t=this.props.post.is_hidden&&!this.props.post.acl.can_see_hidden,e=0===this.props.post.edits;if(t||e)return null;var n=npgettext("post edits stat","This post was edited %(edits)s time.","This post was edited %(edits)s times.",this.props.post.edits),a=interpolate(n,{edits:this.props.post.edits},!0),i=npgettext("post edits stat","edited %(edits)s time","edited %(edits)s times",this.props.post.edits);return(0,r.Z)("button",{className:"btn btn-link btn-see-edits hidden-xs",onClick:this.onClick,title:a,type:"button"},void 0,interpolate(i,{edits:this.props.post.edits},!0))}}]),n}(v().Component),Qa=function(t){(0,u.Z)(n,t);var e=qa(n);function n(){return(0,s.Z)(this,n),e.apply(this,arguments)}return(0,l.Z)(n,[{key:"render",value:function(){var t=this.props.post.is_hidden&&!this.props.post.acl.can_see_hidden,e=0===this.props.post.edits;if(t||e)return null;var n=npgettext("post edits stat","%(edits)s edit","%(edits)s edits",this.props.post.edits);return(0,r.Z)("button",{className:"btn btn-link btn-see-edits visible-xs-inline-block",onClick:this.onClick,type:"button"},void 0,interpolate(n,{edits:this.props.post.edits},!0))}}]),n}($a);function Ka(t){var e=t.post.poster&&t.post.poster.id===t.user.id,n=t.post.acl.can_protect;return t.user.id&&t.post.is_protected&&(e||n)?(0,r.Z)("span",{className:"label label-protected hidden-xs",title:pgettext("post protected label","This post is protected and may not be edited.")},void 0,ja||(ja=(0,r.Z)("span",{className:"material-icon"},void 0,"lock_outline")),pgettext("post protected label","protected")):null}function Xa(t){var e=t.post,n=t.thread;return(0,r.Z)("div",{className:"post-side post-side-anonymous"},void 0,(0,r.Z)(Da,{post:e,thread:n}),(0,r.Z)(Ia,{post:e,thread:n}),(0,r.Z)("div",{className:"media"},void 0,Ga||(Ga=(0,r.Z)("div",{className:"media-left"},void 0,(0,r.Z)("span",{},void 0,(0,r.Z)(I.ZP,{className:"poster-avatar",size:100})))),(0,r.Z)("div",{className:"media-body"},void 0,(0,r.Z)("span",{className:"media-heading item-title"},void 0,e.poster_name),(0,r.Z)("span",{className:"user-title user-title-anonymous"},void 0,pgettext("post removed poster username","Removed user")))))}function Ja(t){var e=t.title,n=t.rank;return n.is_tab||!!e||!!n.title}function ti(t){var e=t.poster,n=npgettext("poster stats","%(posts)s post","%(posts)s posts",e.posts),a="user-postcount";return Ja(e)&&(a+=" hidden-xs hidden-sm"),(0,r.Z)("span",{className:a},void 0,interpolate(n,{posts:e.posts},!0))}function ei(t){var e=t.poster,n="hidden-xs";return Ja(e)&&(n+=" hidden-sm"),(0,r.Z)("span",{className:n},void 0,(0,r.Z)(Ua.ZP,{status:e.status},void 0,(0,r.Z)(Ua.pg,{status:e.status,user:e})))}function ni(t){var e=t.rank,n=t.title||e.title;if(!n&&e.is_tab&&(n=e.name),!n)return null;var a="user-title";return e.css_class&&(a+=" user-title-"+e.css_class),e.is_tab?(0,r.Z)("div",{className:a},void 0,(0,r.Z)("a",{href:e.url},void 0,n)):(0,r.Z)("div",{className:a},void 0,n)}function ai(t){var e=t.post,n=t.thread,a=e.poster;return(0,r.Z)("div",{className:"post-side post-side-registered"},void 0,(0,r.Z)(Da,{post:e,thread:n}),(0,r.Z)(Ia,{post:e,thread:n}),(0,r.Z)("div",{className:"media"},void 0,(0,r.Z)("div",{className:"media-left"},void 0,(0,r.Z)("a",{href:a.url},void 0,(0,r.Z)(I.ZP,{className:"poster-avatar",size:100,user:a}))),(0,r.Z)("div",{className:"media-body"},void 0,(0,r.Z)("div",{className:"media-heading"},void 0,(0,r.Z)("a",{className:"item-title",href:a.url},void 0,a.username),(0,r.Z)(Ua.ZP,{status:a.status},void 0,(0,r.Z)(Ua.Jj,{status:a.status}))),(0,r.Z)(ni,{rank:a.rank,title:a.title}),(0,r.Z)(ei,{poster:a}),(0,r.Z)(ti,{poster:a}))))}function ii(t){return t.post.poster?v().createElement(ai,t):v().createElement(Xa,t)}function oi(t){var e="post";return t.post.isDeleted?e="hide":t.post.is_hidden&&!t.post.acl.can_see_hidden&&(e="post post-hidden"),t.post.poster&&t.post.poster.rank.css_class&&(e+=" post-"+t.post.poster.rank.css_class),t.post.is_read||(e+=" post-new"),(0,r.Z)("li",{id:"post-"+t.post.id,className:e},void 0,(0,r.Z)("div",{className:"panel panel-default panel-post"},void 0,(0,r.Z)("div",{className:"panel-body"},void 0,v().createElement(ii,t),(0,r.Z)("div",{className:"panel-content"},void 0,v().createElement(Ma,t),v().createElement(De,t),v().createElement(ze,t),v().createElement(qe,t),v().createElement(Ue,t),v().createElement(Te,t),v().createElement(Ne,t),v().createElement(hn,t)))))}const ri=function(){return(0,r.Z)("li",{className:"post"},void 0,(0,r.Z)("div",{className:"panel panel-default panel-post"},void 0,(0,r.Z)("div",{className:"panel-body"},void 0,(0,r.Z)("div",{className:"post-side post-side-registered"},void 0,(0,r.Z)("div",{className:"media"},void 0,Wa||(Wa=(0,r.Z)("div",{className:"media-left"},void 0,(0,r.Z)("span",{},void 0,(0,r.Z)(I.ZP,{className:"poster-avatar",size:"100"})))),(0,r.Z)("div",{className:"media-body"},void 0,(0,r.Z)("span",{className:"media-heading item-title"},void 0,(0,r.Z)("span",{className:"ui-preview-text",style:{width:"80px"}},void 0," ")),(0,r.Z)("span",{className:"user-title user-title-anonymous"},void 0,(0,r.Z)("span",{className:"ui-preview-text",style:{width:"60px"}},void 0," "))))),(0,r.Z)("div",{className:"panel-content"},void 0,(0,r.Z)("div",{className:"post-body"},void 0,(0,r.Z)("article",{className:"misago-markup"},void 0,(0,r.Z)("p",{className:"ui-preview-text",style:{width:"100%"}},void 0," "),(0,r.Z)("p",{className:"ui-preview-text",style:{width:"70%"}},void 0," "),(0,r.Z)("p",{className:"ui-preview-text hidden-xs hidden-sm",style:{width:"85%"}},void 0," ")))))))};var si;function li(t){return t.posts.isLoaded?(0,r.Z)("ul",{className:"posts-list ui-ready"},void 0,t.posts.results.map((function(e){return v().createElement(ci,(0,f.Z)({key:e.id,post:e},t))}))):si||(si=(0,r.Z)("ul",{className:"posts-list ui-preview"},void 0,(0,r.Z)(ri,{})))}function ci(t){return t.post.is_event?v().createElement(fe,t):v().createElement(oi,t)}var ui,di,pi,hi,mi,vi,fi,Zi=n(55547),gi=n(53328),yi=n(9771),bi=n(59131),ki=n(98936);const _i=function(t){var e=t.thread;return(0,r.Z)("ul",{className:"thread-flags"},void 0,2==e.weight&&(0,r.Z)("li",{className:"thread-flag-pinned-globally",title:pgettext("thread flag","Pinned globally")},void 0,ui||(ui=(0,r.Z)("span",{className:"material-icon"},void 0,"bookmark"))),1==e.weight&&(0,r.Z)("li",{className:"thread-flag-pinned-locally",title:pgettext("thread flag","Pinned in category")},void 0,di||(di=(0,r.Z)("span",{className:"material-icon"},void 0,"bookmark_outline"))),e.best_answer&&(0,r.Z)("li",{className:"thread-flag-answered",title:pgettext("thread flag","Answered")},void 0,pi||(pi=(0,r.Z)("span",{className:"material-icon"},void 0,"check_circle"))),e.has_poll&&(0,r.Z)("li",{className:"thread-flag-poll",title:pgettext("thread flag","Poll")},void 0,hi||(hi=(0,r.Z)("span",{className:"material-icon"},void 0,"poll"))),(e.is_unapproved||e.has_unapproved_posts)&&(0,r.Z)("li",{className:"thread-flag-unapproved",title:e.is_unapproved?pgettext("thread flag","Awaiting approval"):pgettext("thread flag","Has unapproved posts")},void 0,mi||(mi=(0,r.Z)("span",{className:"material-icon"},void 0,"visibility"))),e.is_closed&&(0,r.Z)("li",{className:"thread-flag-closed",title:pgettext("thread flag","Closed")},void 0,vi||(vi=(0,r.Z)("span",{className:"material-icon"},void 0,"lock"))),e.is_hidden&&(0,r.Z)("li",{className:"thread-flag-hidden",title:pgettext("thread flag","Hidden")},void 0,fi||(fi=(0,r.Z)("span",{className:"material-icon"},void 0,"visibility_off"))))};var xi;const Ni=function(t){var e=t.thread;return(0,r.Z)("span",{className:"threads-replies",title:interpolate(npgettext("thread replies stat","%(replies)s reply","%(replies)s replies",e.replies),{replies:e.replies},!0)},void 0,xi||(xi=(0,r.Z)("span",{className:"material-icon"},void 0,"chat_bubble_outline")),e.replies>980?Math.round(e.replies/1e3)+"K":e.replies)};var wi;const Ci=function(t){var e=t.thread;return(0,r.Z)("div",{className:"thread-user-card"},void 0,(0,r.Z)("div",{className:"thread-user-card-media"},void 0,e.starter?(0,r.Z)("a",{href:e.url.starter},void 0,(0,r.Z)(I.ZP,{size:40,user:e.starter})):wi||(wi=(0,r.Z)(I.ZP,{size:40}))),(0,r.Z)("div",{className:"thread-user-card-body"},void 0,(0,r.Z)("div",{className:"thread-user-card-header"},void 0,e.starter?(0,r.Z)("a",{className:"item-title",href:e.url.starter,title:pgettext("thread starter info","Thread author")},void 0,e.starter.username):(0,r.Z)("span",{className:"item-title",title:pgettext("thread starter info","Thread author")},void 0,e.starter_name)),(0,r.Z)("div",{},void 0,(0,r.Z)("span",{className:"text-muted",title:interpolate(pgettext("thread starter info","Started on: %(timestamp)s"),{timestamp:e.started_on.format("LLL")},!0)},void 0,e.started_on.fromNow()))))};var Ri,Ei,Si=n(99755),Li=n(12891);var Oi,Pi=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(t){var e;return(0,s.Z)(this,i),e=a.call(this,t),(0,h.Z)((0,c.Z)(e),"handleSuccess",(function(t){e.handleSuccessUnmounted(t),e.setState({isLoading:!0}),_.Z.hide()})),(0,h.Z)((0,c.Z)(e),"handleSuccessUnmounted",(function(t){N.Z.dispatch(b.Ar()),N.Z.dispatch(b.Vx(t))})),(0,h.Z)((0,c.Z)(e),"handleError",(function(t){N.Z.dispatch(b.Ar()),400===t.status?x.Z.error(t.detail[0]):x.Z.apiError(t)})),(0,h.Z)((0,c.Z)(e),"onChange",(function(t){e.changeValue("title",t.target.value)})),e.state={isLoading:!1,title:t.thread.title,validators:{title:(0,Li.jn)()},errors:{}},e}return(0,l.Z)(i,[{key:"clean",value:function(){if(!this.state.title.trim().length)return x.Z.error(pgettext("thread title form","You have to enter thread title.")),!1;var t=this.validate();return!t.title||(x.Z.error(t.title[0]),!1)}},{key:"send",value:function(){return N.Z.dispatch(b.n6()),k.Z.patch(this.props.thread.api.index,[{op:"replace",path:"title",value:this.state.title}])}},{key:"render",value:function(){return(0,r.Z)("div",{className:"modal-dialog modal-lg",role:"document"},void 0,(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,Ri||(Ri=(0,r.Z)(Ai,{})),(0,r.Z)("div",{className:"modal-body"},void 0,(0,r.Z)(g.Z,{for:"id_modal_title",label:pgettext("thread title form field","Thread title")},void 0,(0,r.Z)("input",{className:"form-control",disabled:this.state.isLoading||this.props.thread.isBusy,id:"id_modal_title",onChange:this.onChange,value:this.state.title}))),(0,r.Z)("div",{className:"modal-footer"},void 0,(0,r.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,pgettext("thread title form btn","Cancel")),(0,r.Z)("button",{className:"btn btn-primary",disabled:this.state.isLoading||this.props.thread.isBusy},void 0,pgettext("thread title form btn","Change title"))))))}}]),i}(Z.Z);function Ai(t){return(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,Ei||(Ei=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("thread title form title","Change title")))}var Ti,Ii,Bi=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(t){var e;return(0,s.Z)(this,i),e=a.call(this,t),(0,h.Z)((0,c.Z)(e),"handleSuccess",(function(t){e.props.onSuccess(t),_.Z.hide()})),(0,h.Z)((0,c.Z)(e),"handleError",(function(t){e.props.onError(t)})),(0,h.Z)((0,c.Z)(e),"onBestAnswerChange",(function(t){e.changeValue("bestAnswer",t.target.value)})),(0,h.Z)((0,c.Z)(e),"onPollChange",(function(t){e.changeValue("poll",t.target.value)})),e.state={isLoading:!1,bestAnswer:"0",poll:"0"},e}return(0,l.Z)(i,[{key:"clean",value:function(){return!this.props.polls||"0"!==this.state.poll||window.confirm(pgettext("merge threads conflict form","Are you sure you want to delete all polls?"))}},{key:"send",value:function(){var t=Object.assign({},this.props.data,{best_answer:this.state.bestAnswer,poll:this.state.poll});return k.Z.post(this.props.api,t)}},{key:"render",value:function(){return(0,r.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,Oi||(Oi=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("merge threads conflict modal title","Merge threads"))),(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"modal-body"},void 0,(0,r.Z)(ji,{choices:this.props.bestAnswers,onChange:this.onBestAnswerChange,value:this.state.bestAnswer}),(0,r.Z)(Di,{choices:this.props.polls,onChange:this.onPollChange,value:this.state.poll})),(0,r.Z)("div",{className:"modal-footer"},void 0,(0,r.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,pgettext("merge threads conflict btn","Cancel")),(0,r.Z)(Tt.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,pgettext("merge threads conflict btn","Merge threads"))))))}}]),i}(Z.Z);function ji(t){var e=t.choices,n=t.onChange,a=t.value;return e?(0,r.Z)(g.Z,{label:pgettext("merge threads conflict best answer","Best answer"),helpText:pgettext("merge threads conflict best answer","Select the best answer for your newly merged thread. No posts will be deleted during the merge."),for:"id_best_answer"},void 0,(0,r.Z)("select",{className:"form-control",id:"id_best_answer",onChange:n,value:a},void 0,e.map((function(t){return(0,r.Z)("option",{value:t[0]},t[0],t[1])})))):null}function Di(t){var e=t.choices,n=t.onChange,a=t.value;return e?(0,r.Z)(g.Z,{label:pgettext("merge threads conflict poll","Poll"),helpText:pgettext("merge threads conflict poll","Select the poll for your newly merged thread. Rejected polls will be permanently deleted and cannot be recovered."),for:"id_poll"},void 0,(0,r.Z)("select",{className:"form-control",id:"id_poll",onChange:n,value:a},void 0,e.map((function(t){return(0,r.Z)("option",{value:t[0]},t[0],t[1])})))):null}var Ui,zi,qi,Mi,Fi,Hi,Vi=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(t){var e;return(0,s.Z)(this,i),e=a.call(this,t),(0,h.Z)((0,c.Z)(e),"handleSuccess",(function(t){e.handleSuccessUnmounted(t),e.setState({isLoading:!0})})),(0,h.Z)((0,c.Z)(e),"handleSuccessUnmounted",(function(t){x.Z.success(pgettext("thread merge form","Thread has been merged with other one.")),window.location=t.url})),(0,h.Z)((0,c.Z)(e),"handleError",(function(t){N.Z.dispatch(b.Ar()),400===t.status?t.best_answers||t.polls?_.Z.show((0,r.Z)(Bi,{api:e.props.thread.api.merge,bestAnswers:t.best_answers,data:{other_thread:e.state.url},polls:t.polls,onError:e.handleError,onSuccess:e.handleSuccessUnmounted})):t.best_answer?x.Z.error(t.best_answer[0]):t.poll?x.Z.error(t.poll[0]):x.Z.error(t.detail):x.Z.apiError(t)})),(0,h.Z)((0,c.Z)(e),"onUrlChange",(function(t){e.changeValue("url",t.target.value)})),e.state={isLoading:!1,url:"",validators:{url:[]},errors:{}},e}return(0,l.Z)(i,[{key:"clean",value:function(){return!!this.state.url.trim().length||(x.Z.error(pgettext("thread merge form","You have to enter link to the other thread.")),!1)}},{key:"send",value:function(){return N.Z.dispatch(b.n6()),k.Z.post(this.props.thread.api.merge,{other_thread:this.state.url})}},{key:"render",value:function(){return(0,r.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,Ti||(Ti=(0,r.Z)(Yi,{})),(0,r.Z)("div",{className:"modal-body"},void 0,(0,r.Z)(g.Z,{for:"id_url",label:pgettext("thread merge form field","Link to thread you want to merge with"),help_text:pgettext("thread merge form field","Merge will delete current thread and move its contents to the thread specified here.")},void 0,(0,r.Z)("input",{className:"form-control",disabled:this.state.isLoading||this.props.thread.isBusy,id:"id_url",onChange:this.onUrlChange,value:this.state.url}))),(0,r.Z)("div",{className:"modal-footer"},void 0,(0,r.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,pgettext("thread merge form btn","Cancel")),(0,r.Z)("button",{className:"btn btn-primary",disabled:this.state.isLoading||this.props.thread.isBusy},void 0,pgettext("thread merge form btn","Merge thread"))))))}}]),i}(Z.Z);function Yi(t){return(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,Ii||(Ii=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("thread merge form title","Merge thread")))}var Gi,Wi,$i,Qi,Ki,Xi,Ji,to,eo,no,ao,io,oo=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(t){var e;return(0,s.Z)(this,i),e=a.call(this,t),(0,h.Z)((0,c.Z)(e),"onCategoryChange",(function(t){e.changeValue("category",t.target.value)})),e.state={isReady:!1,isLoading:!1,isError:!1,category:null,categories:[]},e}return(0,l.Z)(i,[{key:"componentDidMount",value:function(){var t=this;k.Z.get(S.Z.get("THREAD_EDITOR_API")).then((function(e){var n=null,a=e.map((function(t){return!1===t.post||n||(n=t.id),Object.assign(t,{disabled:!1===t.post,label:t.name,value:t.id})}));t.setState({isReady:!0,category:n,categories:a})}),(function(e){t.setState({isError:e.detail})}))}},{key:"send",value:function(){return N.Z.dispatch(b.n6()),k.Z.patch(this.props.thread.api.index,[{op:"replace",path:"category",value:this.state.category}])}},{key:"handleSuccess",value:function(){k.Z.get(this.props.thread.api.posts.index,{page:this.props.posts.page}).then((function(t){N.Z.dispatch(b.gx(t)),N.Z.dispatch(Ba.zD(t.post_set)),N.Z.dispatch(b.Ar()),x.Z.success(pgettext("thread move form","Thread has been moved.")),_.Z.hide()}),(function(t){N.Z.dispatch(b.Ar()),x.Z.apiError(t)}))}},{key:"handleError",value:function(t){400===t.status?x.Z.error(t.detail[0]):x.Z.apiError(t)}},{key:"render",value:function(){return this.state.isReady?(0,r.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,Ui||(Ui=(0,r.Z)(ro,{})),(0,r.Z)("div",{className:"modal-body"},void 0,(0,r.Z)(g.Z,{for:"id_category",label:pgettext("thread move form field","New category")},void 0,(0,r.Z)(Qn.Z,{choices:this.state.categories,disabled:this.state.isLoading||this.props.thread.isBusy,id:"id_category",onChange:this.onCategoryChange,value:this.state.category}))),(0,r.Z)("div",{className:"modal-footer"},void 0,(0,r.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,pgettext("thread move form btn","Cancel")),(0,r.Z)("button",{className:"btn btn-primary",disabled:this.state.isLoading||this.props.thread.isBusy},void 0,pgettext("thread move form btn","Move thread")))))):this.state.isError?(0,r.Z)(lo,{message:this.state.isError}):zi||(zi=(0,r.Z)(so,{}))}}]),i}(Z.Z);function ro(t){return(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,qi||(qi=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("thread move form title","Move thread")))}function so(t){return Mi||(Mi=(0,r.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,(0,r.Z)(ro,{}),(0,r.Z)(J.Z,{}))))}function lo(t){return(0,r.Z)("div",{className:"modal-dialog modal-message",role:"document"},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,Fi||(Fi=(0,r.Z)(ro,{})),Hi||(Hi=(0,r.Z)("div",{className:"message-icon"},void 0,(0,r.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,r.Z)("div",{className:"message-body"},void 0,(0,r.Z)("p",{className:"lead"},void 0,pgettext("thread move form","You can't move this thread at the moment.")),(0,r.Z)("p",{},void 0,t.message),(0,r.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,pgettext("thread move form dismiss btn","Ok")))))}var co=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(){var t;(0,s.Z)(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t=a.call.apply(a,[this].concat(n)),(0,h.Z)((0,c.Z)(t),"callApi",(function(e,n){N.Z.dispatch(b.n6()),e.push({op:"add",path:"acl",value:!0}),k.Z.patch(t.props.thread.api.index,e).then((function(t){N.Z.dispatch(b.Vx(t)),N.Z.dispatch(b.Ar()),x.Z.success(n)}),(function(t){N.Z.dispatch(b.Ar()),400===t.status?x.Z.error(t.detail[0]):x.Z.apiError(t)}))})),(0,h.Z)((0,c.Z)(t),"changeTitle",(function(){_.Z.show((0,r.Z)(Pi,{thread:t.props.thread}))})),(0,h.Z)((0,c.Z)(t),"pinGlobally",(function(){t.callApi([{op:"replace",path:"weight",value:2}],pgettext("thread moderation","Thread has been pinned globally."))})),(0,h.Z)((0,c.Z)(t),"pinLocally",(function(){t.callApi([{op:"replace",path:"weight",value:1}],pgettext("thread moderation","Thread has been pinned in category."))})),(0,h.Z)((0,c.Z)(t),"unpin",(function(){t.callApi([{op:"replace",path:"weight",value:0}],pgettext("thread moderation","Thread has been unpinned."))})),(0,h.Z)((0,c.Z)(t),"approve",(function(){t.callApi([{op:"replace",path:"is-unapproved",value:!1}],pgettext("thread moderation","Thread has been approved."))})),(0,h.Z)((0,c.Z)(t),"open",(function(){t.callApi([{op:"replace",path:"is-closed",value:!1}],gettext("Thread has been opened."))})),(0,h.Z)((0,c.Z)(t),"close",(function(){t.callApi([{op:"replace",path:"is-closed",value:!0}],pgettext("thread moderation","Thread has been closed."))})),(0,h.Z)((0,c.Z)(t),"unhide",(function(){t.callApi([{op:"replace",path:"is-hidden",value:!1}],pgettext("thread moderation","Thread has been made visible."))})),(0,h.Z)((0,c.Z)(t),"hide",(function(){t.callApi([{op:"replace",path:"is-hidden",value:!0}],pgettext("thread moderation","Thread has been made hidden."))})),(0,h.Z)((0,c.Z)(t),"move",(function(){_.Z.show((0,r.Z)(oo,{posts:t.props.posts,thread:t.props.thread}))})),(0,h.Z)((0,c.Z)(t),"merge",(function(){_.Z.show((0,r.Z)(Vi,{thread:t.props.thread}))})),(0,h.Z)((0,c.Z)(t),"delete",(function(){window.confirm(pgettext("thread moderation","Are you sure you want to delete this thread?"))&&(N.Z.dispatch(b.n6()),k.Z.delete(t.props.thread.api.index).then((function(e){x.Z.success(pgettext("thread moderation","Thread has been deleted.")),window.location=t.props.thread.category.url.index}),(function(t){N.Z.dispatch(b.Ar()),x.Z.apiError(t)})))})),t}return(0,l.Z)(i,[{key:"render",value:function(){var t=this.props.moderation;return(0,r.Z)("ul",{className:"dropdown-menu dropdown-menu-right stick-to-bottom"},void 0,!!t.edit&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.changeTitle,type:"button"},void 0,Gi||(Gi=(0,r.Z)("span",{className:"material-icon"},void 0,"edit")),pgettext("thread moderation btn","Change title"))),!!t.pinGlobally&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.pinGlobally,type:"button"},void 0,Wi||(Wi=(0,r.Z)("span",{className:"material-icon"},void 0,"bookmark")),pgettext("thread moderation btn","Pin globally"))),!!t.pinLocally&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.pinLocally,type:"button"},void 0,$i||($i=(0,r.Z)("span",{className:"material-icon"},void 0,"bookmark_border")),pgettext("thread moderation btn","Pin in category"))),!!t.unpin&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.unpin,type:"button"},void 0,Qi||(Qi=(0,r.Z)("span",{className:"material-icon"},void 0,"panorama_fish_eye")),pgettext("thread moderation btn","Unpin"))),!!t.move&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.move,type:"button"},void 0,Ki||(Ki=(0,r.Z)("span",{className:"material-icon"},void 0,"arrow_forward")),pgettext("thread moderation btn","Move"))),!!t.merge&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.merge,type:"button"},void 0,Xi||(Xi=(0,r.Z)("span",{className:"material-icon"},void 0,"call_merge")),pgettext("thread moderation btn","Merge"))),!!t.approve&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.approve,type:"button"},void 0,Ji||(Ji=(0,r.Z)("span",{className:"material-icon"},void 0,"done")),pgettext("thread moderation btn","Approve"))),!!t.open&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.open,type:"button"},void 0,to||(to=(0,r.Z)("span",{className:"material-icon"},void 0,"lock_open")),pgettext("thread moderation btn","Open"))),!!t.close&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.close,type:"button"},void 0,eo||(eo=(0,r.Z)("span",{className:"material-icon"},void 0,"lock_outline")),pgettext("thread moderation btn","Close"))),!!t.unhide&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.unhide,type:"button"},void 0,no||(no=(0,r.Z)("span",{className:"material-icon"},void 0,"visibility")),pgettext("thread moderation btn","Unhide"))),!!t.hide&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.hide,type:"button"},void 0,ao||(ao=(0,r.Z)("span",{className:"material-icon"},void 0,"visibility_off")),pgettext("thread moderation btn","Hide"))),!!t.delete&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.delete,type:"button"},void 0,io||(io=(0,r.Z)("span",{className:"material-icon"},void 0,"clear")),pgettext("thread moderation btn","Delete"))))}}]),i}(v().Component);const uo=co;var po;const ho=function(t){var e=t.thread,n=t.posts,a=t.moderation;return(0,r.Z)("div",{className:"dropdown"},void 0,(0,r.Z)("button",{type:"button",className:"btn btn-default btn-outline btn-icon dropdown-toggle",title:pgettext("thread options btn","Thread options"),"data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",disabled:e.isBusy},void 0,po||(po=(0,r.Z)("span",{className:"material-icon"},void 0,"settings"))),(0,r.Z)(uo,{thread:e,posts:n,moderation:a}))};var mo,vo,fo,Zo=n(94184),go=n.n(Zo),yo=n(60642),bo=n(49021);const ko=(0,o.$j)()((function(t){var e=t.dispatch,n=t.dropup,a=t.stickToBottom,i=t.thread;return(0,r.Z)(yo.D,{url:i.api.watch},void 0,(function(t,o){var s,l=o.loading;function c(n){i.notifications!==n&&(e((0,b.Vx)({notifications:n})),t({json:{notifications:n},onError:function(t){x.Z.apiError(t),e((0,b.Vx)({notifications:i.notifications}))}}))}return(0,r.Z)("div",{className:n?"dropup":"dropdown"},void 0,(0,r.Z)("button",{className:"btn btn-default btn-outline btn-block","aria-expanded":"true","aria-haspopup":"true","data-toggle":"dropdown",type:"button"},void 0,(0,r.Z)("span",{className:"material-icon"},void 0,2===(s=i.notifications)?"mail":1===s?"notifications_active":"notifications_none"),function(t){return t?pgettext("watch thread","Watching"):pgettext("watch thread","Watch")}(i.notifications)),(0,r.Z)("ul",{className:go()("dropdown-menu dropdown-menu-right",{"stick-to-bottom":a})},void 0,(0,r.Z)(bo.iC,{},void 0,pgettext("watch thread","Notify about new replies")),(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",disabled:l,onClick:function(){return c(2)}},void 0,mo||(mo=(0,r.Z)("span",{className:"material-icon"},void 0,"mail")),pgettext("watch thread","On site and with e-mail"))),(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",disabled:l,onClick:function(){return c(1)}},void 0,vo||(vo=(0,r.Z)("span",{className:"material-icon"},void 0,"notifications_active")),pgettext("watch thread","On site only"))),(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",disabled:l,onClick:function(){return c(0)}},void 0,fo||(fo=(0,r.Z)("span",{className:"material-icon"},void 0,"notifications_none")),pgettext("watch thread","Don't notify")))))}))})),_o=function(t){var e=t.children,n=t.className;return(0,r.Z)("ul",{className:go()("breadcrumbs",n)},void 0,e)},xo=function(t){var e=t.category,n=t.className;return(0,r.Z)("li",{className:go()("breadcrumbs-item",n)},void 0,(0,r.Z)("a",{href:e.url.index},void 0,(0,r.Z)("span",{className:"material-icon",style:{color:e.color||"inherit"}},void 0,"label"),!!e.short_name&&(0,r.Z)("span",{className:"breadcrumbs-item-name hidden-sm hidden-md hidden-lg",title:e.name},void 0,e.short_name),!!e.short_name&&(0,r.Z)("span",{className:"breadcrumbs-item-name hidden-xs"},void 0,e.name),!e.short_name&&(0,r.Z)("span",{className:"breadcrumbs-item-name"},void 0,e.name)))};var No;const wo=function(t){var e=t.category,n=t.className;return(0,r.Z)("li",{className:go()("breadcrumbs-item",n)},void 0,(0,r.Z)("a",{href:e.url.index},void 0,No||(No=(0,r.Z)("span",{className:"material-icon"},void 0,"chevron_right")),(0,r.Z)("span",{className:"breadcrumbs-item-name"},void 0,"root_category"===e.special_role?pgettext("breadcrumb","Threads"):pgettext("breadcrumb","Private threads"))))},Co=function(t){var e=t.breadcrumbs;return(0,r.Z)(_o,{},void 0,e.map((function(t){return t.special_role?(0,r.Z)(wo,{category:t},t.id):(0,r.Z)(xo,{category:t},t.id)})))};var Ro;const Eo=function(t){var e=t.styleName,n=t.thread,a=t.posts,i=t.user,o=t.moderation;return(0,r.Z)(Si.sP,{},void 0,(0,r.Z)(Si.mr,{styleName:e},void 0,(0,r.Z)(Si.gC,{styleName:e},void 0,(0,r.Z)(Co,{breadcrumbs:n.path}),(0,r.Z)("h1",{},void 0,n.title)),(0,r.Z)(Si.eA,{className:"page-header-thread-details"},void 0,(0,r.Z)(ki.gq,{},void 0,(0,r.Z)(ki.kw,{auto:!0},void 0,(0,r.Z)(ki.Z6,{shrink:!0},void 0,(0,r.Z)(Ci,{thread:n})),Ro||(Ro=(0,r.Z)(ki.Z6,{auto:!0})),n.replies>0&&(0,r.Z)(ki.Z6,{shrink:!0},void 0,(0,r.Z)(Ni,{thread:n})),function(t){return t.is_closed||t.is_hidden||t.is_unapproved||t.weight>0||t.best_answer||t.has_poll||t.has_unapproved_posts}(n)&&(0,r.Z)(ki.Z6,{shrink:!0},void 0,(0,r.Z)(_i,{thread:n}))),i.is_authenticated&&(0,r.Z)(ki.kw,{},void 0,(0,r.Z)(ki.Z6,{},void 0,(0,r.Z)(ko,{thread:n})),o.enabled&&(0,r.Z)(ki.Z6,{shrink:!0},void 0,(0,r.Z)(ho,{thread:n,posts:a,moderation:o})))))))};var So,Lo,Oo,Po,Ao,To,Io,Bo,jo=n(92490),Do=n(69987);function Uo(){window.scrollTo(0,0)}var zo=(0,Do.EN)((function(t){var e=t.router,n=t.baseUrl,a=t.posts,i=t.scrollToTop;return(0,r.Z)("div",{className:"thread-paginator"},void 0,a.isLoaded&&a.first?(0,r.Z)(Do.rU,{className:"btn btn-default btn-outline btn-icon",to:n,title:pgettext("paginator","Go to first page"),onClick:i?Uo:null},void 0,So||(So=(0,r.Z)("span",{className:"material-icon"},void 0,"first_page"))):(0,r.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:pgettext("paginator","Go to first page"),type:"button",disabled:!0},void 0,Lo||(Lo=(0,r.Z)("span",{className:"material-icon"},void 0,"first_page"))),a.isLoaded&&a.previous?(0,r.Z)(Do.rU,{className:"btn btn-default btn-outline btn-icon",to:n+(a.previous>1?a.previous+"/":""),title:pgettext("paginator","Go to previous page"),onClick:i?Uo:null},void 0,Oo||(Oo=(0,r.Z)("span",{className:"material-icon"},void 0,"chevron_left"))):(0,r.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:pgettext("paginator","Go to previous page"),type:"button",disabled:!0},void 0,Po||(Po=(0,r.Z)("span",{className:"material-icon"},void 0,"chevron_left"))),(0,r.Z)(bo.Lt,{toggle:function(t){var e,n,i=t.aria,o=t.toggle;return v().createElement("button",(0,f.Z)({},i,{className:"btn btn-default btn-block btn-outline",type:"button",disabled:!a.isLoaded,onClick:o}),(e=a.page,n=a.pages,pgettext("paginator","Page %(page)s of %(pages)s").replace("%(page)s",e).replace("%(pages)s",n)))},onOpen:function(t){t.querySelector("input").focus()}},void 0,(function(t){var o=t.close;return(0,r.Z)("form",{className:"thread-paginator-form",onSubmit:function(t){if(a.isLoaded){var r=new FormData(t.target),s=parseInt(r.get("page"));if(s&&s!=a.page&&s>=1&&s<=a.pages){var l=s>1?n+s+"/":n;e.push({pathname:l})}}t.preventDefault(),o(),i&&Uo()}},void 0,(0,r.Z)("input",{className:"form-control",name:"page",type:"number",min:1,max:a.pages,placeholder:pgettext("paginator input","Page"),disabled:!a.isLoaded}),(0,r.Z)("button",{className:"btn btn-primary",type:"submit",disabled:!a.isLoaded},void 0,pgettext("paginator","Go")))})),a.isLoaded&&a.next?(0,r.Z)(Do.rU,{className:"btn btn-default btn-outline btn-icon",to:n+a.next+"/",title:pgettext("paginator","Go to next page"),onClick:i?Uo:null},void 0,Ao||(Ao=(0,r.Z)("span",{className:"material-icon"},void 0,"chevron_right"))):(0,r.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:pgettext("paginator","Go to next page"),type:"button",disabled:!0},void 0,To||(To=(0,r.Z)("span",{className:"material-icon"},void 0,"chevron_right"))),a.isLoaded&&a.last?(0,r.Z)(Do.rU,{className:"btn btn-default btn-outline btn-icon",to:n+a.last+"/",title:pgettext("paginator","Go to last page"),onClick:i?Uo:null},void 0,Io||(Io=(0,r.Z)("span",{className:"material-icon"},void 0,"last_page"))):(0,r.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:pgettext("paginator","Go to last page"),type:"button",disabled:!0},void 0,Bo||(Bo=(0,r.Z)("span",{className:"material-icon"},void 0,"last_page"))))}));const qo=zo;var Mo,Fo,Ho;function Vo(t){var e=t.errors,n=t.posts;return(0,r.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,Mo||(Mo=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("thread posts moderation modal title","Moderation"))),(0,r.Z)("div",{className:"modal-body"},void 0,(0,r.Z)("p",{className:"lead"},void 0,pgettext("thread posts moderation modal","One or more posts could not be changed:")),(0,r.Z)("ul",{className:"list-unstyled list-errored-items"},void 0,e.map((function(t){return(0,r.Z)(Yo,{errors:t.detail,post:n[t.id]},t.id)}))))))}function Yo(t){var e=t.errors,n=t.post,a=interpolate(pgettext("thread posts moderation modal","%(username)s on %(posted_on)s"),{posted_on:n.posted_on.format("LL, LT"),username:n.poster_name},!0);return(0,r.Z)("li",{},void 0,(0,r.Z)("h5",{},void 0,a,":"),e.map((function(t,e){return(0,r.Z)("p",{},e,t)})))}function Go(t){var e=t.selection,n=e.map((function(t){return{id:t.id,is_unapproved:!1}})),a=e.map((function(t){return{id:t.id,is_unapproved:t.is_unapproved}}));Xo(t,[{op:"replace",path:"is-unapproved",value:!1}],n,a)}function Wo(t){var e=t.selection,n=e.map((function(t){return{id:t.id,is_protected:!0}})),a=e.map((function(t){return{id:t.id,is_protected:t.is_protected}}));Xo(t,[{op:"replace",path:"is-protected",value:!0}],n,a)}function $o(t){var e=t.selection,n=e.map((function(t){return{id:t.id,is_protected:!1}})),a=e.map((function(t){return{id:t.id,is_protected:t.is_protected}}));Xo(t,[{op:"replace",path:"is-protected",value:!1}],n,a)}function Qo(t){var e=t.selection,n=e.map((function(e){return{id:e.id,is_hidden:!0,hidden_on:F()(),hidden_by_name:t.user.username,url:Object.assign(e.url,{hidden_by:t.user.url})}})),a=e.map((function(t){return{id:t.id,is_hidden:t.is_hidden,hidden_on:t.hidden_on,hidden_by_name:t.hidden_by_name,url:t.url}}));Xo(t,[{op:"replace",path:"is-hidden",value:!0}],n,a)}function Ko(t){var e=t.selection,n=e.map((function(e){return{id:e.id,is_hidden:!1,hidden_on:F()(),hidden_by_name:t.user.username,url:Object.assign(e.url,{hidden_by:t.user.url})}})),a=e.map((function(t){return{id:t.id,is_hidden:t.is_hidden,hidden_on:t.hidden_on,hidden_by_name:t.hidden_by_name,url:t.url}}));Xo(t,[{op:"replace",path:"is-hidden",value:!1}],n,a)}function Xo(t,e,n,a){var i=t.selection,o=t.thread;n.forEach((function(t){Gt.r$(t,t)})),N.Z.dispatch(Ba.kR());var s={ops:e,ids:i.map((function(t){return t.id}))};k.Z.patch(o.api.posts.index,s).then((function(t){t.forEach((function(t){N.Z.dispatch(Gt.r$(t,t))}))}),(function(t){if(400!==t.status)return a.forEach((function(t){N.Z.dispatch(Gt.r$(t,t))})),x.Z.apiError(t);var e=[],n=[];t.forEach((function(t){t.detail?(e.push(t),n.push(t.id)):N.Z.dispatch(Gt.r$(t,t)),a.forEach((function(t){-1!==n.indexOf(t)&&N.Z.dispatch(Gt.r$(t,t))}))}));var o={};i.forEach((function(t){o[t.id]=t})),_.Z.show((0,r.Z)(Vo,{errors:e,posts:o}))}))}function Jo(t){window.confirm(pgettext("merge posts","Are you sure you want to merge selected posts? This action is not reversible!"))&&(t.selection.slice(1).map((function(t){N.Z.dispatch(Gt.r$(t,{isDeleted:!0}))})),k.Z.post(t.thread.api.posts.merge,{posts:t.selection.map((function(t){return t.id}))}).then((function(t){N.Z.dispatch(Gt.r$(t,Gt.ZB(t)))}),(function(e){400===e.status?x.Z.error(e.detail):x.Z.apiError(e),t.selection.slice(1).map((function(t){N.Z.dispatch(Gt.r$(t,{isDeleted:!1}))}))})),N.Z.dispatch(Ba.kR()))}function tr(t){if(window.confirm(pgettext("delete posts","Are you sure you want to delete selected posts? This action is not reversible!"))){t.selection.map((function(t){N.Z.dispatch(Gt.r$(t,{isDeleted:!0}))}));var e=t.selection.map((function(t){return t.id}));k.Z.delete(t.thread.api.posts.index,e).then((function(){}),(function(e){400===e.status?x.Z.error(e.detail):x.Z.apiError(e),t.selection.map((function(t){N.Z.dispatch(Gt.r$(t,{isDeleted:!1}))}))})),N.Z.dispatch(Ba.kR())}}var er,nr,ar,ir,or,rr,sr=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(t){var e;return(0,s.Z)(this,i),e=a.call(this,t),(0,h.Z)((0,c.Z)(e),"onUrlChange",(function(t){e.changeValue("url",t.target.value)})),e.state={isLoading:!1,url:"",validators:{url:[]},errors:{}},e}return(0,l.Z)(i,[{key:"clean",value:function(){return!!this.state.url.trim().length||(x.Z.error(pgettext("thread posts moderation move","You have to enter link to the other thread.")),!1)}},{key:"send",value:function(){return k.Z.post(this.props.thread.api.posts.move,{new_thread:this.state.url,posts:this.props.selection.map((function(t){return t.id}))})}},{key:"handleSuccess",value:function(t){this.props.selection.forEach((function(t){N.Z.dispatch(Gt.r$(t,{isDeleted:!0}))})),_.Z.hide(),x.Z.success(pgettext("thread posts moderation move","Selected posts were moved to the other thread."))}},{key:"handleError",value:function(t){400===t.status?x.Z.error(t.detail):x.Z.apiError(t)}},{key:"render",value:function(){return(0,r.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,Fo||(Fo=(0,r.Z)(lr,{})),(0,r.Z)("div",{className:"modal-body"},void 0,(0,r.Z)(g.Z,{for:"id_url",label:pgettext("thread posts moderation move","Link to thread you want to move posts to")},void 0,(0,r.Z)("input",{className:"form-control",disabled:this.state.isLoading,id:"id_url",onChange:this.onUrlChange,value:this.state.url}))),(0,r.Z)("div",{className:"modal-footer"},void 0,(0,r.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,pgettext("thread posts moderation move btn","Cancel")),(0,r.Z)("button",{className:"btn btn-primary",disabled:this.state.isLoading},void 0,pgettext("thread posts moderation move btn","Move posts"))))))}}]),i}(Z.Z);function lr(t){return(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,Ho||(Ho=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("thread posts moderation move title","Move posts")))}function cr(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,a=(0,p.Z)(t);if(e){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}function ur(t){return v().createElement(br,(0,f.Z)({},t,{Form:kr}))}var dr,pr,hr,mr,vr,fr,Zr,gr,yr,br=function(t){(0,u.Z)(n,t);var e=cr(n);function n(t){var a;return(0,s.Z)(this,n),(a=e.call(this,t)).state={isLoaded:!1,isError:!1,categories:[]},a}return(0,l.Z)(n,[{key:"componentDidMount",value:function(){var t=this;k.Z.get(misago.get("THREAD_EDITOR_API")).then((function(e){var n=e.map((function(t){return Object.assign(t,{disabled:!1===t.post,label:t.name,value:t.id,post:t.post})}));t.setState({isLoaded:!0,categories:n})}),(function(e){t.setState({isError:e.detail})}))}},{key:"render",value:function(){return this.state.isError?(0,r.Z)(xr,{message:this.state.isError}):this.state.isLoaded?v().createElement(kr,(0,f.Z)({},this.props,{categories:this.state.categories})):er||(er=(0,r.Z)(_r,{}))}}]),n}(v().Component),kr=function(t){(0,u.Z)(n,t);var e=cr(n);function n(t){var a;return(0,s.Z)(this,n),a=e.call(this,t),(0,h.Z)((0,c.Z)(a),"onCategoryChange",(function(t){var e=t.target.value,n={category:e};a.acl[e].can_pin_threads<n.weight&&(n.weight=0),a.acl[e].can_hide_threads||(n.is_hidden=0),a.acl[e].can_close_threads||(n.is_closed=!1),a.setState(n)})),a.state={isLoading:!1,title:"",category:null,categories:t.categories,weight:0,is_hidden:0,is_closed:!1,validators:{title:[Xn.C1()]},errors:{}},a.isHiddenChoices=[{value:0,icon:"visibility",label:pgettext("thread hidden switch choice","No")},{value:1,icon:"visibility_off",label:pgettext("thread hidden switch choice","Yes")}],a.isClosedChoices=[{value:!1,icon:"lock_outline",label:pgettext("thread closed switch choice","No")},{value:!0,icon:"lock",label:pgettext("thread closed switch choice","Yes")}],a.acl={},a.props.categories.forEach((function(t){t.post&&(a.state.category||(a.state.category=t.id),a.acl[t.id]={can_pin_threads:t.post.pin,can_close_threads:t.post.close,can_hide_threads:t.post.hide})})),a}return(0,l.Z)(n,[{key:"clean",value:function(){return!!this.isValid()||(x.Z.error(gettext("Form contains errors.")),this.setState({errors:this.validate()}),!1)}},{key:"send",value:function(){return k.Z.post(this.props.thread.api.posts.split,{title:this.state.title,category:this.state.category,weight:this.state.weight,is_hidden:this.state.is_hidden,is_closed:this.state.is_closed,posts:this.props.selection.map((function(t){return t.id}))})}},{key:"handleSuccess",value:function(t){this.props.selection.forEach((function(t){N.Z.dispatch(Gt.r$(t,{isDeleted:!0}))})),_.Z.hide(),x.Z.success(pgettext("posts moderation split","Selected posts were split into new thread."))}},{key:"handleError",value:function(t){400===t.status?(this.setState({errors:Object.assign({},this.state.errors,t)}),x.Z.error(gettext("Form contains errors."))):403===t.status&&Array.isArray(t)?_.Z.show((0,r.Z)(Vo,{errors:t})):x.Z.apiError(t)}},{key:"getWeightChoices",value:function(){var t=[{value:0,icon:"remove",label:pgettext("thread weight choice","Not pinned")},{value:1,icon:"bookmark_border",label:pgettext("thread weight choice","Pinned in category")}];return 2==this.acl[this.state.category].can_pin_threads&&t.push({value:2,icon:"bookmark",label:pgettext("thread weight choice","Pinned globally")}),t}},{key:"renderWeightField",value:function(){return this.acl[this.state.category].can_pin_threads?(0,r.Z)(g.Z,{label:pgettext("posts moderation split field","Thread weight"),for:"id_weight",labelClass:"col-sm-4",controlClass:"col-sm-8"},void 0,(0,r.Z)(Kn.Z,{id:"id_weight",onChange:this.bindInput("weight"),value:this.state.weight,choices:this.getWeightChoices()})):null}},{key:"renderHiddenField",value:function(){return this.acl[this.state.category].can_hide_threads?(0,r.Z)(g.Z,{label:pgettext("posts moderation split field","Hide thread"),for:"id_is_hidden",labelClass:"col-sm-4",controlClass:"col-sm-8"},void 0,(0,r.Z)(Kn.Z,{id:"id_is_closed",onChange:this.bindInput("is_hidden"),value:this.state.is_hidden,choices:this.isHiddenChoices})):null}},{key:"renderClosedField",value:function(){return this.acl[this.state.category].can_close_threads?(0,r.Z)(g.Z,{label:pgettext("posts moderation split field","Close thread"),for:"id_is_closed",labelClass:"col-sm-4",controlClass:"col-sm-8"},void 0,(0,r.Z)(Kn.Z,{id:"id_is_closed",onChange:this.bindInput("is_closed"),value:this.state.is_closed,choices:this.isClosedChoices})):null}},{key:"render",value:function(){return(0,r.Z)(Nr,{className:"modal-dialog"},void 0,(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"modal-body"},void 0,(0,r.Z)(g.Z,{label:pgettext("posts moderation split field","Thread title"),for:"id_title",labelClass:"col-sm-4",controlClass:"col-sm-8",validation:this.state.errors.title},void 0,(0,r.Z)("input",{id:"id_title",className:"form-control",type:"text",onChange:this.bindInput("title"),value:this.state.title})),nr||(nr=(0,r.Z)("div",{className:"clearfix"})),(0,r.Z)(g.Z,{label:pgettext("posts moderation split field","Category"),for:"id_category",labelClass:"col-sm-4",controlClass:"col-sm-8",validation:this.state.errors.category},void 0,(0,r.Z)(Qn.Z,{id:"id_category",onChange:this.onCategoryChange,value:this.state.category,choices:this.state.categories})),ar||(ar=(0,r.Z)("div",{className:"clearfix"})),this.renderWeightField(),this.renderHiddenField(),this.renderClosedField()),(0,r.Z)("div",{className:"modal-footer"},void 0,(0,r.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,pgettext("posts moderation split btn","Cancel")),(0,r.Z)(Tt.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,pgettext("posts moderation split btn","Split posts")))))}}]),n}(Z.Z);function _r(){return ir||(ir=(0,r.Z)(Nr,{className:"modal-dialog"},void 0,(0,r.Z)(J.Z,{})))}function xr(t){return(0,r.Z)(Nr,{className:"modal-dialog modal-message"},void 0,or||(or=(0,r.Z)("div",{className:"message-icon"},void 0,(0,r.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,r.Z)("div",{className:"message-body"},void 0,(0,r.Z)("p",{className:"lead"},void 0,pgettext("posts moderation split","You can't move selected posts at the moment.")),(0,r.Z)("p",{},void 0,t.message),(0,r.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,pgettext("posts moderation split dismiss btn","Ok"))))}function Nr(t){return(0,r.Z)("div",{className:t.className,role:"document"},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,rr||(rr=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("posts moderation split title","Split posts into new thread"))),t.children))}function wr(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,a=(0,p.Z)(t);if(e){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}function Cr(t){return(0,r.Z)("ul",{className:"dropdown-menu dropdown-menu-right stick-to-bottom"},void 0,v().createElement(Er,t),v().createElement(Sr,t),v().createElement(Lr,t),v().createElement(Or,t),v().createElement(Pr,t),v().createElement(Ar,t),v().createElement(Ir,t),v().createElement(Tr,t),v().createElement(Br,t))}var Rr,Er=function(t){(0,u.Z)(n,t);var e=wr(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){Go(t.props)})),t}return(0,l.Z)(n,[{key:"render",value:function(){var t=this.props.selection.find((function(t){return t.acl.can_approve&&t.is_unapproved}));return t?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,dr||(dr=(0,r.Z)("span",{className:"material-icon"},void 0,"done")),pgettext("thread posts moderation","Approve"))):null}}]),n}(v().Component),Sr=function(t){(0,u.Z)(n,t);var e=wr(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){Jo(t.props)})),t}return(0,l.Z)(n,[{key:"render",value:function(){var t=this.props.selection.length>1&&this.props.selection.find((function(t){return t.acl.can_merge}));return t?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,pr||(pr=(0,r.Z)("span",{className:"material-icon"},void 0,"call_merge")),pgettext("thread posts moderation","Merge"))):null}}]),n}(v().Component),Lr=function(t){(0,u.Z)(n,t);var e=wr(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){_.Z.show(v().createElement(sr,t.props))})),t}return(0,l.Z)(n,[{key:"render",value:function(){var t=this.props.selection.find((function(t){return t.acl.can_move}));return t?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,hr||(hr=(0,r.Z)("span",{className:"material-icon"},void 0,"arrow_forward")),pgettext("thread posts moderation","Move"))):null}}]),n}(v().Component),Or=function(t){(0,u.Z)(n,t);var e=wr(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){_.Z.show(v().createElement(ur,t.props))})),t}return(0,l.Z)(n,[{key:"render",value:function(){var t=this.props.selection.find((function(t){return t.acl.can_move}));return t?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,mr||(mr=(0,r.Z)("span",{className:"material-icon"},void 0,"call_split")),pgettext("thread posts moderation","Split"))):null}}]),n}(v().Component),Pr=function(t){(0,u.Z)(n,t);var e=wr(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){Wo(t.props)})),t}return(0,l.Z)(n,[{key:"render",value:function(){var t=this.props.selection.find((function(t){return!t.is_protected&&t.acl.can_protect}));return t?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,vr||(vr=(0,r.Z)("span",{className:"material-icon"},void 0,"lock_outline")),pgettext("thread posts moderation","Protect"))):null}}]),n}(v().Component),Ar=function(t){(0,u.Z)(n,t);var e=wr(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){$o(t.props)})),t}return(0,l.Z)(n,[{key:"render",value:function(){var t=this.props.selection.find((function(t){return t.is_protected&&t.acl.can_protect}));return t?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,fr||(fr=(0,r.Z)("span",{className:"material-icon"},void 0,"lock_open")),pgettext("thread posts moderation","Unprotect"))):null}}]),n}(v().Component),Tr=function(t){(0,u.Z)(n,t);var e=wr(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){Qo(t.props)})),t}return(0,l.Z)(n,[{key:"render",value:function(){var t=this.props.selection.find((function(t){return t.acl.can_hide&&!t.is_hidden}));return t?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,Zr||(Zr=(0,r.Z)("span",{className:"material-icon"},void 0,"visibility_off")),pgettext("thread posts moderation","Hide"))):null}}]),n}(v().Component),Ir=function(t){(0,u.Z)(n,t);var e=wr(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){Ko(t.props)})),t}return(0,l.Z)(n,[{key:"render",value:function(){var t=this.props.selection.find((function(t){return t.acl.can_unhide&&t.is_hidden}));return t?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,gr||(gr=(0,r.Z)("span",{className:"material-icon"},void 0,"visibility")),pgettext("thread posts moderation","Unhide"))):null}}]),n}(v().Component),Br=function(t){(0,u.Z)(n,t);var e=wr(n);function n(){var t;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,c.Z)(t),"onClick",(function(){tr(t.props)})),t}return(0,l.Z)(n,[{key:"render",value:function(){var t=this.props.selection.find((function(t){return t.acl.can_delete}));return t?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,yr||(yr=(0,r.Z)("span",{className:"material-icon"},void 0,"clear")),pgettext("thread posts moderation","Delete"))):null}}]),n}(v().Component);const jr=function(t){var e=t.thread,n=t.user,a=t.selection,i=t.dropup;return(0,r.Z)("div",{className:i?"dropup":"dropdown"},void 0,(0,r.Z)("button",{type:"button",className:"btn btn-default btn-outline btn-icon dropdown-toggle",title:pgettext("post options btn","Posts options"),"data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",disabled:0===a.length},void 0,Rr||(Rr=(0,r.Z)("span",{className:"material-icon"},void 0,"settings"))),(0,r.Z)(Cr,{thread:e,user:n,selection:a}))};var Dr;const Ur=function(t){var e=t.onClick;return(0,r.Z)("button",{className:"btn btn-primary btn-outline btn-block",type:"button",onClick:e},void 0,Dr||(Dr=(0,r.Z)("span",{className:"material-icon"},void 0,"chat")),pgettext("thread reply btn","Reply"))};var zr;const qr=function(t){var e=t.thread,n=t.posts,a=t.user,i=t.selection,o=t.moderation,s=t.onReply;return(0,r.Z)(jo.o8,{},void 0,n.pages>1&&(0,r.Z)(jo.Z2,{},void 0,(0,r.Z)(jo.Eg,{},void 0,(0,r.Z)(qo,{baseUrl:e.url.index,posts:n,scrollToTop:!0}))),zr||(zr=(0,r.Z)(jo.tw,{})),a.is_authenticated&&(0,r.Z)(jo.Z2,{},void 0,(0,r.Z)(jo.Eg,{className:"hidden-xs"},void 0,(0,r.Z)(ko,{thread:e,dropup:!0})),e.acl.can_reply&&(0,r.Z)(jo.Eg,{},void 0,(0,r.Z)(Ur,{onClick:s})),o.enabled&&(0,r.Z)(jo.Eg,{shrink:!0},void 0,(0,r.Z)(jr,{thread:e,user:a,selection:i,dropup:!0}))),a.is_authenticated&&(0,r.Z)(jo.Z2,{className:"hidden-sm hidden-md hidden-lg"},void 0,(0,r.Z)(jo.Eg,{},void 0,(0,r.Z)(ko,{thread:e,dropup:!0}))))};var Mr,Fr;const Hr=function(){return(0,r.Z)(jo.o8,{className:"thread-toolbar-third"},void 0,Mr||(Mr=(0,r.Z)(jo.tw,{})),(0,r.Z)(jo.Z2,{},void 0,(0,r.Z)(jo.Eg,{},void 0,(0,r.Z)("button",{className:"btn btn-muted btn-block",type:"button",onClick:function(){return window.scrollTo(0,0)}},void 0,Fr||(Fr=(0,r.Z)("span",{className:"material-icon"},void 0,"arrow_upward")),pgettext("go up","Go to top")))))};var Vr;const Yr=function(t){var e=t.compact,n=t.disabled,a=t.onClick;return(0,r.Z)("button",{className:go()("btn btn-default btn-outline",{"btn-block":!e,"btn-icon":e}),type:"button",title:e?pgettext("thread poll btn","Add poll"):null,disabled:n,onClick:a},void 0,Vr||(Vr=(0,r.Z)("span",{className:"material-icon"},void 0,"poll")),!e&&pgettext("thread poll btn","Add poll"))};var Gr,Wr,$r,Qr,Kr,Xr;const Jr=function(t){var e=t.user,n=t.thread,a=t.posts;return(0,r.Z)("div",{className:"dropdown"},void 0,(0,r.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:pgettext("thread shortcuts btn","Shortcuts"),"aria-expanded":"true","aria-haspopup":"true","data-toggle":"dropdown",type:"button"},void 0,Gr||(Gr=(0,r.Z)("span",{className:"material-icon"},void 0,"bookmark"))),(0,r.Z)("ul",{className:"dropdown-menu"},void 0,!!a.first&&(0,r.Z)("li",{},void 0,(0,r.Z)(Do.rU,{className:"btn btn-link",href:n.url.index},void 0,Wr||(Wr=(0,r.Z)("span",{className:"material-icon"},void 0,"place")),pgettext("thread shortcut btn","Go to first post"))),e.is_authenticated&&n.is_new&&(0,r.Z)("li",{},void 0,(0,r.Z)("a",{className:"btn btn-link",href:n.url.new_post},void 0,$r||($r=(0,r.Z)("span",{className:"material-icon"},void 0,"comment")),pgettext("thread shortcut btn","Go to new post"))),n.best_answer&&(0,r.Z)("li",{},void 0,(0,r.Z)("a",{className:"btn btn-link",href:n.url.best_answer},void 0,Qr||(Qr=(0,r.Z)("span",{className:"material-icon"},void 0,"check_circle")),pgettext("thread shortcut btn","Go to best answer"))),n.has_unapproved_posts&&n.acl.can_approve&&(0,r.Z)("li",{},void 0,(0,r.Z)("a",{className:"btn btn-link",href:n.url.unapproved_post},void 0,Kr||(Kr=(0,r.Z)("span",{className:"material-icon"},void 0,"visibility")),pgettext("thread shortcut btn","Go to unapproved post"))),(0,r.Z)("li",{},void 0,(0,r.Z)("a",{className:"btn btn-link",href:n.url.last_post},void 0,Xr||(Xr=(0,r.Z)("span",{className:"material-icon"},void 0,"reply")),pgettext("thread shortcut btn","Go to last post")))))};var ts;const es=function(t){var e=t.thread,n=t.posts,a=t.user,i=t.pollDisabled,o=t.selection,s=t.moderation,l=t.onPoll,c=t.onReply;return(0,r.Z)(jo.o8,{},void 0,(0,r.Z)(jo.Z2,{className:"hidden-xs"},void 0,(0,r.Z)(jo.Eg,{},void 0,(0,r.Z)(Jr,{posts:n,thread:e,user:a})),n.pages>1&&(0,r.Z)(jo.Eg,{},void 0,(0,r.Z)(qo,{baseUrl:e.url.index,posts:n}))),ts||(ts=(0,r.Z)(jo.tw,{})),e.acl.can_start_poll&&!e.poll&&(0,r.Z)(jo.Z2,{className:"hidden-xs"},void 0,(0,r.Z)(jo.Eg,{},void 0,(0,r.Z)(Yr,{disabled:i,onClick:l}))),e.acl.can_reply?(0,r.Z)(jo.Z2,{},void 0,(0,r.Z)(jo.Eg,{className:"hidden-sm hidden-md hidden-lg",shrink:!0},void 0,(0,r.Z)(Jr,{posts:n,thread:e,user:a})),(0,r.Z)(jo.Eg,{},void 0,(0,r.Z)(Ur,{onClick:c})),e.acl.can_start_poll&&!e.poll&&(0,r.Z)(jo.Eg,{className:"hidden-sm hidden-md hidden-lg",shrink:!0},void 0,(0,r.Z)(Yr,{disabled:i,onClick:l,compact:!0})),s.enabled&&(0,r.Z)(jo.Eg,{className:"hidden-xs",shrink:!0},void 0,(0,r.Z)(jr,{thread:e,user:a,selection:o}))):(0,r.Z)(jo.Z2,{},void 0,(0,r.Z)(jo.Eg,{className:"hidden-sm hidden-md hidden-lg",shrink:!0},void 0,(0,r.Z)(Jr,{posts:n,thread:e,user:a})),e.acl.can_start_poll&&!e.poll&&(0,r.Z)(jo.Eg,{},void 0,(0,r.Z)(Yr,{disabled:i,onClick:l})),s.enabled&&(0,r.Z)(jo.Eg,{shrink:!0},void 0,(0,r.Z)(jr,{thread:e,user:a,selection:o}))),n.pages>1&&(0,r.Z)(jo.Z2,{className:"hidden-sm hidden-md hidden-lg"},void 0,(0,r.Z)(jo.Eg,{},void 0,(0,r.Z)(qo,{baseUrl:e.url.index,posts:n}))))};var ns;var as=function(t){(0,u.Z)(i,t);var e,n,a=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,p.Z)(e);if(n){var i=(0,p.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,d.Z)(this,t)});function i(t){var e;return(0,s.Z)(this,i),e=a.call(this,t),(0,h.Z)((0,c.Z)(e),"update",(function(t){N.Z.dispatch(b.gx(t)),N.Z.dispatch(Ba.zD(t.post_set)),t.participants&&N.Z.dispatch(y.gx(t.participants)),t.poll&&N.Z.dispatch(lt.gx(t.poll)),e.setPageTitle()})),(0,h.Z)((0,c.Z)(e),"openPollForm",(function(){e.setState({editPoll:!0})})),(0,h.Z)((0,c.Z)(e),"closePollForm",(function(){e.setState({editPoll:!1})})),(0,h.Z)((0,c.Z)(e),"openReplyForm",(function(){ct.Z.open({mode:"REPLY",thread:e.props.thread,config:e.props.thread.api.editor,submit:e.props.thread.api.posts.index})})),e.state={editPoll:!1},e}return(0,l.Z)(i,[{key:"componentDidMount",value:function(){this.shouldFetchData()&&(this.fetchData(),this.setPageTitle()),this.startPollingApi()}},{key:"componentDidUpdate",value:function(){this.shouldFetchData()&&(this.fetchData(),this.startPollingApi(),this.setPageTitle())}},{key:"componentWillUnmount",value:function(){this.stopPollingApi()}},{key:"shouldFetchData",value:function(){return!!this.props.posts.isLoaded&&1*(this.props.params.page||1)!=this.props.posts.page}},{key:"fetchData",value:function(){var t=this;N.Z.dispatch(Ba.Rz()),k.Z.get(this.props.thread.api.posts.index,{page:this.props.params.page||1},"posts").then((function(e){t.update(e)}),(function(t){x.Z.apiError(t)}))}},{key:"startPollingApi",value:function(){Zi.Z.start({poll:"thread-posts",url:this.props.thread.api.posts.index,data:{page:this.props.params.page||1},update:this.update,frequency:12e4,delayed:!0})}},{key:"stopPollingApi",value:function(){Zi.Z.stop("thread-posts")}},{key:"setPageTitle",value:function(){gi.Z.set({title:this.props.thread.title,parent:this.props.thread.category.name,page:1*(this.props.params.page||1)})}},{key:"render",value:function(){var t=this.props.thread.category,e="page page-thread";t.css_class&&(e+=" page-thread-"+t.css_class);var n="private_threads"===t.special_role?"private-threads":t.css_class||"category-threads",a=is(this.props.thread,this.props.user),i=os(this.props.posts.results,this.props.user),o=this.props.posts.results.filter((function(t){return t.isSelected}));return(0,r.Z)("div",{className:e},void 0,(0,r.Z)(Eo,{styleName:n,thread:this.props.thread,posts:this.props.posts,user:this.props.user,moderation:a}),(0,r.Z)(bi.Z,{},void 0,(0,r.Z)(U,{participants:this.props.participants,thread:this.props.thread,user:this.props.user}),(0,r.Z)(es,{thread:this.props.thread,posts:this.props.posts,user:this.props.user,selection:o,moderation:i,pollDisabled:this.state.editPoll,onPoll:this.openPollForm,onReply:this.openReplyForm}),this.state.editPoll?(0,r.Z)(Ft,{poll:this.props.poll,thread:this.props.thread,close:this.closePollForm}):(0,r.Z)(jt,{poll:this.props.poll,thread:this.props.thread,user:this.props.user,edit:this.openPollForm}),this.props.thread.acl.can_reply?(0,r.Z)(yi.mv,{posting:{mode:"REPLY",thread:this.props.thread,config:this.props.thread.api.editor,submit:this.props.thread.api.posts.index}},void 0,v().createElement(li,this.props)):v().createElement(li,this.props),(0,r.Z)(qr,{thread:this.props.thread,posts:this.props.posts,user:this.props.user,selection:o,moderation:i,onReply:this.openReplyForm}),ns||(ns=(0,r.Z)(Hr,{}))))}}]),i}(v().Component),is=function(t,e){var n={enabled:!1,edit:!1,approve:!1,close:!1,open:!1,hide:!1,unhide:!1,move:!1,merge:!1,pinGlobally:!1,pinLocally:!1,unpin:!1,delete:!1};return e.is_authenticated?(n.edit=t.acl.can_edit,n.approve=t.acl.can_approve&&t.is_unapproved,n.close=t.acl.can_close&&!t.is_closed,n.open=t.acl.can_close&&t.is_closed,n.hide=t.acl.can_hide&&!t.is_hidden,n.unhide=t.acl.can_unhide&&t.is_hidden,n.move=t.acl.can_move,n.merge=t.acl.can_merge,n.pinGlobally=t.acl.can_pin_globally&&t.weight<2,n.pinLocally=t.acl.can_pin&&1!==t.weight,n.unpin=t.acl.can_pin&&1===t.weight||t.acl.can_pin_globally&&2===t.weight,n.delete=t.acl.can_delete,n.enabled=n.edit||n.approve||n.close||n.open||n.hide||n.unhide||n.move||n.merge||n.pinGlobally||n.pinLocally||n.unpin||n.delete,n):n},os=function(t,e){var n={enabled:!1,approve:!1,move:!1,merge:!1,protect:!1,hide:!1,delete:!1};return e.is_authenticated?(t.forEach((function(t){t.is_event||(t.acl.can_approve&&t.is_unapproved&&(n.approve=!0),t.acl.can_move&&(n.move=!0),t.acl.can_merge&&(n.merge=!0),(t.acl.can_protect||t.acl.can_unprotect)&&(n.protect=!0),(t.acl.can_hide||t.acl.can_unhide)&&(n.hide=!0),t.acl.can_delete&&(n.delete=!0),(n.approve||n.move||n.merge||n.protect||n.hide||n.delete)&&(n.enabled=!0))})),n):n};function rs(t){return{participants:t.participants,poll:t.poll,posts:t.posts,thread:t.thread,tick:t.tick.tick,user:t.auth.user}}var ss=n(39633);S.Z.addInitializer({name:"component:thread",initializer:function(t){var e,n;t.has("THREAD")&&t.has("POSTS")&&(0,ss.Z)({paths:(e=S.Z.get("THREAD"),n=e.url.index.replace(e.slug+"-"+e.pk,":slug"),[{path:n,component:(0,o.$j)(rs)(as)},{path:n+":page/",component:(0,o.$j)(rs)(as)}])})},after:"store"})},63290:(t,e,n)=>{"use strict";var a,i=n(22928),o=(n(57588),n(73935)),r=n.n(o),s=n(37424),l=n(28166),c=n(90287);misago.addInitializer({name:"component:user-nav-overlay",initializer:function(t){var e=document.getElementById("user-nav-mount");r().render((0,i.Z)(s.zt,{store:c.Z.getStore()},void 0,a||(a=(0,i.Z)(l.Qm,{}))),e)},after:"store"})},77031:(t,e,n)=>{"use strict";var a,i=n(22928),o=n(15671),r=n(43144),s=n(79340),l=n(6215),c=n(61120),u=n(57588),d=n.n(u),p=n(37424),h=n(97326),m=n(4942),v=n(59131),f=n(69987),Z=n(94417),g=function(t,e){var n=t;return"rank"===e.component?n+=e.slug:n+=e.component,n+"/"};const y=function(t){var e=t.baseUrl,n=t.page,o=t.pages;return(0,i.Z)("div",{className:"nav-container"},void 0,(0,i.Z)("div",{className:"dropdown hidden-sm hidden-md hidden-lg"},void 0,(0,i.Z)("button",{className:"btn btn-default btn-block btn-outline dropdown-toggle",type:"button","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},void 0,a||(a=(0,i.Z)("span",{className:"material-icon"},void 0,"menu")),n.name),(0,i.Z)("ul",{className:"dropdown-menu stick-to-bottom"},void 0,o.map((function(t){var n=g(e,t);return(0,i.Z)("li",{},n,(0,i.Z)(f.rU,{to:n},void 0,t.name))})))),(0,i.Z)("ul",{className:"nav nav-pills hidden-xs",role:"menu"},void 0,o.map((function(t){var n=g(e,t);return(0,i.Z)(Z.Z,{path:n},n,(0,i.Z)(f.rU,{to:n},void 0,t.name))}))))};var b,k,_=function(t){(0,s.Z)(u,t);var e,n,a=(e=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,l.Z)(this,t)});function u(){return(0,o.Z)(this,u),a.apply(this,arguments)}return(0,r.Z)(u,[{key:"getEmptyMessage",value:function(){return interpolate(npgettext("top posters empty","No users have posted any new messages during last %(days)s day.","No users have posted any new messages during last %(days)s days.",this.props.trackedPeriod),{days:this.props.trackedPeriod},!0)}},{key:"render",value:function(){return(0,i.Z)("div",{className:"active-posters-list"},void 0,(0,i.Z)(v.Z,{},void 0,(0,i.Z)(y,{baseUrl:misago.get("USERS_LIST_URL"),page:this.props.page,pages:misago.get("USERS_LISTS")}),(0,i.Z)("p",{className:"lead"},void 0,this.getEmptyMessage())))}}]),u}(d().Component),x=n(19605),N=n(44039);var w=function(t){(0,s.Z)(u,t);var e,n,a=(e=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,l.Z)(this,t)});function u(){return(0,o.Z)(this,u),a.apply(this,arguments)}return(0,r.Z)(u,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"getClassName",value:function(){return this.props.hiddenOnMobile?"list-group-item hidden-xs hidden-sm":"list-group-item"}},{key:"render",value:function(){return(0,i.Z)("li",{className:this.getClassName()},void 0,b||(b=(0,i.Z)("div",{className:"rank-user-avatar"},void 0,(0,i.Z)("span",{},void 0,(0,i.Z)(x.ZP,{size:"50"})))),(0,i.Z)("div",{className:"rank-user"},void 0,(0,i.Z)("div",{className:"user-name"},void 0,(0,i.Z)("span",{className:"item-title"},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:N.e(30,80)+"px"}},void 0," "))),(0,i.Z)("div",{className:"user-details"},void 0,(0,i.Z)("span",{className:"user-status"},void 0,k||(k=(0,i.Z)("span",{className:"status-icon ui-preview-text"},void 0," ")),(0,i.Z)("span",{className:"status-label ui-preview-text hidden-xs hidden-sm",style:{width:N.e(30,50)+"px"}},void 0," ")),(0,i.Z)("span",{className:"rank-name"},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:N.e(30,50)+"px"}},void 0," ")),(0,i.Z)("span",{className:"user-title hidden-xs hidden-sm"},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:N.e(30,50)+"px"}},void 0," "))),(0,i.Z)("div",{className:"user-compact-stats visible-xs-block"},void 0,(0,i.Z)("span",{className:"rank-position"},void 0,(0,i.Z)("strong",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:N.e(20,30)+"px"}},void 0," ")),(0,i.Z)("small",{},void 0,pgettext("top posters list item","Rank"))),(0,i.Z)("span",{className:"rank-posts-counted"},void 0,(0,i.Z)("strong",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:N.e(20,30)+"px"}},void 0," ")),(0,i.Z)("small",{},void 0,pgettext("top posters list item","Ranked posts"))))),(0,i.Z)("div",{className:"rank-position hidden-xs"},void 0,(0,i.Z)("strong",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:N.e(20,30)+"px"}},void 0," ")),(0,i.Z)("small",{},void 0,pgettext("top posters list item","Rank"))),(0,i.Z)("div",{className:"rank-posts-counted hidden-xs"},void 0,(0,i.Z)("strong",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:N.e(20,30)+"px"}},void 0," ")),(0,i.Z)("small",{},void 0,pgettext("top posters list item","Ranked posts"))),(0,i.Z)("div",{className:"rank-posts-total hidden-xs"},void 0,(0,i.Z)("strong",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:N.e(20,30)+"px"}},void 0," ")),(0,i.Z)("small",{},void 0,pgettext("top posters list item","Total posts"))))}}]),u}(d().Component);var C,R=function(t){(0,s.Z)(u,t);var e,n,a=(e=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,l.Z)(this,t)});function u(){return(0,o.Z)(this,u),a.apply(this,arguments)}return(0,r.Z)(u,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"render",value:function(){return(0,i.Z)("div",{className:"active-posters-list"},void 0,(0,i.Z)(v.Z,{},void 0,(0,i.Z)(y,{baseUrl:misago.get("USERS_LIST_URL"),page:this.props.page,pages:misago.get("USERS_LISTS")}),(0,i.Z)("p",{className:"lead ui-preview"},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:N.e(50,220)+"px"}},void 0," ")),(0,i.Z)("div",{className:"active-posters ui-preview"},void 0,(0,i.Z)("ul",{className:"list-group"},void 0,[0,1,2].map((function(t){return(0,i.Z)(w,{hiddenOnMobile:t>0},t)}))))))}}]),u}(d().Component),E=n(24678),S=n(34458);var L=function(t){(0,s.Z)(u,t);var e,n,a=(e=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,l.Z)(this,t)});function u(){return(0,o.Z)(this,u),a.apply(this,arguments)}return(0,r.Z)(u,[{key:"getClassName",value:function(){return this.props.rank.css_class?"list-group-item list-group-rank-"+this.props.rank.css_class:"list-group-item"}},{key:"getUserStatus",value:function(){return this.props.user.status?(0,i.Z)(E.ZP,{user:this.props.user,status:this.props.user.status},void 0,(0,i.Z)(E.Jj,{user:this.props.user,status:this.props.user.status}),(0,i.Z)(E.pg,{user:this.props.user,status:this.props.user.status,className:"status-label hidden-xs hidden-sm"})):(0,i.Z)("span",{className:"user-status"},void 0,C||(C=(0,i.Z)("span",{className:"status-icon ui-preview-text"},void 0," ")),(0,i.Z)("span",{className:"status-label ui-preview-text hidden-xs hidden-sm",style:{width:N.e(30,50)+"px"}},void 0," "))}},{key:"getRankName",value:function(){if(!this.props.rank.is_tab)return(0,i.Z)("span",{className:"rank-name item-title"},void 0,this.props.rank.name);var t=S.Z.get("USERS_LIST_URL")+this.props.rank.slug+"/";return(0,i.Z)(f.rU,{to:t,className:"rank-name item-title"},void 0,this.props.rank.name)}},{key:"getUserTitle",value:function(){return this.props.user.title?(0,i.Z)("span",{className:"user-title hidden-xs hidden-sm"},void 0,this.props.user.title):null}},{key:"render",value:function(){return(0,i.Z)("li",{className:this.getClassName()},void 0,(0,i.Z)("div",{className:"rank-user-avatar"},void 0,(0,i.Z)("a",{href:this.props.user.url},void 0,(0,i.Z)(x.ZP,{user:this.props.user,size:50,size2x:64}))),(0,i.Z)("div",{className:"rank-user"},void 0,(0,i.Z)("div",{className:"user-name"},void 0,(0,i.Z)("a",{href:this.props.user.url,className:"item-title"},void 0,this.props.user.username)),(0,i.Z)("div",{className:"user-details"},void 0,this.getUserStatus(),this.getRankName(),this.getUserTitle()),(0,i.Z)("div",{className:"user-compact-stats visible-xs-block"},void 0,(0,i.Z)("span",{className:"rank-position"},void 0,(0,i.Z)("strong",{},void 0,"#",this.props.counter),(0,i.Z)("small",{},void 0,pgettext("top posters list item","Rank"))),(0,i.Z)("span",{className:"rank-posts-counted"},void 0,(0,i.Z)("strong",{},void 0,this.props.user.meta.score),(0,i.Z)("small",{},void 0,pgettext("top posters list item","Ranked posts"))))),(0,i.Z)("div",{className:"rank-position hidden-xs"},void 0,(0,i.Z)("strong",{},void 0,"#",this.props.counter),(0,i.Z)("small",{},void 0,pgettext("top posters list item","Rank"))),(0,i.Z)("div",{className:"rank-posts-counted hidden-xs"},void 0,(0,i.Z)("strong",{},void 0,this.props.user.meta.score),(0,i.Z)("small",{},void 0,pgettext("top posters list item","Ranked posts"))),(0,i.Z)("div",{className:"rank-posts-total hidden-xs"},void 0,(0,i.Z)("strong",{},void 0,this.props.user.posts),(0,i.Z)("small",{},void 0,pgettext("top posters list item","Total posts"))))}}]),u}(d().Component);var O=function(t){(0,s.Z)(u,t);var e,n,a=(e=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,l.Z)(this,t)});function u(){return(0,o.Z)(this,u),a.apply(this,arguments)}return(0,r.Z)(u,[{key:"getLeadMessage",value:function(){var t=npgettext("top posters list","%(posters)s top poster from last %(days)s days.","%(posters)s top posters from last %(days)s days.",this.props.count);return interpolate(t,{posters:this.props.count,days:this.props.trackedPeriod},!0)}},{key:"render",value:function(){return(0,i.Z)("div",{className:"active-posters-list"},void 0,(0,i.Z)(v.Z,{},void 0,(0,i.Z)(y,{baseUrl:misago.get("USERS_LIST_URL"),page:this.props.page,pages:misago.get("USERS_LISTS")}),(0,i.Z)("p",{className:"lead"},void 0,this.getLeadMessage()),(0,i.Z)("div",{className:"active-posters ui-ready"},void 0,(0,i.Z)("ul",{className:"list-group"},void 0,this.props.users.map((function(t,e){return(0,i.Z)(L,{user:t,rank:t.rank,counter:e+1},t.id)}))))))}}]),u}(d().Component),P=n(6935),A=n(55547),T=n(90287),I=n(53328);var B=function(t){(0,s.Z)(u,t);var e,n,a=(e=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,l.Z)(this,t)});function u(t){var e;return(0,o.Z)(this,u),e=a.call(this,t),(0,m.Z)((0,h.Z)(e),"update",(function(t){T.Z.dispatch((0,P.ZB)(t.results)),e.setState({isLoaded:!0,trackedPeriod:t.tracked_period,count:t.count})})),S.Z.has("USERS")?e.initWithPreloadedData(S.Z.pop("USERS")):e.initWithoutPreloadedData(),e.startPolling(),e}return(0,r.Z)(u,[{key:"initWithPreloadedData",value:function(t){this.state={isLoaded:!0,trackedPeriod:t.tracked_period,count:t.count},T.Z.dispatch((0,P.ZB)(t.results))}},{key:"initWithoutPreloadedData",value:function(){this.state={isLoaded:!1}}},{key:"startPolling",value:function(){A.Z.start({poll:"active-posters",url:S.Z.get("USERS_API"),data:{list:"active"},frequency:9e4,update:this.update})}},{key:"componentDidMount",value:function(){I.Z.set({title:this.props.route.extra.name,parent:pgettext("users page title","Users")})}},{key:"componentWillUnmount",value:function(){A.Z.stop("active-posters")}},{key:"render",value:function(){var t={name:this.props.route.extra.name};return this.state.isLoaded?this.state.count>0?(0,i.Z)(O,{page:t,users:this.props.users,trackedPeriod:this.state.trackedPeriod,count:this.state.count}):(0,i.Z)(_,{page:t,trackedPeriod:this.state.trackedPeriod}):(0,i.Z)(R,{page:t})}}]),u}(d().Component);var j=function(t){(0,s.Z)(u,t);var e,n,a=(e=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,l.Z)(this,t)});function u(){return(0,o.Z)(this,u),a.apply(this,arguments)}return(0,r.Z)(u,[{key:"getClassName",value:function(){return this.props.copy&&this.props.copy.length&&1===function(t,e){if(t=(t+"").toLowerCase(),(e=(e+"").toLowerCase()).length<=0)return 0;for(var n=0,a=0,i=e.length;(a=t.indexOf(e,a))>=0;)n+=1,a+=i;return n}(this.props.copy,"<p")&&-1===this.props.copy.indexOf("<br")?"page-lead lead":"page-lead"}},{key:"render",value:function(){return this.props.copy&&this.props.copy.length?(0,i.Z)("div",{className:this.getClassName(),dangerouslySetInnerHTML:{__html:this.props.copy}}):null}}]),u}(d().Component),D=n(40429);const U=function(t){var e=t.users;return(0,i.Z)(D.Z,{cols:4,isReady:!0,showStatus:!0,users:e})};var z;const q=function(t){(0,s.Z)(u,t);var e,n,a=(e=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,l.Z)(this,t)});function u(){var t;(0,o.Z)(this,u);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=a.call.apply(a,[this].concat(n)),(0,m.Z)((0,h.Z)(t),"render",(function(){return z||(z=(0,i.Z)(D.Z,{cols:4,isReady:!1}))})),t}return(0,r.Z)(u,[{key:"shouldComponentUpdate",value:function(){return!1}}]),u}(d().Component);var M=n(92490);const F=function(t){var e=t.users;return e.more?(0,i.Z)("p",{},void 0,interpolate(npgettext("rank users list","There is %(more)s more user with this rank.","There are %(more)s more users with this rank.",e.more),{more:e.more},!0)):(0,i.Z)("p",{},void 0,pgettext("rank users list empty","There are no more users with this rank."))};var H,V,Y,G,W,$,Q,K;const X=function(t){var e=t.baseUrl,n=t.users;return(0,i.Z)("div",{className:"misago-pagination"},void 0,n.isLoaded&&n.first?(0,i.Z)(f.rU,{className:"btn btn-default btn-outline btn-icon",to:e,title:pgettext("rank users list paginator","Go to first page")},void 0,H||(H=(0,i.Z)("span",{className:"material-icon"},void 0,"first_page"))):(0,i.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:pgettext("rank users list paginator","Go to first page"),type:"button",disabled:!0},void 0,V||(V=(0,i.Z)("span",{className:"material-icon"},void 0,"first_page"))),n.isLoaded&&n.previous?(0,i.Z)(f.rU,{className:"btn btn-default btn-outline btn-icon",to:e+(n.previous>1?n.previous+"/":""),title:pgettext("rank users list paginator","Go to previous page")},void 0,Y||(Y=(0,i.Z)("span",{className:"material-icon"},void 0,"chevron_left"))):(0,i.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:pgettext("rank users list paginator","Go to previous page"),type:"button",disabled:!0},void 0,G||(G=(0,i.Z)("span",{className:"material-icon"},void 0,"chevron_left"))),n.isLoaded&&n.next?(0,i.Z)(f.rU,{className:"btn btn-default btn-outline btn-icon",to:e+n.next+"/",title:pgettext("rank users list paginator","Go to next page")},void 0,W||(W=(0,i.Z)("span",{className:"material-icon"},void 0,"chevron_right"))):(0,i.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:pgettext("rank users list paginator","Go to next page"),type:"button",disabled:!0},void 0,$||($=(0,i.Z)("span",{className:"material-icon"},void 0,"chevron_right"))),n.isLoaded&&n.last?(0,i.Z)(f.rU,{className:"btn btn-default btn-outline btn-icon",to:e+n.last+"/",title:pgettext("rank users list paginator","Go to last page")},void 0,Q||(Q=(0,i.Z)("span",{className:"material-icon"},void 0,"last_page"))):(0,i.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:pgettext("rank users list paginator","Go to last page"),type:"button",disabled:!0},void 0,K||(K=(0,i.Z)("span",{className:"material-icon"},void 0,"last_page"))))},J=function(t){var e=t.baseUrl,n=t.users;return(0,i.Z)(M.o8,{},void 0,(0,i.Z)(M.Z2,{},void 0,(0,i.Z)(M.Eg,{},void 0,(0,i.Z)(X,{baseUrl:e,users:n}))),(0,i.Z)(M.Z2,{auto:!0},void 0,(0,i.Z)(M.Eg,{},void 0,(0,i.Z)(F,{users:n}))))};var tt;var et=function(t){(0,s.Z)(u,t);var e,n,a=(e=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,l.Z)(this,t)});function u(t){var e;return(0,o.Z)(this,u),e=a.call(this,t),(0,m.Z)((0,h.Z)(e),"update",(function(t){T.Z.dispatch((0,P.ZB)(t.results)),t.isLoaded=!0,e.setState(t)})),S.Z.has("USERS")?e.initWithPreloadedData(S.Z.pop("USERS")):e.initWithoutPreloadedData(),e.startPolling(t.params.page||1),e}return(0,r.Z)(u,[{key:"initWithPreloadedData",value:function(t){this.state=Object.assign(t,{isLoaded:!0}),T.Z.dispatch((0,P.ZB)(t.results))}},{key:"initWithoutPreloadedData",value:function(){this.state={isLoaded:!1}}},{key:"startPolling",value:function(t){A.Z.start({poll:"rank-users",url:S.Z.get("USERS_API"),data:{rank:this.props.route.rank.id,page:t},frequency:9e4,update:this.update})}},{key:"componentDidMount",value:function(){I.Z.set({title:this.props.route.rank.name,page:this.props.params.page||null,parent:pgettext("users page title","Users")})}},{key:"componentWillUnmount",value:function(){A.Z.stop("rank-users")}},{key:"componentWillReceiveProps",value:function(t){this.props.params.page!==t.params.page&&(I.Z.set({title:this.props.route.rank.name,page:t.params.page||null,parent:pgettext("users page title","Users")}),this.setState({isLoaded:!1}),A.Z.stop("rank-users"),this.startPolling(t.params.page))}},{key:"getClassName",value:function(){return this.props.route.rank.css_class?"rank-users-list rank-users-"+this.props.route.rank.css_class:"rank-users-list"}},{key:"getRankDescription",value:function(){return this.props.route.rank.description?(0,i.Z)("div",{className:"rank-description"},void 0,(0,i.Z)(j,{copy:this.props.route.rank.description.html})):null}},{key:"getComponent",value:function(){return this.state.isLoaded?this.state.count>0?(0,i.Z)(U,{users:this.props.users}):(0,i.Z)("p",{className:"lead"},void 0,pgettext("rank users list","There are no users with this rank at the moment.")):tt||(tt=(0,i.Z)(q,{}))}},{key:"render",value:function(){return(0,i.Z)("div",{className:this.getClassName()},void 0,(0,i.Z)(v.Z,{},void 0,(0,i.Z)(y,{baseUrl:S.Z.get("USERS_LIST_URL"),page:{name:this.props.route.rank.name},pages:S.Z.get("USERS_LISTS")}),this.getRankDescription(),this.getComponent(),(0,i.Z)(J,{baseUrl:S.Z.get("USERS_LIST_URL")+this.props.route.rank.slug+"/",users:this.state})))}}]),u}(d().Component),nt=n(82125),at=n(99755);var it=function(t){(0,s.Z)(u,t);var e,n,a=(e=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,c.Z)(e);if(n){var i=(0,c.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,l.Z)(this,t)});function u(){return(0,o.Z)(this,u),a.apply(this,arguments)}return(0,r.Z)(u,[{key:"render",value:function(){return(0,i.Z)("div",{className:"page page-users-lists"},void 0,(0,i.Z)(at.sP,{},void 0,(0,i.Z)(at.mr,{styleName:"users-lists"},void 0,(0,i.Z)(at.gC,{styleName:"users-lists"},void 0,(0,i.Z)("h1",{},void 0,pgettext("users page title","Users"))))),this.props.children)}}]),u}(nt.Z);function ot(t){return{tick:t.tick.tick,user:t.auth.user,users:t.users}}function rt(){var t=[];return S.Z.get("USERS_LISTS").forEach((function(e){"rank"===e.component?(t.push({path:S.Z.get("USERS_LIST_URL")+e.slug+"/:page/",component:(0,p.$j)(ot)(et),rank:e}),t.push({path:S.Z.get("USERS_LIST_URL")+e.slug+"/",component:(0,p.$j)(ot)(et),rank:e})):"active-posters"===e.component&&t.push({path:S.Z.get("USERS_LIST_URL")+e.component+"/",component:(0,p.$j)(ot)(B),extra:{name:e.name}})})),t}var st=n(39633);S.Z.addInitializer({name:"component:users",initializer:function(t){t.has("USERS_LISTS")&&(0,st.Z)({root:S.Z.get("USERS_LIST_URL"),component:it,paths:rt()})},after:"store"})},97751:(t,e,n)=>{"use strict";var a=n(34458),i=n(96142);a.Z.addInitializer({name:"include",initializer:function(t){i.Z.init(t.get("STATIC_URL"))}})},76093:(t,e,n)=>{"use strict";var a=n(34458),i=n(62833);a.Z.addInitializer({name:"local-storage",initializer:function(){i.Z.init("misago_")}})},87336:(t,e,n)=>{"use strict";var a=n(34458),i=n(15671),o=n(43144),r=n(4869),s=n(19755);const l=new(function(){function t(){(0,i.Z)(this,t)}return(0,o.Z)(t,[{key:"init",value:function(t){this._element=t,this._component=null}},{key:"show",value:function(t){this._component===t?this.hide():(this._component=t,(0,r.Z)(t,this._element.id),s(this._element).addClass("open"))}},{key:"showConnected",value:function(t,e){this._component===t?this.hide():(this._component=t,(0,r.Z)(e,this._element.id,!0),s(this._element).addClass("open"))}},{key:"hide",value:function(){s(this._element).removeClass("open"),this._component=null}}]),t}());a.Z.addInitializer({name:"dropdown",initializer:function(){var t=document.getElementById("mobile-navbar-dropdown-mount");t&&l.init(t)},before:"store"})},47549:(t,e,n)=>{"use strict";var a=n(34458),i=n(59801);a.Z.addInitializer({name:"modal",initializer:function(){var t=document.getElementById("modal-mount");t&&i.Z.init(t)},before:"store"})},22331:(t,e,n)=>{"use strict";var a=n(30381),i=n.n(a),o=n(34458),r=n(19755);o.Z.addInitializer({name:"moment",initializer:function(){i().locale(r("html").attr("lang"))}})},21513:(t,e,n)=>{"use strict";var a=n(34458),i=n(53328);a.Z.addInitializer({name:"page-title",initializer:function(t){i.Z.init(t.get("SETTINGS").forum_index_title,t.get("SETTINGS").forum_name)}})},98749:(t,e,n)=>{"use strict";var a=n(34458),i=n(78657),o=n(53904),r=n(55547);a.Z.addInitializer({name:"polls",initializer:function(){r.Z.init(i.Z,o.Z)}})},98251:(t,e,n)=>{"use strict";var a=n(34458),i=n(78657),o=n(64646),r=n(53904);a.Z.addInitializer({name:"posting",initializer:function(){o.Z.init(i.Z,r.Z,document.getElementById("posting-mount"))}})},6720:(t,e,n)=>{"use strict";var a=n(34458),i=n(35486),o=n(90287);a.Z.addInitializer({name:"reducer:auth",initializer:function(t){o.Z.addReducer("auth",i.ZP,Object.assign({isAuthenticated:t.get("isAuthenticated"),isAnonymous:!t.get("isAuthenticated"),user:t.get("user")},i.E3))},before:"store"})},66806:(t,e,n)=>{"use strict";var a=n(34458),i=n(993),o=n(90287);a.Z.addInitializer({name:"reducer:overlay",initializer:function(t){o.Z.addReducer("overlay",i.ZP,i.E3)},before:"store"})},10846:(t,e,n)=>{"use strict";var a=n(34458),i=n(8154),o=n(90287);a.Z.addInitializer({name:"reducer:participants",initializer:function(){var t=null;a.Z.has("THREAD")&&(t=a.Z.get("THREAD").participants),o.Z.addReducer("participants",i.ZP,t||[])},before:"store"})},18255:(t,e,n)=>{"use strict";var a=n(34458),i=n(59752),o=n(90287);a.Z.addInitializer({name:"reducer:poll",initializer:function(){var t;t=a.Z.has("THREAD")&&a.Z.get("THREAD").poll?(0,i.ZB)(a.Z.get("THREAD").poll):{},o.Z.addReducer("poll",i.ZP,t)},before:"store"})},14113:(t,e,n)=>{"use strict";var a=n(34458),i=n(21981),o=n(90287);a.Z.addInitializer({name:"reducer:posts",initializer:function(){var t;t=a.Z.has("POSTS")?(0,i.ZB)(a.Z.get("POSTS")):{isLoaded:!1,isBusy:!1},o.Z.addReducer("posts",i.ZP,t)},before:"store"})},24444:(t,e,n)=>{"use strict";var a=n(34458),i=n(58598),o=n(90287);a.Z.addInitializer({name:"reducer:profile-details",initializer:function(){var t=null;a.Z.has("PROFILE_DETAILS")&&(t=a.Z.get("PROFILE_DETAILS")),o.Z.addReducer("profile-details",i.ZP,t||{})},before:"store"})},1764:(t,e,n)=>{"use strict";var a=n(34458),i=n(27519),o=n(90287);a.Z.addInitializer({name:"reducer:profile-hydrate",initializer:function(){a.Z.has("PROFILE")&&o.Z.dispatch((0,i.ZB)(a.Z.get("PROFILE")))},after:"store"})},68351:(t,e,n)=>{"use strict";var a=n(34458),i=n(27519),o=n(90287);a.Z.addInitializer({name:"reducer:profile",initializer:function(){o.Z.addReducer("profile",i.ZP,{})},before:"store"})},81521:(t,e,n)=>{"use strict";var a=n(34458),i=n(16427),o=n(90287);a.Z.addInitializer({name:"reducer:search",initializer:function(){o.Z.addReducer("search",i.ZP,Object.assign({},i.E3,{providers:a.Z.get("SEARCH_PROVIDERS")||[],query:a.Z.get("SEARCH_QUERY")||""}))},before:"store"})},68585:(t,e,n)=>{"use strict";var a=n(34458);function i(t,e){if(-1===t.indexOf(e)){var n=t.slice();return n.push(e),n}return t.filter((function(t){return t!==e}))}var o="SELECT_ALL",r="SELECT_NONE",s="SELECT_ITEM";function l(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(e.type){case o:return e.items;case r:return[];case s:return i(t,e.item);default:return t}}var c=n(90287);a.Z.addInitializer({name:"reducer:selection",initializer:function(){c.Z.addReducer("selection",l,[])},before:"store"})},41229:(t,e,n)=>{"use strict";var a=n(34458),i=n(27346),o=n(90287);a.Z.addInitializer({name:"reducer:snackbar",initializer:function(){o.Z.addReducer("snackbar",i.ZP,i.E3)},before:"store"})},43589:(t,e,n)=>{"use strict";var a=n(34458),i=n(7738),o=n(90287);a.Z.addInitializer({name:"reducer:thread",initializer:function(){var t;t=a.Z.has("THREAD")?(0,i.ZB)(a.Z.get("THREAD")):{isBusy:!1},o.Z.addReducer("thread",i.ZP,t)},before:"store"})},62894:(t,e,n)=>{"use strict";var a=n(34458),i=(n(30381),n(89759)),o="APPEND_THREADS",r="DELETE_THREAD",s="FILTER_THREADS",l="HYDRATE_THREADS",c="PATCH_THREAD",u="SORT_THREADS",d=["can_announce","can_approve","can_close","can_hide","can_move","can_merge","can_pin","can_review"];function p(t){return Object.assign({},t,{moderation:(e=t.acl,n=[],d.forEach((function(t){e[t]&&n.push(t)})),n)});var e,n}function h(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(e.type){case o:var n=(0,i.Z)(e.items.map(p),t);return n.sort(e.sorting);case r:return t.filter((function(t){return t.id!==e.thread.id}));case s:return t.filter((function(t){var n=e.categoriesMap[t.category];return n.lft>=e.category.lft&&n.rght<=e.category.rght||2==t.weight}));case l:return e.items.map(p);case c:var a=t.map((function(t){return t.id===e.thread.id?Object.assign({},t,e.patch):t}));return e.sorting?a.sort(e.sorting):a;case u:return t.sort(e.sorting);default:return t}}var m=n(90287);a.Z.addInitializer({name:"reducer:threads",initializer:function(){m.Z.addReducer("threads",h,[])},before:"store"})},33934:(t,e,n)=>{"use strict";var a=n(34458),i=n(85586),o=n(90287);a.Z.addInitializer({name:"reducer:tick",initializer:function(){o.Z.addReducer("tick",i.ZP,i.E3)},before:"store"})},85577:(t,e,n)=>{"use strict";var a=n(34458),i=n(48927),o=n(90287);a.Z.addInitializer({name:"reducer:username-history",initializer:function(){o.Z.addReducer("username-history",i.ZP,[])},before:"store"})},83526:(t,e,n)=>{"use strict";var a=n(34458),i=n(6935),o=n(90287);a.Z.addInitializer({name:"reducer:users",initializer:function(){o.Z.addReducer("users",i.ZP,[])},before:"store"})},43060:(t,e,n)=>{"use strict";var a=n(34458),i=n(53904),o=n(90287);a.Z.addInitializer({name:"snackbar",initializer:function(){i.Z.init(o.Z)},after:"store"})},92292:(t,e,n)=>{"use strict";var a=n(34458),i=n(90287);a.Z.addInitializer({name:"store",initializer:function(){i.Z.init()},before:"_end"})},33409:(t,e,n)=>{"use strict";var a=n(34458),i=n(85586),o=n(90287);a.Z.addInitializer({name:"tick-start",initializer:function(){window.setInterval((function(){o.Z.dispatch((0,i.bq)())}),5e4)},after:"store"})},31341:(t,e,n)=>{"use strict";var a=n(34458),i=n(96142),o=n(59940);a.Z.addInitializer({name:"zxcvbn",initializer:function(){o.Z.init(i.Z)}})},35486:(t,e,n)=>{"use strict";n.d(e,{E3:()=>i,ZP:()=>h,r$:()=>u,w7:()=>p,yH:()=>c,zB:()=>d});var a=n(6935),i={signedIn:!1,signedOut:!1},o="UPDATE_AUTHENTICATED_USER",r="PATCH_USER",s="SIGN_IN",l="SIGN_OUT";function c(t){return{type:o,data:t}}function u(t){return{type:r,patch:t}}function d(t){return{type:s,user:t}}function p(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return{type:l,soft:t}}function h(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(e.type){case r:var n=Object.assign({},t);return n.user=Object.assign({},t.user,e.patch),n;case o:var c=Object.assign({},t);return c.user=Object.assign({},t.user,e.data),c;case s:return Object.assign({},t,{signedIn:e.user});case l:return Object.assign({},t,{isAuthenticated:!1,isAnonymous:!0,signedOut:!e.soft});case a.oB:if(t.isAuthenticated&&t.user.id===e.userId){var u=Object.assign({},t);return u.user=Object.assign({},t.user,{avatars:e.avatars}),u}return t;case a.D9:if(t.isAuthenticated&&t.user.id===e.userId){var d=Object.assign({},t);return d.user=Object.assign({},t.user,{username:e.username,slug:e.slug}),d}return t;default:return t}}},993:(t,e,n)=>{"use strict";n.d(e,{AU:()=>c,E3:()=>m,T5:()=>p,UL:()=>u,ZP:()=>v,hN:()=>d,xv:()=>h});var a="OPEN_SITE_NAV",i="OPEN_SEARCH",o="OPEN_NOTIFICATIONS",r="OPEN_PRIVATE_THREADS",s="OPEN_USER_NAV",l="CLOSE_OVERLAYS";function c(){return{type:a}}function u(){return{type:i}}function d(){return{type:o}}function p(){return{type:s}}function h(){return{type:l}}var m={siteNav:!1,search:!1,notifications:!1,privateThreads:!1,userNav:!1};function v(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(e.type){case a:return Object.assign({},t,m,{siteNav:!0});case i:return Object.assign({},t,m,{search:!0});case o:return Object.assign({},t,m,{notifications:!0});case r:return Object.assign({},t,m,{privateThreads:!0});case s:return Object.assign({},t,m,{userNav:!0});case l:return Object.assign({},t,m);default:return t}}},8154:(t,e,n)=>{"use strict";n.d(e,{ZP:()=>o,gx:()=>i});var a="REPLACE_PARTICIPANTS";function i(t){return{type:a,state:t}}function o(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return e.type===a?e.state:t}},59752:(t,e,n)=>{"use strict";n.d(e,{Ar:()=>p,Od:()=>m,ZB:()=>u,ZH:()=>s,ZP:()=>v,b9:()=>l,gx:()=>h,n6:()=>d});var a=n(30381),i=n.n(a),o="BUSY_POLL",r="RELEASE_POLL",s="REMOVE_POLL",l="REPLACE_POLL",c="UPDATE_POLL";function u(t){var e=!1;for(var n in t.choices)if(t.choices[n].selected){e=!0;break}return Object.assign({},t,{posted_on:i()(t.posted_on),hasSelectedChoices:e,endsOn:t.length?i()(t.posted_on).add(t.length,"days"):null,isBusy:!1})}function d(){return{type:o}}function p(){return{type:r}}function h(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:l,state:e?t:u(t)}}function m(){return{type:s}}function v(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(e.type){case o:return Object.assign({},t,{isBusy:!0});case r:return Object.assign({},t,{isBusy:!1});case s:return{isBusy:!1};case l:return e.state;case c:return Object.assign({},t,e.data);default:return t}}},92747:(t,e,n)=>{"use strict";n.d(e,{Qu:()=>r,ZB:()=>s,ZP:()=>u,r$:()=>c});var a=n(30381),i=n.n(a),o=n(6935),r="PATCH_POST";function s(t){return Object.assign({},t,{posted_on:i()(t.posted_on),updated_on:i()(t.updated_on),hidden_on:i()(t.hidden_on),attachments:t.attachments?t.attachments.map(l):null,poster:t.poster?(0,o.Ru)(t.poster):null,isSelected:!1,isBusy:!1,isDeleted:!1})}function l(t){return Object.assign({},t,{uploaded_on:i()(t.uploaded_on)})}function c(t,e){return{type:r,post:t,patch:e}}function u(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return e.type===r&&t.id==e.post.id?Object.assign({},t,e.patch):t}},21981:(t,e,n)=>{"use strict";n.d(e,{R3:()=>f,Rz:()=>Z,Vx:()=>g,Ys:()=>d,ZB:()=>m,ZP:()=>y,_H:()=>p,kR:()=>h,zD:()=>v});var a=n(92747),i="APPEND_POSTS",o="SELECT_POST",r="DESELECT_POST",s="DESELECT_POSTS",l="LOAD_POSTS",c="UNLOAD_POSTS",u="UPDATE_POSTS";function d(t){return{type:o,post:t}}function p(t){return{type:r,post:t}}function h(){return{type:s}}function m(t){return Object.assign({},t,{results:t.results.map(a.ZB),isLoaded:!0,isBusy:!1,isSelected:!1})}function v(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:l,state:e?t:m(t)}}function f(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:i,state:e?t:m(t)}}function Z(){return{type:c}}function g(t){return{type:u,update:t}}function y(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(e.type){case o:var n=t.results.map((function(t){return t.id==e.post.id?Object.assign({},t,{isSelected:!0}):t}));return Object.assign({},t,{results:n});case r:var d=t.results.map((function(t){return t.id==e.post.id?Object.assign({},t,{isSelected:!1}):t}));return Object.assign({},t,{results:d});case s:var p=t.results.map((function(t){return Object.assign({},t,{isSelected:!1})}));return Object.assign({},t,{results:p});case i:var h=t.results.slice(),m=t.results.map((function(t){return t.id}));return e.state.results.map((function(t){-1===m.indexOf(t.id)&&h.push(t)})),Object.assign({},e.state,{results:h});case l:return e.state;case c:return Object.assign({},t,{isLoaded:!1});case u:return Object.assign({},t,e.update);case a.Qu:var v=t.results.map((function(t){return(0,a.ZP)(t,e)}));return Object.assign({},t,{results:v});default:return t}}},58598:(t,e,n)=>{"use strict";n.d(e,{ZP:()=>o,zD:()=>i});var a="LOAD_DETAILS";function i(t){return{type:a,newState:t}}function o(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return e.type===a?e.newState:t}},27519:(t,e,n)=>{"use strict";n.d(e,{ZB:()=>l,ZP:()=>u,r$:()=>c});var a=n(30381),i=n.n(a),o=n(6935),r="HYDRATE_PROFILE",s="PATCH_PROFILE";function l(t){return{type:r,profile:t}}function c(t){return{type:s,patch:t}}function u(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(e.type){case r:return Object.assign({},e.profile,{joined_on:i()(e.profile.joined_on),status:(0,o.$q)(e.profile.status)});case s:return Object.assign({},t,e.patch);case o.oB:return t.id===e.userId?Object.assign({},t,{avatars:e.avatars}):t;case o.D9:return t.id===e.userId?Object.assign({},t,{username:e.username,slug:e.slug}):t;default:return t}}},16427:(t,e,n)=>{"use strict";n.d(e,{E3:()=>r,P0:()=>l,Vx:()=>s,ZP:()=>c});var a="REPLACE_SEARCH",i="UPDATE_SEARCH",o="UPDATE_SEARCH_PROVIDER",r={isLoading:!1,query:"",providers:[]};function s(t){return{type:i,update:t}}function l(t){return{type:o,provider:t}}function c(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(e.type){case a:return e.state;case i:return Object.assign({},t,e.update);case o:return Object.assign({},t,{providers:t.providers.map((function(t){return t.id===e.provider.id?e.provider:t}))});default:return t}}},27346:(t,e,n)=>{"use strict";n.d(e,{E3:()=>a,OV:()=>r,ZP:()=>l,p2:()=>s});var a={type:"info",message:"",isVisible:!1},i="SHOW_SNACKBAR",o="HIDE_SNACKBAR";function r(t,e){return{type:i,message:t,messageType:e}}function s(){return{type:o}}function l(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return e.type===i?{type:e.messageType,message:e.message,isVisible:!0}:e.type===o?Object.assign({},t,{isVisible:!1}):t}},7738:(t,e,n)=>{"use strict";n.d(e,{Ar:()=>h,Vx:()=>v,ZB:()=>d,ZP:()=>Z,gx:()=>m,n6:()=>p,y8:()=>f});var a=n(30381),i=n.n(a),o=n(59752),r="BUSY_THREAD",s="RELEASE_THREAD",l="REPLACE_THREAD",c="UPDATE_THREAD",u="UPDATE_THREAD_ACL";function d(t){return Object.assign({},t,{started_on:i()(t.started_on),last_post_on:i()(t.last_post_on),best_answer_marked_on:t.best_answer_marked_on?i()(t.best_answer_marked_on):null,isBusy:!1})}function p(){return{type:r}}function h(){return{type:s}}function m(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:l,state:e?t:d(t)}}function v(t){return{type:c,data:t}}function f(t){return{type:u,data:t}}function Z(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(e.type){case r:return Object.assign({},t,{isBusy:!0});case s:return Object.assign({},t,{isBusy:!1});case o.ZH:return Object.assign({},t,{poll:null});case o.b9:return Object.assign({},t,{poll:e.state});case l:return e.state;case c:return Object.assign({},t,e.data);case u:var n=Object.assign({},t.acl,e.data);return Object.assign({},t,{acl:n});default:return t}}},85586:(t,e,n)=>{"use strict";n.d(e,{E3:()=>a,ZP:()=>r,bq:()=>o});var a={tick:0},i="TICK";function o(){return{type:i}}function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return e.type===i?Object.assign({},t,{tick:t.tick+1}):t}},48927:(t,e,n)=>{"use strict";n.d(e,{KP:()=>u,R3:()=>d,ZB:()=>p,ZP:()=>m});var a=n(30381),i=n.n(a),o=n(6935),r=n(89759),s="ADD_NAME_CHANGE",l="APPEND_HISTORY",c="HYDRATE_HISTORY";function u(t,e,n){return{type:s,change:t,user:e,changedBy:n}}function d(t){return{type:l,items:t}}function p(t){return{type:c,items:t}}function h(t){return Object.assign({},t,{changed_on:i()(t.changed_on)})}function m(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(e.type){case s:var n=t.slice();return n.unshift({id:Math.floor(Date.now()/1e3),changed_by:e.changedBy,changed_by_username:e.changedBy.username,changed_on:i()(),new_username:e.change.username,old_username:e.user.username}),n;case l:return(0,r.Z)(t,e.items.map(h));case c:return e.items.map(h);case o.oB:return t.map((function(t){return(t=Object.assign({},t)).changed_by&&t.changed_by.id===e.userId&&(t.changed_by=Object.assign({},t.changed_by,{avatars:e.avatars})),t}));case o.D9:return t.map((function(t){return(t=Object.assign({},t)).changed_by&&t.changed_by.id===e.userId&&(t.changed_by=Object.assign({},t.changed_by,{username:e.username,slug:e.slug})),Object.assign({},t)}));default:return t}}},6935:(t,e,n)=>{"use strict";n.d(e,{$q:()=>p,D9:()=>c,R3:()=>u,Ru:()=>h,ZB:()=>d,ZP:()=>f,_S:()=>v,n1:()=>m,oB:()=>l});var a=n(30381),i=n.n(a),o=n(89759),r="APPEND_USERS",s="HYDRATE_USERS",l="UPDATE_AVATAR",c="UPDATE_USERNAME";function u(t){return{type:r,items:t}}function d(t){return{type:s,items:t}}function p(t){return t?Object.assign({},t,{last_click:t.last_click?i()(t.last_click):null,banned_until:t.banned_until?i()(t.banned_until):null}):null}function h(t){return Object.assign({},t,{joined_on:i()(t.joined_on),status:p(t.status)})}function m(t,e){return{type:l,userId:t.id,avatars:e}}function v(t,e,n){return{type:c,userId:t.id,username:e,slug:n}}function f(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(e.type){case r:return(0,o.Z)(t,e.items.map(h));case s:return e.items.map(h);case l:return t.map((function(t){return(t=Object.assign({},t)).id===e.userId&&(t.avatars=e.avatars),t}));default:return t}}},59180:()=>{document.body.addEventListener("click",(function(t){var e=t.target.getAttribute("misago-scroll-to");if(e){t.preventDefault();var n=document.querySelector(e);n&&n.scrollIntoView({behavior:"instant"})}}))},78657:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});var a=n(15671),i=n(43144),o=n(19755);const r=new(function(){function t(){(0,a.Z)(this,t),this._cookieName=null,this._csrfToken=null,this._locks={}}return(0,i.Z)(t,[{key:"init",value:function(t){this._cookieName=t}},{key:"getCsrfToken",value:function(){if(-1!==document.cookie.indexOf(this._cookieName)){var t=new RegExp(this._cookieName+"=([^;]*)"),e=document.cookie.match(t)[0];return e?e.split("=")[1]:null}return null}},{key:"request",value:function(t,e,n){var a=this;return new Promise((function(i,r){var s={url:e,method:t,headers:{"X-CSRFToken":a.getCsrfToken()},data:n?JSON.stringify(n):null,contentType:"application/json; charset=utf-8",dataType:"json",success:function(t){i(t)},error:function(t){var e=t.responseJSON||{};e.status=t.status,0===e.status&&(e.detail=pgettext("ajax client error","Could not connect to the site.")),404===e.status&&(e.detail&&"NOT FOUND"!==e.detail||(e.detail=pgettext("ajax client error","Action link is invalid."))),500!==e.status||e.detail||(e.detail=pgettext("ajax client error","Unknown error has occurred.")),e.statusText=t.statusText,r(e)}};o.ajax(s)}))}},{key:"get",value:function(t,e,n){if(e&&(t+="?"+o.param(e)),n){var a=this;return this._locks[n]&&(this._locks[n].url=t),this._locks[n]&&this._locks[n].waiter?{then:function(){}}:this._locks[n]&&this._locks[n].wait?(this._locks[n].waiter=!0,new Promise((function(e,i){var o=function t(o){a._locks[n].wait?window.setTimeout((function(){t(o)}),300):a._locks[n].url!==o?t(a._locks[n].url):(a._locks[n].waiter=!1,a.request("GET",a._locks[n].url).then((function(i){a._locks[n].url===o?e(i):(a._locks[n].waiter=!0,t(a._locks[n].url))}),(function(e){a._locks[n].url===o?i(e):(a._locks[n].waiter=!0,t(a._locks[n].url))})))};window.setTimeout((function(){o(t)}),300)}))):(this._locks[n]={url:t,wait:!0,waiter:!1},new Promise((function(e,i){a.request("GET",t).then((function(i){a._locks[n].wait=!1,a._locks[n].url===t&&e(i)}),(function(e){a._locks[n].wait=!1,a._locks[n].url===t&&i(e)}))})))}return this.request("GET",t)}},{key:"post",value:function(t,e){return this.request("POST",t,e)}},{key:"patch",value:function(t,e){return this.request("PATCH",t,e)}},{key:"put",value:function(t,e){return this.request("PUT",t,e)}},{key:"delete",value:function(t,e){return this.request("DELETE",t,e)}},{key:"upload",value:function(t,e,n){var a=this;return new Promise((function(i,r){var s={url:t,method:"POST",headers:{"X-CSRFToken":a.getCsrfToken()},data:e,contentType:!1,processData:!1,xhr:function(){var t=new window.XMLHttpRequest;return t.upload.addEventListener("progress",(function(t){t.lengthComputable&&n(Math.round(t.loaded/t.total*100))}),!1),t},success:function(t){i(t)},error:function(t){var e=t.responseJSON||{};e.status=t.status,0===e.status&&(e.detail=pgettext("api error","Could not connect to the site.")),413!==e.status||e.detail||(e.detail=pgettext("api error","Upload was rejected by the site as too large.")),404===e.status&&(e.detail&&"NOT FOUND"!==e.detail||(e.detail=pgettext("api error","Action link is invalid."))),500!==e.status||e.detail||(e.detail=pgettext("api error","Unknown error has occurred.")),e.statusText=t.statusText,r(e)}};o.ajax(s)}))}}]),t}())},98274:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});var a=n(15671),i=n(43144),o=n(35486);const r=new(function(){function t(){(0,a.Z)(this,t)}return(0,i.Z)(t,[{key:"init",value:function(t,e,n){this._store=t,this._local=e,this._modal=n,this.syncSession(),this.watchState()}},{key:"syncSession",value:function(){var t=this._store.getState().auth;t.isAuthenticated?this._local.set("auth",{isAuthenticated:!0,username:t.user.username}):this._local.set("auth",{isAuthenticated:!1})}},{key:"watchState",value:function(){var t=this,e=this._store.getState().auth;this._local.watch("auth",(function(n){n.isAuthenticated?t._store.dispatch((0,o.zB)({username:n.username})):e.isAuthenticated&&t._store.dispatch((0,o.w7)())})),this._modal.hide()}},{key:"signIn",value:function(t){this._store.dispatch((0,o.zB)(t)),this._local.set("auth",{isAuthenticated:!0,username:t.username}),this._modal.hide()}},{key:"signOut",value:function(){this._store.dispatch((0,o.w7)()),this._local.set("auth",{isAuthenticated:!1}),this._modal.hide()}},{key:"softSignOut",value:function(){this._store.dispatch((0,o.w7)(!0)),this._local.set("auth",{isAuthenticated:!1}),this._modal.hide()}}]),t}())},93825:(t,e,n)=>{"use strict";n.d(e,{ZP:()=>y});var a,i=n(22928),o=n(79340),r=n(6215),s=n(61120),l=n(15671),c=n(43144),u=n(57588),d=n.n(u),p=n(96359);function h(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,a=(0,s.Z)(t);if(e){var i=(0,s.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,r.Z)(this,n)}}var m=function(){function t(){(0,l.Z)(this,t)}return(0,c.Z)(t,[{key:"init",value:function(t,e,n,a){this._context=t,this._ajax=e,this._include=n,this._snackbar=a}}]),t}(),v=function(t){(0,o.Z)(n,t);var e=h(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"load",value:function(){return new Promise((function(t){t()}))}},{key:"validator",value:function(){return null}},{key:"component",value:function(){return null}}]),n}(m),f=function(t){(0,o.Z)(n,t);var e=h(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"load",value:function(){var t=this;return new Promise((function(e,n){t._ajax.get(t._context.get("CAPTCHA_API")).then((function(n){t.question=n.question,t.helpText=n.help_text,e()}),(function(){t._snackbar.error(pgettext("captcha field","Failed to load CAPTCHA.")),n()}))}))}},{key:"validator",value:function(){return[]}},{key:"component",value:function(t){return(0,i.Z)(p.Z,{label:this.question,for:"id_captcha",labelClass:t.labelClass||"",controlClass:t.controlClass||"",validation:t.form.state.errors.captcha,helpText:this.helpText||null},void 0,(0,i.Z)("input",{"aria-describedby":"id_captcha_status",className:"form-control",disabled:t.form.state.isLoading,id:"id_captcha",onChange:t.form.bindInput("captcha"),type:"text",value:t.form.state.captcha}))}}]),n}(m),Z=function(t){(0,o.Z)(n,t);var e=h(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"componentDidMount",value:function(){var t=this;grecaptcha.render("recaptcha",{sitekey:this.props.siteKey,callback:function(e){t.props.binding({target:{value:e}})}})}},{key:"render",value:function(){return a||(a=(0,i.Z)("div",{id:"recaptcha"}))}}]),n}(d().Component),g=function(t){(0,o.Z)(n,t);var e=h(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"load",value:function(){return this._include.include("https://www.google.com/recaptcha/api.js",!0),new Promise((function(t){!function e(){"undefined"==typeof grecaptcha?window.setTimeout((function(){e()}),200):t()}()}))}},{key:"validator",value:function(){return[]}},{key:"component",value:function(t){return(0,i.Z)(p.Z,{label:pgettext("captcha field","Please solve the quick test"),for:"id_captcha",labelClass:t.labelClass||"",controlClass:t.controlClass||"",validation:t.form.state.errors.captcha,helpText:pgettext("captcha field","This test helps us prevent automated spam registrations on the site.")},void 0,(0,i.Z)(Z,{binding:t.form.bindInput("captcha"),siteKey:this._context.get("SETTINGS").recaptcha_site_key}))}}]),n}(m);const y=new(function(){function t(){(0,l.Z)(this,t)}return(0,c.Z)(t,[{key:"init",value:function(t,e,n,a){switch(t.get("SETTINGS").captcha_type){case"no":this._captcha=new v;break;case"qa":this._captcha=new f;break;case"re":this._captcha=new g}this._captcha.init(t,e,n,a)}},{key:"load",value:function(){return this._captcha.load()}},{key:"validator",value:function(){return this._captcha.validator()}},{key:"component",value:function(t){return this._captcha.component(t)}}]),t}())},96142:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});var a=n(15671),i=n(43144),o=n(19755);const r=new(function(){function t(){(0,a.Z)(this,t)}return(0,i.Z)(t,[{key:"init",value:function(t){this._staticUrl=t,this._included=[]}},{key:"include",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];-1===this._included.indexOf(t)&&(this._included.push(t),this._include(t,e))}},{key:"_include",value:function(t,e){o.ajax({url:(e?"":this._staticUrl)+t,cache:!0,dataType:"script"})}}]),t}())},62833:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});var a=n(15671),i=n(43144),o=window.localStorage;const r=new(function(){function t(){(0,a.Z)(this,t)}return(0,i.Z)(t,[{key:"init",value:function(t){var e=this;this._prefix=t,this._watchers=[],window.addEventListener("storage",(function(t){var n=JSON.parse(t.newValue);e._watchers.forEach((function(e){e.key===t.key&&t.oldValue!==t.newValue&&e.callback(n)}))}))}},{key:"set",value:function(t,e){o.setItem(this._prefix+t,JSON.stringify(e))}},{key:"get",value:function(t){var e=o.getItem(this._prefix+t);return e?JSON.parse(e):null}},{key:"watch",value:function(t,e){this._watchers.push({key:this._prefix+t,callback:e})}}]),t}())},59801:(t,e,n)=>{"use strict";n.d(e,{Z:()=>c});var a=n(15671),i=n(43144),o=n(73935),r=n.n(o),s=n(4869),l=n(19755);const c=new(function(){function t(){(0,a.Z)(this,t)}return(0,i.Z)(t,[{key:"init",value:function(t){var e=this;this._element=t,this._modal=l(t).modal({show:!1}),this._modal.on("hidden.bs.modal",(function(){r().unmountComponentAtNode(e._element)}))}},{key:"show",value:function(t){(0,s.Z)(t,this._element.id),this._modal.modal("show")}},{key:"hide",value:function(){this._modal.modal("hide")}}]),t}())},53328:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var a=n(15671),i=n(43144);const o=new(function(){function t(){(0,a.Z)(this,t)}return(0,i.Z)(t,[{key:"init",value:function(t,e){this._indexTitle=t,this._forumName=e}},{key:"set",value:function(t){if(t){"string"==typeof t&&(t={title:t});var e=t.title;t.page>1&&(e+=" ("+interpolate(pgettext("page title pagination","page: %(page)s"),{page:t.page},!0)+")"),t.parent&&(e+=" | "+t.parent),document.title=e+" | "+this._forumName}else document.title=this._indexTitle||this._forumName}}]),t}())},55547:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var a=n(15671),i=n(43144);const o=new(function(){function t(){(0,a.Z)(this,t)}return(0,i.Z)(t,[{key:"init",value:function(t,e){this._ajax=t,this._snackbar=e,this._polls={}}},{key:"start",value:function(t){var e=this;this.stop(t.poll);var n=function n(){e._polls[t.poll]=t,e._ajax.get(t.url,t.data||null).then((function(a){e._polls[t.poll]._stopped||(t.update(a),e._polls[t.poll].timeout=window.setTimeout(n,t.frequency))}),(function(n){e._polls[t.poll]._stopped||(t.error?t.error(n):e._snackbar.apiError(n))}))};t.delayed?this._polls[t.poll]={timeout:window.setTimeout(n,t.frequency)}:n()}},{key:"stop",value:function(t){this._polls[t]&&(window.clearTimeout(this._polls[t].timeout),this._polls[t]._stopped=!0)}}]),t}())},64646:(t,e,n)=>{"use strict";n.d(e,{Z:()=>p});var a=n(15671),i=n(43144),o=n(4942),r=n(57588),s=n.n(r),l=n(73935),c=n.n(l),u=n(9771),d=n(4869);const p=new(function(){function t(){var e=this;(0,a.Z)(this,t),(0,o.Z)(this,"close",(function(){e.unsetBeforeUnload(),e._props=null,e._isOpen&&!e._isClosing&&(e._isClosing=!0,e._mount.classList.remove("show"),window.setTimeout((function(){c().unmountComponentAtNode(e._mount),e._observer.unobserve(e._mount),e._spacer.style.height="0px;",e._isClosing=!1,e._isOpen=!1,e._mode=null}),300))}))}return(0,i.Z)(t,[{key:"init",value:function(t,e,n){var a=this;this._ajax=t,this._snackbar=e,this._mount=n,this._mode=null,this._spacer=document.getElementById("posting-spacer"),this._observer=new ResizeObserver((function(t){a._spacer.style.height=t[0].contentRect.height+"px"})),this._isOpen=!1,this._isClosing=!1,this._beforeunloadSet=!1,this._props=null}},{key:"isOpen",value:function(){return this._isOpen}},{key:"setBeforeUnload",value:function(){this._beforeunloadSet||(window.addEventListener("beforeunload",this.beforeUnload,{capture:!0}),this._beforeunloadSet=!0)}},{key:"unsetBeforeUnload",value:function(){window.removeEventListener("beforeunload",this.beforeUnload,{capture:!0}),this._beforeunloadSet=!1}},{key:"beforeUnload",value:function(t){return t.returnValue="true","true"}},{key:"open",value:function(t){if(!1===this._isOpen)"QUOTE"===t.mode?this._mode="REPLY":this._mode=t.mode,this._isOpen=t.submit,this._realOpen(Object.assign({},t,{mode:this._mode}));else if("QUOTE"===t.mode)this._realOpen(Object.assign({},this._props,{config:t.config,context:t.context}));else if(this._isOpen!==t.submit){var e=gettext("You are already working on other message. Do you want to discard it?");window.confirm(e)&&(this._mode=t.mode,this._isOpen=t.submit,this._realOpen(t))}else"REPLY"==this._mode&&"REPLY"==t.mode&&this._realOpen(t)}},{key:"_realOpen",value:function(t){(0,d.Z)(s().createElement(u.ZP,t),this._mount.id),this._props=t,this._mount.classList.add("show"),this._observer.observe(this._mount),this.setBeforeUnload()}}]),t}())},53904:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s});var a=n(15671),i=n(43144),o=n(4942),r=n(27346);const s=new(function(){function t(){var e=this;(0,a.Z)(this,t),(0,o.Z)(this,"alert",(function(t,n){e._timeout?(window.clearTimeout(e._timeout),e._store.dispatch((0,r.p2)()),e._timeout=window.setTimeout((function(){e._timeout=null,e.alert(t,n)}),300)):(e._store.dispatch((0,r.OV)(t,n)),e._timeout=window.setTimeout((function(){e._store.dispatch((0,r.p2)()),e._timeout=null}),5e3))})),(0,o.Z)(this,"info",(function(t){e.alert(t,"info")})),(0,o.Z)(this,"success",(function(t){e.alert(t,"success")})),(0,o.Z)(this,"warning",(function(t){e.alert(t,"warning")})),(0,o.Z)(this,"error",(function(t){e.alert(t,"error")})),(0,o.Z)(this,"apiError",(function(t){var n=t.data?t.data.detail:t.detail;n||(n=0===t.status?pgettext("api error","Could not connect to the site."):404===t.status?pgettext("api error","Action link is invalid."):pgettext("api error","Unknown error has occurred.")),403===t.status&&"Permission denied"===n&&(n=pgettext("api error","You don't have permission to perform this action.")),e.error(n)}))}return(0,i.Z)(t,[{key:"init",value:function(t){this._store=t,this._timeout=null}}]),t}())},90287:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});var a=n(15671),i=n(43144),o=n(41438);const r=new(function(){function t(){(0,a.Z)(this,t),this._store=null,this._reducers={},this._initialState={}}return(0,i.Z)(t,[{key:"addReducer",value:function(t,e,n){this._reducers[t]=e,this._initialState[t]=n}},{key:"init",value:function(){this._store=(0,o.createStore)((0,o.combineReducers)(this._reducers),this._initialState)}},{key:"getStore",value:function(){return this._store}},{key:"getState",value:function(){return this._store.getState()}},{key:"dispatch",value:function(t){return this._store.dispatch(t)}}]),t}())},59940:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var a=n(15671),i=n(43144);const o=new(function(){function t(){(0,a.Z)(this,t)}return(0,i.Z)(t,[{key:"init",value:function(t){this._include=t,this._isLoaded=!1}},{key:"scorePassword",value:function(t,e){return this._isLoaded?zxcvbn(t,e).score:0}},{key:"load",value:function(){return this._isLoaded?this._loadedPromise():(this._include.include("misago/js/zxcvbn.js"),this._loadingPromise())}},{key:"_loadingPromise",value:function(){var t=this;return new Promise((function(e,n){!function a(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;(i+=1)>200?n():"undefined"==typeof zxcvbn?window.setTimeout((function(){a(i)}),200):(t._isLoaded=!0,e())}()}))}},{key:"_loadedPromise",value:function(){return new Promise((function(t){t()}))}}]),t}())},93051:(t,e,n)=>{"use strict";n.d(e,{Z:()=>k});var a,i=n(22928),o=n(30381),r=n.n(o),s=n(57588),l=n.n(s),c=n(73935),u=n.n(c),d=n(37424),p=n(15671),h=n(43144),m=n(79340),v=n(6215),f=n(61120);var Z=function(t){(0,m.Z)(s,t);var e,n,o=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,a=(0,f.Z)(e);if(n){var i=(0,f.Z)(this).constructor;t=Reflect.construct(a,arguments,i)}else t=a.apply(this,arguments);return(0,v.Z)(this,t)});function s(){return(0,p.Z)(this,s),o.apply(this,arguments)}return(0,h.Z)(s,[{key:"getReasonMessage",value:function(){return this.props.message.html?(0,i.Z)("div",{className:"lead",dangerouslySetInnerHTML:{__html:this.props.message.html}}):(0,i.Z)("p",{className:"lead"},void 0,this.props.message.plain)}},{key:"getExpirationMessage",value:function(){if(this.props.expires){if(this.props.expires.isAfter(r()())){var t=interpolate(pgettext("banned page","This ban expires on %(expires_on)s."),{expires_on:this.props.expires.format("LL, LT")},!0),e=interpolate(pgettext("banned page","This ban expires %(expires_on)s."),{expires_on:this.props.expires.fromNow()},!0);return(0,i.Z)("abbr",{title:t},void 0,e)}return pgettext("banned page","This ban has expired.")}return pgettext("banned page","This ban is permanent.")}},{key:"render",value:function(){return(0,i.Z)("div",{className:"page page-error page-error-banned"},void 0,(0,i.Z)("div",{className:"container"},void 0,(0,i.Z)("div",{className:"message-panel"},void 0,a||(a=(0,i.Z)("div",{className:"message-icon"},void 0,(0,i.Z)("span",{className:"material-icon"},void 0,"highlight_off"))),(0,i.Z)("div",{className:"message-body"},void 0,this.getReasonMessage(),(0,i.Z)("p",{className:"message-footnote"},void 0,this.getExpirationMessage())))))}}]),s}(l().Component),g=n(34458),y=n(90287),b=(0,d.$j)((function(t){return t.tick}))(Z);function k(t,e){if(u().render((0,i.Z)(d.zt,{store:y.Z.getStore()},void 0,(0,i.Z)(b,{message:t.message,expires:t.expires_on?r()(t.expires_on):null})),document.getElementById("page-mount")),void 0===e||e){var n=g.Z.get("SETTINGS").forum_name;document.title=pgettext("banned error title","You are banned")+" | "+n,window.history.pushState({},"",g.Z.get("BANNED_URL"))}}},69130:(t,e,n)=>{"use strict";function a(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=[],i=[];if(t.forEach((function(t){i.push(t),i.length===e&&(a.push(i),i=[])})),!1!==n&&i.length>0&&i.length<e)for(var o=i.length;o<e;o++)i.push(n);return i.length&&a.push(i),a}n.d(e,{Z:()=>a})},89759:(t,e,n)=>{"use strict";function a(t,e){var n=[];return t.concat(e).filter((function(t){return-1===n.indexOf(t.id)&&(n.push(t.id),!0)}))}n.d(e,{Z:()=>a})},89627:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var a={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};function i(t){return t.replace(/[&<>"']/g,(function(t){return a[t]}))}},48772:(t,e,n)=>{"use strict";function a(t){return t>1073741824?i(t/1073741824)+" GB":t>1048576?i(t/1048576)+" MB":t>1024?i(t/1024)+" KB":i(t)+" B"}function i(t){return t.toFixed(1)}n.d(e,{Z:()=>a})},54031:(t,e,n)=>{"use strict";n.d(e,{ZP:()=>o});var a="12345678990abcdefghijklmnopqrstuvwxyz",i=a.length;function o(t){for(var e=[],n=0;n<t;n++){var o=Math.floor(Math.random()*i);e.push(a[o])}return e.join("")}},4869:(t,e,n)=>{"use strict";n.d(e,{Z:()=>l});var a=n(22928),i=(n(57588),n(73935)),o=n.n(i),r=n(37424),s=n(90287);function l(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=document.getElementById(e),l=t.props?t:(0,a.Z)(t,{});i&&(n?o().render((0,a.Z)(r.zt,{store:s.Z.getStore()},void 0,l),i):o().render(l,i))}},44039:(t,e,n)=>{"use strict";function a(t,e){return Math.floor(Math.random()*(e-t+1))+t}n.d(e,{e:()=>a})},39633:(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});var a=n(22928),i=(n(57588),n(73935)),o=n.n(i),r=n(37424),s=n(69987),l=n(90287),c=document.getElementById("page-mount");function u(t){var e={component:t.component||null,childRoutes:[]};t.root?e.childRoutes=[{path:t.root,onEnter:function(e,n){n(null,t.paths[0].path)}}].concat(t.paths):e.childRoutes=t.paths,o().render((0,a.Z)(r.zt,{store:l.Z.getStore()},void 0,(0,a.Z)(s.F0,{routes:e,history:s.mW})),c)}},55210:(t,e,n)=>{"use strict";n.d(e,{BS:()=>d,C1:()=>r,Do:()=>c,Ei:()=>u,HR:()=>p,Vb:()=>v,fT:()=>s,gS:()=>h,jA:()=>l,lG:()=>m});var a=/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i,i=new RegExp("^[0-9a-z_]+$","i"),o=new RegExp("[0-9a-z]","i");function r(t){return function(e){if(!1===e||null===e||0===String(e).trim().length)return t||gettext("This field is required.")}}function s(t){var e=pgettext("agreement validator","You have to accept the terms of service.");return r(t||e)}function l(t){var e=pgettext("agreement validator","You have to accept the privacy policy.");return r(t||e)}function c(t){return function(e){if(!a.test(e))return t||pgettext("email validator","Enter a valid e-mail address.")}}function u(t,e){return function(n){var a="",i=n.trim().length;if(i<t)return a=e?e(t,i):npgettext("value length validator","Ensure this value has at least %(limit_value)s character (it has %(show_value)s).","Ensure this value has at least %(limit_value)s characters (it has %(show_value)s).",t),interpolate(a,{limit_value:t,show_value:i},!0)}}function d(t,e){return function(n){var a="",i=n.trim().length;if(i>t)return a=e?e(t,i):npgettext("value length validator","Ensure this value has at most %(limit_value)s character (it has %(show_value)s).","Ensure this value has at most %(limit_value)s characters (it has %(show_value)s).",t),interpolate(a,{limit_value:t,show_value:i},!0)}}function p(t){return u(t,(function(t){return npgettext("username length validator","Username must be at least %(limit_value)s character long.","Username must be at least %(limit_value)s characters long.",t)}))}function h(t){return d(t,(function(t){return npgettext("username length validator","Username cannot be longer than %(limit_value)s character.","Username cannot be longer than %(limit_value)s characters.",t)}))}function m(){return function(t){var e=t.trim();return i.test(e)?o.test(e)?void 0:pgettext("username validator","Username must contain Latin alphabet letters or digits."):pgettext("username validator","Username can only contain Latin alphabet letters, digits, and an underscore sign.")}}function v(t){return function(e){var n=e.length;if(n<t){var a=npgettext("password length validator","Valid password must be at least %(limit_value)s character long.","Valid password must be at least %(limit_value)s characters long.",t);return interpolate(a,{limit_value:t,show_value:n},!0)}}}},46700:(t,e,n)=>{var a={"./af":42786,"./af.js":42786,"./ar":30867,"./ar-dz":14130,"./ar-dz.js":14130,"./ar-kw":96135,"./ar-kw.js":96135,"./ar-ly":56440,"./ar-ly.js":56440,"./ar-ma":47702,"./ar-ma.js":47702,"./ar-sa":16040,"./ar-sa.js":16040,"./ar-tn":37100,"./ar-tn.js":37100,"./ar.js":30867,"./az":31083,"./az.js":31083,"./be":9808,"./be.js":9808,"./bg":68338,"./bg.js":68338,"./bm":67438,"./bm.js":67438,"./bn":8905,"./bn-bd":76225,"./bn-bd.js":76225,"./bn.js":8905,"./bo":11560,"./bo.js":11560,"./br":1278,"./br.js":1278,"./bs":80622,"./bs.js":80622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":50877,"./cv.js":50877,"./cy":47373,"./cy.js":47373,"./da":24780,"./da.js":24780,"./de":59740,"./de-at":60217,"./de-at.js":60217,"./de-ch":60894,"./de-ch.js":60894,"./de.js":59740,"./dv":5300,"./dv.js":5300,"./el":50837,"./el.js":50837,"./en-au":78348,"./en-au.js":78348,"./en-ca":77925,"./en-ca.js":77925,"./en-gb":22243,"./en-gb.js":22243,"./en-ie":46436,"./en-ie.js":46436,"./en-il":47207,"./en-il.js":47207,"./en-in":44175,"./en-in.js":44175,"./en-nz":76319,"./en-nz.js":76319,"./en-sg":31662,"./en-sg.js":31662,"./eo":92915,"./eo.js":92915,"./es":55655,"./es-do":55251,"./es-do.js":55251,"./es-mx":96112,"./es-mx.js":96112,"./es-us":71146,"./es-us.js":71146,"./es.js":55655,"./et":5603,"./et.js":5603,"./eu":77763,"./eu.js":77763,"./fa":76959,"./fa.js":76959,"./fi":11897,"./fi.js":11897,"./fil":42549,"./fil.js":42549,"./fo":94694,"./fo.js":94694,"./fr":94470,"./fr-ca":63049,"./fr-ca.js":63049,"./fr-ch":52330,"./fr-ch.js":52330,"./fr.js":94470,"./fy":5044,"./fy.js":5044,"./ga":29295,"./ga.js":29295,"./gd":2101,"./gd.js":2101,"./gl":38794,"./gl.js":38794,"./gom-deva":27884,"./gom-deva.js":27884,"./gom-latn":23168,"./gom-latn.js":23168,"./gu":95349,"./gu.js":95349,"./he":24206,"./he.js":24206,"./hi":30094,"./hi.js":30094,"./hr":30316,"./hr.js":30316,"./hu":22138,"./hu.js":22138,"./hy-am":11423,"./hy-am.js":11423,"./id":29218,"./id.js":29218,"./is":90135,"./is.js":90135,"./it":90626,"./it-ch":10150,"./it-ch.js":10150,"./it.js":90626,"./ja":39183,"./ja.js":39183,"./jv":24286,"./jv.js":24286,"./ka":12105,"./ka.js":12105,"./kk":47772,"./kk.js":47772,"./km":18758,"./km.js":18758,"./kn":79282,"./kn.js":79282,"./ko":33730,"./ko.js":33730,"./ku":1408,"./ku.js":1408,"./ky":33291,"./ky.js":33291,"./lb":36841,"./lb.js":36841,"./lo":55466,"./lo.js":55466,"./lt":57010,"./lt.js":57010,"./lv":37595,"./lv.js":37595,"./me":39861,"./me.js":39861,"./mi":35493,"./mi.js":35493,"./mk":95966,"./mk.js":95966,"./ml":87341,"./ml.js":87341,"./mn":5115,"./mn.js":5115,"./mr":10370,"./mr.js":10370,"./ms":9847,"./ms-my":41237,"./ms-my.js":41237,"./ms.js":9847,"./mt":72126,"./mt.js":72126,"./my":56165,"./my.js":56165,"./nb":64924,"./nb.js":64924,"./ne":16744,"./ne.js":16744,"./nl":93901,"./nl-be":59814,"./nl-be.js":59814,"./nl.js":93901,"./nn":83877,"./nn.js":83877,"./oc-lnc":92135,"./oc-lnc.js":92135,"./pa-in":15858,"./pa-in.js":15858,"./pl":64495,"./pl.js":64495,"./pt":89520,"./pt-br":57971,"./pt-br.js":57971,"./pt.js":89520,"./ro":96459,"./ro.js":96459,"./ru":21793,"./ru.js":21793,"./sd":40950,"./sd.js":40950,"./se":10490,"./se.js":10490,"./si":90124,"./si.js":90124,"./sk":64249,"./sk.js":64249,"./sl":14985,"./sl.js":14985,"./sq":51104,"./sq.js":51104,"./sr":49131,"./sr-cyrl":79915,"./sr-cyrl.js":79915,"./sr.js":49131,"./ss":85893,"./ss.js":85893,"./sv":98760,"./sv.js":98760,"./sw":91172,"./sw.js":91172,"./ta":27333,"./ta.js":27333,"./te":23110,"./te.js":23110,"./tet":52095,"./tet.js":52095,"./tg":27321,"./tg.js":27321,"./th":9041,"./th.js":9041,"./tk":19005,"./tk.js":19005,"./tl-ph":75768,"./tl-ph.js":75768,"./tlh":89444,"./tlh.js":89444,"./tr":72397,"./tr.js":72397,"./tzl":28254,"./tzl.js":28254,"./tzm":51106,"./tzm-latn":30699,"./tzm-latn.js":30699,"./tzm.js":51106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":67691,"./uk.js":67691,"./ur":13795,"./ur.js":13795,"./uz":6791,"./uz-latn":60588,"./uz-latn.js":60588,"./uz.js":6791,"./vi":65666,"./vi.js":65666,"./x-pseudo":14378,"./x-pseudo.js":14378,"./yo":75805,"./yo.js":75805,"./zh-cn":83839,"./zh-cn.js":83839,"./zh-hk":55726,"./zh-hk.js":55726,"./zh-mo":99807,"./zh-mo.js":99807,"./zh-tw":74152,"./zh-tw.js":74152};function i(t){var e=o(t);return n(e)}function o(t){if(!n.o(a,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return a[t]}i.keys=function(){return Object.keys(a)},i.resolve=o,t.exports=i,i.id=46700}},i={};function o(t){var e=i[t];if(void 0!==e)return e.exports;var n=i[t]={id:t,loaded:!1,exports:{}};return a[t].call(n.exports,n,n.exports,o),n.loaded=!0,n.exports}o.m=a,t=[],o.O=(e,n,a,i)=>{if(!n){var r=1/0;for(u=0;u<t.length;u++){for(var[n,a,i]=t[u],s=!0,l=0;l<n.length;l++)(!1&i||r>=i)&&Object.keys(o.O).every((t=>o.O[t](n[l])))?n.splice(l--,1):(s=!1,i<r&&(r=i));if(s){t.splice(u--,1);var c=a();void 0!==c&&(e=c)}}return e}i=i||0;for(var u=t.length;u>0&&t[u-1][2]>i;u--)t[u]=t[u-1];t[u]=[n,a,i]},o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.f={},o.e=t=>Promise.all(Object.keys(o.f).reduce(((e,n)=>(o.f[n](t,e),e)),[])),o.u=t=>"hljs.js",o.miniCssF=t=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),o.hmd=t=>((t=Object.create(t)).children||(t.children=[]),Object.defineProperty(t,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+t.id)}}),t),o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),e={},n="misago:",o.l=(t,a,i,r)=>{if(e[t])e[t].push(a);else{var s,l;if(void 0!==i)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var d=c[u];if(d.getAttribute("src")==t||d.getAttribute("data-webpack")==n+i){s=d;break}}s||(l=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,o.nc&&s.setAttribute("nonce",o.nc),s.setAttribute("data-webpack",n+i),s.src=t),e[t]=[a];var p=(n,a)=>{s.onerror=s.onload=null,clearTimeout(h);var i=e[t];if(delete e[t],s.parentNode&&s.parentNode.removeChild(s),i&&i.forEach((t=>t(a))),n)return n(a)},h=setTimeout(p.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=p.bind(null,s.onerror),s.onload=p.bind(null,s.onload),l&&document.head.appendChild(s)}},o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{var t;o.g.importScripts&&(t=o.g.location+"");var e=o.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var n=e.getElementsByTagName("script");n.length&&(t=n[n.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=t})(),(()=>{var t={174:0};o.f.j=(e,n)=>{var a=o.o(t,e)?t[e]:void 0;if(0!==a)if(a)n.push(a[2]);else{var i=new Promise(((n,i)=>a=t[e]=[n,i]));n.push(a[2]=i);var r=o.p+o.u(e),s=new Error;o.l(r,(n=>{if(o.o(t,e)&&(0!==(a=t[e])&&(t[e]=void 0),a)){var i=n&&("load"===n.type?"missing":n.type),r=n&&n.target&&n.target.src;s.message="Loading chunk "+e+" failed.\n("+i+": "+r+")",s.name="ChunkLoadError",s.type=i,s.request=r,a[1](s)}}),"chunk-"+e,e)}},o.O.j=e=>0===t[e];var e=(e,n)=>{var a,i,[r,s,l]=n,c=0;if(r.some((e=>0!==t[e]))){for(a in s)o.o(s,a)&&(o.m[a]=s[a]);if(l)var u=l(o)}for(e&&e(n);c<r.length;c++)i=r[c],o.o(t,i)&&t[i]&&t[i][0](),t[i]=0;return o.O(u)},n=self.webpackChunkmisago=self.webpackChunkmisago||[];n.forEach(e.bind(null,0)),n.push=e.bind(null,n.push.bind(n))})(),o.O(void 0,[736],(()=>o(34458))),o.O(void 0,[736],(()=>o(58339))),o.O(void 0,[736],(()=>o(64109))),o.O(void 0,[736],(()=>o(46226))),o.O(void 0,[736],(()=>o(93240))),o.O(void 0,[736],(()=>o(75147))),o.O(void 0,[736],(()=>o(4894))),o.O(void 0,[736],(()=>o(29223))),o.O(void 0,[736],(()=>o(73806))),o.O(void 0,[736],(()=>o(27015))),o.O(void 0,[736],(()=>o(88097))),o.O(void 0,[736],(()=>o(46016))),o.O(void 0,[736],(()=>o(32488))),o.O(void 0,[736],(()=>o(11768))),o.O(void 0,[736],(()=>o(61323))),o.O(void 0,[736],(()=>o(64752))),o.O(void 0,[736],(()=>o(40949))),o.O(void 0,[736],(()=>o(78679))),o.O(void 0,[736],(()=>o(61814))),o.O(void 0,[736],(()=>o(95920))),o.O(void 0,[736],(()=>o(44095))),o.O(void 0,[736],(()=>o(63290))),o.O(void 0,[736],(()=>o(77031))),o.O(void 0,[736],(()=>o(97751))),o.O(void 0,[736],(()=>o(76093))),o.O(void 0,[736],(()=>o(87336))),o.O(void 0,[736],(()=>o(47549))),o.O(void 0,[736],(()=>o(22331))),o.O(void 0,[736],(()=>o(21513))),o.O(void 0,[736],(()=>o(98749))),o.O(void 0,[736],(()=>o(98251))),o.O(void 0,[736],(()=>o(6720))),o.O(void 0,[736],(()=>o(66806))),o.O(void 0,[736],(()=>o(10846))),o.O(void 0,[736],(()=>o(18255))),o.O(void 0,[736],(()=>o(14113))),o.O(void 0,[736],(()=>o(24444))),o.O(void 0,[736],(()=>o(1764))),o.O(void 0,[736],(()=>o(68351))),o.O(void 0,[736],(()=>o(81521))),o.O(void 0,[736],(()=>o(68585))),o.O(void 0,[736],(()=>o(41229))),o.O(void 0,[736],(()=>o(43589))),o.O(void 0,[736],(()=>o(62894))),o.O(void 0,[736],(()=>o(33934))),o.O(void 0,[736],(()=>o(85577))),o.O(void 0,[736],(()=>o(83526))),o.O(void 0,[736],(()=>o(43060))),o.O(void 0,[736],(()=>o(92292))),o.O(void 0,[736],(()=>o(33409)));var r=o.O(void 0,[736],(()=>o(31341)));r=o.O(r)})();
+(()=>{var e,t,n,a={60642:(e,t,n)=>{"use strict";n.d(t,{b:()=>v,D:()=>f});var a=n(15861),i=n(15671),o=n(43144),r=n(97326),s=n(79340),l=n(6215),c=n(61120),u=n(4942),d=n(64687),p=n.n(d),h=n(57588),m=n.n(h);var v=function(e){(0,s.Z)(h,e);var t,n,d=(t=h,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function h(e){var t;return(0,i.Z)(this,h),t=d.call(this,e),(0,u.Z)((0,r.Z)(t),"hasCache",(function(e){return t.props.cache&&t.props.cache[e]})),(0,u.Z)((0,r.Z)(t),"getCache",function(){var e=(0,a.Z)(p().mark((function e(n){var a;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t.props.cache[n],t.setState({loading:!1,error:null,data:a}),!t.props.onData){e.next=5;break}return e.next=5,t.props.onData(a);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),(0,u.Z)((0,r.Z)(t),"setCache",(function(e,n){t.props.cache&&(t.props.cache[e]=n)})),(0,u.Z)((0,r.Z)(t),"request",(function(e){t.setState({loading:!0}),fetch(e,{method:"GET",credentials:"include",signal:t.signal}).then(function(){var n=(0,a.Z)(p().mark((function n(a){var i,o;return p().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(e!==t.props.url){n.next=18;break}if(200!=a.status){n.next=12;break}return n.next=4,a.json();case 4:if(i=n.sent,t.setState({loading:!1,error:null,data:i}),t.setCache(e,i),!t.props.onData){n.next=10;break}return n.next=10,t.props.onData(i);case 10:n.next=18;break;case 12:if(o={status:a.status},"application/json"!==a.headers.get("Content-Type")){n.next=17;break}return n.next=16,a.json();case 16:o.data=n.sent;case 17:t.setState({loading:!1,error:o});case 18:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}(),(function(n){e===t.props.url&&t.setState({loading:!1,error:{status:0,rejection:n}})}))})),(0,u.Z)((0,r.Z)(t),"refetch",(function(){t.request(t.props.url)})),(0,u.Z)((0,r.Z)(t),"update",(function(e){t.setState((function(t){return{data:e(t.data)}}))})),t.state={data:null,loading:!1,error:null},t.controller=new AbortController,t.signal=t.controller.signal,t}return(0,o.Z)(h,[{key:"componentDidMount",value:function(){this.props.url&&!this.props.disabled&&this.request(this.props.url)}},{key:"componentDidUpdate",value:function(e){var t=this.props.url,n=t&&t!==e.url,a=this.props.disabled!=e.disabled;(n||a)&&(this.props.disabled?this.controller.abort():this.hasCache(t)?this.getCache(t):(this.controller.abort(),this.controller=new AbortController,this.signal=this.controller.signal,this.request(t)))}},{key:"componentWillUnmount",value:function(){this.controller.abort()}},{key:"render",value:function(){return this.props.children(Object.assign({refetch:this.refetch,update:this.update},this.state))}}]),h}(m().Component);var f=function(e){(0,s.Z)(h,e);var t,n,d=(t=h,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function h(e){var t;return(0,i.Z)(this,h),t=d.call(this,e),(0,u.Z)((0,r.Z)(t),"mutate",(function(e){t.setState({loading:!0}),fetch(t.props.url,{method:t.props.method||"POST",credentials:"include",headers:Z(e),body:g(e)}).then(function(){var n=(0,a.Z)(p().mark((function n(a){var i,o;return p().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(200!=a.status){n.next=10;break}return n.next=3,a.json();case 3:if(i=n.sent,t.setState({loading:!1,data:i}),!e.onSuccess){n.next=8;break}return n.next=8,e.onSuccess(i);case 8:n.next=26;break;case 10:if(204!=a.status){n.next=17;break}if(t.setState({loading:!1}),!e.onSuccess){n.next=15;break}return n.next=15,e.onSuccess();case 15:n.next=26;break;case 17:if(o={status:a.status},"application/json"!==a.headers.get("Content-Type")){n.next=22;break}return n.next=21,a.json();case 21:o.data=n.sent;case 22:if(t.setState({loading:!1,error:o}),!e.onError){n.next=26;break}return n.next=26,e.onError(o);case 26:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}(),function(){var n=(0,a.Z)(p().mark((function n(a){var i;return p().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(i={status:0,rejection:a},t.setState({loading:!1,error:i}),!e.onError){n.next=5;break}return n.next=5,e.onError(i);case 5:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}())})),t.state={data:null,loading:!1,error:null},t}return(0,o.Z)(h,[{key:"render",value:function(){return this.props.children(this.mutate,this.state)}}]),h}(m().Component);function Z(e){return e.json?{"Content-Type":"application/json; charset=utf-8","X-CSRFToken":y()}:{"X-CSRFToken":y()}}function g(e){if(e.json)return JSON.stringify(e.json)}function y(){var e=window.misago_csrf;if(-1!==document.cookie.indexOf(e)){var t=new RegExp(e+"=([^;]*)"),n=document.cookie.match(t)[0];return n?n.split("=")[1]:null}return null}},49021:(e,t,n)=>{"use strict";n.d(t,{Lt:()=>m,YV:()=>Z,kE:()=>g,Aw:()=>y,Xi:()=>b,KE:()=>k,iC:()=>_});var a=n(15671),i=n(43144),o=n(97326),r=n(79340),s=n(6215),l=n(61120),c=n(4942),u=n(94184),d=n.n(u),p=n(57588),h=n.n(p);var m=function(e){(0,r.Z)(p,e);var t,n,u=(t=p,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,s.Z)(this,e)});function p(e){var t;return(0,a.Z)(this,p),t=u.call(this,e),(0,c.Z)((0,o.Z)(t),"handleClick",(function(e){t.state.isOpen&&(!t.root.contains(e.target)||t.menu.contains(e.target)&&e.target.closest("a"))&&t.setState({isOpen:!1})})),(0,c.Z)((0,o.Z)(t),"toggle",(function(){t.setState((function(e){return{isOpen:!e.isOpen}}))})),(0,c.Z)((0,o.Z)(t),"close",(function(){t.setState({isOpen:!1})})),t.state={isOpen:!1},t.root=null,t.dropdown=null,t}return(0,i.Z)(p,[{key:"componentDidMount",value:function(){window.addEventListener("click",this.handleClick)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("click",this.handleClick)}},{key:"componentDidUpdate",value:function(e,t){t.isOpen!==this.state.isOpen&&(this.state.isOpen&&this.props.onOpen&&this.props.onOpen(this.root),!this.state.isOpen&&this.props.onClose&&this.props.onClose(this.root))}},{key:"render",value:function(){var e=this,t=this.state.isOpen;return h().createElement("div",{id:this.props.id,className:d()("dropdown",{open:t},this.props.className),ref:function(t){t&&!e.element&&(e.root=t)}},this.props.toggle({isOpen:t,toggle:this.toggle,aria:v(t)}),h().createElement("div",{className:d()("dropdown-menu",{"dropdown-menu-right":this.props.menuAlignRight},this.props.menuClassName),ref:function(t){t&&!e.menu&&(e.menu=t)},role:"menu"},this.props.children({isOpen:t,close:this.close})))}}]),p}(h().Component);function v(e){return{"aria-haspopup":"true","aria-expanded":e?"true":"false"}}var f=n(22928);function Z(e){var t=e.className;return(0,f.Z)("li",{className:d()("divider",t)})}function g(e){var t=e.children;return e.listItem?(0,f.Z)("li",{className:"dropdown-footer"},void 0,t):(0,f.Z)("div",{className:"dropdown-footer"},void 0,t)}function y(e){var t=e.className,n=e.children;return(0,f.Z)("div",{className:d()("dropdown-header",t)},void 0,n)}function b(e){var t=e.className,n=e.children;return(0,f.Z)("li",{className:d()("dropdown-menu-item",t)},void 0,n)}function k(e){var t=e.className,n=e.children;return(0,f.Z)("div",{className:d()("dropdown-pills",t)},void 0,n)}function _(e){var t=e.className,n=e.children;return(0,f.Z)("li",{className:d()("dropdown-subheader",t)},void 0,n)}},98936:(e,t,n)=>{"use strict";n.d(t,{gq:()=>r,Z6:()=>s,kw:()=>l});var a=n(22928),i=n(94184),o=n.n(i);n(57588);const r=function(e){var t=e.children,n=e.className;return(0,a.Z)("div",{className:o()("flex-row",n)},void 0,t)},s=function(e){var t=e.children,n=e.className,i=e.shrink;return(0,a.Z)("div",{className:o()("flex-row-col",n,{"flex-row-col-shrink":i})},void 0,t)},l=function(e){var t=e.auto,n=e.children,i=e.className;return(0,a.Z)("div",{className:o()("flex-row-section",{"flex-row-section-auto":t},i)},void 0,n)}},66398:(e,t,n)=>{"use strict";n.d(t,{NX:()=>s,PB:()=>c,Zn:()=>u,WI:()=>l,WE:()=>d,j0:()=>p});var a,i=n(22928),o=n(94184),r=n.n(o);function s(e){var t=e.className,n=e.children;return(0,i.Z)("ul",{className:r()("list-group",t)},void 0,n)}function l(e){var t=e.className,n=e.children;return(0,i.Z)("li",{className:r()("list-group-item",t)},void 0,n)}function c(e){var t=e.className,n=e.icon,a=e.message;return(0,i.Z)(l,{className:r()("list-group-empty",t)},void 0,!!n&&(0,i.Z)("div",{className:"list-group-empty-icon"},void 0,(0,i.Z)("span",{className:"material-icon"},void 0,n)),(0,i.Z)("p",{className:"list-group-empty-message"},void 0,a))}function u(e){var t=e.className,n=e.icon,a=e.message,o=e.detail;return(0,i.Z)(l,{className:r()("list-group-error",t)},void 0,!!n&&(0,i.Z)("div",{className:"list-group-error-icon"},void 0,(0,i.Z)("span",{className:"material-icon"},void 0,n)),(0,i.Z)("p",{className:"list-group-error-message"},void 0,a),!!o&&(0,i.Z)("p",{className:"list-group-error-detail"},void 0,o))}function d(e){var t=e.className,n=e.message;return(0,i.Z)(l,{className:r()("list-group-loading",t)},void 0,(0,i.Z)("p",{className:"list-group-loading-message"},void 0,n),a||(a=(0,i.Z)("div",{className:"list-group-loading-progress"},void 0,(0,i.Z)("div",{className:"list-group-loading-progress-bar"}))))}function p(e){var t=e.className,n=e.icon,a=e.message,o=e.detail;return(0,i.Z)(l,{className:r()("list-group-message",t)},void 0,!!n&&(0,i.Z)("div",{className:"list-group-message-icon"},void 0,(0,i.Z)("span",{className:"material-icon"},void 0,n)),(0,i.Z)("p",{className:"list-group-message-message"},void 0,a),!!o&&(0,i.Z)("p",{className:"list-group-message-detail"},void 0,o))}n(57588)},4517:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var a=n(22928),i=(n(57588),n(37424)),o=n(35486),r=n(60642);function s(e,t){var n=misago.get("NOTIFICATIONS_API")+"?limit=30";return n+="&filter="+e,t&&(t.after&&(n+="&after="+t.after),t.before&&(n+="&before="+t.before)),n}const l=(0,i.$j)((function(e){var t=e.auth;return t.user?{unreadNotifications:t.user.unreadNotifications}:{unreadNotifications:null}}))((function(e){var t=e.children,n=e.filter,i=e.query,l=e.dispatch,c=e.unreadNotifications,u=e.disabled;return(0,a.Z)(r.b,{url:s(n,i),disabled:u,onData:function(e){e.unreadNotifications!=c&&l((0,o.yH)({unreadNotifications:e.unreadNotifications}))}},void 0,(function(e){var n=e.data,a=e.loading,i=e.error,o=e.refetch;return t({data:n,loading:a,error:i,refetch:o})}))}))},63026:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});const a=n(4517).Z},66462:(e,t,n)=>{"use strict";n.d(t,{uE:()=>b,lb:()=>k,Pu:()=>_});var a=n(22928),i=(n(57588),n(66398));function o(e){var t=e.filter;return(0,a.Z)(i.PB,{icon:"unread"===t?"sentiment_very_satisfied":"notifications_none",message:r(t)})}function r(e){return"read"===e?pgettext("notifications list","You don't have any read notifications."):"unread"===e?pgettext("notifications list","You don't have any unread notifications."):pgettext("notifications list","You don't have any notifications.")}var s=n(94184),l=n.n(s);function c(e){var t=e.className,n=e.children;return(0,a.Z)("div",{className:l()("notifications-list",t)},void 0,(0,a.Z)(i.NX,{},void 0,n))}var u,d,p,h=n(19605);function m(e){var t=e.notification;return t.actor?(0,a.Z)("a",{href:t.actor.url,className:"notifications-list-item-actor",title:t.actor.username},void 0,(0,a.Z)(h.ZP,{size:30,user:t.actor})):(0,a.Z)("span",{className:"threads-list-item-last-poster",title:t.actor_name||null},void 0,u||(u=(0,a.Z)(h.ZP,{size:30})))}function v(e){var t=e.notification;return(0,a.Z)("a",{href:t.url,className:l()("notification-message",{"notification-message-read":t.isRead,"notification-message-unread":!t.isRead}),dangerouslySetInnerHTML:{__html:t.message}})}function f(e){return e.notification.isRead?(0,a.Z)("div",{className:"notifications-list-item-read-status",title:pgettext("notification status","Read notification")},void 0,d||(d=(0,a.Z)("span",{className:"notification-read-icon"}))):(0,a.Z)("div",{className:"notifications-list-item-read-status",title:pgettext("notification status","Unread notification")},void 0,p||(p=(0,a.Z)("span",{className:"notification-unread-icon"})))}var Z=n(16069);function g(e){var t=e.notification;return(0,a.Z)("div",{className:"notifications-list-item-timestamp"},void 0,(0,a.Z)(Z.Z,{datetime:t.createdAt}))}function y(e){var t=e.notification;return(0,a.Z)(i.WI,{className:l()("notifications-list-item",{"notifications-list-item-read":t.isRead,"notifications-list-item-unread":!t.isRead})},t.id,(0,a.Z)("div",{className:"notifications-list-item-left-col"},void 0,(0,a.Z)("div",{className:"notifications-list-item-col-actor"},void 0,(0,a.Z)(m,{notification:t})),(0,a.Z)("div",{className:"notifications-list-item-col-read-icon"},void 0,(0,a.Z)(f,{notification:t}))),(0,a.Z)("div",{className:"notifications-list-item-right-col"},void 0,(0,a.Z)("div",{className:"notifications-list-item-col-message"},void 0,(0,a.Z)(v,{notification:t})),(0,a.Z)("div",{className:"notifications-list-item-col-timestamp"},void 0,(0,a.Z)(g,{notification:t}))))}function b(e){var t=e.filter,n=e.items;return(0,a.Z)(c,{className:n.length>0?"notifications-list-ready":"notifications-list-pending"},void 0,0===n.length&&(0,a.Z)(o,{filter:t}),n.map((function(e){return(0,a.Z)(y,{notification:e},e.id)})))}function k(e){var t,n=0===(t=e.error).status?gettext("Check your internet connection and try refreshing the site."):t.data&&t.data.detail?t.data.detail:void 0;return(0,a.Z)(c,{className:"notifications-list-pending"},void 0,(0,a.Z)(i.Zn,{icon:"notifications_off",message:pgettext("notifications list","Notifications could not be loaded."),detail:n}))}function _(){return(0,a.Z)(c,{className:"notifications-list-pending"},void 0,(0,a.Z)(i.WE,{message:pgettext("notifications list","Loading notifications...")}))}},64836:(e,t,n)=>{"use strict";n.d(t,{a:()=>y,i:()=>k});var a=n(22928),i=n(15671),o=n(43144),r=n(97326),s=n(79340),l=n(6215),c=n(61120),u=n(4942),d=n(94184),p=n.n(d),h=n(57588),m=n.n(h),v=n(37424),f=n(993);var Z="has-overlay",g=function(e){(0,s.Z)(h,e);var t,n,d=(t=h,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function h(e){var t;return(0,i.Z)(this,h),t=d.call(this,e),(0,u.Z)((0,r.Z)(t),"closeOnNavigation",(function(e){e.target.closest("a")&&t.props.dispatch((0,f.xv)())})),t.scrollOrigin=null,t}return(0,o.Z)(h,[{key:"componentDidUpdate",value:function(e){e.open!==this.props.open&&(this.props.open?(this.scrollOrigin=window.pageYOffset,document.body.classList.add(Z),this.props.onOpen&&this.props.onOpen()):(document.body.classList.remove(Z),window.scrollTo(0,this.scrollOrigin),this.scrollOrigin=null))}},{key:"render",value:function(){return(0,a.Z)("div",{className:p()("overlay",this.props.className,{"overlay-open":this.props.open}),onClick:this.closeOnNavigation},void 0,this.props.children)}}]),h}(m().Component);const y=(0,v.$j)()(g);var b;const k=(0,v.$j)()((function(e){var t=e.children,n=e.dispatch;return(0,a.Z)("div",{className:"overlay-header"},void 0,(0,a.Z)("div",{className:"overlay-header-caption"},void 0,t),(0,a.Z)("button",{className:"btn btn-overlay-close",title:pgettext("modal","Close"),type:"button",onClick:function(){return n((0,f.xv)())}},void 0,b||(b=(0,a.Z)("span",{className:"material-icon"},void 0,"close"))))}))},59131:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var a=n(22928);n(57588);const i=function(e){var t=e.children;return(0,a.Z)("div",{className:"container page-container"},void 0,t)}},99755:(e,t,n)=>{"use strict";n.d(t,{mr:()=>s,gC:()=>l,sP:()=>c,eA:()=>u,Iv:()=>d});var a,i=n(22928),o=n(94184),r=n.n(o);n(57588);const s=function(e){var t=e.children,n=e.className,o=e.styleName;return(0,i.Z)("div",{className:r()("page-header",n,o&&"page-header-"+o)},void 0,(0,i.Z)("div",{className:"page-header-bg-image"},void 0,(0,i.Z)("div",{className:"page-header-bg-overlay"},void 0,a||(a=(0,i.Z)("div",{className:"page-header-image"})),t)))},l=function(e){var t=e.children,n=e.className,a=e.styleName;return(0,i.Z)("div",{className:r()("page-header-banner",n,a&&"page-header-banner-"+a)},void 0,(0,i.Z)("div",{className:"page-header-banner-bg-image"},void 0,(0,i.Z)("div",{className:"page-header-banner-bg-overlay"},void 0,t)))},c=function(e){var t=e.children;return(0,i.Z)("div",{className:"container page-header-container"},void 0,t)},u=function(e){var t=e.children,n=e.className;return(0,i.Z)("div",{className:r()("page-header-details",n)},void 0,t)},d=function(e){var t=e.styleName,n=e.header,a=e.message;return(0,i.Z)(c,{},void 0,(0,i.Z)(s,{styleName:t},void 0,(0,i.Z)(l,{styleName:t},void 0,(0,i.Z)("h1",{},void 0,n)),a&&(0,i.Z)(u,{styleName:t},void 0,a)))}},40689:(e,t,n)=>{"use strict";n.d(t,{Z:()=>H});var a=n(22928),i=n(15671),o=n(43144),r=n(97326),s=n(79340),l=n(6215),c=n(61120),u=n(4942),d=n(94184),p=n.n(d),h=n(57588),m=n.n(h),v=n(78657),f=n(93825),Z=n(59801),g=n(53904),y=n(37848),b=n(87462),k=n(82211),_=n(43345),x=n(96359),N=n(59940);var w,C,R,E=["progress-bar-danger","progress-bar-warning","progress-bar-warning","progress-bar-primary","progress-bar-success"],S=[pgettext("password strength indicator","Entered password is very weak."),pgettext("password strength indicator","Entered password is weak."),pgettext("password strength indicator","Entered password is average."),pgettext("password strength indicator","Entered password is strong."),pgettext("password strength indicator","Entered password is very strong.")],L=function(e){(0,s.Z)(u,e);var t,n,r=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function u(e){var t;return(0,i.Z)(this,u),(t=r.call(this,e))._score=0,t._password=null,t._inputs=[],t.state={loaded:!1},t}return(0,o.Z)(u,[{key:"componentDidMount",value:function(){var e=this;N.Z.load().then((function(){e.setState({loaded:!0})}))}},{key:"getScore",value:function(e,t){var n=this,a=!1;return e!==this._password&&(a=!0),t.length!==this._inputs.length?a=!0:t.map((function(e,t){e.trim()!==n._inputs[t]&&(a=!0)})),a&&(this._score=N.Z.scorePassword(e,t),this._password=e,this._inputs=t.map((function(e){return e.trim()}))),this._score}},{key:"render",value:function(){if(!this.state.loaded)return null;var e=this.getScore(this.props.password,this.props.inputs);return(0,a.Z)("div",{className:"help-block password-strength"},void 0,(0,a.Z)("div",{className:"progress"},void 0,(0,a.Z)("div",{className:"progress-bar "+E[e],style:{width:20+20*e+"%"},role:"progress-bar","aria-valuenow":e,"aria-valuemin":"0","aria-valuemax":"4"},void 0,(0,a.Z)("span",{className:"sr-only"},void 0,S[e]))),(0,a.Z)("p",{className:"text-small"},void 0,S[e]))}}]),u}(m().Component),O=n(26106),P=n(47235),A=n(34458),T=n(98274),I=n(93051),B=n(55210);function j(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function D(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?j(Object(n),!0).forEach((function(t){(0,u.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function U(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=(0,c.Z)(e);if(t){var i=(0,c.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,l.Z)(this,n)}}var z,q=function(e){(0,s.Z)(n,e);var t=U(n);function n(e){var a;(0,i.Z)(this,n),a=t.call(this,e),(0,u.Z)((0,r.Z)(a),"handlePrivacyPolicyChange",(function(e){var t=e.target.value;a.handleToggleAgreement("privacyPolicy",t)})),(0,u.Z)((0,r.Z)(a),"handleTermsOfServiceChange",(function(e){var t=e.target.value;a.handleToggleAgreement("termsOfService",t)})),(0,u.Z)((0,r.Z)(a),"handleToggleAgreement",(function(e,t){a.setState((function(n,i){if(null===n[e]){var o=D(D({},n.errors),{},(0,u.Z)({},e,null));return(0,u.Z)({errors:o},e,t)}var r=a.state.validators[e][0],s=D(D({},n.errors),{},(0,u.Z)({},e,[r(null)]));return(0,u.Z)({errors:s},e,null)}))}));var o=a.props.criteria,s=o.username,l=o.password,c=0;l.forEach((function(e){"MinimumLengthValidator"===e.name&&(c=e.min_length)}));var d={username:[B.lG(),B.HR(s.min_length),B.gS(s.max_length)],email:[B.Do()],password:[B.Vb(c)],captcha:f.ZP.validator()};return A.Z.get("TERMS_OF_SERVICE_ID")&&(d.termsOfService=[B.fT()]),A.Z.get("PRIVACY_POLICY_ID")&&(d.privacyPolicy=[B.jA()]),a.state={isLoading:!1,username:"",email:"",password:"",captcha:"",termsOfService:null,privacyPolicy:null,validators:d,errors:{}},a}return(0,o.Z)(n,[{key:"clean",value:function(){return!!this.isValid()||(g.Z.error(gettext("Form contains errors.")),this.setState({errors:this.validate()}),!1)}},{key:"send",value:function(){return v.Z.post(A.Z.get("USERS_API"),{username:this.state.username,email:this.state.email,password:this.state.password,captcha:this.state.captcha,terms_of_service:this.state.termsOfService,privacy_policy:this.state.privacyPolicy})}},{key:"handleSuccess",value:function(e){this.props.callback(e)}},{key:"handleError",value:function(e){400===e.status?(this.setState({errors:Object.assign({},this.state.errors,e)}),e.__all__&&e.__all__.length>0?g.Z.error(e.__all__[0]):g.Z.error(gettext("Form contains errors."))):403===e.status&&e.ban?((0,I.Z)(e.ban),Z.Z.hide()):g.Z.apiError(e)}},{key:"render",value:function(){return(0,a.Z)("div",{className:"modal-dialog modal-register",role:"document"},void 0,(0,a.Z)("div",{className:"modal-content"},void 0,(0,a.Z)("div",{className:"modal-header"},void 0,(0,a.Z)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":pgettext("modal","Close")},void 0,w||(w=(0,a.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,a.Z)("h4",{className:"modal-title"},void 0,pgettext("register modal title","Register"))),(0,a.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,a.Z)("input",{type:"type",style:{display:"none"}}),(0,a.Z)("input",{type:"password",style:{display:"none"}}),(0,a.Z)("div",{className:"modal-body"},void 0,(0,a.Z)(P.Z,{buttonClassName:"col-xs-12 col-sm-6",buttonLabel:pgettext("register modal field","Join with %(site)s"),formLabel:pgettext("register modal field","Or create forum account:")}),(0,a.Z)(x.Z,{label:pgettext("register modal field","Username"),for:"id_username",validation:this.state.errors.username},void 0,(0,a.Z)("input",{type:"text",id:"id_username",className:"form-control","aria-describedby":"id_username_status",disabled:this.state.isLoading,onChange:this.bindInput("username"),value:this.state.username})),(0,a.Z)(x.Z,{label:pgettext("register modal field","E-mail"),for:"id_email",validation:this.state.errors.email},void 0,(0,a.Z)("input",{type:"text",id:"id_email",className:"form-control","aria-describedby":"id_email_status",disabled:this.state.isLoading,onChange:this.bindInput("email"),value:this.state.email})),(0,a.Z)(x.Z,{label:pgettext("register modal field","Password"),for:"id_password",validation:this.state.errors.password,extra:(0,a.Z)(L,{password:this.state.password,inputs:[this.state.username,this.state.email]})},void 0,(0,a.Z)("input",{type:"password",id:"id_password",className:"form-control","aria-describedby":"id_password_status",disabled:this.state.isLoading,onChange:this.bindInput("password"),value:this.state.password})),f.ZP.component({form:this}),(0,a.Z)(O.Z,{errors:this.state.errors,privacyPolicy:this.state.privacyPolicy,termsOfService:this.state.termsOfService,onPrivacyPolicyChange:this.handlePrivacyPolicyChange,onTermsOfServiceChange:this.handleTermsOfServiceChange})),(0,a.Z)("div",{className:"modal-footer"},void 0,(0,a.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,pgettext("register modal btn","Cancel")),(0,a.Z)(k.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,pgettext("register modal btn","Register account"))))))}}]),n}(_.Z),M=function(e){(0,s.Z)(n,e);var t=U(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,o.Z)(n,[{key:"getLead",value:function(){return"user"===this.props.activation?pgettext("account activation required","%(username)s, your account has been created but you need to activate it before you will be able to sign in."):"admin"===this.props.activation?pgettext("account activation required","%(username)s, your account has been created but the site administrator will have to activate it before you will be able to sign in."):void 0}},{key:"getSubscript",value:function(){return"user"===this.props.activation?pgettext("account activation required","We have sent an e-mail to %(email)s with link that you have to click to activate your account."):"admin"===this.props.activation?pgettext("account activation required","We will send an e-mail to %(email)s when this takes place."):void 0}},{key:"render",value:function(){return(0,a.Z)("div",{className:"modal-dialog modal-message modal-register",role:"document"},void 0,(0,a.Z)("div",{className:"modal-content"},void 0,(0,a.Z)("div",{className:"modal-header"},void 0,(0,a.Z)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":pgettext("modal","Close")},void 0,C||(C=(0,a.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,a.Z)("h4",{className:"modal-title"},void 0,pgettext("register modal title","Registration complete"))),(0,a.Z)("div",{className:"modal-body"},void 0,R||(R=(0,a.Z)("div",{className:"message-icon"},void 0,(0,a.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,a.Z)("div",{className:"message-body"},void 0,(0,a.Z)("p",{className:"lead"},void 0,interpolate(this.getLead(),{username:this.props.username},!0)),(0,a.Z)("p",{},void 0,interpolate(this.getSubscript(),{email:this.props.email},!0)),(0,a.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,pgettext("register modal dismiss","Ok"))))))}}]),n}(m().Component),F=function(e){(0,s.Z)(n,e);var t=U(n);function n(e){var a;return(0,i.Z)(this,n),a=t.call(this,e),(0,u.Z)((0,r.Z)(a),"completeRegistration",(function(e){"active"===e.activation?(Z.Z.hide(),T.Z.signIn(e)):a.setState({complete:e})})),a.state={complete:!1},a}return(0,o.Z)(n,[{key:"render",value:function(){return this.state.complete?(0,a.Z)(M,{activation:this.state.complete.activation,email:this.state.complete.email,username:this.state.complete.username}):m().createElement(q,(0,b.Z)({callback:this.completeRegistration},this.props))}}]),n}(m().Component);const H=function(e){(0,s.Z)(h,e);var t,n,d=(t=h,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function h(e){var t;return(0,i.Z)(this,h),t=d.call(this,e),(0,u.Z)((0,r.Z)(t),"showRegisterForm",(function(){t.props.onClick&&t.props.onClick(),"closed"===misago.get("SETTINGS").account_activation?g.Z.info(pgettext("register form","Registration form is currently disabled by the site administrator.")):t.state.isLoaded?Z.Z.show((0,a.Z)(F,{criteria:t.state.criteria})):(t.setState({isLoading:!0}),Promise.all([f.ZP.load(),v.Z.get(misago.get("AUTH_CRITERIA_API"))]).then((function(e){t.setState({isLoading:!1,isLoaded:!0,criteria:e[1]}),Z.Z.show((0,a.Z)(F,{criteria:e[1]}))}),(function(){t.setState({isLoading:!1}),g.Z.error(pgettext("register form","Registration form is currently unavailable due to an error."))})))})),t.state={isLoading:!1,isLoaded:!1,criteria:null},t}return(0,o.Z)(h,[{key:"render",value:function(){return(0,a.Z)("button",{className:p()("btn btn-register",this.props.className,{"btn-block":this.props.block,"btn-loading":this.state.isLoading}),disabled:this.state.isLoading,onClick:this.showRegisterForm,type:"button"},void 0,pgettext("cta","Register"),this.state.isLoading?z||(z=(0,a.Z)(y.Z,{})):null)}}]),h}(m().Component)},26106:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var a=n(22928),i=(n(57588),n(34458)),o=n(89627),r=function(e){var t=e.agreement,n=e.checked,i=e.errors,r=e.url,s=e.value,l=e.onChange;if(!r)return null;var c=interpolate('<a href="%(url)s" target="_blank">%(agreement)s</a>',{agreement:(0,o.Z)(t),url:(0,o.Z)(r)},!0),u=interpolate(pgettext("register form agreement prompt","I have read and accept %(agreement)s."),{agreement:c},!0);return(0,a.Z)("div",{className:"checkbox legal-footnote"},void 0,(0,a.Z)("label",{},void 0,(0,a.Z)("input",{checked:n,type:"checkbox",value:s,onChange:l}),(0,a.Z)("span",{dangerouslySetInnerHTML:{__html:u}})),i&&i.map((function(e,t){return(0,a.Z)("div",{className:"help-block errors"},t,e)})))};const s=function(e){var t=e.errors,n=e.privacyPolicy,o=e.termsOfService,s=e.onPrivacyPolicyChange,l=e.onTermsOfServiceChange,c=i.Z.get("TERMS_OF_SERVICE_ID"),u=i.Z.get("TERMS_OF_SERVICE_URL"),d=i.Z.get("PRIVACY_POLICY_ID"),p=i.Z.get("PRIVACY_POLICY_URL");return c||d?(0,a.Z)("div",{},void 0,(0,a.Z)(r,{agreement:pgettext("register form agreement prompt","the terms of service"),checked:null!==o,errors:t.termsOfService,url:u,value:c,onChange:l}),(0,a.Z)(r,{agreement:pgettext("register form agreement prompt","the privacy policy"),checked:null!==n,errors:t.privacyPolicy,url:p,value:d,onChange:s})):null}},80261:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var a,i=n(22928),o=n(94184),r=n.n(o),s=(n(57588),n(59801)),l=n(14467);const c=function(e){var t=e.block,n=e.className,o=e.onClick,c=misago.get("SETTINGS");return c.DELEGATE_AUTH?(0,i.Z)("a",{className:r()("btn btn-sign-in",n,{"btn-block":t}),href:c.LOGIN_URL,onClick:function(){o&&o()}},void 0,pgettext("cta","Sign in")):(0,i.Z)("a",{className:r()("btn btn-sign-in",n,{"btn-block":t}),href:c.LOGIN_URL,onClick:function(e){e.preventDefault(),o&&o(),s.Z.show(a||(a=(0,i.Z)(l.Z,{})))}},void 0,pgettext("cta","Sign in"))}},6333:(e,t,n)=>{"use strict";n.d(t,{bS:()=>v,Or:()=>g});var a,i,o,r=n(22928),s=n(94184),l=n.n(s),c=(n(57588),n(37424)),u=n(49021),d=n(40689),p=n(80261),h=(0,c.$j)((function(e){return{isAnonymous:!e.auth.user.id}}))((function(e){var t=e.isAnonymous,n=e.close,s=e.dropdown,c=e.overlay,h=misago.get("MISAGO_PATH"),m=misago.get("SETTINGS"),v=misago.get("main_menu"),f=misago.get("extraMenuItems"),Z=misago.get("extraFooterItems"),g=misago.get("categories_menu"),y=misago.get("usersLists"),b=m.enable_oauth2_client,k=[];v.forEach((function(e){k.push({title:e.label,url:e.url})})),k.push({title:pgettext("site nav","Search"),url:h+"search/"});var _=[],x=misago.get("TERMS_OF_SERVICE_TITLE"),N=misago.get("TERMS_OF_SERVICE_URL");x&&N&&_.push({title:x,url:N});var w=misago.get("PRIVACY_POLICY_TITLE"),C=misago.get("PRIVACY_POLICY_URL");return w&&C&&_.push({title:w,url:C}),(0,r.Z)("ul",{className:l()("site-nav-menu",{"dropdown-menu-list":s,"overlay-menu-list":c})},void 0,t&&(0,r.Z)(u.Aw,{className:"site-nav-sign-in-message"},void 0,pgettext("cta","You are not signed in")),t&&(0,r.Z)(u.KE,{className:"site-nav-sign-in-options"},void 0,(0,r.Z)(p.Z,{onClick:n}),!b&&(0,r.Z)(d.Z,{onClick:n})),(0,r.Z)(u.iC,{},void 0,m.forum_name),k.map((function(e){return(0,r.Z)(u.Xi,{},e.url,(0,r.Z)("a",{href:e.url},void 0,e.title))})),f.map((function(e,t){return(0,r.Z)(u.Xi,{className:e.className},t,(0,r.Z)("a",{href:e.url,target:e.targetBlank?"_blank":null,rel:e.rel},void 0,e.title))})),!!y.length&&(a||(a=(0,r.Z)(u.YV,{className:"site-nav-users-divider"}))),!!y.length&&(0,r.Z)(u.iC,{className:"site-nav-users"},void 0,pgettext("site nav section","Users")),y.map((function(e){return(0,r.Z)(u.Xi,{},e.url,(0,r.Z)("a",{href:e.url},void 0,e.name))})),i||(i=(0,r.Z)(u.YV,{className:"site-nav-categories-divider"})),(0,r.Z)(u.iC,{className:"site-nav-categories"},void 0,pgettext("site nav section","Categories")),g.map((function(e){return e.is_vanilla?(0,r.Z)(u.Xi,{className:"site-nav-category-header"},e.id,(0,r.Z)("a",{href:e.url},void 0,e.name)):(0,r.Z)(u.Xi,{className:l()("site-nav-category",{"site-nav-category-last":e.last})},e.id,(0,r.Z)("a",{href:e.url},void 0,(0,r.Z)("span",{},void 0,e.name),(0,r.Z)("span",{className:l()("threads-list-item-category threads-list-category-label",{"threads-list-category-label-color":!!e.color}),style:{"--label-color":e.color}},void 0,e.short_name||e.name)))})),(!!_.length||!!Z.length)&&(o||(o=(0,r.Z)(u.YV,{className:"site-nav-footer-divider"}))),(!!_.length||!!Z.length)&&(0,r.Z)(u.iC,{className:"site-nav-footer"},void 0,pgettext("site nav section","Footer")),Z.map((function(e,t){return(0,r.Z)(u.Xi,{className:e.className},t,(0,r.Z)("a",{href:e.url,target:e.targetBlank?"_blank":null,rel:e.rel},void 0,e.title))})),_.map((function(e){return(0,r.Z)(u.Xi,{},e.url,(0,r.Z)("a",{href:e.url},void 0,e.title))})))}));const m=h;function v(e){var t=e.close;return(0,r.Z)(m,{close:t,dropdown:!0})}var f=n(993),Z=n(64836);const g=(0,c.$j)((function(e){return{isOpen:e.overlay.siteNav}}))((function(e){var t=e.dispatch,n=e.isOpen;return(0,r.Z)(Z.a,{open:n},void 0,(0,r.Z)(Z.i,{},void 0,pgettext("site nav title","Menu")),(0,r.Z)(m,{close:function(){return t((0,f.xv)())},overlay:!0}))}))},47235:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var a,i=n(22928),o=(n(57588),n(34458)),r=function(e){var t=e.className,n=e.text;return n?(0,i.Z)("h5",{className:t||""},void 0,n):null};const s=function(e){var t=e.buttonClassName,n=e.buttonLabel,s=e.formLabel,l=e.header,c=e.labelClassName,u=o.Z.get("SOCIAL_AUTH");return 0===u.length?null:(0,i.Z)("div",{className:"form-group form-social-auth"},void 0,(0,i.Z)(r,{className:c,text:l}),(0,i.Z)("div",{className:"row"},void 0,u.map((function(e){var a=e.pk,o=e.name,r=e.button_text,s=e.button_color,l=e.url,c="btn btn-block btn-default btn-social-"+a,u=s?{color:s}:null,d=r||interpolate(n,{site:o},!0);return(0,i.Z)("div",{className:t||"col-xs-12"},a,(0,i.Z)("a",{className:c,style:u,href:l},void 0,d))}))),a||(a=(0,i.Z)("hr",{})),(0,i.Z)(r,{className:c,text:s}))}},16069:(e,t,n)=>{"use strict";n.d(t,{Z:()=>v});var a=n(22928),i=n(15671),o=n(43144),r=n(97326),s=n(79340),l=n(6215),c=n(61120),u=n(4942),d=n(57588),p=n.n(d),h=n(75557);function m(e){return{tick:e.tick+1}}const v=function(e){(0,s.Z)(p,e);var t,n,d=(t=p,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function p(e){var t;return(0,i.Z)(this,p),t=d.call(this,e),(0,u.Z)((0,r.Z)(t),"scheduleNextUpdate",(function(){var e=new Date,n=Math.ceil(Math.abs(Math.round((t.date-e)/1e3)));n<3600?t.timeout=window.setTimeout((function(){t.setState(m),t.scheduleNextUpdate()}),5e4):n<86400&&(t.timeout=window.setTimeout((function(){t.setState(m)}),24e5))})),t.state={tick:0},t.date=new Date(e.datetime),t.timeout=null,t}return(0,o.Z)(p,[{key:"componentDidMount",value:function(){this.scheduleNextUpdate()}},{key:"componentWillUnmount",value:function(){this.timeout&&window.clearTimeout(this.timeout)}},{key:"render",value:function(){var e=this.props.narrow?(0,h.xn)(this.date):(0,h.SW)(this.date);return(0,a.Z)("attr",{title:this.props.title?this.props.title.replace("%(timestamp)s",h.ry.format(this.date)):h.ry.format(this.date)},void 0,e)}}]),p}(p().Component)},92490:(e,t,n)=>{"use strict";n.d(t,{o8:()=>r,Eg:()=>s,Z2:()=>l,tw:()=>c});var a=n(22928),i=n(94184),o=n.n(i);n(57588);const r=function(e){var t=e.children,n=e.className;return(0,a.Z)("nav",{className:o()("toolbar",n)},void 0,t)},s=function(e){var t=e.children,n=e.className,i=e.shrink;return(0,a.Z)("div",{className:o()("toolbar-item",n,{"toolbar-item-shrink":i})},void 0,t)},l=function(e){var t=e.auto,n=e.children,i=e.className;return(0,a.Z)("div",{className:o()("toolbar-section",{"toolbar-section-auto":t},i)},void 0,n)},c=function(e){var t=e.className;return(0,a.Z)("div",{className:o()("toolbar-spacer",t)})}},28166:(e,t,n)=>{"use strict";n.d(t,{o4:()=>ie,Qm:()=>se});var a,i=n(42982),o=n(22928),r=n(15671),s=n(43144),l=n(97326),c=n(79340),u=n(6215),d=n(61120),p=n(4942),h=n(94184),m=n.n(h),v=n(57588),f=n.n(v),Z=n(37424),g=n(59801),y=n(19605),b=n(82211),k=n(37848),_=n(78657),x=n(53904);var N,w=function(e){(0,c.Z)(h,e);var t,n,i=(t=h,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function h(e){var t;return(0,r.Z)(this,h),t=i.call(this,e),(0,p.Z)((0,l.Z)(t),"setGravatar",(function(){t.callApi("gravatar")})),(0,p.Z)((0,l.Z)(t),"setGenerated",(function(){t.callApi("generated")})),t.state={isLoading:!1},t}return(0,s.Z)(h,[{key:"callApi",value:function(e){var t=this;if(this.state.isLoading)return!1;this.setState({isLoading:!0}),_.Z.post(this.props.user.api.avatar,{avatar:e}).then((function(e){t.setState({isLoading:!1}),x.Z.success(e.detail),t.props.onComplete(e)}),(function(e){400===e.status?(x.Z.error(e.detail),t.setState({isLoading:!1})):t.props.showError(e)}))}},{key:"getGravatarButton",value:function(){return this.props.options.gravatar?(0,o.Z)(b.Z,{onClick:this.setGravatar,disabled:this.state.isLoading,className:"btn-default btn-block btn-avatar-gravatar"},void 0,pgettext("avatar modal btn","Download my Gravatar")):null}},{key:"getCropButton",value:function(){return this.props.options.crop_src?(0,o.Z)(b.Z,{className:"btn-default btn-block btn-avatar-crop",disabled:this.state.isLoading,onClick:this.props.showCrop},void 0,pgettext("avatar modal btn","Re-crop uploaded image")):null}},{key:"getUploadButton",value:function(){return this.props.options.upload?(0,o.Z)(b.Z,{className:"btn-default btn-block btn-avatar-upload",disabled:this.state.isLoading,onClick:this.props.showUpload},void 0,pgettext("avatar modal btn","Upload new image")):null}},{key:"getGalleryButton",value:function(){return this.props.options.galleries?(0,o.Z)(b.Z,{className:"btn-default btn-block btn-avatar-gallery",disabled:this.state.isLoading,onClick:this.props.showGallery},void 0,pgettext("avatar modal btn","Pick avatar from gallery")):null}},{key:"getAvatarPreview",value:function(){var e={id:this.props.user.id,avatars:this.props.options.avatars};return this.state.isLoading?(0,o.Z)("div",{className:"avatar-preview preview-loading"},void 0,(0,o.Z)(y.ZP,{size:"200",user:e}),a||(a=(0,o.Z)(k.Z,{}))):(0,o.Z)("div",{className:"avatar-preview"},void 0,(0,o.Z)(y.ZP,{size:"200",user:e}))}},{key:"render",value:function(){return(0,o.Z)("div",{className:"modal-body modal-avatar-index"},void 0,(0,o.Z)("div",{className:"row"},void 0,(0,o.Z)("div",{className:"col-md-5"},void 0,this.getAvatarPreview()),(0,o.Z)("div",{className:"col-md-7"},void 0,this.getGravatarButton(),(0,o.Z)(b.Z,{onClick:this.setGenerated,disabled:this.state.isLoading,className:"btn-default btn-block btn-avatar-generate"},void 0,pgettext("avatar modal btn","Generate my individual avatar")),this.getCropButton(),this.getUploadButton(),this.getGalleryButton())))}}]),h}(f().Component),C=n(19755);var R,E=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,p.Z)((0,l.Z)(t),"cropAvatar",(function(){if(t.state.isLoading)return!1;t.setState({isLoading:!0});var e=t.props.upload?"crop_tmp":"crop_src",n=C(".crop-form"),a=n.cropit("exportZoom"),i=n.cropit("offset");_.Z.post(t.props.user.api.avatar,{avatar:e,crop:{offset:{x:i.x*a,y:i.y*a},zoom:n.cropit("zoom")*a}}).then((function(e){t.props.onComplete(e),x.Z.success(e.detail)}),(function(e){400===e.status?(x.Z.error(e.detail),t.setState({isLoading:!1})):t.props.showError(e)}))})),t.state={isLoading:!1,deviceRatio:1},t}return(0,s.Z)(i,[{key:"getAvatarSize",value:function(){return this.props.upload?this.props.options.crop_tmp.size:this.props.options.crop_src.size}},{key:"getImagePath",value:function(){return this.props.upload?this.props.dataUrl:this.props.options.crop_src.url}},{key:"componentDidMount",value:function(){for(var e=this,t=C(".crop-form"),n=this.getAvatarSize(),a=t.width();a<n;)n/=2;var i=this.getAvatarSize()/n;t.width(n),t.cropit({width:n,height:n,exportZoom:i,imageState:{src:this.getImagePath()},onImageLoaded:function(){if(e.props.upload){var n=t.cropit("zoom"),a=t.cropit("imageSize");if(a.width>a.height){var i=(a.width*n-e.getAvatarSize())/-2;t.cropit("offset",{x:i,y:0})}else if(a.width<a.height){var o=(a.height*n-e.getAvatarSize())/-2;t.cropit("offset",{x:0,y:o})}else t.cropit("offset",{x:0,y:0})}else{var r=e.props.options.crop_src.crop;r&&(t.cropit("zoom",r.zoom),t.cropit("offset",{x:r.x,y:r.y}))}}})}},{key:"componentWillUnmount",value:function(){C(".crop-form").cropit("disable")}},{key:"render",value:function(){return(0,o.Z)("div",{},void 0,N||(N=(0,o.Z)("div",{className:"modal-body modal-avatar-crop"},void 0,(0,o.Z)("div",{className:"crop-form"},void 0,(0,o.Z)("div",{className:"cropit-preview"}),(0,o.Z)("input",{type:"range",className:"cropit-image-zoom-input"})))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("div",{className:"col-md-6 col-md-offset-3"},void 0,(0,o.Z)(b.Z,{onClick:this.cropAvatar,loading:this.state.isLoading,className:"btn-primary btn-block"},void 0,this.props.upload?pgettext("avatar crop modal btn","Set avatar"):pgettext("avatar crop modal btn","Crop image")),(0,o.Z)(b.Z,{onClick:this.props.showIndex,disabled:this.state.isLoading,className:"btn-default btn-block"},void 0,pgettext("avatar crop modal btn","Cancel")))))}}]),i}(f().Component),S=n(48772);var L,O=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,p.Z)((0,l.Z)(t),"pickFile",(function(){document.getElementById("avatar-hidden-upload").click()})),(0,p.Z)((0,l.Z)(t),"uploadFile",(function(){var e=document.getElementById("avatar-hidden-upload").files[0];if(e){var n=t.validateFile(e);if(n)x.Z.error(n);else{t.setState({image:e,preview:URL.createObjectURL(e),progress:0});var a=new FormData;a.append("avatar","upload"),a.append("image",e),_.Z.upload(t.props.user.api.avatar,a,(function(e){t.setState({progress:e})})).then((function(e){t.setState({options:e,uploaded:e.detail}),x.Z.info(pgettext("avatar upload modal","Your image has been uploaded and you may now crop it."))}),(function(e){400===e.status||413===e.status?(x.Z.error(e.detail),t.setState({isLoading:!1,image:null,progress:0})):t.props.showError(e)}))}}})),t.state={image:null,preview:null,progress:0,uploaded:null,dataUrl:null},t}return(0,s.Z)(i,[{key:"validateFile",value:function(e){if(e.size>this.props.options.upload.limit)return interpolate(pgettext("avatar upload modal","Selected file is too big. (%(filesize)s)"),{filesize:(0,S.Z)(e.size)},!0);var t=pgettext("avatar upload modal","Selected file type is not supported.");if(-1===this.props.options.upload.allowed_mime_types.indexOf(e.type))return t;var n=!1,a=e.name.toLowerCase();return this.props.options.upload.allowed_extensions.map((function(e){a.substr(-1*e.length)===e&&(n=!0)})),!n&&t}},{key:"getUploadRequirements",value:function(e){var t=e.allowed_extensions.map((function(e){return e.substr(1)}));return interpolate(pgettext("avatar upload modal","%(files)s files smaller than %(limit)s"),{files:t.join(", "),limit:(0,S.Z)(e.limit)},!0)}},{key:"getUploadButton",value:function(){return(0,o.Z)("div",{className:"modal-body modal-avatar-upload"},void 0,(0,o.Z)(b.Z,{className:"btn-pick-file",onClick:this.pickFile},void 0,R||(R=(0,o.Z)("div",{className:"material-icon"},void 0,"input")),pgettext("avatar upload modal field","Select file")),(0,o.Z)("p",{className:"text-muted"},void 0,this.getUploadRequirements(this.props.options.upload)))}},{key:"getUploadProgressLabel",value:function(){return interpolate(pgettext("avatar upload modal field","%(progress)s % complete"),{progress:this.state.progress},!0)}},{key:"getUploadProgress",value:function(){return(0,o.Z)("div",{className:"modal-body modal-avatar-upload"},void 0,(0,o.Z)("div",{className:"upload-progress"},void 0,(0,o.Z)("img",{src:this.state.preview}),(0,o.Z)("div",{className:"progress"},void 0,(0,o.Z)("div",{className:"progress-bar",role:"progressbar","aria-valuenow":"{this.state.progress}","aria-valuemin":"0","aria-valuemax":"100",style:{width:this.state.progress+"%"}},void 0,(0,o.Z)("span",{className:"sr-only"},void 0,this.getUploadProgressLabel())))))}},{key:"renderUpload",value:function(){return(0,o.Z)("div",{},void 0,(0,o.Z)("input",{type:"file",id:"avatar-hidden-upload",className:"hidden-file-upload",onChange:this.uploadFile}),this.state.image?this.getUploadProgress():this.getUploadButton(),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("div",{className:"col-md-6 col-md-offset-3"},void 0,(0,o.Z)(b.Z,{onClick:this.props.showIndex,disabled:!!this.state.image,className:"btn-default btn-block"},void 0,pgettext("avatar upload modal btn","Cancel")))))}},{key:"renderCrop",value:function(){return(0,o.Z)(E,{options:this.state.options,user:this.props.user,upload:this.state.uploaded,dataUrl:this.state.preview,onComplete:this.props.onComplete,showError:this.props.showError,showIndex:this.props.showIndex})}},{key:"render",value:function(){return this.state.uploaded?this.renderCrop():this.renderUpload()}}]),i}(f().Component),P=n(87462),A=(n(34458),n(69130));function T(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=(0,d.Z)(e);if(t){var i=(0,d.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,u.Z)(this,n)}}var I,B,j,D=function(e){(0,c.Z)(n,e);var t=T(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,p.Z)((0,l.Z)(e),"select",(function(){e.props.select(e.props.id)})),e}return(0,s.Z)(n,[{key:"getClassName",value:function(){return this.props.selection===this.props.id?this.props.disabled?"btn btn-avatar btn-disabled avatar-selected":"btn btn-avatar avatar-selected":this.props.disabled?"btn btn-avatar btn-disabled":"btn btn-avatar"}},{key:"render",value:function(){return(0,o.Z)("button",{type:"button",className:this.getClassName(),disabled:this.props.disabled,onClick:this.select},void 0,(0,o.Z)("img",{src:this.props.url}))}}]),n}(f().Component),U=function(e){(0,c.Z)(n,e);var t=T(n);function n(){return(0,r.Z)(this,n),t.apply(this,arguments)}return(0,s.Z)(n,[{key:"render",value:function(){var e=this;return(0,o.Z)("div",{className:"avatars-gallery"},void 0,(0,o.Z)("h3",{},void 0,this.props.name),(0,o.Z)("div",{className:"avatars-gallery-images"},void 0,(0,A.Z)(this.props.images,4,null).map((function(t,n){return(0,o.Z)("div",{className:"row"},n,t.map((function(t,n){return(0,o.Z)("div",{className:"col-xs-3"},n,t?f().createElement(D,(0,P.Z)({disabled:e.props.disabled,select:e.props.select,selection:e.props.selection},t)):L||(L=(0,o.Z)("div",{className:"blank-avatar"})))})))}))))}}]),n}(f().Component),z=function(e){(0,c.Z)(n,e);var t=T(n);function n(e){var a;return(0,r.Z)(this,n),a=t.call(this,e),(0,p.Z)((0,l.Z)(a),"select",(function(e){a.setState({selection:e})})),(0,p.Z)((0,l.Z)(a),"save",(function(){if(a.state.isLoading)return!1;a.setState({isLoading:!0}),_.Z.post(a.props.user.api.avatar,{avatar:"galleries",image:a.state.selection}).then((function(e){a.setState({isLoading:!1}),x.Z.success(e.detail),a.props.onComplete(e),a.props.showIndex()}),(function(e){400===e.status?(x.Z.error(e.detail),a.setState({isLoading:!1})):a.props.showError(e)}))})),a.state={selection:null,isLoading:!1},a}return(0,s.Z)(n,[{key:"render",value:function(){var e=this;return(0,o.Z)("div",{},void 0,(0,o.Z)("div",{className:"modal-body modal-avatar-gallery"},void 0,this.props.options.galleries.map((function(t,n){return(0,o.Z)(U,{name:t.name,images:t.images,selection:e.state.selection,disabled:e.state.isLoading,select:e.select},n)}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("div",{className:"row"},void 0,(0,o.Z)("div",{className:"col-md-6 col-md-offset-3"},void 0,(0,o.Z)(b.Z,{onClick:this.save,loading:this.state.isLoading,disabled:!this.state.selection,className:"btn-primary btn-block"},void 0,this.state.selection?pgettext("avatar gallery modal btn","Save choice"):pgettext("avatar gallery modal btn","Select avatar")),(0,o.Z)(b.Z,{onClick:this.props.showIndex,disabled:this.state.isLoading,className:"btn-default btn-block"},void 0,pgettext("avatar gallery modal btn","Cancel"))))))}}]),n}(f().Component),q=n(3784),M=n(6935),F=n(90287);function H(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=(0,d.Z)(e);if(t){var i=(0,d.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,u.Z)(this,n)}}var V=function(e){(0,c.Z)(n,e);var t=H(n);function n(){return(0,r.Z)(this,n),t.apply(this,arguments)}return(0,s.Z)(n,[{key:"getErrorReason",value:function(){return this.props.reason?(0,o.Z)("p",{dangerouslySetInnerHTML:{__html:this.props.reason}}):null}},{key:"render",value:function(){return(0,o.Z)("div",{className:"modal-body"},void 0,I||(I=(0,o.Z)("div",{className:"message-icon"},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,"remove_circle_outline"))),(0,o.Z)("div",{className:"message-body"},void 0,(0,o.Z)("p",{className:"lead"},void 0,this.props.message),this.getErrorReason(),(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,pgettext("avatar modal dismiss","Ok"))))}}]),n}(f().Component),Y=function(e){(0,c.Z)(n,e);var t=H(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,p.Z)((0,l.Z)(e),"showError",(function(t){e.setState({error:t})})),(0,p.Z)((0,l.Z)(e),"showIndex",(function(){e.setState({component:w})})),(0,p.Z)((0,l.Z)(e),"showUpload",(function(){e.setState({component:O})})),(0,p.Z)((0,l.Z)(e),"showCrop",(function(){e.setState({component:E})})),(0,p.Z)((0,l.Z)(e),"showGallery",(function(){e.setState({component:z})})),(0,p.Z)((0,l.Z)(e),"completeFlow",(function(t){F.Z.dispatch((0,M.n1)(e.props.user,t.avatars)),e.setState({component:w,options:t})})),e}return(0,s.Z)(n,[{key:"componentDidMount",value:function(){var e=this;_.Z.get(this.props.user.api.avatar).then((function(t){e.setState({component:w,options:t,error:null})}),(function(t){e.showError(t)}))}},{key:"getBody",value:function(){return this.state?this.state.error?(0,o.Z)(V,{message:this.state.error.detail,reason:this.state.error.reason}):(0,o.Z)(this.state.component,{options:this.state.options,user:this.props.user,onComplete:this.completeFlow,showError:this.showError,showIndex:this.showIndex,showCrop:this.showCrop,showUpload:this.showUpload,showGallery:this.showGallery}):B||(B=(0,o.Z)(q.Z,{}))}},{key:"getClassName",value:function(){return this.state&&this.state.error?"modal-dialog modal-message modal-change-avatar":"modal-dialog modal-change-avatar"}},{key:"render",value:function(){return(0,o.Z)("div",{className:this.getClassName(),role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":pgettext("modal","Close")},void 0,j||(j=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,pgettext("avatar modal title","Change your avatar"))),this.getBody()))}}]),n}(f().Component);function G(e){return{user:e.auth.user}}var W,$,Q,K,X,J,ee=n(49021);function te(){document.getElementById("hidden-logout-form").submit()}var ne=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,p.Z)((0,l.Z)(t),"changeAvatar",(function(){t.props.close(),g.Z.show((0,Z.$j)(G)(Y))})),(0,p.Z)((0,l.Z)(t),"revealOptions",(function(){t.setState({options:t.props.options,optionsMore:!1})})),e.dropdown?t.state={options:e.options.slice(0,2),optionsMore:e.options.length>2}:t.state={options:e.options,optionsMore:!1},t}return(0,s.Z)(i,[{key:"render",value:function(){var e=this.props,t=e.user,n=e.close,a=e.dropdown,i=e.overlay;if(!t)return null;var r=misago.get("ADMIN_URL");return(0,o.Z)("ul",{className:m()("user-nav-menu",{"dropdown-menu-list":a,"overlay-menu-list":i})},void 0,(0,o.Z)("li",{className:"dropdown-menu-item"},void 0,(0,o.Z)("a",{href:t.url,className:"user-nav-profile"},void 0,(0,o.Z)("strong",{},void 0,t.username),(0,o.Z)("small",{},void 0,pgettext("user nav","Go to your profile")))),W||(W=(0,o.Z)(ee.YV,{})),(0,o.Z)(ee.Xi,{},void 0,(0,o.Z)("a",{href:misago.get("NOTIFICATIONS_URL")},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,t.unreadNotifications?"notifications_active":"notifications_none"),pgettext("user nav","Notifications"),!!t.unreadNotifications&&(0,o.Z)("span",{className:"badge"},void 0,t.unreadNotifications))),!!t.showPrivateThreads&&(0,o.Z)(ee.Xi,{},void 0,(0,o.Z)("a",{href:misago.get("PRIVATE_THREADS_URL")},void 0,$||($=(0,o.Z)("span",{className:"material-icon"},void 0,"inbox")),pgettext("user nav","Private threads"),!!t.unreadPrivateThreads&&(0,o.Z)("span",{className:"badge"},void 0,t.unreadPrivateThreads))),!!r&&(0,o.Z)(ee.Xi,{},void 0,(0,o.Z)("a",{href:r,target:"_blank"},void 0,Q||(Q=(0,o.Z)("span",{className:"material-icon"},void 0,"security")),pgettext("user nav","Admin control panel"))),K||(K=(0,o.Z)(ee.YV,{})),(0,o.Z)(ee.iC,{className:"user-nav-options"},void 0,pgettext("user nav section","Account settings")),(0,o.Z)(ee.Xi,{},void 0,(0,o.Z)("button",{className:"btn-link",onClick:this.changeAvatar,type:"button"},void 0,X||(X=(0,o.Z)("span",{className:"material-icon"},void 0,"portrait")),pgettext("user nav","Change avatar"))),this.state.options.map((function(e){return(0,o.Z)(ee.Xi,{},e.icon,(0,o.Z)("a",{href:e.url},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,e.icon),e.name))})),(0,o.Z)(ee.Xi,{},void 0,(0,o.Z)("button",{className:m()("btn-link",{"d-none":!this.state.optionsMore}),onClick:this.revealOptions,type:"button"},void 0,J||(J=(0,o.Z)("span",{className:"material-icon"},void 0,"more_vertical")),pgettext("user nav","See more"))),!!a&&(0,o.Z)(ee.kE,{listItem:!0},void 0,(0,o.Z)("button",{className:"btn btn-default btn-block",onClick:function(){te(),n()},type:"button"},void 0,pgettext("user nav","Log out"))))}}]),i}(f().Component);const ae=(0,Z.$j)((function(e){var t=e.auth.user;return t.id?{user:{username:t.username,unreadNotifications:t.unreadNotifications,unreadPrivateThreads:t.unread_private_threads,showPrivateThreads:t.acl.can_use_private_threads,url:t.url},options:(0,i.Z)(misago.get("userOptions"))}:{user:null}}))(ne);function ie(e){var t=e.close;return(0,o.Z)(ae,{close:t,dropdown:!0})}var oe=n(993),re=n(64836);const se=(0,Z.$j)((function(e){return{isOpen:e.overlay.userNav}}))((function(e){var t=e.dispatch,n=e.isOpen;return(0,o.Z)(re.a,{open:n},void 0,(0,o.Z)(re.i,{},void 0,pgettext("user nav title","Your options")),(0,o.Z)(ae,{close:function(){return t((0,oe.xv)())},overlay:!0}),(0,o.Z)(ee.kE,{},void 0,(0,o.Z)("button",{className:"btn btn-default btn-block",onClick:function(){te(),t((0,oe.xv)())},type:"button"},void 0,pgettext("user nav","Log out"))))}))},19605:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>o});var a=n(22928),i=(n(57588),n(34458));function o(e){var t=e.size||100,n=e.size2x||2*t;return(0,a.Z)("img",{alt:"",className:e.className||"user-avatar",src:r(e.user,t),srcSet:r(e.user,n),width:e.height||t,height:e.height||t})}function r(e,t){return e&&e.id?function(e,t){var n=e[0];return e.forEach((function(e){e.size>=t&&(n=e)})),n}(e.avatars,t).url:i.Z.get("BLANK_AVATAR_URL")}},82211:(e,t,n)=>{"use strict";n.d(t,{Z:()=>h});var a,i=n(22928),o=n(15671),r=n(43144),s=n(79340),l=n(6215),c=n(61120),u=n(57588),d=n.n(u),p=n(37848);var h=function(e){(0,s.Z)(d,e);var t,n,u=(t=d,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function d(){return(0,o.Z)(this,d),u.apply(this,arguments)}return(0,r.Z)(d,[{key:"render",value:function(){var e="btn "+this.props.className,t=this.props.disabled;return this.props.loading&&(e+=" btn-loading",t=!0),(0,i.Z)("button",{className:e,disabled:t,onClick:this.props.onClick,type:this.props.onClick?"button":"submit"},void 0,this.props.children,this.props.loading?a||(a=(0,i.Z)(p.Z,{})):null)}}]),d}(d().Component);h.defaultProps={className:"btn-default",type:"submit",loading:!1,disabled:!1,onClick:null}},57026:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var a=n(22928);function i(e){return(0,a.Z)("select",{className:e.className||"form-control",disabled:e.disabled||!1,id:e.id||null,onChange:e.onChange,value:e.value},void 0,e.choices.map((function(e){return(0,a.Z)("option",{disabled:e.disabled||!1,value:e.value},e.value,"- - ".repeat(e.level)+e.label)})))}n(57588)},96359:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var a=n(22928),i=n(15671),o=n(43144),r=n(79340),s=n(6215),l=n(61120),c=n(57588);var u=function(e){(0,r.Z)(u,e);var t,n,c=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,s.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,o.Z)(u,[{key:"isValidated",value:function(){return void 0!==this.props.validation}},{key:"getClassName",value:function(){var e="form-group";return this.isValidated()&&(e+=" has-feedback",null===this.props.validation?e+=" has-success":e+=" has-error"),e}},{key:"getFeedback",value:function(){var e=this;return this.props.validation?(0,a.Z)("div",{className:"help-block errors"},void 0,this.props.validation.map((function(t,n){return(0,a.Z)("p",{},e.props.for+"FeedbackItem"+n,t)}))):null}},{key:"getFeedbackDescription",value:function(){return this.isValidated()?(0,a.Z)("span",{id:this.props.for+"_status",className:"sr-only"},void 0,this.props.validation?pgettext("field validation status","(error)"):pgettext("field validation status","(success)")):null}},{key:"getHelpText",value:function(){return this.props.helpText?(0,a.Z)("p",{className:"help-block"},void 0,this.props.helpText):null}},{key:"render",value:function(){return(0,a.Z)("div",{className:this.getClassName()},void 0,(0,a.Z)("label",{className:"control-label "+(this.props.labelClass||""),htmlFor:this.props.for||""},void 0,this.props.label+":"),(0,a.Z)("div",{className:this.props.controlClass||""},void 0,this.props.children,this.getFeedbackDescription(),this.getFeedback(),this.getHelpText(),this.props.extra||null))}}]),u}(n.n(c)().Component)},43345:(e,t,n)=>{"use strict";n.d(t,{Z:()=>v});var a=n(15671),i=n(43144),o=n(97326),r=n(79340),s=n(6215),l=n(61120),c=n(4942),u=n(57588),d=n.n(u),p=n(55210),h=n(53904);var m=(0,p.C1)(),v=function(e){(0,r.Z)(d,e);var t,n,u=(t=d,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,s.Z)(this,e)});function d(){var e;(0,a.Z)(this,d);for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return e=u.call.apply(u,[this].concat(n)),(0,c.Z)((0,o.Z)(e),"bindInput",(function(t){return function(n){e.changeValue(t,n.target.value)}})),(0,c.Z)((0,o.Z)(e),"changeValue",(function(t,n){var a=(0,c.Z)({},t,n),i=e.state.errors||{};i[t]=e.validateField(t,a[t]),a.errors=i,e.setState(a)})),(0,c.Z)((0,o.Z)(e),"handleSubmit",(function(t){if(t&&t.preventDefault(),!e.state.isLoading&&e.clean()){e.setState({isLoading:!0});var n=e.send();n?n.then((function(t){e.setState({isLoading:!1}),e.handleSuccess(t)}),(function(t){e.setState({isLoading:!1}),e.handleError(t)})):e.setState({isLoading:!1})}})),e}return(0,i.Z)(d,[{key:"validate",value:function(){var e={};if(!this.state.validators)return e;var t={required:this.state.validators.required||this.state.validators,optional:this.state.validators.optional||{}},n=[];for(var a in t.required)t.required.hasOwnProperty(a)&&t.required[a]&&n.push(a);for(var i in t.optional)t.optional.hasOwnProperty(i)&&t.optional[i]&&n.push(i);for(var o in n){var r=n[o],s=this.validateField(r,this.state[r]);null===s?e[r]=null:s&&(e[r]=s)}return e}},{key:"isValid",value:function(){var e=this.validate();for(var t in e)if(e.hasOwnProperty(t)&&null!==e[t])return!1;return!0}},{key:"validateField",value:function(e,t){var n=[];if(!this.state.validators)return n;var a={required:(this.state.validators.required||this.state.validators)[e],optional:(this.state.validators.optional||{})[e]},i=m(t)||!1;if(a.required){if(i)n=[i];else for(var o in a.required){var r=a.required[o](t);r&&n.push(r)}return n.length?n:null}if(!1===i&&a.optional){for(var s in a.optional){var l=a.optional[s](t);l&&n.push(l)}return n.length?n:null}return!1}},{key:"clean",value:function(){return!0}},{key:"send",value:function(){return null}},{key:"handleSuccess",value:function(e){}},{key:"handleError",value:function(e){h.Z.apiError(e)}}]),d}(d().Component)},94417:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var a=n(22928),i=n(15671),o=n(43144),r=n(79340),s=n(6215),l=n(61120),c=n(57588);var u=function(e){(0,r.Z)(u,e);var t,n,c=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,s.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,o.Z)(u,[{key:"isActive",value:function(){return this.props.isControlled?this.props.isActive:!!this.props.path&&0===document.location.pathname.indexOf(this.props.path)}},{key:"getClassName",value:function(){return this.isActive()?(this.props.className||"")+" "+(this.props.activeClassName||"active"):this.props.className||""}},{key:"render",value:function(){return(0,a.Z)("li",{className:this.getClassName()},void 0,this.props.children)}}]),u}(n.n(c)().Component)},37848:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var a,i=n(22928);function o(e){return(0,i.Z)("div",{className:e.className||"loader"},void 0,a||(a=(0,i.Z)("div",{className:"loader-spinning-wheel"})))}n(57588)},69092:(e,t,n)=>{"use strict";n.d(t,{Z:()=>g});var a=n(15671),i=n(43144),o=n(79340),r=n(6215),s=n(61120),l=n(94184),c=n.n(l),u=n(57588),d=n.n(u),p=n(4942),h=n(19755),m=new RegExp("^.*(?:(?:youtu.be/|v/|vi/|u/w/|embed/)|(?:(?:watch)??v(?:i)?=|&v(?:i)?=))([^#&?]*).*");const v=new(function(){function e(){var t=this;(0,a.Z)(this,e),(0,p.Z)(this,"render",(function(e){e&&(t.highlightCode(e),t.embedYoutubePlayers(e))})),this._youtube={}}return(0,i.Z)(e,[{key:"highlightCode",value:function(e){n.e(417).then(n.bind(n,15739)).then((function(t){for(var n=t.default,a=e.querySelectorAll("pre>code"),i=0;i<a.length;i++)n.highlightElement(a[i])}))}},{key:"embedYoutubePlayers",value:function(e){for(var t=e.querySelectorAll("p>a"),n=0;n<t.length;n++){var a=t[n],i=1===a.parentNode.childNodes.length;this._youtube[a.href]||(this._youtube[a.href]=f(a.href));var o=this._youtube[a.href];i&&o&&!1!==o.data&&this.swapYoutubePlayer(a,o)}}},{key:"swapYoutubePlayer",value:function(e,t){var n="https://www.youtube.com/embed/";n+=t.video,n+="?feature=oembed",t.start&&(n+="&start="+t.start);var a=h('<iframe class="embed-responsive-item" frameborder="0" src="'+n+'" allow="encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>');h(e).replaceWith(a),a.wrap('<div class="embed-responsive embed-responsive-16by9"></div>')}}]),e}());function f(e){var t=function(e){var t=e;return"https://"===e.substr(0,8)?t=t.substr(8):"http://"===e.substr(0,7)&&(t=t.substr(7)),"www."===t.substr(0,4)&&(t=t.substr(4)),t}(e),n=function(e){if(-1===e.indexOf("youtu"))return null;var t=e.match(m);return t?t[1]:null}(t);if(!n)return null;var a=0;if(t.indexOf("?")>0){var i=t.substr(t.indexOf("?")+1).split("&").filter((function(e){return"t="===e.substr(0,2)}))[0];if(i){var o=i.substr(2).split("m");"s"===o[0].substr(-1)?a+=parseInt(o[0].substr(0,o[0].length-1)):(a+=60*parseInt(o[0]),o[1]&&"s"===o[1].substr(-1)&&(a+=parseInt(o[1].substr(0,o[1].length-1))))}}return{start:a,video:n}}var Z=n(19755);var g=function(e){(0,o.Z)(u,e);var t,n,l=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,s.Z)(t);if(n){var i=(0,s.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,a.Z)(this,u),l.apply(this,arguments)}return(0,i.Z)(u,[{key:"componentDidMount",value:function(){v.render(this.documentNode),Z(this.documentNode).find(".spoiler-reveal").click(y)}},{key:"componentDidUpdate",value:function(e,t){v.render(this.documentNode),Z(this.documentNode).find(".spoiler-reveal").click(y)}},{key:"shouldComponentUpdate",value:function(e,t){return e.markup!==this.props.markup}},{key:"render",value:function(){var e=this;return d().createElement("article",{className:c()("misago-markup",this.props.className),dangerouslySetInnerHTML:{__html:this.props.markup},"data-author":this.props.author||void 0,ref:function(t){e.documentNode=t}})}}]),u}(d().Component);function y(e){var t=e.target;Z(t).parent().parent().addClass("revealed")}},3784:(e,t,n)=>{"use strict";n.d(t,{Z:()=>h});var a,i=n(22928),o=n(15671),r=n(43144),s=n(79340),l=n(6215),c=n(61120),u=n(57588),d=n.n(u),p=n(37848);var h=function(e){(0,s.Z)(d,e);var t,n,u=(t=d,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function d(){return(0,o.Z)(this,d),u.apply(this,arguments)}return(0,r.Z)(d,[{key:"render",value:function(){return a||(a=(0,i.Z)("div",{className:"modal-body modal-loader"},void 0,(0,i.Z)(p.Z,{})))}}]),d}(d().Component)},30337:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var a=n(22928),i=n(15671),o=n(43144),r=n(79340),s=n(6215),l=n(61120);n(57588);var c=function(e){(0,r.Z)(u,e);var t,n,c=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,s.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,o.Z)(u,[{key:"getHelpText",value:function(){return this.props.helpText?(0,a.Z)("p",{className:"help-block"},void 0,this.props.helpText):null}},{key:"render",value:function(){return(0,a.Z)("div",{className:"modal-body"},void 0,(0,a.Z)("div",{className:"message-icon"},void 0,(0,a.Z)("span",{className:"material-icon"},void 0,this.props.icon||"info_outline")),(0,a.Z)("div",{className:"message-body"},void 0,(0,a.Z)("p",{className:"lead"},void 0,this.props.message),this.getHelpText(),(0,a.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,pgettext("modal message dismiss btn","Ok"))))}}]),u}(n(33556).Z)},33556:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var a=n(22928),i=n(15671),o=n(43144),r=n(79340),s=n(6215),l=n(61120),c=n(57588);var u=function(e){(0,r.Z)(u,e);var t,n,c=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,s.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,o.Z)(u,[{key:"getHelpText",value:function(){return this.props.helpText?(0,a.Z)("p",{className:"help-block"},void 0,this.props.helpText):null}},{key:"render",value:function(){return(0,a.Z)("div",{className:"panel-body panel-message-body"},void 0,(0,a.Z)("div",{className:"message-icon"},void 0,(0,a.Z)("span",{className:"material-icon"},void 0,this.props.icon||"info_outline")),(0,a.Z)("div",{className:"message-body"},void 0,(0,a.Z)("p",{className:"lead"},void 0,this.props.message),this.getHelpText()))}}]),u}(n.n(c)().Component)},11005:(e,t,n)=>{"use strict";n.d(t,{Z:()=>N});var a=n(22928),i=n(57588),o=n.n(i),r=n(69092);function s(e){return e.post.content?o().createElement(l,e):o().createElement(c,e)}function l(e){return(0,a.Z)("div",{className:"post-body"},void 0,(0,a.Z)(r.Z,{markup:e.post.headline||e.post.content}))}function c(e){return(0,a.Z)("div",{className:"post-body post-body-invalid"},void 0,(0,a.Z)("p",{className:"lead"},void 0,pgettext("post body invalid","This post's contents cannot be displayed.")),(0,a.Z)("p",{className:"text-muted"},void 0,pgettext("post body invalid","This error is caused by invalid post content manipulation.")))}function u(e){var t=e.post,n=t.category,i=t.thread,o=interpolate(pgettext("posts feed item header","posted %(posted_on)s"),{posted_on:t.posted_on.format("LL, LT")},!0);return(0,a.Z)("div",{className:"post-heading"},void 0,(0,a.Z)("a",{className:"btn btn-link item-title",href:i.url},void 0,i.title),(0,a.Z)("a",{className:"btn btn-link post-category",href:n.url.index},void 0,n.name),(0,a.Z)("a",{href:t.url.index,className:"btn btn-link posted-on",title:o},void 0,t.posted_on.fromNow()))}var d,p,h=n(19605);function m(e){var t=e.post;return(0,a.Z)("a",{className:"btn btn-default btn-icon pull-right",href:t.url.index},void 0,(0,a.Z)("span",{className:"btn-text-left hidden-xs"},void 0,pgettext("go to post link","See post")),d||(d=(0,a.Z)("span",{className:"material-icon"},void 0,"chevron_right")))}function v(e){var t=e.post;return(0,a.Z)("div",{className:"post-side post-side-anonymous"},void 0,(0,a.Z)(m,{post:t}),(0,a.Z)("div",{className:"media"},void 0,p||(p=(0,a.Z)("div",{className:"media-left"},void 0,(0,a.Z)("span",{},void 0,(0,a.Z)(h.ZP,{className:"poster-avatar",size:50})))),(0,a.Z)("div",{className:"media-body"},void 0,(0,a.Z)("div",{className:"media-heading"},void 0,(0,a.Z)("span",{className:"item-title"},void 0,t.poster_name)),(0,a.Z)("span",{className:"user-title user-title-anonymous"},void 0,pgettext("post removed poster username","Removed user")))))}function f(e){var t=e.rank,n=e.title||t.title||t.name,i="user-title";return t.css_class&&(i+=" user-title-"+t.css_class),t.is_tab?(0,a.Z)("a",{className:i,href:t.url},void 0,n):(0,a.Z)("span",{className:i},void 0,n)}function Z(e){var t=e.post,n=e.poster;return(0,a.Z)("div",{className:"post-side post-side-registered"},void 0,(0,a.Z)(m,{post:t}),(0,a.Z)("div",{className:"media"},void 0,(0,a.Z)("div",{className:"media-left"},void 0,(0,a.Z)("a",{href:n.url},void 0,(0,a.Z)(h.ZP,{className:"poster-avatar",size:50,user:n}))),(0,a.Z)("div",{className:"media-body"},void 0,(0,a.Z)("div",{className:"media-heading"},void 0,(0,a.Z)("a",{className:"item-title",href:n.url},void 0,n.username)),(0,a.Z)(f,{title:n.title,rank:n.rank}))))}function g(e){var t=e.post,n=e.poster;return n&&n.id?(0,a.Z)(Z,{post:t,poster:n}):(0,a.Z)(v,{post:t})}function y(e){var t=e.post,n=e.poster||t.poster,i="post";return n&&n.rank.css_class&&(i+=" post-"+n.rank.css_class),(0,a.Z)("li",{className:i,id:"post-"+t.id},void 0,(0,a.Z)("div",{className:"panel panel-default panel-post"},void 0,(0,a.Z)("div",{className:"panel-body"},void 0,(0,a.Z)("div",{className:"panel-content"},void 0,(0,a.Z)(g,{post:t,poster:n}),(0,a.Z)(u,{post:t}),(0,a.Z)(s,{post:t})))))}var b,k,_=n(44039);function x(){return(0,a.Z)("ul",{className:"posts-list post-feed ui-preview"},void 0,(0,a.Z)("li",{className:"post"},void 0,(0,a.Z)("div",{className:"panel panel-default panel-post"},void 0,(0,a.Z)("div",{className:"panel-body"},void 0,(0,a.Z)("div",{className:"panel-content"},void 0,(0,a.Z)("div",{className:"post-side post-side-anonymous"},void 0,(0,a.Z)("div",{className:"media"},void 0,b||(b=(0,a.Z)("div",{className:"media-left"},void 0,(0,a.Z)("span",{},void 0,(0,a.Z)(h.ZP,{className:"poster-avatar",size:50})))),(0,a.Z)("div",{className:"media-body"},void 0,(0,a.Z)("div",{className:"media-heading"},void 0,(0,a.Z)("span",{className:"item-title"},void 0,(0,a.Z)("span",{className:"ui-preview-text",style:{width:_.e(30,200)+"px"}},void 0," "))),(0,a.Z)("span",{className:"user-title user-title-anonymous"},void 0,(0,a.Z)("span",{className:"ui-preview-text",style:{width:_.e(30,200)+"px"}},void 0," "))))),(0,a.Z)("div",{className:"post-heading"},void 0,(0,a.Z)("span",{className:"ui-preview-text",style:{width:_.e(30,200)+"px"}},void 0," ")),(0,a.Z)("div",{className:"post-body"},void 0,(0,a.Z)("article",{className:"misago-markup"},void 0,(0,a.Z)("p",{},void 0,(0,a.Z)("span",{className:"ui-preview-text",style:{width:_.e(30,200)+"px"}},void 0," ")," ",(0,a.Z)("span",{className:"ui-preview-text",style:{width:_.e(30,200)+"px"}},void 0," ")," ",(0,a.Z)("span",{className:"ui-preview-text",style:{width:_.e(30,200)+"px"}},void 0," ")))))))))}function N(e){var t=e.isReady,n=e.posts,i=e.poster;return t?(0,a.Z)("ul",{className:"posts-list post-feed ui-ready"},void 0,n.map((function(e){return(0,a.Z)(y,{post:e,poster:i},e.id)}))):k||(k=(0,a.Z)(x,{}))}},9771:(e,t,n)=>{"use strict";n.d(t,{mv:()=>v,ZP:()=>cn,MO:()=>T,Fi:()=>x});var a,i=n(57588),o=n.n(i),r=n(22928),s=n(43144),l=n(15671),c=n(97326),u=n(79340),d=n(6215),p=n(61120),h=n(4942),m=n(64646);var v=function(e){(0,u.Z)(v,e);var t,n,i=(t=v,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function v(e){var t;return(0,l.Z)(this,v),t=i.call(this,e),(0,h.Z)((0,c.Z)(t),"selected",(function(){if(t.element){var e=Z(t.element)||null,n=e?e.getBoundingClientRect():null;t.setState({range:e,rect:n})}})),(0,h.Z)((0,c.Z)(t),"reply",(function(){if(m.Z.isOpen()){var e=T();e&&!e.disabled&&(e.quote(x(t.state.range)),t.setState({range:null,rect:null}),f())}else{var n=x(t.state.range);m.Z.open(Object.assign({},t.props.posting,{default:n})),t.setState({range:null,rect:null}),window.setTimeout(f,1e3)}})),(0,h.Z)((0,c.Z)(t),"render",(function(){return(0,r.Z)("div",{},void 0,o().createElement("div",{ref:function(e){e&&(t.element=e)},onMouseUp:t.selected,onTouchEnd:t.selected},t.props.children),!!t.state.rect&&(0,r.Z)("div",{className:"quote-control",style:{position:"absolute",left:t.state.rect.left+window.scrollX,top:t.state.rect.bottom+window.scrollY}},void 0,a||(a=(0,r.Z)("div",{className:"quote-control-arrow"})),(0,r.Z)("div",{className:"quote-control-inner"},void 0,(0,r.Z)("button",{className:"btn quote-control-btn",type:"button",onClick:t.reply},void 0,pgettext("post reply","Quote")))))})),t.state={range:null,rect:null},t.element=null,t}return(0,s.Z)(v)}(o().Component);function f(){var e=document.querySelector("#posting-mount textarea");e.focus(),e.selectionStart=e.selectionEnd=e.value.length}var Z=function(e){if(void 0!==window.getSelection){var t=window.getSelection();if(t&&"Range"===t.type&&1===t.rangeCount){var n=t.getRangeAt(0);if(g(n,e)&&y(n)&&b(n.cloneContents()))return n}}},g=function(e,t){var n=e.commonAncestorContainer;if(n===t)return!0;for(var a=n.parentNode;a;){if(a===t)return!0;a=a.parentNode}return!1},y=function(e){var t=e.commonAncestorContainer;if("ARTICLE"===t.nodeName)return!0;if(t.dataset&&"1"===t.dataset.noquote)return!1;for(var n=t.parentNode;n;){if(n.dataset&&"1"===n.dataset.noquote)return!1;if("ARTICLE"===n.nodeName)return!0;n=n.parentNode}return!1},b=function e(t){for(var n=0;n<t.childNodes.length;n++){var a=t.childNodes[n];if(a.nodeType===Node.TEXT_NODE&&a.textContent&&a.textContent.trim().length>0)return!0;if("IMG"===a.nodeName)return!0;if(e(a))return!0}return!1},k=n(42982),_=n(70885);const x=function(e){var t=N(e),n=O(e.cloneContents().childNodes,[]),a=t?'[quote="'.concat(t,'"]\n'):"[quote]\n",i="\n[/quote]\n\n",o=R(e);return o?(a+=o.syntax?"[code=".concat(o.syntax,"]\n"):"[code]\n",i="\n[/code]"+i):S(e)?(n=n.trim(),a+="`",i="`"+i):n=n.trim(),a+n+i};var N=function(e){var t=e.commonAncestorContainer;if(w(t))return C(t);for(var n=t.parentNode;n;){if(w(n))return C(n);n=n.parentNode}return""},w=function(e){return e.nodeType===Node.ELEMENT_NODE&&("ARTICLE"===e.nodeName||"BLOCKQUOTE"===e.nodeName&&e.dataset&&"quote"===e.dataset.block)},C=function(e){return e.dataset&&e.dataset.author||null},R=function(e){var t=e.commonAncestorContainer;if(E(t))return L(t);for(var n=t.parentNode;n;){if(E(n))return L(n);n=n.parentNode}return null},E=function(e){return"PRE"===e.nodeName},S=function(e){var t=e.commonAncestorContainer;if("CODE"===t.nodeName)return!0;for(var n=t.parentNode;n;){if(w(n))return!1;if("CODE"===n.nodeName)return!0;n=n.parentNode}return!1},L=function(e){return e.dataset?{syntax:e.dataset.syntax||null}:{syntax:null}},O=function(e,t){for(var n="",a=0;a<e.length;a++){var i=e[a];n+=A(i,t)}return n},P={H1:["\n\n# ",""],H2:["\n\n## ",""],H3:["\n\n### ",""],H4:["\n\n#### ",""],H5:["\n\n##### ",""],H6:["\n\n###### ",""],STRONG:["**","**"],EM:["*","*"],DEL:["~~","~~"],B:["[b]","[/b]"],U:["[u]","[/u]"],I:["[i]","[/i]"],SUB:["[sub]","[/sub]"],SUP:["[sup]","[/sup]"]},A=function(e,t){var n=e.dataset||{};if(e.nodeType===Node.TEXT_NODE)return e.textContent||"";if(e.nodeType===Node.ELEMENT_NODE){if(n.quote)return n.quote||"";if("1"===n.noquote)return""}if(e.nodeType===Node.ELEMENT_NODE&&n.quote&&n.quote.trim())return"";if("HR"===e.nodeName)return"\n\n- - -";if(P[e.nodeName]){var a=(0,_.Z)(P[e.nodeName],2),i=a[0],o=a[1];return i+O(e.childNodes,[].concat((0,k.Z)(t),[e.nodeName]))+o}if("A"===e.nodeName){var r=e.href,s=O(e.childNodes,[].concat((0,k.Z)(t),[e.nodeName]));return s?"[".concat(s,"](").concat(r,")"):"!(".concat(r,")")}if("IMG"===e.nodeName){var l=e.src,c=e.alt;return c?"![".concat(c,"](").concat(l,")"):"!(".concat(l,")")}if("DIV"===e.nodeName||"ASIDE"===e.nodeName){var u=n.block&&n.block.toUpperCase();if(u&&P[u]){var d=(0,_.Z)(P[u],2),p=d[0],h=d[1];return p+O(e.childNodes,[].concat((0,k.Z)(t),[u]))+h}return O(e.childNodes,t)}if("BLOCKQUOTE"===e.nodeName){if("spoiler"===n.block){var m=O(e.childNodes,[].concat((0,k.Z)(t),["SPOILER"])).trim();if(!m)return"";var v="\n[spoiler]\n";return(v+=m)+"\n[/spoiler]"}var f=O(e.childNodes,[].concat((0,k.Z)(t),["QUOTE"])).trim();if(!f)return"";var Z=C(e),g=Z?"\n[quote=".concat(Z,"]\n"):"\n\n[quote]\n";return(g+=f)+"\n[/quote]"}if("PRE"===e.nodeName){var y=n.syntax||null,b=e.querySelector("code"),x=b&&b.innerText||"";return x.trim()?"\n[code"+(y?"="+y:"")+"]"+x+"[/code]":""}if("CODE"===e.nodeName)return"`"+e.innerText+"`";if("P"===e.nodeName)return"\n"+O(e.childNodes,[].concat((0,k.Z)(t),[e.nodeName]));if("UL"===e.nodeName||"OL"===e.nodeName)return(0===t.filter((function(e){return"OL"===e||"UL"===e})).length?"\n":"")+O(e.childNodes,[].concat((0,k.Z)(t),[e.nodeName]));if("LI"===e.nodeName){for(var N="",w=t.filter((function(e){return"OL"===e||"UL"===e})).length,R=1;R<w;R++)N+="    ";N+="OL"===t[t.length-1]?n.index?n.index+". ":"1. ":"- ";var E=O(e.childNodes,[].concat((0,k.Z)(t),[e.nodeName]));return E.trim()?"\n"+N+E:""}return"SPAN"===e.nodeName?O(e.childNodes,t):""};function T(){return window.misagoReply}function I(e,t){window.misagoReply={disabled:e,quote:t}}function B(){window.misagoReply=null}var j=n(57026),D=n(43345),U=n(30381),z=n.n(U);function q(e){return e.filter((function(e){return e.id&&!e.isRemoved})).map((function(e){return e.id}))}var M,F=n(12891),H=n(78657),V=n(53904),Y=n(94184),G=n.n(Y),W=n(34458),$=n(69092),Q=n(59801),K=n(48772);function X(e){var t=e.attachment;return(0,r.Z)("div",{className:"modal-dialog modal-lg",role:"document"},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,M||(M=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("markup editor","Attachment details"))),(0,r.Z)("div",{className:"modal-body"},void 0,!!t.is_image&&(0,r.Z)("div",{className:"markup-editor-attachment-modal-preview"},void 0,(0,r.Z)("a",{href:t.url.index+"?shva=1",target:"_blank"},void 0,(0,r.Z)("img",{src:t.url.index+"?shva=1",alt:""}))),(0,r.Z)("div",{className:"markup-editor-attachment-modal-filename"},void 0,t.filename),(0,r.Z)("div",{className:"row markup-editor-attachment-modal-details"},void 0,(0,r.Z)("div",{className:"col-xs-12 col-md-3"},void 0,(0,r.Z)("strong",{},void 0,t.filetype+", "+(0,K.Z)(t.size)),(0,r.Z)("div",{className:"text-muted"},void 0,(0,r.Z)("small",{},void 0,pgettext("markup editor","Type and size")))),(0,r.Z)("div",{className:"col-xs-12 col-md-4"},void 0,(0,r.Z)("strong",{},void 0,(0,r.Z)("abbr",{title:t.uploaded_on.format("LLL")},void 0,t.uploaded_on.fromNow())),(0,r.Z)("div",{className:"text-muted"},void 0,(0,r.Z)("small",{},void 0,pgettext("markup editor","Uploaded at")))),(0,r.Z)("div",{className:"col-xs-12 col-md-3"},void 0,t.url.uploader?(0,r.Z)("a",{href:t.url.uploader,target:"_blank",className:"item-title"},void 0,t.uploader_name):(0,r.Z)("span",{className:"item-title"},void 0,t.uploader_name),(0,r.Z)("div",{className:"text-muted"},void 0,(0,r.Z)("small",{},void 0,pgettext("markup editor","Uploader")))))),(0,r.Z)("div",{className:"modal-footer"},void 0,(0,r.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,pgettext("modal","Close")))))}var J,ee,te,ne,ae=function(e,t,n,a,i){var o=e.text||i||"",r=e.prefix;r+=n+o+a,t(r+=e.suffix),window.setTimeout((function(){se(e.textarea);var t=e.start+n.length;e.textarea.setSelectionRange(t,t+o.length)}),250)},ie=function(e,t,n){var a=e.prefix;a+=n,t(a+=e.suffix),window.setTimeout((function(){se(e.textarea);var t=e.end+n.length;e.textarea.setSelectionRange(t,t)}),250)},oe=function(e){if(document.selection){e.focus();var t=document.selection.createRange(),n=t.text.length;return t.moveStart("character",-e.value.length),re(e,t.text.length-n,t.text.length)}if(e.selectionStart||"0"==e.selectionStart)return re(e,e.selectionStart,e.selectionEnd)},re=function(e,t,n){return{textarea:e,start:t,end:n,text:e.value.substring(t,n),prefix:e.value.substring(0,t),suffix:e.value.substring(n)}};function se(e){var t=e.scrollTop;e.focus(),e.scrollTop=t}const le=function(e){var t,n=e.attachment,a=e.disabled,i=e.element,o=e.setState,s=e.update;return(0,r.Z)("div",{className:"markup-editor-attachments-item"},void 0,(0,r.Z)("div",{className:"markup-editor-attachment"},void 0,(0,r.Z)("div",{className:"markup-editor-attachment-details"},void 0,n.id?(0,r.Z)("a",{className:"item-title",href:n.url.index+"?shva=1",target:"_blank",onClick:function(e){e.preventDefault(),Q.Z.show(t||(t=(0,r.Z)(X,{attachment:n})))}},void 0,n.filename):(0,r.Z)("strong",{className:"item-title"},void 0,n.filename),(0,r.Z)("div",{className:"text-muted"},void 0,(0,r.Z)("ul",{className:"list-unstyled list-inline"},void 0,!n.id&&(0,r.Z)("li",{},void 0,n.progress+"%"),!!n.filetype&&(0,r.Z)("li",{},void 0,n.filetype),n.size>0&&(0,r.Z)("li",{},void 0,(0,K.Z)(n.size))))),!!n.id&&(0,r.Z)("div",{className:"markup-editor-attachment-buttons"},void 0,(0,r.Z)("button",{className:"btn btn-markup-editor-attachment btn-icon",title:pgettext("markup editor","Insert into message"),type:"button",disabled:a,onClick:function(){var e=function(e){var t="[";return e.is_image?(t+="!["+e.filename+"]",t+="("+(e.url.thumb||e.url.index)+"?shva=1)"):t+=e.filename,t+"]("+e.url.index+"?shva=1)"}(n),t=oe(i);ie(t,s,e)}},void 0,J||(J=(0,r.Z)("span",{className:"material-icon"},void 0,"flip_to_front"))),(0,r.Z)("button",{className:"btn btn-markup-editor-attachment btn-icon",title:pgettext("markup editor","Remove attachment"),type:"button",disabled:a,onClick:function(){o((function(e){var t=e.attachments;if(window.confirm(pgettext("markup editor","Remove this attachment?")))return{attachments:t.filter((function(e){return e.id!==n.id}))}}))}},void 0,ee||(ee=(0,r.Z)("span",{className:"material-icon"},void 0,"close")))),!n.id&&!!n.key&&(0,r.Z)("div",{className:"markup-editor-attachment-buttons"},void 0,n.error&&(0,r.Z)("button",{className:"btn btn-markup-editor-attachment btn-icon",title:pgettext("markup editor","See error"),type:"button",onClick:function(){V.Z.error(interpolate(pgettext("markup editor","%(filename)s: %(error)s"),{filename:n.filename,error:n.error},!0))}},void 0,te||(te=(0,r.Z)("span",{className:"material-icon"},void 0,"warning"))),(0,r.Z)("button",{className:"btn btn-markup-editor-attachment btn-icon",title:pgettext("markup editor","Remove attachment"),type:"button",disabled:a,onClick:function(){o((function(e){return{attachments:e.attachments.filter((function(e){return e.key!==n.key}))}}))}},void 0,ne||(ne=(0,r.Z)("span",{className:"material-icon"},void 0,"close"))))))},ce=function(e){var t=e.attachments,n=e.disabled,a=e.element,i=e.setState,o=e.update;return(0,r.Z)("div",{className:"markup-editor-attachments"},void 0,(0,r.Z)("div",{className:"markup-editor-attachments-container"},void 0,t.map((function(e){return(0,r.Z)(le,{attachment:e,disabled:n,element:a,setState:i,update:o},e.key||e.id)}))))};var ue,de=n(82211);const pe=function(e){var t=e.canProtect,n=e.disabled,a=e.empty,i=e.preview,o=e.isProtected,s=e.submitText,l=e.showPreview,c=e.closePreview,u=e.enableProtection,d=e.disableProtection;return(0,r.Z)("div",{className:"markup-editor-footer"},void 0,!!t&&(0,r.Z)(de.Z,{className:"btn-default btn-icon hidden-sm hidden-md hidden-lg",title:o?pgettext("markup editor","Protected"):pgettext("markup editor","Protect"),type:"button",disabled:n,onClick:function(){o?d():u()}},void 0,(0,r.Z)("span",{className:"material-icon"},void 0,o?"lock":"lock_open")),!!t&&(0,r.Z)("div",{},void 0,(0,r.Z)(de.Z,{className:"btn-default hidden-xs",type:"button",disabled:n,onClick:function(){o?d():u()}},void 0,(0,r.Z)("span",{className:"material-icon"},void 0,o?"lock":"lock_open"),o?pgettext("markup editor","Protected"):pgettext("markup editor","Protect"))),ue||(ue=(0,r.Z)("div",{className:"markup-editor-spacer"})),i?(0,r.Z)(de.Z,{className:"btn-default btn-auto",type:"button",onClick:c},void 0,pgettext("markup editor","Edit")):(0,r.Z)(de.Z,{className:"btn-default btn-auto",disabled:n||a,type:"button",onClick:l},void 0,pgettext("markup editor","Preview")),(0,r.Z)(de.Z,{className:"btn-primary btn-auto",disabled:n||a},void 0,s||pgettext("markup editor","Post")))};var he,me=n(96359);var ve=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"handleSubmit",(function(e){e.preventDefault();var n=t.props,a=n.selection,i=n.update,o=t.state.syntax.trim(),r=t.state.text.trim();if(0===r.length)return t.setState({error:gettext("This field is required.")}),!1;var s=a.prefix.trim().length?"\n\n":"";return ie(Object.assign({},a,{text:r}),i,s+"```"+o+"\n"+r+"\n```\n\n"),Q.Z.hide(),!1})),t.state={error:null,syntax:"",text:e.selection.text},t}return(0,s.Z)(i,[{key:"render",value:function(){var e=this;return(0,r.Z)("div",{className:"modal-dialog modal-lg",role:"document"},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,he||(he=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("markup editor","Code"))),(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"modal-body"},void 0,(0,r.Z)(me.Z,{for:"markup_code_syntax",label:pgettext("markup editor","Syntax highlighting")},void 0,(0,r.Z)("select",{id:"markup_code_syntax",className:"form-control",value:this.state.syntax,onChange:function(t){return e.setState({syntax:t.target.value})}},void 0,(0,r.Z)("option",{value:""},void 0,pgettext("markup editor","No syntax highlighting")),fe.map((function(e){var t=e.value,n=e.name;return(0,r.Z)("option",{value:t},t,n)})))),(0,r.Z)(me.Z,{for:"markup_code_text",label:pgettext("markup editor","Code to insert"),validation:this.state.error?[this.state.error]:void 0},void 0,(0,r.Z)("textarea",{id:"markup_code_text",className:"form-control",rows:"8",value:this.state.text,onChange:function(t){return e.setState({text:t.target.value})}}))),(0,r.Z)("div",{className:"modal-footer"},void 0,(0,r.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,pgettext("markup editor","Cancel")),(0,r.Z)("button",{className:"btn btn-primary"},void 0,pgettext("markup editor","Insert code"))))))}}]),i}(o().Component),fe=[{value:"bash",name:"Bash"},{value:"c",name:"C"},{value:"c#",name:"C#"},{value:"c++",name:"C++"},{value:"css",name:"CSS"},{value:"diff",name:"Diff"},{value:"go",name:"Go"},{value:"graphql",name:"GraphQL"},{value:"html,",name:"HTML"},{value:"xml",name:"XML"},{value:"json",name:"JSON"},{value:"java",name:"Java"},{value:"javascript",name:"JavaScript"},{value:"kotlin",name:"Kotlin"},{value:"less",name:"Less"},{value:"lua",name:"Lua"},{value:"makefile",name:"Makefile"},{value:"markdown",name:"Markdown"},{value:"objective-C",name:"Objective-C"},{value:"php",name:"PHP"},{value:"perl",name:"Perl"},{value:"plain",name:"Plain"},{value:"text",name:"text"},{value:"python",name:"Python"},{value:"repl",name:"REPL"},{value:"r",name:"R"},{value:"ruby",name:"Ruby"},{value:"rust",name:"Rust"},{value:"scss",name:"SCSS"},{value:"sql",name:"SQL"},{value:"shell",name:"Shell Session"},{value:"swift",name:"Swift"},{value:"toml",name:"TOML"},{value:"ini",name:"INI"},{value:"typescript",name:"TypeScript"},{value:"visualbasic",name:"Visual Basic .NET"},{value:"webassembly",name:"WebAssembly"},{value:"yaml",name:"YAML"}];const Ze=ve;var ge,ye,be,ke,_e,xe,Ne,we,Ce,Re,Ee,Se,Le,Oe,Pe,Ae,Te,Ie,Be,je,De,Ue,ze,qe,Me,Fe,He,Ve,Ye,Ge,We,$e,Qe,Ke,Xe,Je,et,tt,nt,at,it,ot,rt,st,lt;function ct(){return(0,r.Z)("div",{className:"modal-dialog modal-lg",role:"document"},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,ge||(ge=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("markup help","Formatting help"))),(0,r.Z)("div",{className:"modal-body formatting-help"},void 0,(0,r.Z)("h4",{},void 0,pgettext("markup help","Emphasis text")),(0,r.Z)(ut,{markup:pgettext("markup help","_This text will have emphasis_"),result:(0,r.Z)("p",{},void 0,(0,r.Z)("em",{},void 0,pgettext("markup help","This text will have emphasis")))}),ye||(ye=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Bold text")),(0,r.Z)(ut,{markup:pgettext("markup help","**This text will be bold**"),result:(0,r.Z)("p",{},void 0,(0,r.Z)("strong",{},void 0,pgettext("markup help","This text will be bold")))}),be||(be=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Removed text")),(0,r.Z)(ut,{markup:pgettext("markup help","~~This text will be removed~~"),result:(0,r.Z)("p",{},void 0,(0,r.Z)("del",{},void 0,pgettext("markup help","This text will be removed")))}),ke||(ke=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Bold text (BBCode)")),(0,r.Z)(ut,{markup:pgettext("markup help","[b]This text will be bold[/b]"),result:(0,r.Z)("p",{},void 0,(0,r.Z)("b",{},void 0,pgettext("markup help","This text will be bold")))}),_e||(_e=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Underlined text (BBCode)")),(0,r.Z)(ut,{markup:pgettext("markup help","[u]This text will be underlined[/u]"),result:(0,r.Z)("p",{},void 0,(0,r.Z)("u",{},void 0,pgettext("markup help","This text will be underlined")))}),xe||(xe=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Italics text (BBCode)")),(0,r.Z)(ut,{markup:pgettext("markup help","[i]This text will be in italics[/i]"),result:(0,r.Z)("p",{},void 0,(0,r.Z)("i",{},void 0,pgettext("markup help","This text will be in italics")))}),Ne||(Ne=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Link")),we||(we=(0,r.Z)(ut,{markup:"<http://example.com>",result:(0,r.Z)("p",{},void 0,(0,r.Z)("a",{href:"#"},void 0,"example.com"))})),Ce||(Ce=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Link with text")),(0,r.Z)(ut,{markup:"["+pgettext("markup help","Link text")+"](http://example.com)",result:(0,r.Z)("p",{},void 0,(0,r.Z)("a",{href:"#"},void 0,pgettext("markup help","Link text")))}),Re||(Re=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Link (BBCode)")),Ee||(Ee=(0,r.Z)(ut,{markup:"[url]http://example.com[/url]",result:(0,r.Z)("p",{},void 0,(0,r.Z)("a",{href:"#"},void 0,"example.com"))})),Se||(Se=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Link with text (BBCode)")),(0,r.Z)(ut,{markup:"[url=http://example.com]"+pgettext("markup help","Link text")+"[/url]",result:(0,r.Z)("p",{},void 0,(0,r.Z)("a",{href:"#"},void 0,pgettext("markup help","Link text")))}),Le||(Le=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Image")),Oe||(Oe=(0,r.Z)(ut,{markup:"!(http://dummyimage.com/38/38)",result:(0,r.Z)("p",{},void 0,(0,r.Z)("img",{alt:"",src:"http://dummyimage.com/38/38"}))})),Pe||(Pe=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Image with alternate text")),(0,r.Z)(ut,{markup:"!["+pgettext("markup help","Image text")+"](http://dummyimage.com/38/38)",result:(0,r.Z)("p",{},void 0,(0,r.Z)("img",{alt:pgettext("markup help","Image text"),src:"http://dummyimage.com/38/38"}))}),Ae||(Ae=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Image (BBCode)")),Te||(Te=(0,r.Z)(ut,{markup:"[img]http://dummyimage.com/38/38[/img]",result:(0,r.Z)("p",{},void 0,(0,r.Z)("img",{alt:"",src:"http://dummyimage.com/38/38"}))})),Ie||(Ie=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Mention user by their name")),Be||(Be=(0,r.Z)(ut,{markup:"@username",result:(0,r.Z)("p",{},void 0,(0,r.Z)("a",{href:"#"},void 0,"@username"))})),je||(je=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Heading 1")),(0,r.Z)(ut,{markup:pgettext("markup help","# First level heading"),result:(0,r.Z)("h1",{},void 0,pgettext("markup help","First level heading"))}),De||(De=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Heading 2")),(0,r.Z)(ut,{markup:pgettext("markup help","## Second level heading"),result:(0,r.Z)("h2",{},void 0,pgettext("markup help","Second level heading"))}),Ue||(Ue=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Heading 3")),(0,r.Z)(ut,{markup:pgettext("markup help","### Third level heading"),result:(0,r.Z)("h3",{},void 0,pgettext("markup help","Third level heading"))}),ze||(ze=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Heading 4")),(0,r.Z)(ut,{markup:pgettext("markup help","#### Fourth level heading"),result:(0,r.Z)("h4",{},void 0,pgettext("markup help","Fourth level heading"))}),qe||(qe=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Heading 5")),(0,r.Z)(ut,{markup:pgettext("markup help","##### Fifth level heading"),result:(0,r.Z)("h5",{},void 0,pgettext("markup help","Fifth level heading"))}),Me||(Me=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Unordered list")),Fe||(Fe=(0,r.Z)(ut,{markup:"- Lorem ipsum\n- Dolor met\n- Vulputate lectus",result:(0,r.Z)("ul",{},void 0,(0,r.Z)("li",{},void 0,"Lorem ipsum"),(0,r.Z)("li",{},void 0,"Dolor met"),(0,r.Z)("li",{},void 0,"Vulputate lectus"))})),He||(He=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Ordered list")),Ve||(Ve=(0,r.Z)(ut,{markup:"1. Lorem ipsum\n2. Dolor met\n3. Vulputate lectus",result:(0,r.Z)("ol",{},void 0,(0,r.Z)("li",{},void 0,"Lorem ipsum"),(0,r.Z)("li",{},void 0,"Dolor met"),(0,r.Z)("li",{},void 0,"Vulputate lectus"))})),Ye||(Ye=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Quote text")),(0,r.Z)(ut,{markup:"> "+pgettext("markup help","Quoted text"),result:(0,r.Z)("blockquote",{},void 0,(0,r.Z)("p",{},void 0,pgettext("markup help","Quoted text")))}),Ge||(Ge=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Quote text (BBCode)")),(0,r.Z)(ut,{markup:"[quote]\n"+pgettext("markup help","Quoted text")+"\n[/quote]",result:(0,r.Z)("aside",{className:"quote-block"},void 0,(0,r.Z)("div",{className:"quote-heading"},void 0,gettext("Quoted message:")),(0,r.Z)("blockquote",{className:"quote-body"},void 0,(0,r.Z)("p",{},void 0,pgettext("markup help","Quoted text"))))}),We||(We=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Quote text with author (BBCode)")),(0,r.Z)(ut,{markup:'[quote="'+pgettext("markup help","Quote author")+'"]\n'+pgettext("markup help","Quoted text")+"\n[/quote]",result:(0,r.Z)("aside",{className:"quote-block"},void 0,(0,r.Z)("div",{className:"quote-heading"},void 0,pgettext("markup help","Quote author has written:")),(0,r.Z)("blockquote",{className:"quote-body"},void 0,(0,r.Z)("p",{},void 0,pgettext("markup help","Quoted text"))))}),$e||($e=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Spoiler")),(0,r.Z)(ut,{markup:"[spoiler]\n"+pgettext("markup help","Secret text")+"\n[/spoiler]",result:(0,r.Z)(pt,{},void 0,pgettext("markup help","Secret text"))}),Qe||(Qe=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Inline code")),(0,r.Z)(ut,{markup:pgettext("markup help","`Inline code`"),result:(0,r.Z)("p",{},void 0,(0,r.Z)("code",{},void 0,pgettext("markup help","Inline code")))}),Ke||(Ke=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Code block")),Xe||(Xe=(0,r.Z)(ut,{markup:'```\nalert("Hello world!");\n```',result:(0,r.Z)("pre",{},void 0,(0,r.Z)("code",{className:"hljs"},void 0,'alert("Hello world!");'))})),Je||(Je=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Code block with syntax highlighting")),et||(et=(0,r.Z)(ut,{markup:'```python\nprint("Hello world!");\n```',result:(0,r.Z)("pre",{},void 0,(0,r.Z)("code",{className:"hljs language-python"},void 0,(0,r.Z)("span",{className:"hljs-built_in"},void 0,"print"),'("Hello world!");'))})),tt||(tt=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Code block (BBCode)")),nt||(nt=(0,r.Z)(ut,{markup:'[code]\nalert("Hello world!");\n[/code]',result:(0,r.Z)("pre",{},void 0,(0,r.Z)("code",{className:"hljs"},void 0,'alert("Hello world!");'))})),at||(at=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Code block with syntax highlighting (BBCode)")),it||(it=(0,r.Z)(ut,{markup:'[code="python"]\nprint("Hello world!");\n[/code]',result:(0,r.Z)("pre",{},void 0,(0,r.Z)("code",{className:"hljs language-python"},void 0,(0,r.Z)("span",{className:"hljs-built_in"},void 0,"print"),'("Hello world!");'))})),ot||(ot=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Horizontal rule")),rt||(rt=(0,r.Z)(ut,{markup:"Lorem ipsum\n- - -\nDolor met",result:(0,r.Z)("div",{},void 0,(0,r.Z)("p",{},void 0,"Lorem ipsum"),(0,r.Z)("hr",{}),(0,r.Z)("p",{},void 0,"Dolor met"))})),st||(st=(0,r.Z)("hr",{})),(0,r.Z)("h4",{},void 0,pgettext("markup help","Horizontal rule (BBCode)")),lt||(lt=(0,r.Z)(ut,{markup:"Lorem ipsum\n[hr]\nDolor met",result:(0,r.Z)("div",{},void 0,(0,r.Z)("p",{},void 0,"Lorem ipsum"),(0,r.Z)("hr",{}),(0,r.Z)("p",{},void 0,"Dolor met"))}))),(0,r.Z)("div",{className:"modal-footer"},void 0,(0,r.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,pgettext("modal","Close")))))}function ut(e){var t=e.markup,n=e.result;return(0,r.Z)("div",{className:"formatting-help-item"},void 0,(0,r.Z)("div",{className:"formatting-help-item-markup"},void 0,(0,r.Z)("pre",{},void 0,(0,r.Z)("code",{},void 0,t))),(0,r.Z)("div",{className:"formatting-help-item-preview"},void 0,(0,r.Z)("article",{className:"misago-markup"},void 0,n)))}var dt,pt=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,l.Z)(this,i),(t=a.call(this,e)).state={reveal:!1},t}return(0,s.Z)(i,[{key:"render",value:function(){var e=this;return(0,r.Z)("aside",{className:this.state.reveal?"spoiler-block revealed":"spoiler-block"},void 0,(0,r.Z)("blockquote",{className:"spoiler-body"},void 0,(0,r.Z)("p",{},void 0,this.props.children)),!this.state.reveal&&(0,r.Z)("div",{className:"spoiler-overlay"},void 0,(0,r.Z)("button",{className:"spoiler-reveal",type:"button",onClick:function(){e.setState({reveal:!0})}},void 0,gettext("Reveal spoiler"))))}}]),i}(o().Component),ht=new RegExp("^(((ftps?)|(https?))://)","i");function mt(e){return ht.test(e.trim())}const vt=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"handleSubmit",(function(e){e.preventDefault();var n=t.props,a=n.selection,i=n.update,o=t.state.text.trim(),r=t.state.url.trim();return 0===r.length?(t.setState({error:gettext("This field is required.")}),!1):(o.length>0?ie(a,i,"!["+o+"]("+r+")"):ie(a,i,"!("+r+")"),Q.Z.hide(),!1)}));var n=e.selection.text.trim(),o=mt(n);return t.state={error:null,text:o?"":n,url:o?n:""},t}return(0,s.Z)(i,[{key:"render",value:function(){var e=this;return(0,r.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,dt||(dt=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("markup editor","Image"))),(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"modal-body"},void 0,(0,r.Z)(me.Z,{for:"markup_image_text",label:pgettext("markup editor","Image description"),helpText:pgettext("markup editor","Optional but recommended . Will be displayed instead of image when it fails to load.")},void 0,(0,r.Z)("input",{id:"markup_image_text",className:"form-control",type:"text",value:this.state.text,onChange:function(t){return e.setState({text:t.target.value})}})),(0,r.Z)(me.Z,{for:"markup_image_url",label:pgettext("markup editor","Image URL"),validation:this.state.error?[this.state.error]:void 0},void 0,(0,r.Z)("input",{id:"markup_image_url",className:"form-control",type:"text",value:this.state.url,placeholder:"http://domain.com/image.png",onChange:function(t){return e.setState({url:t.target.value})}}))),(0,r.Z)("div",{className:"modal-footer"},void 0,(0,r.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,pgettext("markup editor","Cancel")),(0,r.Z)("button",{className:"btn btn-primary"},void 0,pgettext("markup editor","Insert image"))))))}}]),i}(o().Component);var ft;const Zt=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"handleSubmit",(function(e){e.preventDefault();var n=t.props,a=n.selection,i=n.update,o=t.state.text.trim(),r=t.state.url.trim();return 0===r.length?(t.setState({error:gettext("This field is required.")}),!1):(o.length>0?ie(a,i,"["+o+"]("+r+")"):ie(a,i,"<"+r+">"),Q.Z.hide(),!1)}));var n=e.selection.text.trim(),o=mt(n);return t.state={error:null,text:o?"":n,url:o?n:""},t}return(0,s.Z)(i,[{key:"render",value:function(){var e=this;return(0,r.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,ft||(ft=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("markup editor","Link"))),(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"modal-body"},void 0,(0,r.Z)(me.Z,{for:"markup_link_url",label:pgettext("markup editor","Link text"),helpText:pgettext("markup editor","Optional. Will be displayed instead of link's address.")},void 0,(0,r.Z)("input",{id:"markup_link_text",className:"form-control",type:"text",value:this.state.text,onChange:function(t){return e.setState({text:t.target.value})}})),(0,r.Z)(me.Z,{for:"markup_link_url",label:pgettext("markup editor","Link address"),validation:this.state.error?[this.state.error]:void 0},void 0,(0,r.Z)("input",{id:"markup_link_url",className:"form-control",type:"text",value:this.state.url,onChange:function(t){return e.setState({url:t.target.value})}}))),(0,r.Z)("div",{className:"modal-footer"},void 0,(0,r.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,pgettext("markup editor","Cancel")),(0,r.Z)("button",{className:"btn btn-primary"},void 0,pgettext("markup editor","Insert link"))))))}}]),i}(o().Component);var gt;const yt=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"handleSubmit",(function(e){e.preventDefault();var n=t.props,a=n.selection,i=n.update,o=t.state.author.trim(),r=t.state.text.trim();if(0===r.length)return t.setState({error:gettext("This field is required.")}),!1;var s=a.prefix.trim().length?"\n\n":"";return ie(a,i,o?s+'[quote="'+o+'"]\n'+r+"\n[/quote]\n\n":s+"[quote]\n"+r+"\n[/quote]\n\n"),Q.Z.hide(),!1})),t.state={error:null,author:"",text:e.selection.text},t}return(0,s.Z)(i,[{key:"render",value:function(){var e=this;return(0,r.Z)("div",{className:"modal-dialog modal-lg",role:"document"},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,gt||(gt=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("markup editor","Quote"))),(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"modal-body"},void 0,(0,r.Z)(me.Z,{for:"markup_quote_author",label:pgettext("markup editor","Quote's author or source"),helpText:pgettext("markup editor",'Optional. If it\'s username, put "@" before it ("@JohnDoe").')},void 0,(0,r.Z)("input",{id:"markup_quote_author",className:"form-control",type:"text",value:this.state.author,onChange:function(t){return e.setState({author:t.target.value})}})),(0,r.Z)(me.Z,{for:"markup_quote_text",label:pgettext("markup editor","Quoted text"),validation:this.state.error?[this.state.error]:void 0},void 0,(0,r.Z)("textarea",{id:"markup_quote_text",className:"form-control",rows:"8",value:this.state.text,onChange:function(t){return e.setState({text:t.target.value})}}))),(0,r.Z)("div",{className:"modal-footer"},void 0,(0,r.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,pgettext("markup editor","Cancel")),(0,r.Z)("button",{className:"btn btn-primary"},void 0,pgettext("markup editor","Insert quote"))))))}}]),i}(o().Component),bt=function(e){var t=e.disabled,n=e.icon,a=e.title,i=e.onClick;return(0,r.Z)("button",{className:"btn btn-markup-editor",title:a,type:"button",disabled:t,onClick:i},void 0,(0,r.Z)("span",{className:"material-icon"},void 0,n))};var kt=n(54031);const _t=function(e,t){var n=1024*W.Z.get("user").acl.max_attachment_size;if(e.size>n)V.Z.error(interpolate(pgettext("markup editor","File %(filename)s is bigger than %(limit)s."),{filename:e.name,limit:(0,K.Z)(n)},!0));else{var a={id:null,key:(0,kt.ZP)(32),error:null,uploaded_on:null,progress:0,filename:e.name,filetype:null,is_image:!1,size:e.size,url:null,uploader_name:null};t((function(e){var t=e.attachments;return{attachments:[a].concat(t)}}));var i=function(){t((function(e){return{attachments:e.attachments.concat()}}))},o=new FormData;o.append("upload",e),H.Z.upload(W.Z.get("ATTACHMENTS_API"),o,(function(e){a.progress=e,i()})).then((function(e){Object.assign(a,e,{uploaded_on:z()(e.uploaded_on)}),i()}),(function(e){400===e.status||413===e.status?(a.error=e.detail,V.Z.error(e.detail),i()):V.Z.apiError(e)}))}};var xt,Nt;const wt=function(e){var t=e.disabled,n=e.element,a=e.update,i=e.updateAttachments,o=[{name:pgettext("markup editor","Strong"),icon:"format_bold",onClick:function(){ae(oe(n),a,"**","**",pgettext("example markup","Strong text"))}},{name:pgettext("markup editor","Emphasis"),icon:"format_italic",onClick:function(){ae(oe(n),a,"*","*",pgettext("example markup","Text with emphasis"))}},{name:pgettext("markup editor","Strikethrough"),icon:"format_strikethrough",onClick:function(){ae(oe(n),a,"~~","~~",pgettext("example markup","Text with strikethrough"))}},{name:pgettext("markup editor","Horizontal ruler"),icon:"remove",onClick:function(){ie(oe(n),a,"\n\n- - -\n\n")}},{name:pgettext("markup editor","Link"),icon:"insert_link",onClick:function(){var e=oe(n);Q.Z.show((0,r.Z)(Zt,{selection:e,element:n,update:a}))}},{name:pgettext("markup editor","Image"),icon:"insert_photo",onClick:function(){var e=oe(n);Q.Z.show((0,r.Z)(vt,{selection:e,element:n,update:a}))}},{name:pgettext("markup editor","Quote"),icon:"format_quote",onClick:function(){var e=oe(n);Q.Z.show((0,r.Z)(yt,{selection:e,element:n,update:a}))}},{name:pgettext("markup editor","Spoiler"),icon:"visibility_off",onClick:function(){!function(e,t){var n=oe(e),a=n.prefix.trim().length?"\n\n":"";ae(n,t,a+"[spoiler]\n","\n[/spoiler]\n\n",pgettext("markup editor","Spoiler text"))}(n,a)}},{name:pgettext("markup editor","Code"),icon:"code",onClick:function(){var e=oe(n);Q.Z.show((0,r.Z)(Ze,{selection:e,element:n,update:a}))}}];return W.Z.get("user").acl.max_attachment_size&&o.push({name:pgettext("markup editor","Upload file"),icon:"file_upload",onClick:function(){return e=i,(t=document.createElement("input")).type="file",t.multiple="multiple",t.addEventListener("change",(function(){for(var n=0;n<t.files.length;n++)_t(t.files[n],e)})),void t.click();var e,t}}),(0,r.Z)("div",{className:"markup-editor-toolbar"},void 0,(0,r.Z)("div",{className:"markup-editor-toolbar-left"},void 0,o.map((function(e){var a=e.name,i=e.icon,o=e.onClick;return(0,r.Z)(bt,{title:a,icon:i,disabled:t||!n,onClick:o},i)}))),(0,r.Z)("div",{className:"markup-editor-toolbar-right"},void 0,(0,r.Z)("div",{className:"markup-editor-controls-dropdown"},void 0,(0,r.Z)("button",{type:"button",className:"btn btn-markup-editor dropdown-toggle","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",disabled:t||!n},void 0,xt||(xt=(0,r.Z)("span",{className:"material-icon"},void 0,"more_vert"))),(0,r.Z)("ul",{className:"dropdown-menu dropdown-menu-right stick-to-bottom"},void 0,o.map((function(e){var a=e.name,i=e.icon,o=e.onClick;return(0,r.Z)("li",{},i,(0,r.Z)("button",{type:"button",className:"btn-link",disabled:t||!n,onClick:o},void 0,(0,r.Z)("span",{className:"material-icon"},void 0,i),a))})))),(0,r.Z)(bt,{title:pgettext("markup editor","Open formatting help"),icon:"help_outline",onClick:function(){Q.Z.show(Nt||(Nt=(0,r.Z)(ct,{})))}})))};var Ct=n(19755);const Rt=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"showPreview",(function(){t.state.loading||(t.setState({loading:!0,preview:!0,element:null}),H.Z.post(W.Z.get("PARSE_MARKUP_API"),{post:t.props.value}).then((function(e){t.setState({loading:!1,parsed:e.parsed})}),(function(e){400===e.status?V.Z.error(e.detail):V.Z.apiError(e),t.setState({loading:!1,preview:!1})})))})),(0,h.Z)((0,c.Z)(t),"closePreview",(function(){t.setState({loading:!1,preview:!1})})),(0,h.Z)((0,c.Z)(t),"onDrop",(function(e){if(e.preventDefault(),e.stopPropagation(),e.dataTransfer.files){var n=t.props.onAttachmentsChange;if(W.Z.get("user").acl.max_attachment_size)for(var a=0;a<e.dataTransfer.files.length;a++){var i=e.dataTransfer.files[a];_t(i,n)}}})),(0,h.Z)((0,c.Z)(t),"onPaste",(function(e){for(var n=t.props.onAttachmentsChange,a=[],i=0;i<e.clipboardData.items.length;i++){var o=e.clipboardData.items[i];"file"===o.kind&&a.push(o.getAsFile())}if(a.length&&(e.preventDefault(),e.stopPropagation(),W.Z.get("user").acl.max_attachment_size))for(var r=0;r<a.length;r++)_t(a[r],n)})),(0,h.Z)((0,c.Z)(t),"render",(function(){return(0,r.Z)("div",{className:G()("markup-editor",{"markup-editor-focused":t.state.focused&&!t.state.preview})},void 0,(0,r.Z)(wt,{disabled:t.props.disabled||t.state.preview,element:t.state.element,update:function(e){return t.props.onChange({target:{value:e}})},updateAttachments:t.props.onAttachmentsChange}),t.state.preview?(0,r.Z)("div",{className:"markup-editor-preview"},void 0,t.state.loading?(0,r.Z)("div",{className:"markup-editor-preview-loading"},void 0,(0,r.Z)("div",{className:"ui-preview"},void 0,(0,r.Z)("span",{className:"ui-preview-text",style:{width:"240px"}}))):(0,r.Z)($.Z,{className:"markup-editor-preview-contents",markup:t.state.parsed})):o().createElement("textarea",{className:"markup-editor-textarea form-control",placeholder:t.props.placeholder,value:t.props.value,disabled:t.props.disabled||t.state.loading,rows:6,ref:function(e){e&&t.state.element!==e&&(t.setState({element:e}),function(e,t){Ct(t).atwho({at:"@",displayTpl:'<li><img src="${avatar}" alt="">${username}</li>',insertTpl:"@${username}",searchKey:"username",callbacks:{remoteFilter:function(e,t){Ct.getJSON(W.Z.get("MENTION_API"),{q:e},t)}}}),Ct(t).on("inserted.atwho",(function(t,n,a,i){var o=i.query,r=a.target.innerText.trim(),s=t.target.value.substr(0,o.headPos),l=t.target.value.substr(o.endPos);t.target.value=s+r+l,e.onChange(t);var c=o.headPos+r.length;t.target.setSelectionRange(c,c),t.target.focus()}))}(t.props,e))},onChange:t.props.onChange,onDrop:t.onDrop,onFocus:function(){return t.setState({focused:!0})},onPaste:t.onPaste,onBlur:function(){return t.setState({focused:!1})}}),t.props.attachments.length>0&&(0,r.Z)(ce,{attachments:t.props.attachments,disabled:t.props.disabled||t.state.preview,element:t.state.element,setState:t.props.onAttachmentsChange,update:function(e){return t.props.onChange({target:{value:e}})}}),(0,r.Z)(pe,{preview:t.state.preview,canProtect:t.props.canProtect,isProtected:t.props.isProtected,disabled:t.props.disabled,empty:t.props.value.trim().length<W.Z.get("SETTINGS").post_length_min||t.state.loading,enableProtection:t.props.enableProtection,disableProtection:t.props.disableProtection,showPreview:t.showPreview,closePreview:t.closePreview,submitText:t.props.submitText}))})),t.state={element:null,focused:!1,loading:!1,preview:!1,parsed:null},t}return(0,s.Z)(i)}(o().Component);var Et=n(92490);var St="posting-active",Lt="posting-default",Ot="posting-minimized",Pt="posting-fullscreen";const At=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(){return(0,l.Z)(this,i),a.apply(this,arguments)}return(0,s.Z)(i,[{key:"componentDidMount",value:function(){document.body.classList.add(St,Lt)}},{key:"componentWillUnmount",value:function(){document.body.classList.remove(St,Lt,Ot,Pt)}},{key:"componentWillReceiveProps",value:function(e){var t=e.fullscreen;e.minimized?(document.body.classList.remove(Lt,Pt),document.body.classList.add(Ot)):t?(document.body.classList.remove(Lt,Ot),document.body.classList.add(Pt)):(document.body.classList.remove(Pt,Ot),document.body.classList.add(Lt))}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.fullscreen,a=e.minimized;return(0,r.Z)("div",{className:G()("posting-dialog",{"posting-dialog-minimized":a,"posting-dialog-fullscreen":n&&!a})},void 0,(0,r.Z)("div",{className:"posting-dialog-container"},void 0,t))}}]),i}(o().Component),Tt=function(e){var t=e.children;return(0,r.Z)("div",{className:"posting-dialog-body"},void 0,t)};var It;const Bt=function(e){var t=e.close,n=e.message;return(0,r.Z)("div",{className:"posting-dialog-error"},void 0,It||(It=(0,r.Z)("div",{className:"posting-dialog-error-icon"},void 0,(0,r.Z)("span",{className:"material-icon"},void 0,"error_outlined"))),(0,r.Z)("div",{className:"posting-dialog-error-detail"},void 0,(0,r.Z)("p",{},void 0,n),(0,r.Z)("button",{type:"button",className:"btn btn-default",onClick:t},void 0,pgettext("modal","Close"))))};var jt,Dt,Ut,zt,qt;const Mt=function(e){var t=e.children,n=e.close,a=e.fullscreen,i=e.minimize,o=e.minimized,s=e.fullscreenEnter,l=e.fullscreenExit,c=e.open;return(0,r.Z)("div",{className:"posting-dialog-header"},void 0,(0,r.Z)("div",{className:"posting-dialog-caption"},void 0,t),o?(0,r.Z)("button",{className:"btn btn-posting-dialog",title:pgettext("dialog","Open"),type:"button",onClick:c},void 0,jt||(jt=(0,r.Z)("span",{className:"material-icon"},void 0,"expand_less"))):(0,r.Z)("button",{className:"btn btn-posting-dialog",title:pgettext("dialog","Minimize"),type:"button",onClick:i},void 0,Dt||(Dt=(0,r.Z)("span",{className:"material-icon"},void 0,"expand_more"))),a?(0,r.Z)("button",{className:"btn btn-posting-dialog hidden-xs",title:pgettext("dialog","Exit the fullscreen mode"),type:"button",onClick:l},void 0,Ut||(Ut=(0,r.Z)("span",{className:"material-icon"},void 0,"fullscreen_exit"))):(0,r.Z)("button",{className:"btn btn-posting-dialog hidden-xs",title:pgettext("dialog","Enter the fullscreen mode"),type:"button",onClick:s},void 0,zt||(zt=(0,r.Z)("span",{className:"material-icon"},void 0,"fullscreen"))),(0,r.Z)("button",{className:"btn btn-posting-dialog",title:pgettext("dialog","Cancel"),type:"button",onClick:n},void 0,qt||(qt=(0,r.Z)("span",{className:"material-icon"},void 0,"close"))))};var Ft,Ht,Vt,Yt,Gt,Wt,$t,Qt,Kt;function Xt(e){var t=e.isClosed,n=e.isHidden,a=e.isPinned,i=e.disabled,o=e.options,s=e.close,l=e.open,c=e.hide,u=e.unhide,d=e.pinGlobally,p=e.pinLocally,h=e.unpin,m=function(e,t,n){var a=[];return 2===n&&a.push("bookmark"),1===n&&a.push("bookmark_outline"),e&&a.push("lock"),t&&a.push("visibility_off"),a}(t,n,a);return(0,r.Z)("div",{className:"dropdown"},void 0,(0,r.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:pgettext("post thread","Options"),"aria-expanded":"true","aria-haspopup":"true","data-toggle":"dropdown",type:"button",disabled:i},void 0,m.length>0?(0,r.Z)("span",{className:"btn-icons-family"},void 0,m.map((function(e){return(0,r.Z)("span",{className:"material-icon"},e,e)}))):Ft||(Ft=(0,r.Z)("span",{className:"material-icon"},void 0,"more_horiz"))),(0,r.Z)("ul",{className:"dropdown-menu dropdown-menu-right stick-to-bottom"},void 0,2===o.pin&&2!==a&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:d,type:"button",disabled:i},void 0,Ht||(Ht=(0,r.Z)("span",{className:"material-icon"},void 0,"bookmark")),pgettext("post thread","Pinned globally"))),o.pin>=a&&1!==a&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:p,type:"button",disabled:i},void 0,Vt||(Vt=(0,r.Z)("span",{className:"material-icon"},void 0,"bookmark_outline")),pgettext("post thread","Pinned in category"))),o.pin>=a&&0!==a&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:h,type:"button",disabled:i},void 0,Yt||(Yt=(0,r.Z)("span",{className:"material-icon"},void 0,"radio_button_unchecked")),pgettext("post thread","Not pinned"))),o.close&&!!t&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:l,type:"button",disabled:i},void 0,Gt||(Gt=(0,r.Z)("span",{className:"material-icon"},void 0,"lock_outline")),pgettext("post thread","Open"))),o.close&&!t&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:s,type:"button",disabled:i},void 0,Wt||(Wt=(0,r.Z)("span",{className:"material-icon"},void 0,"lock")),pgettext("post thread","Closed"))),o.hide&&!!n&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:u,type:"button",disabled:i},void 0,$t||($t=(0,r.Z)("span",{className:"material-icon"},void 0,"visibility")),pgettext("post thread","Visible"))),o.hide&&!n&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:c,type:"button",disabled:i},void 0,Qt||(Qt=(0,r.Z)("span",{className:"material-icon"},void 0,"visibility_off")),pgettext("post thread","Hidden")))))}var Jt=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"loadSuccess",(function(e){var n=null,a=null,i=e.map((function(e){return!1===e.post||n&&e.id!=t.state.category||(n=e.id,a=e.post),Object.assign(e,{disabled:!1===e.post,label:e.name,value:e.id})}));t.setState({isReady:!0,options:a,categories:i,category:n})})),(0,h.Z)((0,c.Z)(t),"loadError",(function(e){t.setState({error:e.detail})})),(0,h.Z)((0,c.Z)(t),"onCancel",(function(){if(0===t.state.post.length&&0===t.state.title.length&&0===t.state.attachments.length)return t.minimize(),m.Z.close();window.confirm(pgettext("post thread","Are you sure you want to discard thread?"))&&(t.minimize(),m.Z.close())})),(0,h.Z)((0,c.Z)(t),"onTitleChange",(function(e){t.changeValue("title",e.target.value)})),(0,h.Z)((0,c.Z)(t),"onCategoryChange",(function(e){var n=t.state.categories.find((function(t){return e.target.value==t.value})),a=t.state.pin;n.post.pin&&n.post.pin<a&&(a=n.post.pin),t.setState({category:n.id,categoryOptions:n.post,pin:a})})),(0,h.Z)((0,c.Z)(t),"onPostChange",(function(e){t.changeValue("post",e.target.value)})),(0,h.Z)((0,c.Z)(t),"onAttachmentsChange",(function(e){t.setState(e)})),(0,h.Z)((0,c.Z)(t),"onClose",(function(){t.changeValue("close",!0)})),(0,h.Z)((0,c.Z)(t),"onOpen",(function(){t.changeValue("close",!1)})),(0,h.Z)((0,c.Z)(t),"onPinGlobally",(function(){t.changeValue("pin",2)})),(0,h.Z)((0,c.Z)(t),"onPinLocally",(function(){t.changeValue("pin",1)})),(0,h.Z)((0,c.Z)(t),"onUnpin",(function(){t.changeValue("pin",0)})),(0,h.Z)((0,c.Z)(t),"onHide",(function(){t.changeValue("hide",!0)})),(0,h.Z)((0,c.Z)(t),"onUnhide",(function(){t.changeValue("hide",!1)})),(0,h.Z)((0,c.Z)(t),"close",(function(){t.minimize(),m.Z.close()})),(0,h.Z)((0,c.Z)(t),"minimize",(function(){t.setState({fullscreen:!1,minimized:!0})})),(0,h.Z)((0,c.Z)(t),"open",(function(){t.setState({minimized:!1}),t.state.fullscreen})),(0,h.Z)((0,c.Z)(t),"fullscreenEnter",(function(){t.setState({fullscreen:!0,minimized:!1})})),(0,h.Z)((0,c.Z)(t),"fullscreenExit",(function(){t.setState({fullscreen:!1,minimized:!1})})),t.state={isReady:!1,isLoading:!1,error:null,minimized:!1,fullscreen:!1,options:null,title:"",category:e.category||null,categories:[],post:"",attachments:[],close:!1,hide:!1,pin:0,validators:{title:(0,F.jn)(),post:(0,F.Jh)()},errors:{}},t}return(0,s.Z)(i,[{key:"componentDidMount",value:function(){H.Z.get(this.props.config).then(this.loadSuccess,this.loadError)}},{key:"clean",value:function(){if(!this.state.title.trim().length)return V.Z.error(pgettext("posting form","You have to enter thread title.")),!1;if(!this.state.post.trim().length)return V.Z.error(pgettext("posting form","You have to enter a message.")),!1;var e=this.validate();return e.title?(V.Z.error(e.title[0]),!1):!e.post||(V.Z.error(e.post[0]),!1)}},{key:"send",value:function(){return H.Z.post(this.props.submit,{title:this.state.title,category:this.state.category,post:this.state.post,attachments:q(this.state.attachments),close:this.state.close,hide:this.state.hide,pin:this.state.pin})}},{key:"handleSuccess",value:function(e){this.setState({isLoading:!0}),this.close(),V.Z.success(pgettext("post thread","Your thread has been posted.")),window.location=e.url}},{key:"handleError",value:function(e){if(400===e.status){var t=[].concat(e.non_field_errors||[],e.category||[],e.title||[],e.post||[],e.attachments||[]);V.Z.error(t[0])}else V.Z.apiError(e)}},{key:"render",value:function(){var e={minimized:this.state.minimized,minimize:this.minimize,open:this.open,fullscreen:this.state.fullscreen,fullscreenEnter:this.fullscreenEnter,fullscreenExit:this.fullscreenExit,close:this.onCancel};if(this.state.error)return o().createElement(en,e,(0,r.Z)(Bt,{message:this.state.error,close:this.close}));if(!this.state.isReady)return o().createElement(en,e,(0,r.Z)("div",{className:"posting-loading ui-preview"},void 0,Kt||(Kt=(0,r.Z)(Et.o8,{className:"posting-dialog-toolbar"},void 0,(0,r.Z)(Et.Z2,{className:"posting-dialog-thread-title",auto:!0},void 0,(0,r.Z)(Et.Eg,{auto:!0},void 0,(0,r.Z)("input",{className:"form-control",disabled:!0,type:"text"}))),(0,r.Z)(Et.Z2,{className:"posting-dialog-category-select",auto:!0},void 0,(0,r.Z)(Et.Eg,{},void 0,(0,r.Z)("input",{className:"form-control",disabled:!0,type:"text"}))))),(0,r.Z)(Rt,{attachments:[],value:"",submitText:pgettext("post thread submit","Start thread"),disabled:!0,onAttachmentsChange:function(){},onChange:function(){}})));var t=!!(this.state.options.close||this.state.options.hide||this.state.options.pin);return o().createElement(en,e,(0,r.Z)("form",{className:"posting-dialog-form",onSubmit:this.handleSubmit},void 0,(0,r.Z)(Et.o8,{className:"posting-dialog-toolbar"},void 0,(0,r.Z)(Et.Z2,{className:"posting-dialog-thread-title",auto:!0},void 0,(0,r.Z)(Et.Eg,{auto:!0},void 0,(0,r.Z)("input",{className:"form-control",disabled:this.state.isLoading,onChange:this.onTitleChange,placeholder:pgettext("post thread","Thread title"),type:"text",value:this.state.title}))),(0,r.Z)(Et.Z2,{className:"posting-dialog-category-select",auto:!0},void 0,(0,r.Z)(Et.Eg,{},void 0,(0,r.Z)(j.Z,{choices:this.state.categories,disabled:this.state.isLoading,onChange:this.onCategoryChange,value:this.state.category})),t&&(0,r.Z)(Et.Eg,{shrink:!0},void 0,(0,r.Z)(Xt,{isClosed:this.state.close,isHidden:this.state.hide,isPinned:this.state.pin,disabled:this.state.isLoading,options:this.state.options,close:this.onClose,open:this.onOpen,hide:this.onHide,unhide:this.onUnhide,pinGlobally:this.onPinGlobally,pinLocally:this.onPinLocally,unpin:this.onUnpin})))),(0,r.Z)(Rt,{attachments:this.state.attachments,value:this.state.post,submitText:pgettext("post thread submit","Start thread"),disabled:this.state.isLoading,onAttachmentsChange:this.onAttachmentsChange,onChange:this.onPostChange})))}}]),i}(D.Z),en=function(e){var t=e.children,n=e.close,a=e.minimized,i=e.minimize,o=e.open,s=e.fullscreen,l=e.fullscreenEnter,c=e.fullscreenExit;return(0,r.Z)(At,{fullscreen:s,minimized:a},void 0,(0,r.Z)(Mt,{fullscreen:s,fullscreenEnter:l,fullscreenExit:c,minimized:a,minimize:i,open:o,close:n},void 0,pgettext("post thread","Start new thread")),(0,r.Z)(Tt,{},void 0,t))};function tn(e){var t=e.split(",").map((function(e){return e.trim().toLowerCase()})).filter((function(e){return e.length>0}));return t.filter((function(e,n){return t.indexOf(e)==n}))}var nn=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"onCancel",(function(){if(0===t.state.post.length&&0===t.state.title.length&&0===t.state.to.length&&0===t.state.attachments.length)return t.close();window.confirm(pgettext("post thread","Are you sure you want to discard private thread?"))&&t.close()})),(0,h.Z)((0,c.Z)(t),"onToChange",(function(e){t.changeValue("to",e.target.value)})),(0,h.Z)((0,c.Z)(t),"onTitleChange",(function(e){t.changeValue("title",e.target.value)})),(0,h.Z)((0,c.Z)(t),"onPostChange",(function(e){t.changeValue("post",e.target.value)})),(0,h.Z)((0,c.Z)(t),"onAttachmentsChange",(function(e){t.setState(e)})),(0,h.Z)((0,c.Z)(t),"close",(function(){t.minimize(),m.Z.close()})),(0,h.Z)((0,c.Z)(t),"minimize",(function(){t.setState({fullscreen:!1,minimized:!0})})),(0,h.Z)((0,c.Z)(t),"open",(function(){t.setState({minimized:!1}),t.state.fullscreen})),(0,h.Z)((0,c.Z)(t),"fullscreenEnter",(function(){t.setState({fullscreen:!0,minimized:!1})})),(0,h.Z)((0,c.Z)(t),"fullscreenExit",(function(){t.setState({fullscreen:!1,minimized:!1})}));var n=(e.to||[]).map((function(e){return e.username})).join(", ");return t.state={isLoading:!1,error:null,minimized:!1,fullscreen:!1,to:n,title:"",post:"",attachments:[],validators:{title:(0,F.jn)(),post:(0,F.Jh)()},errors:{}},t}return(0,s.Z)(i,[{key:"clean",value:function(){if(!tn(this.state.to).length)return V.Z.error(pgettext("posting form","You have to enter at least one recipient.")),!1;if(!this.state.title.trim().length)return V.Z.error(pgettext("posting form","You have to enter thread title.")),!1;if(!this.state.post.trim().length)return V.Z.error(pgettext("posting form","You have to enter a message.")),!1;var e=this.validate();return e.title?(V.Z.error(e.title[0]),!1):!e.post||(V.Z.error(e.post[0]),!1)}},{key:"send",value:function(){return H.Z.post(this.props.submit,{to:tn(this.state.to),title:this.state.title,post:this.state.post,attachments:q(this.state.attachments)})}},{key:"handleSuccess",value:function(e){this.setState({isLoading:!0}),this.close(),V.Z.success(pgettext("post thread","Your thread has been posted.")),window.location=e.url}},{key:"handleError",value:function(e){if(400===e.status){var t=[].concat(e.non_field_errors||[],e.to||[],e.title||[],e.post||[],e.attachments||[]);V.Z.error(t[0])}else V.Z.apiError(e)}},{key:"render",value:function(){var e={minimized:this.state.minimized,minimize:this.minimize,open:this.open,fullscreen:this.state.fullscreen,fullscreenEnter:this.fullscreenEnter,fullscreenExit:this.fullscreenExit,close:this.onCancel};return o().createElement(an,e,(0,r.Z)("form",{className:"posting-dialog-form",onSubmit:this.handleSubmit},void 0,(0,r.Z)(Et.o8,{className:"posting-dialog-toolbar"},void 0,(0,r.Z)(Et.Z2,{className:"posting-dialog-thread-recipients",auto:!0},void 0,(0,r.Z)(Et.Eg,{auto:!0},void 0,(0,r.Z)("input",{className:"form-control",disabled:this.state.isLoading,onChange:this.onToChange,placeholder:pgettext("post thread","Recipients, eg.: Danny, Lisa, Alice"),type:"text",value:this.state.to}))),(0,r.Z)(Et.Z2,{className:"posting-dialog-thread-title",auto:!0},void 0,(0,r.Z)(Et.Eg,{auto:!0},void 0,(0,r.Z)("input",{className:"form-control",disabled:this.state.isLoading,onChange:this.onTitleChange,placeholder:pgettext("post thread","Thread title"),type:"text",value:this.state.title})))),(0,r.Z)(Rt,{attachments:this.state.attachments,value:this.state.post,submitText:pgettext("post thread submit","Start thread"),disabled:this.state.isLoading,onAttachmentsChange:this.onAttachmentsChange,onChange:this.onPostChange})))}}]),i}(D.Z),an=function(e){var t=e.children,n=e.close,a=e.minimized,i=e.minimize,o=e.open,s=e.fullscreen,l=e.fullscreenEnter,c=e.fullscreenExit;return(0,r.Z)(At,{fullscreen:s,minimized:a},void 0,(0,r.Z)(Mt,{fullscreen:s,fullscreenEnter:l,fullscreenExit:c,minimized:a,minimize:i,open:o,close:n},void 0,pgettext("post thread","Start private thread")),(0,r.Z)(Tt,{},void 0,t))};var on=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"loadSuccess",(function(e){t.setState({isReady:!0,post:e.post?'[quote="@'+e.poster+'"]\n'+e.post+"\n[/quote]":t.state.post}),t.quoteText=e.post?'[quote="@'+e.poster+'"]\n'+e.post+"\n[/quote]":t.state.post})),(0,h.Z)((0,c.Z)(t),"loadError",(function(e){t.setState({error:e.detail})})),(0,h.Z)((0,c.Z)(t),"appendData",(function(e){var n=e.post?'[quote="@'+e.poster+'"]\n'+e.post+"\n[/quote]\n\n":"";t.setState((function(e,t){return e.post.length>0?{post:e.post.trim()+"\n\n"+n}:{post:n}})),t.open()})),(0,h.Z)((0,c.Z)(t),"onCancel",(function(){if(t.state.post===t.quoteText&&0===t.state.attachments.length)return t.close();window.confirm(pgettext("post reply","Are you sure you want to discard your reply?"))&&t.close()})),(0,h.Z)((0,c.Z)(t),"onPostChange",(function(e){t.changeValue("post",e.target.value)})),(0,h.Z)((0,c.Z)(t),"onAttachmentsChange",(function(e){t.setState(e)})),(0,h.Z)((0,c.Z)(t),"onQuote",(function(e){t.setState((function(t){var n=t.post;return n.length>0?{post:n.trim()+"\n\n"+e}:{post:e}})),t.open()})),(0,h.Z)((0,c.Z)(t),"close",(function(){t.minimize(),m.Z.close()})),(0,h.Z)((0,c.Z)(t),"minimize",(function(){t.setState({fullscreen:!1,minimized:!0})})),(0,h.Z)((0,c.Z)(t),"open",(function(){t.setState({minimized:!1}),t.state.fullscreen})),(0,h.Z)((0,c.Z)(t),"fullscreenEnter",(function(){t.setState({fullscreen:!0,minimized:!1})})),(0,h.Z)((0,c.Z)(t),"fullscreenExit",(function(){t.setState({fullscreen:!1,minimized:!1})})),t.state={isReady:!1,isLoading:!1,error:null,minimized:!1,fullscreen:!1,post:t.props.default||"",attachments:[],validators:{post:(0,F.Jh)()},errors:{}},t.quoteText="",t}return(0,s.Z)(i,[{key:"componentDidMount",value:function(){H.Z.get(this.props.config,this.props.context||null).then(this.loadSuccess,this.loadError),I(!1,this.onQuote)}},{key:"componentWillUnmount",value:function(){B()}},{key:"componentWillReceiveProps",value:function(e){var t=this.props.context,n=e.context;t&&n&&!n.reply||H.Z.get(e.config,e.context||null).then(this.appendData,V.Z.apiError)}},{key:"clean",value:function(){if(!this.state.post.trim().length)return V.Z.error(pgettext("posting form","You have to enter a message.")),!1;var e=this.validate();return!e.post||(V.Z.error(e.post[0]),!1)}},{key:"send",value:function(){return I(!0,this.onQuote),H.Z.post(this.props.submit,{post:this.state.post,attachments:q(this.state.attachments)})}},{key:"handleSuccess",value:function(e){this.setState({isLoading:!0}),this.close(),I(!1,this.onQuote),V.Z.success(pgettext("post reply","Your reply has been posted.")),window.location=e.url.index}},{key:"handleError",value:function(e){if(400===e.status){var t=[].concat(e.non_field_errors||[],e.post||[],e.attachments||[]);V.Z.error(t[0])}else V.Z.apiError(e);I(!1,this.onQuote)}},{key:"render",value:function(){var e={thread:this.props.thread,minimized:this.state.minimized,minimize:this.minimize,open:this.open,fullscreen:this.state.fullscreen,fullscreenEnter:this.fullscreenEnter,fullscreenExit:this.fullscreenExit,close:this.onCancel};return this.state.error?o().createElement(rn,e,(0,r.Z)(Bt,{message:this.state.error,close:this.close})):this.state.isReady?o().createElement(rn,e,(0,r.Z)("form",{className:"posting-dialog-form",method:"POST",onSubmit:this.handleSubmit},void 0,(0,r.Z)(Rt,{attachments:this.state.attachments,value:this.state.post,submitText:pgettext("post reply submit","Post reply"),disabled:this.state.isLoading,onAttachmentsChange:this.onAttachmentsChange,onChange:this.onPostChange}))):o().createElement(rn,e,(0,r.Z)("div",{className:"posting-loading ui-preview"},void 0,(0,r.Z)(Rt,{attachments:[],value:"",submitText:pgettext("post reply submit","Post reply"),disabled:!0,onAttachmentsChange:function(){},onChange:function(){}})))}}]),i}(D.Z),rn=function(e){var t=e.children,n=e.close,a=e.minimized,i=e.minimize,o=e.open,s=e.fullscreen,l=e.fullscreenEnter,c=e.fullscreenExit,u=e.thread;return(0,r.Z)(At,{fullscreen:s,minimized:a},void 0,(0,r.Z)(Mt,{fullscreen:s,fullscreenEnter:l,fullscreenExit:c,minimized:a,minimize:i,open:o,close:n},void 0,interpolate(pgettext("post reply","Reply to: %(thread)s"),{thread:u.title},!0)),(0,r.Z)(Tt,{},void 0,t))};var sn=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"loadSuccess",(function(e){var n;t.originalPost=e.post,t.setState({isReady:!0,post:e.post,attachments:(n=e.attachments,n.map((function(e){return Object.assign({},e,{uploaded_on:z()(e.uploaded_on)})}))),protect:e.is_protected,canProtect:e.can_protect})})),(0,h.Z)((0,c.Z)(t),"loadError",(function(e){t.setState({error:e.detail})})),(0,h.Z)((0,c.Z)(t),"appendData",(function(e){var n=e.post?'[quote="@'+e.poster+'"]\n'+e.post+"\n[/quote]\n\n":"";t.setState((function(e,t){return e.post.length>0?{post:e.post.trim()+"\n\n"+n}:{post:n}})),t.open()})),(0,h.Z)((0,c.Z)(t),"onCancel",(function(){var e=t.state.originalPost===t.state.post,n=0===t.state.attachments.length;if(e&&n)return t.close();window.confirm(pgettext("edit reply","Are you sure you want to discard changes?"))&&t.close()})),(0,h.Z)((0,c.Z)(t),"onProtect",(function(){t.setState({protect:!0})})),(0,h.Z)((0,c.Z)(t),"onUnprotect",(function(){t.setState({protect:!1})})),(0,h.Z)((0,c.Z)(t),"onPostChange",(function(e){t.changeValue("post",e.target.value)})),(0,h.Z)((0,c.Z)(t),"onAttachmentsChange",(function(e){t.setState(e)})),(0,h.Z)((0,c.Z)(t),"onQuote",(function(e){t.setState((function(t){var n=t.post;return n.length>0?{post:n.trim()+"\n\n"+e}:{post:e}})),t.open()})),(0,h.Z)((0,c.Z)(t),"close",(function(){t.minimize(),m.Z.close()})),(0,h.Z)((0,c.Z)(t),"minimize",(function(){t.setState({fullscreen:!1,minimized:!0})})),(0,h.Z)((0,c.Z)(t),"open",(function(){t.setState({minimized:!1}),t.state.fullscreen})),(0,h.Z)((0,c.Z)(t),"fullscreenEnter",(function(){t.setState({fullscreen:!0,minimized:!1})})),(0,h.Z)((0,c.Z)(t),"fullscreenExit",(function(){t.setState({fullscreen:!1,minimized:!1})})),t.state={isReady:!1,isLoading:!1,error:!1,minimized:!1,fullscreen:!1,post:"",attachments:[],protect:!1,canProtect:!1,validators:{post:(0,F.Jh)()},errors:{}},t.originalPost="",t}return(0,s.Z)(i,[{key:"componentDidMount",value:function(){H.Z.get(this.props.config).then(this.loadSuccess,this.loadError),I(!1,this.onQuote)}},{key:"componentWillUnmount",value:function(){B()}},{key:"componentWillReceiveProps",value:function(e){var t=this.props.context,n=e.context;t&&n&&t.reply===n.reply||H.Z.get(e.config,e.context||null).then(this.appendData,V.Z.apiError)}},{key:"clean",value:function(){if(!this.state.post.trim().length)return V.Z.error(pgettext("posting form","You have to enter a message.")),!1;var e=this.validate();return!e.post||(V.Z.error(e.post[0]),!1)}},{key:"send",value:function(){return I(!0,this.onQuote),H.Z.put(this.props.submit,{post:this.state.post,attachments:q(this.state.attachments),protect:this.state.protect})}},{key:"handleSuccess",value:function(e){this.setState({isLoading:!0}),this.close(),I(!1,this.onQuote),V.Z.success(pgettext("edit reply","Reply has been edited.")),window.location=e.url.index}},{key:"handleError",value:function(e){if(400===e.status){var t=[].concat(e.non_field_errors||[],e.category||[],e.title||[],e.post||[],e.attachments||[]);V.Z.error(t[0])}else V.Z.apiError(e);I(!1,this.onQuote)}},{key:"render",value:function(){var e=this,t={post:this.props.post,minimized:this.state.minimized,minimize:this.minimize,open:this.open,fullscreen:this.state.fullscreen,fullscreenEnter:this.fullscreenEnter,fullscreenExit:this.fullscreenExit,close:this.onCancel};return this.state.error?o().createElement(ln,t,(0,r.Z)(Bt,{message:this.state.error,close:this.close})):this.state.isReady?o().createElement(ln,t,(0,r.Z)("form",{className:"posting-dialog-form",method:"POST",onSubmit:this.handleSubmit},void 0,(0,r.Z)(Rt,{attachments:this.state.attachments,canProtect:this.state.canProtect,isProtected:this.state.protect,enableProtection:function(){return e.setState({protect:!0})},disableProtection:function(){return e.setState({protect:!1})},value:this.state.post,submitText:pgettext("edit reply submit","Edit reply"),disabled:this.state.isLoading,onAttachmentsChange:this.onAttachmentsChange,onChange:this.onPostChange}))):o().createElement(ln,t,(0,r.Z)("div",{className:"posting-loading ui-preview"},void 0,(0,r.Z)(Rt,{attachments:[],value:"",submitText:pgettext("edit reply submit","Edit reply"),disabled:!0,onAttachmentsChange:function(){},onChange:function(){}})))}}]),i}(D.Z),ln=function(e){var t=e.children,n=e.close,a=e.minimized,i=e.minimize,o=e.open,s=e.fullscreen,l=e.fullscreenEnter,c=e.fullscreenExit,u=e.post;return(0,r.Z)(At,{fullscreen:s,minimized:a},void 0,(0,r.Z)(Mt,{fullscreen:s,fullscreenEnter:l,fullscreenExit:c,minimized:a,minimize:i,open:o,close:n},void 0,interpolate(pgettext("edit reply","Edit reply by %(poster)s from %(date)s"),{poster:u.poster?u.poster.username:u.poster_name,date:u.posted_on.fromNow()},!0)),(0,r.Z)(Tt,{},void 0,t))};function cn(e){switch(e.mode){case"START":return o().createElement(Jt,e);case"START_PRIVATE":return o().createElement(nn,e);case"REPLY":return o().createElement(on,e);case"EDIT":return o().createElement(sn,e);default:return null}}},12891:(e,t,n)=>{"use strict";n.d(t,{Jh:()=>r,jn:()=>o});var a=n(55210),i=n(34458);function o(){return[(0,a.Ei)(i.Z.get("SETTINGS").thread_title_length_min,(function(e,t){var n=npgettext("thread title length validator","Thread title should be at least %(limit_value)s character long (it has %(show_value)s).","Thread title should be at least %(limit_value)s characters long (it has %(show_value)s).",e);return interpolate(n,{limit_value:e,show_value:t},!0)})),(0,a.BS)(i.Z.get("SETTINGS").thread_title_length_max,(function(e,t){var n=npgettext("thread title length validator","Thread title cannot be longer than %(limit_value)s character (it has %(show_value)s).","Thread title cannot be longer than %(limit_value)s characters (it has %(show_value)s).",e);return interpolate(n,{limit_value:e,show_value:t},!0)}))]}function r(){return i.Z.get("SETTINGS").post_length_max?[s(),(0,a.BS)(i.Z.get("SETTINGS").post_length_max||1e6,(function(e,t){var n=npgettext("post length validator","Posted message cannot be longer than %(limit_value)s character (it has %(show_value)s).","Posted message cannot be longer than %(limit_value)s characters (it has %(show_value)s).",e);return interpolate(n,{limit_value:e,show_value:t},!0)}))]:[s()]}function s(){return(0,a.Ei)(i.Z.get("SETTINGS").post_length_min,(function(e,t){var n=npgettext("post length validator","Posted message should be at least %(limit_value)s character long (it has %(show_value)s).","Posted message should be at least %(limit_value)s characters long (it has %(show_value)s).",e);return interpolate(n,{limit_value:e,show_value:t},!0)}))}},11920:(e,t,n)=>{"use strict";n.d(t,{E:()=>A,F:()=>B});var a=n(22928),i=n(57588),o=n.n(i),r=n(15671),s=n(43144),l=n(79340),c=n(6215),u=n(61120),d=n(60642),p=n(66398);function h(e){var t=e.children;return(0,a.Z)(p.NX,{className:"search-results-list"},void 0,t)}function m(){return(0,a.Z)(h,{},void 0,(0,a.Z)(p.j0,{message:pgettext("search cta","Enter search query (at least 3 characters).")}))}var v=n(16069);function f(e){var t=e.post;return(0,a.Z)(p.WI,{className:"search-result"},void 0,(0,a.Z)("a",{href:t.url.index},void 0,(0,a.Z)("div",{className:"search-result-card"},void 0,(0,a.Z)("div",{className:"search-result-name"},void 0,t.thread.title),(0,a.Z)("div",{className:"search-result-summary",dangerouslySetInnerHTML:{__html:t.headline||t.content}}),(0,a.Z)("ul",{className:"search-result-details"},void 0,(0,a.Z)("li",{},void 0,(0,a.Z)("b",{},void 0,t.category.name)),(0,a.Z)("li",{},void 0,t.poster?t.poster.username:t.poster_name),(0,a.Z)("li",{},void 0,(0,a.Z)(v.Z,{datetime:t.posted_on}))))))}var Z,g,y,b=n(19605);function k(e){var t=e.user,n=t.title||t.rank.title;return(0,a.Z)(p.WI,{className:"search-result"},void 0,(0,a.Z)("a",{href:t.url},void 0,(0,a.Z)(b.ZP,{user:t,size:32}),(0,a.Z)("div",{className:"search-result-card"},void 0,(0,a.Z)("div",{className:"search-result-name"},void 0,t.username),(0,a.Z)("ul",{className:"search-result-details"},void 0,!!n&&(0,a.Z)("li",{},void 0,(0,a.Z)("b",{},void 0,n)),(0,a.Z)("li",{},void 0,t.rank.name),(0,a.Z)("li",{},void 0,(0,a.Z)(v.Z,{datetime:t.joined_on}))))))}function _(e){var t=e.query,n=e.results,i=n[0],o=n[1],r=i.results.count;return(0,a.Z)(h,{},void 0,o.results.results.map((function(e){return(0,a.Z)(k,{user:e},e.id)})),i.results.results.map((function(e){return(0,a.Z)(f,{post:e},e.id)})),r>0&&(0,a.Z)(p.WI,{},void 0,(0,a.Z)("a",{href:i.url+"?q="+encodeURIComponent(t),className:"btn btn-default btn-block"},void 0,npgettext("search results list","See all %(count)s result.","See all %(count)s results.",i.results.count).replace("%(count)s",i.results.count))))}function x(){return(0,a.Z)(h,{},void 0,(0,a.Z)(p.PB,{message:pgettext("search results","The search returned no results.")}))}function N(e){var t=e.error;return(0,a.Z)(h,{},void 0,(0,a.Z)(p.Zn,{message:pgettext("search results","The search could not be completed."),detail:w(t)}))}function w(e){return 0===e.status?gettext("Check your internet connection and try refreshing the site."):e.data&&e.data.detail?e.data.detail:void 0}function C(){return(0,a.Z)(h,{},void 0,(0,a.Z)(p.WE,{message:pgettext("search results","Searching...")}))}var R={},E=function(e){(0,l.Z)(o,e);var t,n,i=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function o(e){var t;return(0,r.Z)(this,o),(t=i.call(this,e)).state={query:t.props.query.trim()},t.debounce=null,t}return(0,s.Z)(o,[{key:"componentDidUpdate",value:function(){var e=this,t=this.props.query.trim();this.state.query!=t&&(this.debounce&&window.clearTimeout(this.debounce),this.debounce=window.setTimeout((function(){e.setState({query:t})}),750))}},{key:"componentWillUnmount",value:function(){this.debounce&&window.clearTimeout(this.debounce)}},{key:"render",value:function(){var e,t=this;return(0,a.Z)(d.b,{url:(e=this.state.query,misago.get("SEARCH_API")+"?q="+encodeURIComponent(e)),cache:R,disabled:this.state.query.length<3},void 0,(function(e){var n=e.data,i=e.loading,o=e.error;return t.state.query.length<3?Z||(Z=(0,a.Z)(m,{})):i?g||(g=(0,a.Z)(C,{})):o?(0,a.Z)(N,{error:o}):function(e){if(null===e)return!0;var t=0;return e.forEach((function(e){t+=e.results.count})),0===t}(n)?y||(y=(0,a.Z)(x,{})):null!==n?(0,a.Z)(_,{query:t.state.query,results:n}):null}))}}]),o}(o().Component);function S(e){var t=e.query,n=e.setQuery;return(0,a.Z)("div",{className:"search-input"},void 0,(0,a.Z)("input",{className:"form-control form-control-search",type:"text",placeholder:pgettext("cta","Search"),value:t,onChange:function(e){return n(e.target.value)}}))}var L=n(97326),O=n(4942);var P=function(e){(0,l.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,O.Z)((0,L.Z)(t),"setQuery",(function(e){t.setState({query:e})})),t.state={query:""},t}return(0,s.Z)(i,[{key:"render",value:function(){return this.props.children({query:this.state.query,setQuery:this.setQuery})}}]),i}(o().Component);function A(){return(0,a.Z)(P,{},void 0,(function(e){var t=e.query,n=e.setQuery;return(0,a.Z)("div",{className:"search-dropdown-body"},void 0,(0,a.Z)(S,{query:t,setQuery:n}),(0,a.Z)(E,{query:t}))}))}var T=n(37424),I=n(64836);const B=(0,T.$j)((function(e){return{open:e.overlay.search}}))((function(e){var t=e.open;return(0,a.Z)(I.a,{open:t,onOpen:function(){window.setTimeout((function(){document.querySelector("#search-mount .form-control-search").focus()}),0)}},void 0,(0,a.Z)(I.i,{},void 0,pgettext("cta","Search")),(0,a.Z)(P,{},void 0,(function(e){var t=e.query,n=e.setQuery;return(0,a.Z)("div",{className:"search-overlay-body"},void 0,(0,a.Z)(S,{query:t,setQuery:n}),(0,a.Z)("div",{className:"search-results-container"},void 0,(0,a.Z)(E,{query:t})))})))}))},60471:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var a=n(22928),i=n(15671),o=n(43144),r=n(97326),s=n(79340),l=n(6215),c=n(61120),u=n(4942),d=n(57588);var p=function(e){(0,s.Z)(p,e);var t,n,d=(t=p,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function p(){var e;(0,i.Z)(this,p);for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return e=d.call.apply(d,[this].concat(n)),(0,u.Z)((0,r.Z)(e),"change",(function(t){return function(){e.props.onChange({target:{value:t}})}})),e}return(0,o.Z)(p,[{key:"getChoice",value:function(){var e=this,t=null;return this.props.choices.map((function(n){n.value===e.props.value&&(t=n)})),t}},{key:"getIcon",value:function(){return this.getChoice().icon}},{key:"getLabel",value:function(){return this.getChoice().label}},{key:"render",value:function(){var e=this;return(0,a.Z)("div",{className:"btn-group btn-select-group"},void 0,(0,a.Z)("button",{type:"button",className:"btn btn-select dropdown-toggle",id:this.props.id||null,"data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false","aria-describedby":this.props["aria-describedby"]||null,disabled:this.props.disabled||!1},void 0,(0,a.Z)(h,{icon:this.getIcon()}),this.getLabel()),(0,a.Z)("ul",{className:"dropdown-menu"},void 0,this.props.choices.map((function(t,n){return(0,a.Z)("li",{},n,(0,a.Z)("button",{type:"button",className:"btn-link",onClick:e.change(t.value)},void 0,(0,a.Z)(h,{icon:t.icon}),t.label))}))))}}]),p}(n.n(d)().Component);function h(e){var t=e.icon;return t?(0,a.Z)("span",{className:"material-icon"},void 0,t):null}},14467:(e,t,n)=>{"use strict";n.d(t,{Z:()=>y});var a,i=n(22928),o=n(15671),r=n(43144),s=n(79340),l=n(6215),c=n(61120),u=(n(57588),n(34458)),d=n(82211),p=n(43345),h=n(47235),m=n(78657),v=n(59801),f=n(53904),Z=n(93051),g=n(19755);var y=function(e){(0,s.Z)(y,e);var t,n,p=(t=y,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function y(e){var t;return(0,o.Z)(this,y),(t=p.call(this,e)).state={isLoading:!1,showActivation:!1,username:"",password:"",validators:{username:[],password:[]}},t}return(0,r.Z)(y,[{key:"clean",value:function(){return!!this.isValid()||(f.Z.error(pgettext("sign in modal","Fill out both fields.")),!1)}},{key:"send",value:function(){return m.Z.post(u.Z.get("AUTH_API"),{username:this.state.username,password:this.state.password})}},{key:"handleSuccess",value:function(){var e=g("#hidden-login-form");e.append('<input type="text" name="username" />'),e.append('<input type="password" name="password" />'),e.find('input[type="hidden"]').val(m.Z.getCsrfToken()),e.find('input[name="next"]').val(window.location.pathname),e.find('input[name="username"]').val(this.state.username),e.find('input[name="password"]').val(this.state.password),e.submit(),this.setState({isLoading:!0})}},{key:"handleError",value:function(e){400===e.status?"inactive_admin"===e.code?f.Z.info(e.detail):"inactive_user"===e.code?(f.Z.info(e.detail),this.setState({showActivation:!0})):"banned"===e.code?((0,Z.Z)(e.detail),v.Z.hide()):f.Z.error(e.detail):403===e.status&&e.ban?((0,Z.Z)(e.ban),v.Z.hide()):f.Z.apiError(e)}},{key:"getActivationButton",value:function(){return this.state.showActivation?(0,i.Z)("a",{className:"btn btn-success btn-block",href:u.Z.get("REQUEST_ACTIVATION_URL")},void 0,pgettext("sign in modal btn","Activate account")):null}},{key:"render",value:function(){return(0,i.Z)("div",{className:"modal-dialog modal-sm modal-sign-in",role:"document"},void 0,(0,i.Z)("div",{className:"modal-content"},void 0,(0,i.Z)("div",{className:"modal-header"},void 0,(0,i.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,a||(a=(0,i.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,i.Z)("h4",{className:"modal-title"},void 0,pgettext("sign in modal title","Sign in"))),(0,i.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,i.Z)("div",{className:"modal-body"},void 0,(0,i.Z)(h.Z,{buttonLabel:pgettext("sign in modal","Sign in with %(site)s"),formLabel:pgettext("sign in modal","Or use your forum account:"),labelClassName:"text-center"}),(0,i.Z)("div",{className:"form-group"},void 0,(0,i.Z)("div",{className:"control-input"},void 0,(0,i.Z)("input",{className:"form-control input-lg",disabled:this.state.isLoading,id:"id_username",onChange:this.bindInput("username"),placeholder:pgettext("sign in modal field","Username or e-mail"),type:"text",value:this.state.username}))),(0,i.Z)("div",{className:"form-group"},void 0,(0,i.Z)("div",{className:"control-input"},void 0,(0,i.Z)("input",{className:"form-control input-lg",disabled:this.state.isLoading,id:"id_password",onChange:this.bindInput("password"),placeholder:pgettext("sign in modal field","Password"),type:"password",value:this.state.password})))),(0,i.Z)("div",{className:"modal-footer"},void 0,this.getActivationButton(),(0,i.Z)(d.Z,{className:"btn-primary btn-block",loading:this.state.isLoading},void 0,pgettext("sign in modal btn","Sign in")),(0,i.Z)("a",{className:"btn btn-default btn-block",href:u.Z.get("FORGOTTEN_PASSWORD_URL")},void 0,pgettext("sign in modal btn","Forgot password?"))))))}}]),y}(p.Z)},24678:(e,t,n)=>{"use strict";n.d(t,{Jj:()=>h,ZP:()=>p,pg:()=>m});var a=n(22928),i=n(15671),o=n(43144),r=n(79340),s=n(6215),l=n(61120),c=n(57588),u=n.n(c);function d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=(0,l.Z)(e);if(t){var i=(0,l.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,s.Z)(this,n)}}var p=function(e){(0,r.Z)(n,e);var t=d(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,o.Z)(n,[{key:"getClass",value:function(){return e=this.props.status,t="",e.is_banned?t="banned":e.is_hidden?t="offline":e.is_online_hidden?t="online":e.is_offline_hidden?t="offline":e.is_online?t="online":e.is_offline&&(t="offline"),"user-status user-"+t;var e,t}},{key:"render",value:function(){return(0,a.Z)("span",{className:this.getClass()},void 0,this.props.children)}}]),n}(u().Component),h=function(e){(0,r.Z)(n,e);var t=d(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,o.Z)(n,[{key:"getIcon",value:function(){return this.props.status.is_banned?"remove_circle_outline":this.props.status.is_hidden?"help_outline":this.props.status.is_online_hidden?"label":this.props.status.is_offline_hidden?"label_outline":this.props.status.is_online?"lens":this.props.status.is_offline?"panorama_fish_eye":void 0}},{key:"render",value:function(){return(0,a.Z)("span",{className:"material-icon status-icon"},void 0,this.getIcon())}}]),n}(u().Component),m=function(e){(0,r.Z)(n,e);var t=d(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,o.Z)(n,[{key:"getHelp",value:function(){return e=this.props.user,(t=this.props.status).is_banned?t.banned_until?interpolate(pgettext("user status","%(username)s is banned until %(ban_expires)s"),{username:e.username,ban_expires:t.banned_until.format("LL, LT")},!0):interpolate(pgettext("user status","%(username)s is banned"),{username:e.username},!0):t.is_hidden?interpolate(pgettext("user status","%(username)s is hiding presence"),{username:e.username},!0):t.is_online_hidden?interpolate(pgettext("user status","%(username)s is online (hidden)"),{username:e.username},!0):t.is_offline_hidden?interpolate(pgettext("user status","%(username)s was last seen %(last_click)s (hidden)"),{username:e.username,last_click:t.last_click.fromNow()},!0):t.is_online?interpolate(pgettext("user status","%(username)s is online"),{username:e.username},!0):t.is_offline?interpolate(pgettext("user status","%(username)s was last seen %(last_click)s"),{username:e.username,last_click:t.last_click.fromNow()},!0):void 0;var e,t}},{key:"getLabel",value:function(){return this.props.status.is_banned?pgettext("user status","Banned"):this.props.status.is_hidden?pgettext("user status","Hidden"):this.props.status.is_online_hidden?pgettext("user status","Online (hidden)"):this.props.status.is_offline_hidden?pgettext("user status","Offline (hidden)"):this.props.status.is_online?pgettext("user status","Online"):this.props.status.is_offline?pgettext("user status","Offline"):void 0}},{key:"render",value:function(){return(0,a.Z)("span",{className:this.props.className||"status-label",title:this.getHelp()},void 0,this.getLabel())}}]),n}(u().Component)},40429:(e,t,n)=>{"use strict";n.d(t,{Z:()=>L});var a,i=n(22928),o=n(57588),r=n.n(o),s=n(19605),l=n(24678);function c(e){var t=e.showStatus,n=e.user;return(0,i.Z)("ul",{className:"list-unstyled"},void 0,(0,i.Z)(u,{showStatus:t,user:n}),(0,i.Z)(d,{user:n}),a||(a=(0,i.Z)("li",{className:"user-stat-divider"})),(0,i.Z)(p,{user:n}),(0,i.Z)(h,{user:n}),(0,i.Z)(m,{user:n}))}function u(e){var t=e.showStatus,n=e.user;return t?(0,i.Z)("li",{className:"user-stat-status"},void 0,(0,i.Z)(l.ZP,{status:n.status},void 0,(0,i.Z)(l.pg,{status:n.status,user:n}))):null}function d(e){var t=e.user.joined_on,n=interpolate(pgettext("users list item","Joined on %(joined_on)s"),{joined_on:t.format("LL, LT")},!0),a=interpolate(pgettext("users list item","Joined %(joined_on)s"),{joined_on:t.fromNow()},!0);return(0,i.Z)("li",{className:"user-stat-join-date"},void 0,(0,i.Z)("abbr",{title:n},void 0,a))}function p(e){var t=e.user,n=v("user-stat-posts",t.posts),a=npgettext("users list item","%(posts)s post","%(posts)s posts",t.posts);return(0,i.Z)("li",{className:n},void 0,interpolate(a,{posts:t.posts},!0))}function h(e){var t=e.user,n=v("user-stat-threads",t.threads),a=npgettext("users list item","%(threads)s thread","%(threads)s threads",t.threads);return(0,i.Z)("li",{className:n},void 0,interpolate(a,{threads:t.threads},!0))}function m(e){var t=e.user,n=v("user-stat-followers",t.followers),a=npgettext("users list item","%(followers)s follower","%(followers)s followers",t.followers);return(0,i.Z)("li",{className:n},void 0,interpolate(a,{followers:t.followers},!0))}function v(e,t){return 0===t?e+" user-stat-empty":e}function f(e){var t=e.rank,n=e.title||t.title||t.name,a="user-title";return t.css_class&&(a+=" user-title-"+t.css_class),t.is_tab?(0,i.Z)("a",{className:a,href:t.url},void 0,n):(0,i.Z)("span",{className:a},void 0,n)}function Z(e){var t=e.showStatus,n=e.user,a=n.rank,o="panel user-card";return a.css_class&&(o+=" user-card-"+a.css_class),(0,i.Z)("div",{className:o},void 0,(0,i.Z)("div",{className:"panel-body"},void 0,(0,i.Z)("div",{className:"row"},void 0,(0,i.Z)("div",{className:"col-xs-3 user-card-left"},void 0,(0,i.Z)("div",{className:"user-card-small-avatar"},void 0,(0,i.Z)("a",{href:n.url},void 0,(0,i.Z)(s.ZP,{size:"50",size2x:"80",user:n})))),(0,i.Z)("div",{className:"col-xs-9 col-sm-12 user-card-body"},void 0,(0,i.Z)("div",{className:"user-card-avatar"},void 0,(0,i.Z)("a",{href:n.url},void 0,(0,i.Z)(s.ZP,{size:"150",size2x:"200",user:n}))),(0,i.Z)("div",{className:"user-card-username"},void 0,(0,i.Z)("a",{href:n.url},void 0,n.username)),(0,i.Z)("div",{className:"user-card-title"},void 0,(0,i.Z)(f,{rank:a,title:n.title})),(0,i.Z)("div",{className:"user-card-stats"},void 0,(0,i.Z)(c,{showStatus:t,user:n}))))))}var g,y,b,k=n(15671),_=n(43144),x=n(79340),N=n(6215),w=n(61120),C=n(44039);var R,E=function(e){(0,x.Z)(o,e);var t,n,a=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,w.Z)(t);if(n){var i=(0,w.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,N.Z)(this,e)});function o(){return(0,k.Z)(this,o),a.apply(this,arguments)}return(0,_.Z)(o,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"render",value:function(){return(0,i.Z)("div",{className:"panel user-card user-card-preview"},void 0,(0,i.Z)("div",{className:"panel-body"},void 0,(0,i.Z)("div",{className:"row"},void 0,g||(g=(0,i.Z)("div",{className:"col-xs-3 user-card-left"},void 0,(0,i.Z)("div",{className:"user-card-small-avatar"},void 0,(0,i.Z)("span",{},void 0,(0,i.Z)(s.ZP,{size:"50",size2x:"80"}))))),(0,i.Z)("div",{className:"col-xs-9 col-sm-12 user-card-body"},void 0,y||(y=(0,i.Z)("div",{className:"user-card-avatar"},void 0,(0,i.Z)("span",{},void 0,(0,i.Z)(s.ZP,{size:"150",size2x:"200"})))),(0,i.Z)("div",{className:"user-card-username"},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:C.e(60,150)+"px"}},void 0," ")),(0,i.Z)("div",{className:"user-card-title"},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:C.e(60,150)+"px"}},void 0," ")),(0,i.Z)("div",{className:"user-card-stats"},void 0,(0,i.Z)("ul",{className:"list-unstyled"},void 0,(0,i.Z)("li",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:C.e(30,70)+"px"}},void 0," ")),(0,i.Z)("li",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:C.e(30,70)+"px"}},void 0," ")),b||(b=(0,i.Z)("li",{className:"user-stat-divider"})),(0,i.Z)("li",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:C.e(30,70)+"px"}},void 0," ")),(0,i.Z)("li",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:C.e(30,70)+"px"}},void 0," "))))))))}}]),o}(r().Component);function S(e){var t=e.colClassName,n=e.cols,a=Array.apply(null,{length:n}).map(Number.call,Number);return(0,i.Z)("div",{className:"users-cards-list ui-preview"},void 0,(0,i.Z)("div",{className:"row"},void 0,a.map((function(e){var n=t;return 0!==e&&(n+=" hidden-xs"),3===e&&(n+=" hidden-sm"),(0,i.Z)("div",{className:n},e,R||(R=(0,i.Z)(E,{})))}))))}function L(e){var t=e.cols,n=e.isReady,a=e.showStatus,o=e.users,r="col-xs-12 col-sm-4";return 4===t&&(r+=" col-md-3"),n?(0,i.Z)("div",{className:"users-cards-list ui-ready"},void 0,(0,i.Z)("div",{className:"row"},void 0,o.map((function(e){return(0,i.Z)("div",{className:r},e.id,(0,i.Z)(Z,{showStatus:a,user:e}))})))):(0,i.Z)(S,{colClassName:r,cols:t})}},82125:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var a=n(15671),i=n(43144),o=n(97326),r=n(79340),s=n(6215),l=n(61120),c=n(4942),u=n(57588);var d=function(e){(0,r.Z)(d,e);var t,n,u=(t=d,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,s.Z)(this,e)});function d(e){var t;return(0,a.Z)(this,d),t=u.call(this,e),(0,c.Z)((0,o.Z)(t),"toggleNav",(function(){t.setState({dropdown:!t.state.dropdown})})),(0,c.Z)((0,o.Z)(t),"hideNav",(function(){t.setState({dropdown:!1})})),t.state={dropdown:!1},t}return(0,i.Z)(d,[{key:"getCompactNavClassName",value:function(){return this.state.dropdown?"compact-nav open":"compact-nav"}}]),d}(n.n(u)().Component)},7227:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var a=n(22928),i=n(15671),o=n(43144),r=n(97326),s=n(79340),l=n(6215),c=n(61120),u=n(4942),d=n(57588);var p=function(e){(0,s.Z)(p,e);var t,n,d=(t=p,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function p(){var e;(0,i.Z)(this,p);for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return e=d.call.apply(d,[this].concat(n)),(0,u.Z)((0,r.Z)(e),"toggle",(function(){e.props.onChange({target:{value:!e.props.value}})})),e}return(0,o.Z)(p,[{key:"getClassName",value:function(){return this.props.value?"btn btn-yes-no btn-yes-no-on":"btn btn-yes-no btn-yes-no-off"}},{key:"getIcon",value:function(){return this.props.value?this.props.iconOn||"check_box":this.props.iconOff||"check_box_outline_blank"}},{key:"getLabel",value:function(){return this.props.value?this.props.labelOn||pgettext("yesno switch choice","yes"):this.props.labelOff||pgettext("yesno switch choice","no")}},{key:"render",value:function(){return(0,a.Z)("button",{type:"button",onClick:this.toggle,className:this.getClassName(),id:this.props.id||null,"aria-describedby":this.props["aria-describedby"]||null,disabled:this.props.disabled||!1},void 0,(0,a.Z)("span",{className:"material-icon"},void 0,this.getIcon()),(0,a.Z)("span",{className:"btn-text"},void 0,this.getLabel()))}}]),p}(n.n(d)().Component)},41761:()=>{document.body.addEventListener("click",(function(e){var t=e.target.getAttribute("misago-focus-on");if(t){e.preventDefault();var n=document.querySelector(t);n&&n.focus()}}))},75557:(e,t,n)=>{"use strict";n.d(t,{SW:()=>k,ry:()=>m,xn:()=>x});var a=window.misago_locale||"en-us",i=pgettext("time ago","moment ago"),o=pgettext("time ago","now"),r=pgettext("day at time","%(day)s at %(time)s"),s=pgettext("day at time","Today at %(time)s"),l=pgettext("day at time","Tomorrow at %(time)s"),c=pgettext("day at time","Yesterday at %(time)s"),u=pgettext("short minutes","%(time)sm"),d=pgettext("short hours","%(time)sh"),p=pgettext("short days","%(time)sd"),h=new Intl.RelativeTimeFormat(a,{numeric:"always",style:"long"}),m=new Intl.DateTimeFormat(a,{dateStyle:"full",timeStyle:"medium"}),v=new Intl.DateTimeFormat(a,{month:"long",day:"numeric"}),f=new Intl.DateTimeFormat(a,{year:"numeric",month:"long",day:"numeric"}),Z=(new Intl.DateTimeFormat(a,{year:"2-digit",month:"short",day:"numeric"}),new Intl.DateTimeFormat(a,{weekday:"long"})),g=new Intl.DateTimeFormat(a,{timeStyle:"short"}),y=new Intl.DateTimeFormat(a,{month:"short",day:"numeric"}),b=new Intl.DateTimeFormat(a,{month:"short",year:"numeric"});function k(e){var t=new Date,n=Math.round((e-t)/1e3),a=Math.abs(n),o=n<1?-1:1;if(a<90)return i;if(a<2820){var u=Math.round(a/60)*o;return h.format(u,"minute")}if(a<10800){var d=Math.round(a/3600)*o;return h.format(d,"hour")}return _(t,e)?n>0?s.replace("%(time)s",g.format(e)):g.format(e):function(e){var t=new Date;return t.setDate(t.getDate()-1),_(t,e)}(e)?c.replace("%(time)s",g.format(e)):function(e){var t=new Date;return t.setDate(t.getDate()+1),_(t,e)}(e)?l.replace("%(time)s",g.format(e)):n<0&&a<518400?function(e,t){return r.replace("%(day)s",e).replace("%(time)s",g.format(t))}(Z.format(e),e):t.getFullYear()==e.getFullYear()?v.format(e):f.format(e)}function _(e,t){return e.getFullYear()==t.getFullYear()&&e.getMonth()==t.getMonth()&&e.getDate()==t.getDate()}function x(e){var t=new Date,n=Math.abs(Math.round((e-t)/1e3));if(n<60)return o;if(n<3300){var a=Math.round(n/60);return u.replace("%(time)s",a)}if(n<86400){var i=Math.round(n/3600);return d.replace("%(time)s",i)}if(n<604800){var r=Math.round(n/86400);return p.replace("%(time)s",r)}return e.getFullYear()===t.getFullYear()?y.format(e):b.format(e)}},34458:(e,t,n)=>{"use strict";n.d(t,{Z:()=>he});var a=n(15671),i=n(43144),o=n(4942),r=(n(58294),n(95377),n(68852),n(39737),n(14316),n(43204),n(7023),n(38914));const s=function(){function e(t){(0,a.Z)(this,e),this.isOrdered=!1,this._items=t||[]}return(0,i.Z)(e,[{key:"add",value:function(e,t,n){this._items.push({key:e,item:t,after:n&&n.after||null,before:n&&n.before||null})}},{key:"get",value:function(e,t){for(var n=0;n<this._items.length;n++)if(this._items[n].key===e)return this._items[n].item;return t}},{key:"has",value:function(e){return void 0!==this.get(e)}},{key:"values",value:function(){for(var e=[],t=0;t<this._items.length;t++)e.push(this._items[t].item);return e}},{key:"order",value:function(e){return this.isOrdered||(this._items=this._order(this._items),this.isOrdered=!0),e||void 0===e?this.values():this._items}},{key:"orderedValues",value:function(){return this.order(!0)}},{key:"_order",value:function(e){var t=[];e.forEach((function(e){t.push(e.key)}));var n=[],a=[];function i(e){var t=-1;-1===a.indexOf(e.key)&&(e.after?-1!==(t=a.indexOf(e.after))&&(t+=1):e.before&&(t=a.indexOf(e.before)),-1!==t&&(n.splice(t,0,e),a.splice(t,0,e.key)))}e.forEach((function(e){e.after||e.before||(n.push(e),a.push(e.key))})),e.forEach((function(e){"_end"===e.before&&(n.push(e),a.push(e.key))}));for(var o=200;o>0&&t.length!==a.length;)o-=1,e.forEach(i);return n}}]),e}();function l(e){var t=e.closest("[hx-silent]");return!t||"true"!==t.getAttribute("hx-silent")}const c=(0,i.Z)((function e(){var t=this;(0,a.Z)(this,e),(0,o.Z)(this,"show",(function(){t.requests+=1,t.update()})),(0,o.Z)(this,"hide",(function(){t.requests&&(t.requests-=1,t.update())})),(0,o.Z)(this,"update",(function(){t.timeout&&window.clearTimeout(t.timeout),t.requests?(t.element.classList.add("busy"),t.element.classList.remove("complete")):(t.element.classList.remove("busy"),t.element.classList.add("complete"),t.timeout=setTimeout((function(){t.element.classList.remove("complete")}),1500))})),this.element=document.getElementById("misago-ajax-loader"),this.requests=0,this.timeout=null}));var u=n(19755);const d=(0,i.Z)((function e(t){var n=this;(0,a.Z)(this,e),(0,o.Z)(this,"registerActions",(function(){n.actions.forEach((function(e){"remove-selection"===e.getAttribute("moderation-action")?e.addEventListener("click",n.onRemoveSelection):e.addEventListener("click",n.onAction)}))})),(0,o.Z)(this,"onAction",(function(e){var t=document.querySelector(n.form),a={};new FormData(t).forEach((function(e,t){void 0===a[t]&&(a[t]=[]),a[t].push(e)}));var i=e.target;a.moderation=i.getAttribute("moderation-action"),"true"===i.getAttribute("moderation-multistage")?r.Z.ajax("POST",document.location.href,{target:n.modal,swap:"innerHTML",values:a}).then((function(){u(n.modal).modal("show")})):r.Z.ajax("POST",document.location.href,{target:"#misago-htmx-root",swap:"outerHTML",values:a})})),(0,o.Z)(this,"onRemoveSelection",(function(e){document.querySelectorAll(n.selection).forEach((function(e){e.checked=!1})),n.update()})),(0,o.Z)(this,"registerEvents",(function(){document.body.addEventListener("click",(function(e){var t=e.target;"INPUT"===t.tagName&&"checkbox"===t.type&&n.update()})),r.Z.onLoad((function(){return n.update()}))})),(0,o.Z)(this,"update",(function(){var e=document.querySelectorAll(n.selection).length;n.control.innerText=n.text.replace("%(number)s",e),n.control.disabled=!e,n.menu&&(e?n.menu.classList.add("visible"):n.menu.classList.remove("visible"))})),this.menu=t.menu?document.querySelector(t.menu):null,this.form=t.form,this.modal=t.modal,this.actions=document.querySelectorAll(t.actions),this.selection=t.selection,this.control=document.querySelector(t.button.selector),this.text=t.button.text,this.update(),this.registerEvents(),this.registerActions()}));n(41761);var p=n(15861),h=n(64687),m=n.n(h),v={};function f(e){if(!e.getAttribute("misago-validate-active")){var t=e.getAttribute("misago-validate"),n=e.getAttribute("misago-validate-user"),a="false"!=e.getAttribute("misago-validate-strip"),i=e.querySelector("input"),o=i.closest("form").querySelector("input[type=hidden]");if(t&&i){v[t]||(v[t]={}),e.setAttribute("misago-validate-active","true");var r=null;i.addEventListener("keyup",(function(s){var l=s.target.value;a&&(l=l.trim()),0!==l.trim().length?v[t][l]?Z(e,i,v[t][l]):(r&&window.clearTimeout(r),r=window.setTimeout((0,p.Z)(m().mark((function a(){var r,s;return m().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,y(t,o,l,n);case 2:r=a.sent,s=r.errors,v[t][l]=s,Z(e,i,s);case 6:case"end":return a.stop()}}),a)}))),1e3)):function(e){e.classList.remove("has-error"),e.classList.remove("has-success"),g(e)}(e)}))}}}function Z(e,t,n){n.length?function(e,t,n){e.classList.remove("has-success"),e.classList.add("has-error"),g(e),n.forEach((function(e){var n=document.createElement("p");n.className="help-block",n.setAttribute("misago-dynamic-message","true"),n.innerText=e,t.after(n)}))}(e,t,n):function(e){e.classList.remove("has-error"),e.classList.add("has-success"),g(e)}(e)}function g(e){e.querySelectorAll("[misago-dynamic-message]").forEach((function(e){return e.remove()}))}function y(e,t,n,a){return b.apply(this,arguments)}function b(){return(b=(0,p.Z)(m().mark((function e(t,n,a,i){var o,r;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(o=new FormData).set(n.name,n.value),o.set("value",a),i&&o.set("user",i),e.next=6,fetch(t,{method:"POST",mode:"cors",credentials:"same-origin",body:o});case 6:return r=e.sent,e.next=9,r.json();case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}r.Z.onLoad((function(e){(e||document).querySelectorAll("[misago-validate]").forEach(f)}));var k=document.getElementById("misago-snackbars"),_=null;function x(){k.replaceChildren()}function N(){_&&window.clearTimeout(_),k.querySelectorAll(".snackbar").forEach((function(e){e.classList.add("in")})),_=window.setTimeout((function(){k.querySelectorAll(".snackbar").forEach((function(e){e.classList.add("out"),_=window.setTimeout(x,1e3)}))}),6e3)}function w(e,t){x(),_&&window.clearTimeout(_);var n=document.createElement("div");n.classList.add("snackbar"),n.classList.add("snackbar-"+e),n.innerText=t,n.role="alert",k.appendChild(n),_=window.setTimeout(N,100)}function C(e){w("danger",e)}function R(e){var t,n,a=e.detail;return!("true"===(t=a.target,n=t.closest("[hx-silent]"),n?n.getAttribute("hx-silent"):null)&&"get"===a.requestConfig.verb)}r.Z.onLoad(N),document.addEventListener("htmx:responseError",(function(e){R(e)&&C(function(e){if("application/json"===e.getResponseHeader("content-type")){var t=JSON.parse(e.response);if(t.error)return t.error}return 404===e.status?pgettext("htmx response error","Page not found"):403===e.status?pgettext("htmx response error","Permission denied"):pgettext("htmx response error","Unexpected error")}(e.detail.xhr))})),document.addEventListener("htmx:sendError",(function(e){R(e)&&C(pgettext("htmx response error","Site could not be reached"))})),document.addEventListener("htmx:timeout",(function(e){R(e)&&C(pgettext("htmx response error","Site took too long to reply"))}));var E=n(75557),S={};function L(e){var t=e.getAttribute("misago-timestamp"),n=e.getAttribute("misago-timestamp-format");S[t]||(S[t]=new Date(t)),"full"===n||e.hasAttribute("misago-timestamp-title")||(e.setAttribute("misago-timestamp-title","true"),e.setAttribute("title",E.ry.format(S[t]))),"short"===n?e.textContent=(0,E.xn)(S[t]):"full"===n?(console.log(n),e.textContent=E.ry.format(S[t])):e.textContent=(0,E.SW)(S[t])}function O(e){(e||document).querySelectorAll("[misago-timestamp]").forEach(L)}document.querySelectorAll("[misago-timestamp]").forEach(L),O(),window.setInterval(O,55e3),r.Z.onLoad(O);var P=n(19755),A=function(){function e(){var t=this;(0,a.Z)(this,e),(0,o.Z)(this,"_onDOMContentLoaded",(function(){t.modal=document.getElementById("misago-lightbox-modal"),t.modal&&(t.pager=t.modal.querySelector("[misago-lightbox-pager]"),t.details=t.modal.querySelector("[misago-lightbox-details]"),t.zoom=t.modal.querySelector("[misago-lightbox-zoom]"),t.download=t.modal.querySelector("[misago-lightbox-download]"),t.link=t.modal.querySelector("[misago-lightbox-link]"),t.container=t.modal.querySelector("[misago-lightbox-container]"),t.caption=t.modal.querySelector("[misago-lightbox-caption]"),t.template=document.getElementById("lightbox-image-caption"),t._registerEvents())})),this.modal=null,this.pager=null,this.details=null,this.zoom=null,this.download=null,this.link=null,this.container=null,this.caption=null,this.state=null,this.template=null,document.addEventListener("DOMContentLoaded",this._onDOMContentLoaded)}return(0,i.Z)(e,[{key:"_registerEvents",value:function(){var e=this;document.addEventListener("click",(function(t){var n=t.target.closest("img[misago-lightbox-media]");if(n)e.onImageClick(t,n);else{var a=t.target.closest("[misago-lightbox-button]");a&&e.onMediaButtonClick(t,a)}})),this.modal.querySelector("[data-dismiss]").addEventListener("click",(function(){e.onHideLightbox()})),this.modal.querySelector("[misago-lightbox-previous]").addEventListener("click",(function(){e.state.index=(e.state.index||e.state.total)-1,e.state.media=e.state.items[e.state.index],e.updateLightbox()})),this.modal.querySelector("[misago-lightbox-next]").addEventListener("click",(function(){e.state.index+=1,e.state.index===e.state.total&&(e.state.index=0),e.state.media=e.state.items[e.state.index],e.updateLightbox()}))}},{key:"onImageClick",value:function(e,t){e.preventDefault();var n=t.closest("[misago-lightbox-root]");this.state=this.getInitialState(n,t),this.updateLightbox(),this.showLightbox()}},{key:"onMediaButtonClick",value:function(e,t){e.preventDefault();var n=t.closest("[misago-lightbox-root]"),a=t.closest("[misago-lightbox-context]").querySelector("[misago-lightbox-media]");this.state=this.getInitialState(n,a),this.updateLightbox(),this.showLightbox()}},{key:"getInitialState",value:function(e,t){var n=this.getRootMedia(e,t),a=n.map((function(e){return e.active})).indexOf(!0);return{items:n,media:n[a],index:a,total:n.length}}},{key:"getRootMedia",value:function(e,t){var n=[];return e.querySelectorAll("[misago-lightbox-media]").forEach((function(e){var a=e.closest("[misago-lightbox-context]"),i=e.closest("a");n.push({element:e,active:e===t,video:"VIDEO"===e.tagName,image:"IMG"===e.tagName,caption:a?a.querySelector("template"):null,details:a?a.getAttribute("misago-lightbox-details"):null,download:a?a.getAttribute("misago-lightbox-download"):null,link:!a&&i,url:a?a.getAttribute("misago-lightbox-url"):e.getAttribute("src")})})),n}},{key:"updateLightbox",value:function(){this.updateLightboxPager(),this.updateLightboxOptions(),this.updateLightboxNav(),this.updateLightboxContainer(),this.updateLightboxCaption()}},{key:"updateLightboxPager",value:function(){var e=this.state,t=this.pager;e.total>1?(t.textContent=t.getAttribute("misago-lightbox-pager").replace("%(total)s",e.total).replace("%(index)s",e.index+1),t.classList.remove("d-none")):(t.textContent="",t.classList.add("d-none"))}},{key:"updateLightboxOptions",value:function(){var e=this.state.media;this.updateLightboxOption(this.details,e.details),this.updateLightboxOption(this.download,e.download&&e.url),this.updateLightboxOption(this.link,e.link&&e.link.href),this.updateLightboxOption(this.zoom,e.url)}},{key:"updateLightboxOption",value:function(e,t){t?(e.setAttribute("href",t),e.classList.remove("d-none")):e.classList.add("d-none")}},{key:"updateLightboxNav",value:function(){var e=this.state;this.modal.querySelectorAll("[misago-lightbox-previous], [misago-lightbox-next]").forEach((function(t){e.total>1?t.classList.remove("d-none"):t.classList.add("d-none")}))}},{key:"updateLightboxContainer",value:function(){var e=this.state,t=this.container,n=e.media;n.image?this.updateLightboxContainerWithImage(t,n):n.video&&this.updateLightboxContainerWithVideo(t,n)}},{key:"updateLightboxContainerWithImage",value:function(e,t){var n=document.createElement("img");n.setAttribute("src",t.url),n.setAttribute("alt","");var a=document.createElement("a");a.setAttribute("href",t.url),a.setAttribute("target","_blank"),a.appendChild(n),e.replaceChildren(a)}},{key:"updateLightboxContainerWithVideo",value:function(e,t){var n=document.createElement("video");n.innerHTML=t.element.innerHTML,n.setAttribute("controls","true"),n.setAttribute("preload","metadata"),e.replaceChildren(n)}},{key:"updateLightboxCaption",value:function(){var e=this.state,t=this.caption,n=e.media;if(n.caption){var a=n.caption.content.cloneNode(!0);O(a),t.replaceChildren(a)}else{var i=this.template.content.cloneNode(!0),o=i.querySelector("[lightbox-image-caption-name]"),r=i.querySelector("[lightbox-image-caption-description]");o.removeAttribute("lightbox-image-caption-name"),r.removeAttribute("lightbox-image-caption-description");var s=(n.element.getAttribute("alt")||"").trim(),l=(n.element.getAttribute("title")||"").trim(),c=n.element.getAttribute("src"),u=l&&s?l+" — "+s:l||s||this.cleanDisplayFilename(c);if(o.textContent=this.shortenLongString(u),o.textContent!==u&&o.setAttribute("title",u),n.link){var d=document.createElement("a"),p=n.link.getAttribute("href");d.setAttribute("href",p),d.setAttribute("target","_blank"),d.textContent=this.cleanDisplayUrl(p),r.appendChild(d)}else l||s?r.textContent=this.cleanDisplayUrl(c):r.remove();t.replaceChildren(i)}}},{key:"cleanDisplayFilename",value:function(e){var t=e.lastIndexOf("/");if(-1===t)return this.cleanDisplayUrl(e);var n=e.substring(t+1).trim();return n?this.shortenLongString(n):this.cleanDisplayUrl(e)}},{key:"cleanDisplayUrl",value:function(e){var t=e;return t.startsWith("https://")?t=t.substring(8):t.startsWith("http://")&&(t=t.substring(7)),this.shortenLongString(t)}},{key:"shortenLongString",value:function(e){return console.log(e,e.length),e.length<=80?e:e.substring(0,35)+"..."+e.substring(e.length-40)}},{key:"showLightbox",value:function(){document.querySelectorAll("video").forEach((function(e){return e.pause()})),P(this.modal).modal("show")}},{key:"onHideLightbox",value:function(){this.modal.querySelectorAll("video").forEach((function(e){return e.pause()}))}}]),e}();function T(e,t){e.classList.remove("animation-fade-in"),e.querySelectorAll("button, input, select, textarea").forEach((function(e){e.setAttribute("disabled","")})),e.addEventListener("animationend",(function(n){"deleteElementAnimation"===n.animationName&&(e.remove(),t&&t())})),e.classList.add("animation-delete")}var I="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",B=I.length;function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function D(e,t){var n=e.content.cloneNode(!0);return n.querySelectorAll("[misago-tpl-if]").forEach((function(e){var n=e.getAttribute("misago-tpl-if");U(t,n)?e.removeAttribute("misago-tpl-if"):e.remove()})),n.querySelectorAll("[misago-tpl-ifnot]").forEach((function(e){var n=e.getAttribute("misago-tpl-ifnot");U(t,n)?e.remove():e.removeAttribute("misago-tpl-ifnot")})),n.querySelectorAll("[misago-tpl-var]").forEach((function(e){var n=e.getAttribute("misago-tpl-var");e.innerText=U(t,n)||"",e.removeAttribute("misago-tpl-var")})),n.querySelectorAll("[misago-tpl-attr]").forEach((function(e){var n=e.getAttribute("misago-tpl-attr");if(":"!==n.indexOf(":")){var a=n.substring(0,n.indexOf(":")).trim(),i=n.substring(n.indexOf(":")+1).trim(),o=i?U(t,i):void 0;a&&o&&e.setAttribute(a,o)}e.removeAttribute("misago-tpl-attr")})),n}function U(e,t){if(-1===t.indexOf("."))return e[t];var n,a=e,i=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return j(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?j(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var a=0,i=function(){};return{s:i,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,r=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return r=e.done,e},e:function(e){s=!0,o=e},f:function(){try{r||null==n.return||n.return()}finally{if(s)throw o}}}}(t.split("."));try{for(i.s();!(n=i.n()).done;){var o=n.value;if(!o||void 0===a[o])return;a=a[o]}}catch(e){i.e(e)}finally{i.f()}return a}function z(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return q(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?q(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var a=0,i=function(){};return{s:i,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,r=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return r=e.done,e},e:function(e){s=!0,o=e},f:function(){try{r||null==n.return||n.return()}finally{if(s)throw o}}}}function q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}var M=function(){function e(t,n){(0,a.Z)(this,e),this.editor=t,this.element=n,this.textarea=t.getTextarea(n),this.lists={media:n.querySelector('[misago-editor-attachments="media"]'),other:n.querySelector('[misago-editor-attachments="other"]')},this.templates={error:document.getElementById("attachment-upload-error-template"),media:document.getElementById("attachment-media-template"),mediaFooter:document.getElementById("attachment-media-footer-template"),mediaFailedFooter:document.getElementById("attachment-media-failed-footer-template"),other:document.getElementById("attachment-other-template"),otherFailed:document.getElementById("attachment-other-failed-template"),otherUploaded:document.getElementById("attachment-other-uploaded-template")};var i=n.querySelector("[misago-editor-attachments]");this.field={name:n.getAttribute("misago-editor-attachments-name"),element:i},this.accept={all:this._getAcceptedExtensions(i.getAttribute("misago-editor-accept-attachments")),image:this._getAcceptedExtensions(i.getAttribute("misago-editor-accept-image")),video:this._getAcceptedExtensions(i.getAttribute("misago-editor-accept-video"))},this.uploadUrl=this._getUploadUrl(n),this.canUpload=!!this.uploadUrl&&!!this.accept.all}return(0,i.Z)(e,[{key:"_getUploadUrl",value:function(e){return e.getAttribute("misago-editor-attachments-url")||null}},{key:"_getAcceptedExtensions",value:function(e){return e.split(",").map((function(e){return e.trim()}))}},{key:"showPermissionDeniedError",value:function(){C(pgettext("markup editor upload","You can't upload attachments"))}},{key:"prompt",value:function(e){var t=this,n=e?e.accept:"all",a=!!e&&e.insert,i=document.createElement("input");i.setAttribute("type","file"),i.setAttribute("accept",(this.accept[n]||this.accept.all).join(",")),i.setAttribute("multiple",!0),i.classList.add("d-none"),i.addEventListener("change",(function(e){var n=e.target.files;n.length&&t.uploadFiles(n,a),i.remove()})),this.element.appendChild(i),i.click()}},{key:"_getAcceptAttributeStr",value:function(e){return(this.accept[e]||this.accept.all).join(",")}},{key:"uploadFiles",value:function(e,t){for(var n=this,a=[],i=0;i<e.length;i++){var o=e[i];this._isFileTypeAccepted(o)?a.push(o):C(pgettext("markup editor upload","%(name)s: uploaded file type is not allowed.").replace("%(name)s",o.name))}if(!a)return{keys:[],files:[]};var r,s=[],l={},c=new FormData;c.append("csrfmiddlewaretoken",(r=document.querySelector('input[name="csrfmiddlewaretoken"]'))?r.value:null),a.forEach((function(e){var t=function(e){for(var t="",n=0;n<16;n++)t+=I[Math.floor(Math.random()*B)];return t}();s.push(t),c.append("keys",t),c.append("upload",e),l[t]=n._createUploadUI(e,t)})),t&&this._insertAttachmentsInTextarea(s,a);var u=new XMLHttpRequest;return this._addOnLoadedEventListener(u,s,l),this._addOnProgressEventListener(u,s,l),u.open("POST",this.uploadUrl),u.send(c),{keys:s,files:a}}},{key:"_isFileTypeAccepted",value:function(e){return this._isFileTypeInList(e,this.accept.all)}},{key:"_isFileTypeImage",value:function(e){return this._isFileTypeInList(e,this.accept.image)}},{key:"_isFileTypeVideo",value:function(e){return this._isFileTypeInList(e,this.accept.video)}},{key:"_isFileTypeInList",value:function(e,t){var n,a=e.name.toLowerCase(),i=z(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(a.substring(a.length-o.length)===o)return!0}}catch(e){i.e(e)}finally{i.f()}return!1}},{key:"_insertAttachmentsInTextarea",value:function(e,t){for(var n=[],a=0;a<e.length;a++){var i=e[a],o=t[a];n.push("<attachment="+o.name+":"+i+">")}n&&this.editor.getSelection(this.textarea).insert(n.join("\n"),{whitespace:"\n\n"})}},{key:"_addOnLoadedEventListener",value:function(e,t,n){var a=this;e.addEventListener("loadend",(function(){e.readyState===XMLHttpRequest.DONE&&(200===e.status?a._handleUploadSuccess(e,t,n):a._handleUploadError(e,t),t.forEach((function(e){return n[e]=null})))}))}},{key:"_handleUploadSuccess",value:function(e,t,n){var a=this;try{var i=JSON.parse(e.response),o=i.attachments,r=i.errors;if(this._replaceTextareaPlaceholders(this.textarea,t,o),r){var s=this.element.querySelector("[misago-editor-attachments-help]");t.forEach((function(e){var t=r[e];t&&a._updateUploadUIWithError(e,s,t)}))}o&&o.forEach((function(e){try{a._updateUploadUI(e,n[e.key]),a._createAttachmentIDField(e)}catch(e){console.error(e)}}))}catch(e){C(pgettext("markup editor upload","Unexpected upload API response")),console.error(e)}}},{key:"_handleUploadError",value:function(e,t){var n=this;if(0===e.status)C(pgettext("markup editor upload","Site could not be reached"));else if(e.status>=400&&e.status<500)try{C(JSON.parse(e.response).error)}catch(e){C(pgettext("markup editor upload","Unexpected upload API error response")),console.error(e)}else C(pgettext("markup editor upload","Unexpected error during upload"));t.forEach((function(e){n._updateUploadUIWithError(e)}))}},{key:"_addOnProgressEventListener",value:function(e,t,n){e.upload.addEventListener("progress",(function(e){if(e.lengthComputable){var a,i=Math.ceil(100*e.loaded/e.total),o=z(t);try{for(o.s();!(a=o.n()).done;){var r=a.value,s=n[r].querySelector(".progress-bar");s.setAttribute("aria-valuenow",i),s.style.width=i+"%"}}catch(e){o.e(e)}finally{o.f()}}}))}},{key:"_replaceTextareaPlaceholders",value:function(e,t,n){var a={};t.forEach((function(e){return a[e]=null})),n&&n.forEach((function(e){return a[e.key]=e})),this.editor.getSelection(e).replaceAttachments((function(e){var t=e.id,n=a[t];return n?"<attachment="+n.name+":"+n.id+">":null===n?"":void 0}))}},{key:"_createUploadUI",value:function(e,t){var n={key:t,file:e,name:e.name,isImage:!1,isVideo:!1};return this._isFileTypeImage(e)?(n.isImage=!0,this._createMediaUploadUI(n)):this._isFileTypeVideo(e)?(n.isVideo=!0,this._createMediaUploadUI(n)):this._createOtherUploadUI(n),this.editor.getAttachmentByKey(t)}},{key:"_createMediaUploadUI",value:function(e){var t=D(this.templates.media,e);if(e.isImage){var n=t.querySelector("[misago-tpl-image]"),a=new FileReader;a.onload=function(){n.style.backgroundImage="url('"+a.result+"')"},a.readAsDataURL(e.file)}else if(e.isVideo){var i=t.querySelector("video"),o=new FileReader;o.onload=function(){var t=document.createElement("source");t.setAttribute("src",o.result),t.setAttribute("type",e.file.type),i.append(t)},o.readAsDataURL(e.file)}this._addUIToAttachmentsList(this.lists.media,t)}},{key:"_createOtherUploadUI",value:function(e){var t=D(this.templates.other,e);this._addUIToAttachmentsList(this.lists.other,t)}},{key:"_addUIToAttachmentsList",value:function(e,t){e.querySelector("ul").prepend(t),e.classList.remove("d-none")}},{key:"_createAttachmentIDField",value:function(e){var t=document.createElement("input");t.setAttribute("type","hidden"),t.setAttribute("name",this.field.name),t.setAttribute("value",e.id),this.field.element.appendChild(t)}},{key:"_updateUploadUI",value:function(e,t){e.filetype.is_media?this._updateMediaUploadUI(e,t):this._updateOtherUploadUI(e,t)}},{key:"_updateMediaUploadUI",value:function(e,t){var n=D(this.templates.mediaFooter,e);n.querySelector("[misago-editor-attachment]").setAttribute("misago-editor-attachment",e.name+":"+e.id),t.querySelector("[misago-tpl-footer]").replaceWith(n)}},{key:"_updateOtherUploadUI",value:function(e,t){var n=D(this.templates.otherUploaded,e);n.querySelector("[misago-editor-attachment]").setAttribute("misago-editor-attachment",e.name+":"+e.id),t.replaceWith(n)}},{key:"_updateUploadUIWithError",value:function(e,t,n){n&&this._createErrorMessage(e,n,t);var a=this.editor.getAttachmentByKey(e),i=a.querySelector("[misago-tpl-footer]");if(i){var o=D(this.templates.mediaFailedFooter,{key:e});i.replaceWith(o)}else{var r=a.querySelector("[misago-tpl-upload]"),s=r.closest("li").querySelector("button");s.setAttribute("misago-editor-action","attachment-error-dismiss"),s.setAttribute("misago-editor-attachment-key",e),s.removeAttribute("disabled"),r.replaceWith(D(this.templates.otherFailed))}}},{key:"_createErrorMessage",value:function(e,t,n){var a=D(this.templates.error,{key:e,error:t});n.after(a)}}]),e}(),F=n(79340),H=n(6215),V=n(61120),Y=n(19755);function G(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=(0,V.Z)(e);if(t){var i=(0,V.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,H.Z)(this,n)}}var W=function(){function e(){var t=this;(0,a.Z)(this,e),this.selection=null,this.element=null,this.form=null,document.addEventListener("DOMContentLoaded",(function(){t.element=t.getElement(),t.element&&(t.form=t.element.querySelector("form"),t.initForm(t.form))}))}return(0,i.Z)(e,[{key:"getElement",value:function(){throw"Subclasses of 'MarkupEditorModal' must implement 'getElement' method"}},{key:"initForm",value:function(e){var t=this;e.addEventListener("submit",(function(e){e.preventDefault();var n=new FormData(e.target);return t.submit(n,t.selection),!1}))}},{key:"reset",value:function(){this.element.querySelectorAll("input").forEach((function(e){e.value=""}))}},{key:"setData",value:function(e,t){}},{key:"submit",value:function(e,t){}},{key:"show",value:function(e){this.reset(),this.selection=e,this.setData(this.form,e),Y(this.element).modal("show")}},{key:"hide",value:function(){Y(this.element).modal("hide")}}]),e}(),$=function(e){(0,F.Z)(n,e);var t=G(n);function n(){return(0,a.Z)(this,n),t.apply(this,arguments)}return(0,i.Z)(n,[{key:"getElement",value:function(){return document.getElementById("markup-editor-link-modal")}},{key:"setData",value:function(e,t){e.querySelector('[name="text"]').value=t.text().trim()}},{key:"submit",value:function(e,t){var n=X(e.get("url").trim()),a=e.get("text").trim();n&&(a?K(n,a)?t.replace("[url="+n+"]"+a+"[/url]"):t.replace("["+a+"]("+n+")"):t.replace("<"+n+">"),this.hide())}}]),n}(W),Q=function(e){(0,F.Z)(n,e);var t=G(n);function n(){return(0,a.Z)(this,n),t.apply(this,arguments)}return(0,i.Z)(n,[{key:"getElement",value:function(){return document.getElementById("markup-editor-image-modal")}},{key:"submit",value:function(e,t){var n=X(e.get("url").trim()),a=e.get("text").trim();n&&(a?K(n,a)?t.replace("[img="+n+"]"+a+"[/img]"):t.replace("!["+a+"]("+n+")"):K(n,a)?t.replace("[img]"+n+"[/img]"):t.replace("!("+n+")"),this.hide())}}]),n}(W);function K(e,t){return e.indexOf("(")>=0||e.indexOf(")")>=0||t.indexOf("[")>=0||t.indexOf("]")>=0}function X(e){return J(e,"http://")||J(e,"https://")?e:"http://"+e}function J(e,t){return e.toLowerCase().substring(0,t.length)===t}var ee=function(e){(0,F.Z)(n,e);var t=G(n);function n(){return(0,a.Z)(this,n),t.apply(this,arguments)}return(0,i.Z)(n,[{key:"getElement",value:function(){return document.getElementById("markup-editor-quote-modal")}},{key:"setData",value:function(e,t){e.querySelector('[name="text"]').value=t.text().trim()}},{key:"submit",value:function(e,t){var n=e.get("author").trim(),a=e.get("text").trim();if(a){var i=this.getQuotePrefix(t,n),o="\n[/quote]\n\n";t.replace(i+a+o,{start:i.length,end:o.length}),this.hide()}}},{key:"getQuotePrefix",value:function(e,t){var n=e.prefix().trim().length?"\n\n":"";return t?n+"[quote="+t+"]\n":n+"[quote]\n"}}]),n}(W),te=function(e){(0,F.Z)(n,e);var t=G(n);function n(){return(0,a.Z)(this,n),t.apply(this,arguments)}return(0,i.Z)(n,[{key:"getElement",value:function(){return document.getElementById("markup-editor-code-modal")}},{key:"setData",value:function(e,t){e.querySelector('[name="code"]').value=t.text().trim()}},{key:"submit",value:function(e,t){var n=e.get("syntax").trim(),a=e.get("code").trim();if(a){var i=this.getQuotePrefix(t,n),o="\n[/code]\n\n";t.replace(i+a+o,{start:i.length,end:o.length}),this.hide()}}},{key:"getQuotePrefix",value:function(e,t){var n=e.prefix().trim().length?"\n\n":"";return t?n+"[code="+t+"]\n":n+"[code]\n"}}]),n}(W),ne=n(19755),ae=function(){function e(){var t=this;(0,a.Z)(this,e),(0,o.Z)(this,"_onWindowResize",(function(){document.querySelectorAll("[misago-editor-active]").forEach(t._resizeEditor)})),(0,o.Z)(this,"_resizeEditor",(function(e){for(var n=t._getResizeConstraints(e),a=e.querySelector(".markup-editor-toolbar-left"),i=e.querySelector(".markup-editor-toolbar-secondary"),o=e.querySelector("[misago-editor-more]"),r=0,s=[],l=0;l<a.children.length;l++){var c=a.children[l];"true"!==c.getAttribute("misago-editor-more")&&(s.push({index:l,priority:parseInt(c.getAttribute("misago-editor-priority")||0),display:!0}),c.clientWidth&&(r+=n.btn))}if(r>n.toolbar){var u=n.toolbar-n.btn;s.sort((function(e,t){return e.priority>t.priority?1:e.priority<t.priority?-1:0})),s.forEach((function(e){r>u?(a.children[e.index].classList.add("d-none"),i.children[e.index].classList.remove("d-none"),e.display=!1,r-=n.btn):(a.children[e.index].classList.remove("d-none"),i.children[e.index].classList.add("d-none"),e.display=!0)}))}else if(r+n.btn<n.toolbar){r=0;var d=n.toolbar;s.sort((function(e,t){return e.priority>t.priority?-1:e.priority<t.priority?1:0})),s.forEach((function(e){r+n.btn<d?(a.children[e.index].classList.remove("d-none"),i.children[e.index].classList.add("d-none"),e.display=!0,r+=n.btn):(a.children[e.index].classList.add("d-none"),i.children[e.index].classList.remove("d-none"),e.display=!1)}))}0===s.filter((function(e){return!e.display})).length?(o.classList.add("d-none"),i.classList.remove("show")):o.classList.remove("d-none")})),(0,o.Z)(this,"_getResizeConstraints",(function(e){var t=e.querySelector(".markup-editor-toolbar-left"),n=0;t.querySelectorAll("button").forEach((function(e){var t=e.clientWidth,a=window.getComputedStyle(e);t+=parseInt(parseFloat(a.borderLeftWidth)),t+=parseInt(parseFloat(a.borderRightWidth)),t+=parseInt(parseFloat(a.marginLeft)),(t+=parseInt(parseFloat(a.marginRight)))>n&&(n=t)}));var a=t.parentElement.clientWidth-n;return{btn:n,toolbar:a}})),(0,o.Z)(this,"setAction",(function(e,n){t.actions[e]=n})),(0,o.Z)(this,"activate",(function(e){"true"!==e.getAttribute("misago-editor-active")&&(t._setEditorActive(e),t._setEditorFocus(e),t._setEditorActions(e),t._setEditorPasteUpload(e),t._setEditorDropUpload(e),t._resizeEditor(e))})),(0,o.Z)(this,"_setEditorPasteUpload",(function(e){e.addEventListener("paste",(function(n){if(n.clipboardData.files.length){var a=new M(t,e);if(a.canUpload){n.preventDefault();var i=n.target.closest("textarea");a.uploadFiles(n.clipboardData.files,i)}else a.showPermissionDeniedError()}}))})),(0,o.Z)(this,"_setEditorDropUpload",(function(e){var n="markup-editor-drag-drop",a=[e.querySelector("textarea")],i=e.querySelector("[misago-editor-attachments]");i&&a.push(i),a.forEach((function(a){a.addEventListener("drop",(function(i){var o=new M(t,e);if(i.dataTransfer.files.length)if(i.preventDefault(),o.canUpload){if(i.dataTransfer.files){var r=i.target.closest("textarea");o.uploadFiles(i.dataTransfer.files,r)}}else o.showPermissionDeniedError();a.classList.remove(n)})),a.addEventListener("dragenter",(function(e){e.preventDefault()})),a.addEventListener("dragleave",(function(){a.classList.remove(n)})),a.addEventListener("dragover",(function(e){a.classList.add(n),e.preventDefault()}))}))})),this.actions={},this.codeModal=new te,this.linkModal=new $,this.imageModal=new Q,this.quoteModal=new ee,this.resizeDebounce=null,window.addEventListener("resize",(function(e){t.resizeDebounce&&window.clearTimeout(t.resizeDebounce),t.resizeDebounce=window.setTimeout(t._onWindowResize,200)}))}return(0,i.Z)(e,[{key:"_setEditorActive",value:function(e){e.setAttribute("misago-editor-active","true")}},{key:"_setEditorFocus",value:function(e){var t=["focusin","click"],n="markup-editor-focused";t.forEach((function(t){e.addEventListener(t,(function(){e.classList.add(n)}))})),t.forEach((function(t){document.addEventListener(t,(function(t){e.contains(t.target)||e.classList.remove(n)}))}))}},{key:"_setEditorActions",value:function(e){var t=this,n=this.getTextarea(e);e.addEventListener("click",(function(e){var a=e.target.closest("[misago-editor-action]");if(!a)return null;var i=a.getAttribute("misago-editor-action");if(!i)return null;e.preventDefault();var o=t.actions[i];o?o({textarea:n,target:a,editor:t,selection:new ie(n)}):console.warn("Undefined editor action: "+i)})),e.querySelector("[misago-editor-more]").addEventListener("click",(function(){var t=e.querySelector(".markup-editor-toolbar-secondary");t.classList.contains("show")?t.classList.remove("show"):t.classList.add("show")}))}},{key:"getTextarea",value:function(e){return e.querySelector("textarea")}},{key:"getSelection",value:function(e){return new ie(e)}},{key:"showFilePrompt",value:function(e,t){var n=new M(this,e.closest("[misago-editor-active]"));n.canUpload?n.prompt(t):n.showPermissionDeniedError()}},{key:"showCodeModal",value:function(e){this.codeModal.show(e)}},{key:"showLinkModal",value:function(e){this.linkModal.show(e)}},{key:"showImageModal",value:function(e){this.imageModal.show(e)}},{key:"showQuoteModal",value:function(e){this.quoteModal.show(e)}},{key:"getAttachmentByKey",value:function(e){return document.querySelector('[misago-editor-upload-key="'+e+'"]')}},{key:"removeAttachmentElement",value:function(e){var t=e.closest("ul");T(e,(function(){t.querySelector("li")||t.closest(".markup-editor-attachments-list").classList.add("d-none")}))}}]),e}(),ie=function(){function e(t){(0,a.Z)(this,e),this.textarea=t,this._range=this._getRange()}return(0,i.Z)(e,[{key:"get",value:function(){return this._range}},{key:"prefix",value:function(){return this._range.prefix}},{key:"suffix",value:function(){return this._range.suffix}},{key:"zero",value:function(){return 0===this._range.length}},{key:"empty",value:function(){return 0===this._range.text.trim().length}},{key:"text",value:function(){return this._range.text}},{key:"wrap",value:function(e,t){var n=this._range.prefix;n+=e+this._range.text+t,n+=this._range.suffix,this.textarea.value=n,this._range.start+=e.length,this._range.end+=e.length,this._range.length=this._range.end-this._range.start,this.refocus()}},{key:"replace",value:function(e,t){var n=this._range.prefix+e+this._range.suffix;this.textarea.value=n,t&&t.start&&(this._range.start+=t.start),this._range.end=this._range.start+e.length,t&&(t.start&&(this._range.end-=t.start),t.end&&(this._range.end-=t.end)),this._range.length=this._range.end-this._range.start,this.refocus()}},{key:"insert",value:function(e,t){var n=t&&t.whitespace||"",a=n?this._range.prefix.trimEnd():this._range.prefix,i=n?this._range.suffix.trim():this._range.suffix,o=1,r=a;a.length&&n&&(r+=n,o+=1),r+=e+n+i,this.textarea.value=r;var s=a.length+e.length+n.length*o;this._range.end=this._range.start=s,this._range.length=0,this.refocus()}},{key:"replaceAttachments",value:function(e){this.textarea.value=this.textarea.value.replace(/<attachment=(.+?)>/gi,(function(t,n){if(1!==n.match(/:/g).length)return t;for(var a=n.trim();'"'===a.substring(0,1);)a=a.substring(1);for(;'"'===a.substring(a.length-1);)a=a.substring(0,a.length-1);var i=a.substring(0,a.indexOf(":")).trim(),o=a.substring(a.indexOf(":")+1).trim();if(o){var r=e({match:t,name:i,id:o});if("string"==typeof r||r instanceof String)return r}return t}))}},{key:"refocus",value:function(){var e=this;window.setTimeout((function(){var t=e.textarea.scrollTop;e.textarea.focus(),e.textarea.scrollTop=t;var n=e._range.start;e.textarea.setSelectionRange(n,n+e._range.length)}),250)}},{key:"_getRange",value:function(){if(document.selection){this.textarea.focus();var e=document.selection.createRange(),t=e.text.length;return e.moveStart("character",-this.textarea.value.length),this._createRange(this.textarea,e.text.length-t,e.text.length)}if(this.textarea.selectionStart||"0"==this.textarea.selectionStart)return this._createRange(this.textarea,this.textarea.selectionStart,this.textarea.selectionEnd)}},{key:"_createRange",value:function(e,t,n){return{start:t,end:n,length:n-t,text:e.value.substring(t,n),prefix:e.value.substring(0,t),suffix:e.value.substring(n)}}}]),e}(),oe=new ae;const re=oe;oe.setAction("strong",(function(e){var t=e.selection;t.empty()?t.replace("**"+pgettext("example markup","Strong text")+"**",{start:2,end:2}):t.wrap("**","**")})),oe.setAction("emphasis",(function(e){var t=e.selection;t.empty()?t.replace("_"+pgettext("example markup","Text with emphasis")+"_",{start:1,end:1}):t.wrap("_","_")})),oe.setAction("strikethrough",(function(e){var t=e.selection;t.empty()?t.replace("~~"+pgettext("example markup","Text with strikethrough")+"~~",{start:2,end:2}):t.wrap("~~","~~")})),oe.setAction("horizontal-ruler",(function(e){e.selection.insert("- - -",{whitespace:"\n\n"})})),oe.setAction("link",(function(e){var t=e.editor,n=e.selection;t.showLinkModal(n)})),oe.setAction("image",(function(e){var t=e.editor,n=e.selection;t.showImageModal(n)})),oe.setAction("quote",(function(e){var t=e.editor,n=e.selection;t.showQuoteModal(n)})),oe.setAction("spoiler",(function(e){var t=e.selection,n=t.prefix().trim().length?"\n\n[spoiler]\n":"[spoiler]\n",a="\n[/spoiler]\n\n";t.empty()?t.replace(n+pgettext("example markup","Spoiler text")+a,{start:n.length,end:a.length}):t.wrap(n,a)})),oe.setAction("code",(function(e){var t=e.editor,n=e.selection;t.showCodeModal(n)})),oe.setAction("attachment",(function(e){var t=e.target,n=e.selection,a=t.getAttribute("misago-editor-attachment");a&&n.insert("<attachment="+a+">",{whitespace:"\n\n"})})),oe.setAction("image-upload",(function(e){var t=e.editor,n=e.target;t.showFilePrompt(n,{accept:"image",insert:!0})})),oe.setAction("attachment-upload",(function(e){var t=e.editor,n=e.target;t.showFilePrompt(n)})),oe.setAction("attachment-delete",(function(e){var t=e.editor,n=e.target,a=e.selection,i=n.getAttribute("misago-editor-attachment"),o=n.closest("[misago-editor-deleted-attachments-name]").getAttribute("misago-editor-deleted-attachments-name");a.replaceAttachments((function(e){return e.id===i&&""}));var r=n.closest("li");t.removeAttachmentElement(r);var s=document.createElement("input");s.setAttribute("type","hidden"),s.setAttribute("name",o),s.setAttribute("value",i),n.closest("[misago-editor-attachments]").appendChild(s)})),oe.setAction("attachment-error-dismiss",(function(e){var t=e.editor,n=e.target,a=e.selection,i=n.getAttribute("misago-editor-attachment-key");a.replaceAttachments((function(e){return e.id===i&&""}));var o=document.querySelector('[misago-editor-attachment-error="'+i+'"]');o&&T(o);var r=t.getAttachmentByKey(i);r&&t.removeAttachmentElement(r)})),oe.setAction("formatting-help",(function(e){var t=e.target,n=document.getElementById("markup-editor-formatting-help"),a=t.closest("a");r.Z.ajax("GET",a.href,{target:n,swap:"innerHTML"}).then((function(){ne(n).modal("show")}))}));const se=re;var le=n(19755);r.Z.onLoad((function(){document.querySelectorAll("[misago-page-form]").forEach((function(e){var t;""===e.getAttribute("misago-page-form")&&((t=e).setAttribute("misago-page-form","true"),t.addEventListener("submit",(function(e){var n=t.getAttribute("misago-page"),a=e.target.querySelector("input"),i=a.value;if(i>=a.min&&i<=a.max&&i!=n){var o=t.getAttribute("misago-page-url");i>1&&(o+=i+"/"),window.history.pushState({},"",o),document.getElementById("misago-page-scroll-target").scrollIntoView(),r.Z.ajax("GET",o,{target:"#misago-htmx-root",swap:"outerHTML"})}return t.closest(".dropdown").querySelector("[data-toggle]")&&le().dropdown("toggle"),e.preventDefault(),!1})))}))})),n(59180);var ce=n(19755),ue=new c,de=new A,pe=new(function(){function e(){(0,a.Z)(this,e),(0,o.Z)(this,"hideMarkAsReadModal",(function(){ce("#mark-as-read").modal("hide")})),this._initializers=[],this._context={},this.loader=ue,this.editor=se,this.lightbox=de}return(0,i.Z)(e,[{key:"addInitializer",value:function(e){this._initializers.push({key:e.name,item:e.initializer,after:e.after,before:e.before})}},{key:"init",value:function(e){var t=this;this._context=e,new s(this._initializers).orderedValues().forEach((function(e){e(t)}))}},{key:"has",value:function(e){return!!this._context[e]}},{key:"get",value:function(e,t){return this.has(e)?this._context[e]:t||void 0}},{key:"pop",value:function(e){if(this.has(e)){var t=this._context[e];return this._context[e]=null,t}}},{key:"snackbar",value:function(e,t){w(e,t)}},{key:"snackbarInfo",value:function(e){!function(e){w("info",e)}(e)}},{key:"snackbarSuccess",value:function(e){!function(e){w("success",e)}(e)}},{key:"snackbarWarning",value:function(e){!function(e){w("warning",e)}(e)}},{key:"snackbarError",value:function(e){C(e)}},{key:"bulkModeration",value:function(e){return new d(e)}}]),e}());window.misago=pe;const he=pe;document.addEventListener("htmx:beforeRequest",(function(e){l(e.target)&&ue.show()})),document.addEventListener("htmx:afterRequest",(function(e){l(e.target)&&ue.hide()})),document.addEventListener("htmx:load",(function(){document.querySelectorAll("[misago-editor-active='false']").forEach(re.activate)})),document.addEventListener("misago:afterModeration",(function(){ce("#threads-moderation-modal").modal("hide")})),document.addEventListener("submit",(function(e){var t=e.target.closest("form[misago-confirm]");t&&!window.confirm(t.getAttribute("misago-confirm"))&&e.preventDefault()}))},58339:(e,t,n)=>{"use strict";var a=n(34458),i=n(78657);a.Z.addInitializer({name:"ajax",initializer:function(){i.Z.init(a.Z.get("CSRF_COOKIE_NAME"))}})},64109:(e,t,n)=>{"use strict";var a=n(34458),i=n(35486),o=n(78657),r=n(53904),s=n(90287);a.Z.addInitializer({name:"auth-sync",initializer:function(e){e.get("isAuthenticated")&&window.setInterval((function(){o.Z.get(e.get("AUTH_API")).then((function(e){s.Z.dispatch((0,i.r$)(e))}),(function(e){r.Z.apiError(e)}))}),45e3)},after:"auth"})},46226:(e,t,n)=>{"use strict";var a=n(34458),i=n(98274),o=n(59801),r=n(90287),s=n(62833);a.Z.addInitializer({name:"auth",initializer:function(){i.Z.init(r.Z,s.Z,o.Z)},after:"store"})},93240:(e,t,n)=>{"use strict";var a=n(34458),i=n(78657),o=n(93825),r=n(96142),s=n(53904);a.Z.addInitializer({name:"captcha",initializer:function(e){o.ZP.init(e,i.Z,r.Z,s.Z)}})},75147:(e,t,n)=>{"use strict";var a=n(22928),i=n(57588),o=n.n(i),r=n(34458),s=n(15671),l=n(43144),c=n(97326),u=n(79340),d=n(6215),p=n(61120),h=n(4942),m=n(78657);var v=function(e){(0,u.Z)(o,e);var t,n,i=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function o(e){var t;return(0,s.Z)(this,o),t=i.call(this,e),(0,h.Z)((0,c.Z)(t),"handleDecline",(function(){t.state.submiting||window.confirm(pgettext("accept agreement prompt","Declining will result in immediate deactivation and deletion of your account. This action is not reversible."))&&(t.setState({submiting:!0}),m.Z.post(t.props.api,{accept:!1}).then((function(){window.location.reload(!0)})))})),(0,h.Z)((0,c.Z)(t),"handleAccept",(function(){t.state.submiting||(t.setState({submiting:!0}),m.Z.post(t.props.api,{accept:!0}).then((function(){window.location.reload(!0)})))})),t.state={submiting:!1},t}return(0,l.Z)(o,[{key:"render",value:function(){return(0,a.Z)("div",{},void 0,(0,a.Z)("button",{className:"btn btn-default",disabled:this.state.submiting,type:"buton",onClick:this.handleDecline},void 0,pgettext("accept agreement choice","Decline")),(0,a.Z)("button",{className:"btn btn-primary",disabled:this.state.submiting,type:"buton",onClick:this.handleAccept},void 0,pgettext("accept agreement choice","Accept and continue")))}}]),o}(o().Component),f=n(4869);r.Z.addInitializer({name:"component:accept-agreement",initializer:function(e){document.getElementById("required-agreement-mount")&&(0,f.Z)((0,a.Z)(v,{api:e.get("REQUIRED_AGREEMENT_API")}),"required-agreement-mount",!1)},after:"store"})},4894:(e,t,n)=>{"use strict";var a=n(37424),i=n(34458),o=n(22928),r=n(15671),s=n(43144),l=n(79340),c=n(6215),u=n(61120),d=n(57588);var p=function(e){(0,l.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function i(){return(0,r.Z)(this,i),a.apply(this,arguments)}return(0,s.Z)(i,[{key:"refresh",value:function(){window.location.reload()}},{key:"getMessage",value:function(){return this.props.signedIn?interpolate(pgettext("auth message","You have signed in as %(username)s. Please refresh the page before continuing."),{username:this.props.signedIn.username},!0):this.props.signedOut?interpolate(pgettext("auth message","%(username)s, you have been signed out. Please refresh the page before continuing."),{username:this.props.user.username},!0):void 0}},{key:"render",value:function(){var e="auth-message";return(this.props.signedIn||this.props.signedOut)&&(e+=" show"),(0,o.Z)("div",{className:e},void 0,(0,o.Z)("div",{className:"container"},void 0,(0,o.Z)("p",{className:"lead"},void 0,this.getMessage()),(0,o.Z)("p",{},void 0,(0,o.Z)("button",{className:"btn btn-default",type:"button",onClick:this.refresh},void 0,pgettext("auth message","Reload page")),(0,o.Z)("span",{className:"hidden-xs hidden-sm"},void 0," "+pgettext("auth message","or press F5 key.")))))}}]),i}(n.n(d)().Component);function h(e){return{user:e.auth.user,signedIn:e.auth.signedIn,signedOut:e.auth.signedOut}}var m=n(4869);i.Z.addInitializer({name:"component:auth-message",initializer:function(){(0,m.Z)((0,a.$j)(h)(p),"auth-message-mount")},after:"store"})},29223:(e,t,n)=>{"use strict";var a=n(34458),i=n(93051);a.Z.addInitializer({name:"component:banmed-page",initializer:function(e){e.has("BAN_MESSAGE")&&(0,i.Z)(e.get("BAN_MESSAGE"),!1)},after:"store"})},73806:(e,t,n)=>{"use strict";var a,i=n(22928),o=n(57588),r=n.n(o),s=n(73935),l=n.n(s),c=n(37424),u=n(993),d=n(40689),p=n(80261),h=n(15671),m=n(43144),v=n(79340),f=n(6215),Z=n(61120),g=n(59801),y=n(14467);const b=function(e){(0,v.Z)(r,e);var t,n,o=(t=r,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,Z.Z)(t);if(n){var i=(0,Z.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,f.Z)(this,e)});function r(){return(0,h.Z)(this,r),o.apply(this,arguments)}return(0,m.Z)(r,[{key:"componentDidMount",value:function(){"?modal=login"===window.document.location.search&&window.setTimeout((function(){return g.Z.show(a||(a=(0,i.Z)(y.Z,{})))}),300)}},{key:"render",value:function(){return null}}]),r}(r().Component);function k(e){var t=e.logo,n=e.logoXs,a=e.text,o=e.url;return t?(0,i.Z)("div",{className:"navbar-branding"},void 0,(0,i.Z)("a",{href:o,className:"navbar-branding-logo"},void 0,(0,i.Z)("img",{src:t,alt:a}))):(0,i.Z)("div",{className:"navbar-branding"},void 0,!!n&&(0,i.Z)("a",{href:o,className:"navbar-branding-logo-xs"},void 0,(0,i.Z)("img",{src:n,alt:a})),!!a&&(0,i.Z)("a",{href:o,className:"navbar-branding-text"},void 0,a))}function _(e){var t=e.items;return(0,i.Z)("ul",{className:"navbar-extra-menu",role:"nav"},void 0,t.map((function(e,t){return(0,i.Z)("li",{className:e.className},t,(0,i.Z)("a",{href:e.url,target:e.targetBlank?"_blank":null,rel:e.rel},void 0,e.title))})))}var x,N=n(49021),w=n(97326),C=n(4942),R=n(63026),E=n(66462),S=n(94184),L=n.n(S);function O(e){var t=e.children,n=e.showAll,a=e.showUnread,o=e.unread;return(0,i.Z)("div",{className:"notifications-dropdown-body"},void 0,(0,i.Z)(N.Aw,{},void 0,pgettext("notifications title","Notifications")),(0,i.Z)(N.KE,{},void 0,(0,i.Z)(P,{active:!o,onClick:n},void 0,pgettext("notifications dropdown","All")),(0,i.Z)(P,{active:o,onClick:a},void 0,pgettext("notifications dropdown","Unread"))),t,(0,i.Z)(N.kE,{},void 0,(0,i.Z)("a",{className:"btn btn-default btn-block",href:misago.get("NOTIFICATIONS_URL")},void 0,pgettext("notifications","See all notifications"))))}function P(e){var t=e.active,n=e.children,a=e.onClick;return(0,i.Z)("button",{className:L()("btn",{"btn-primary":t,"btn-default":!t}),type:"button",onClick:a},void 0,n)}const A=function(e){(0,v.Z)(o,e);var t,n,a=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,Z.Z)(t);if(n){var i=(0,Z.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,f.Z)(this,e)});function o(e){var t;return(0,h.Z)(this,o),t=a.call(this,e),(0,C.Z)((0,w.Z)(t),"render",(function(){return(0,i.Z)(O,{unread:t.state.unread,showAll:function(){return t.setState({unread:!1})},showUnread:function(){return t.setState({unread:!0})}},void 0,(0,i.Z)(R.Z,{filter:t.state.unread?"unread":"all",disabled:!t.props.active},void 0,(function(e){var n=e.data,a=e.loading,o=e.error;return a?x||(x=(0,i.Z)(E.Pu,{})):o?(0,i.Z)(E.lb,{error:o}):(0,i.Z)(E.uE,{filter:t.state.unread?"unread":"all",items:n?n.results:[]})})))})),t.state={unread:!1,url:""},t}return(0,m.Z)(o,[{key:"getApiUrl",value:function(){return misago.get("NOTIFICATIONS_API")+"?limit=20"+(this.state.unread?"&filter=unread":"")}}]),o}(r().Component);function T(e){var t=e.id,n=e.className,a=e.badge,o=e.url,r=e.active,s=e.onClick,l=a?pgettext("navbar","You have unread notifications!"):pgettext("navbar","Open notifications");return(0,i.Z)("a",{id:t,className:L()("btn btn-navbar-icon",n,{active:r}),href:o,title:l,onClick:s},void 0,!!a&&(0,i.Z)("span",{className:"navbar-item-badge"},void 0,a),(0,i.Z)("span",{className:"material-icon"},void 0,a?"notifications_active":"notifications_none"))}function I(e){var t=e.id,n=e.className,a=e.badge,o=e.url;return(0,i.Z)(N.Lt,{id:t,toggle:function(e){var t=e.isOpen,r=e.toggle;return(0,i.Z)(T,{className:n,active:t,badge:a,url:o,onClick:function(e){e.preventDefault(),r()}})},menuClassName:"notifications-dropdown",menuAlignRight:!0},void 0,(function(e){var t=e.isOpen;return(0,i.Z)(A,{active:t})}))}var B;function j(e){var t=e.id,n=e.className,a=e.badge,o=e.url,r=e.active,s=e.onClick,l=a?pgettext("navbar","You have unread private threads!"):pgettext("navbar","Open private threads");return(0,i.Z)("a",{id:t,className:L()("btn btn-navbar-icon",n,{active:r}),href:o,title:l,onClick:s},void 0,!!a&&(0,i.Z)("span",{className:"navbar-item-badge"},void 0,a),B||(B=(0,i.Z)("span",{className:"material-icon"},void 0,"inbox")))}var D,U,z,q=n(11920);function M(e){var t=e.id,n=e.className,a=e.url,o=e.active,r=e.onClick;return(0,i.Z)("a",{id:t,className:L()("btn btn-navbar-icon",n,{active:o}),href:a,title:pgettext("navbar","Open search"),onClick:r},void 0,D||(D=(0,i.Z)("span",{className:"material-icon"},void 0,"search")))}function F(e){var t=e.id,n=e.className,a=e.url;return(0,i.Z)(N.Lt,{id:t,toggle:function(e){var t=e.isOpen,o=e.toggle;return(0,i.Z)(M,{className:n,active:t,url:a,onClick:function(e){e.preventDefault(),o(),window.setTimeout((function(){document.querySelector(".search-dropdown .form-control-search").focus()}),0)}})},menuClassName:"search-dropdown",menuAlignRight:!0},void 0,(function(){return U||(U=(0,i.Z)(q.E,{}))}))}function H(e){var t=e.id,n=e.className,a=e.active,o=e.onClick;return(0,i.Z)("button",{id:t,className:L()("btn btn-navbar-icon",n,{active:a}),title:pgettext("navbar","Open menu"),type:"button",onClick:o},void 0,z||(z=(0,i.Z)("span",{className:"material-icon"},void 0,"menu")))}var V=n(6333);function Y(e){var t=e.id,n=e.className;return(0,i.Z)(N.Lt,{id:t,toggle:function(e){var t=e.isOpen,a=e.toggle;return(0,i.Z)(H,{className:n,active:t,onClick:a})},menuClassName:"site-nav-dropdown",menuAlignRight:!0},void 0,(function(e){e.isOpen;var t=e.close;return(0,i.Z)(V.bS,{close:t})}))}var G=n(19605);function W(e){var t=e.id,n=e.className,a=e.user,o=e.active,r=e.onClick;return(0,i.Z)("a",{id:t,className:L()("btn-navbar-image",n,{active:o}),href:a.url,title:pgettext("navbar","Open your options"),onClick:r},void 0,(0,i.Z)(G.ZP,{user:a,size:34}))}var $,Q,K,X,J=n(28166);function ee(e){var t=e.id,n=e.className,a=e.user;return(0,i.Z)(N.Lt,{id:t,toggle:function(e){var t=e.isOpen,o=e.toggle;return(0,i.Z)(W,{className:n,active:t,user:a,onClick:function(e){e.preventDefault(),o()}})},menuClassName:"user-nav-dropdown",menuAlignRight:!0},void 0,(function(e){e.isOpen;var t=e.close;return(0,i.Z)(J.o4,{close:t})}))}const te=(0,c.$j)((function(e){var t=misago.get("SETTINGS"),n=e.auth.user;return{branding:{logo:t.logo,logoXs:t.logo_small,text:t.logo_text,url:misago.get("MISAGO_PATH")},extraMenuItems:misago.get("extraMenuItems"),user:n.id?{id:n.id,username:n.username,email:n.email,avatars:n.avatars,unreadNotifications:n.unreadNotifications,unreadPrivateThreads:n.unread_private_threads,url:n.url}:null,searchUrl:misago.get("SEARCH_URL"),notificationsUrl:misago.get("NOTIFICATIONS_URL"),privateThreadsUrl:misago.get("PRIVATE_THREADS_URL"),authDelegated:t.enable_oauth2_client,showSearch:!!n.acl.can_search,showPrivateThreads:!!n&&!!n.acl.can_use_private_threads}}))((function(e){var t=e.dispatch,n=e.branding,a=e.extraMenuItems,o=e.authDelegated,s=e.user,l=e.searchUrl,c=e.notificationsUrl,h=e.privateThreadsUrl,m=e.showSearch,v=e.showPrivateThreads;return(0,i.Z)("div",{className:"container navbar-container"},void 0,r().createElement(k,n),(0,i.Z)("div",{className:"navbar-right"},void 0,a.length>0&&(0,i.Z)(_,{items:a}),!!m&&(0,i.Z)(F,{id:"navbar-search-dropdown",url:l}),!!m&&(0,i.Z)(M,{id:"navbar-search-overlay",url:l,onClick:function(e){t(u.UL()),e.preventDefault()}}),$||($=(0,i.Z)(Y,{id:"navbar-site-nav-dropdown"})),(0,i.Z)(H,{id:"navbar-site-nav-overlay",onClick:function(){t(u.AU())}}),!!v&&(0,i.Z)(j,{id:"navbar-private-threads",badge:s.unreadPrivateThreads,url:h}),!!s&&(0,i.Z)(I,{id:"navbar-notifications-dropdown",badge:s.unreadNotifications,url:c}),!!s&&(0,i.Z)(T,{id:"navbar-notifications-overlay",badge:s.unreadNotifications,url:c,onClick:function(e){t(u.hN()),e.preventDefault()}}),!!s&&(0,i.Z)(ee,{id:"navbar-user-nav-dropdown",user:s}),!!s&&(0,i.Z)(W,{id:"navbar-user-nav-overlay",user:s,onClick:function(e){t(u.T5()),e.preventDefault()}}),!s&&(Q||(Q=(0,i.Z)(p.Z,{className:"btn-navbar-sign-in"}))),!s&&!o&&(K||(K=(0,i.Z)(d.Z,{className:"btn-navbar-register"}))),!s&&!o&&(X||(X=(0,i.Z)(b,{})))))}));var ne,ae=n(90287);misago.addInitializer({name:"component:navbar",initializer:function(e){var t=document.getElementById("misago-navbar");l().render((0,i.Z)(c.zt,{store:ae.Z.getStore()},void 0,ne||(ne=(0,i.Z)(te,{}))),t)},after:"store"})},27015:(e,t,n)=>{"use strict";var a,i=n(22928),o=n(57588),r=n.n(o),s=n(73935),l=n.n(s),c=n(37424),u=n(15671),d=n(43144),p=n(97326),h=n(79340),m=n(6215),v=n(61120),f=n(4942),Z=n(63026),g=n(66462),y=n(94184),b=n.n(y),k=n(49021),_=n(64836);function x(e){var t=e.children,n=e.open,a=e.showAll,o=e.showUnread,r=e.unread;return(0,i.Z)(_.a,{open:n},void 0,(0,i.Z)(_.i,{},void 0,pgettext("notifications title","Notifications")),(0,i.Z)(k.KE,{},void 0,(0,i.Z)(N,{active:!r,onClick:a},void 0,pgettext("notifications dropdown","All")),(0,i.Z)(N,{active:r,onClick:o},void 0,pgettext("notifications dropdown","Unread"))),t,(0,i.Z)(k.kE,{},void 0,(0,i.Z)("a",{className:"btn btn-default btn-block",href:misago.get("NOTIFICATIONS_URL")},void 0,pgettext("notifications","See all notifications"))))}function N(e){var t=e.active,n=e.children,a=e.onClick;return(0,i.Z)("button",{className:b()("btn",{"btn-primary":t,"btn-default":!t}),type:"button",onClick:a},void 0,n)}var w=function(e){(0,h.Z)(r,e);var t,n,o=(t=r,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,v.Z)(t);if(n){var i=(0,v.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,m.Z)(this,e)});function r(e){var t;return(0,u.Z)(this,r),t=o.call(this,e),(0,f.Z)((0,p.Z)(t),"render",(function(){return(0,i.Z)(x,{open:t.props.open,unread:t.state.unread,showAll:function(){return t.setState({unread:!1})},showUnread:function(){return t.setState({unread:!0})}},void 0,(0,i.Z)(Z.Z,{filter:t.state.unread?"unread":"all",disabled:!t.props.open},void 0,(function(e){var n=e.data,o=e.loading,r=e.error;return o?a||(a=(0,i.Z)(g.Pu,{})):r?(0,i.Z)(g.lb,{error:r}):(0,i.Z)(g.uE,{filter:t.state.unread?"unread":"all",items:n?n.results:[]})})))})),t.body=document.body,t.state={unread:!1,url:""},t}return(0,d.Z)(r,[{key:"getApiUrl",value:function(){return misago.get("NOTIFICATIONS_API")+"?limit=20"+(this.state.unread?"&filter=unread":"")}},{key:"componentDidUpdate",value:function(e,t){e.open!==this.props.open&&(this.props.open?this.body.classList.add("notifications-fullscreen"):this.body.classList.remove("notifications-fullscreen"))}}]),r}(r().Component);const C=(0,c.$j)((function(e){return{open:e.overlay.notifications}}))(w);var R,E=n(90287);misago.addInitializer({name:"component:notifications-overlay",initializer:function(e){if(e.get("isAuthenticated")){var t=document.getElementById("notifications-mount");l().render((0,i.Z)(c.zt,{store:E.Z.getStore()},void 0,R||(R=(0,i.Z)(C,{}))),t)}},after:"store"})},88097:(e,t,n)=>{"use strict";var a=n(22928),i=n(57588),o=n.n(i),r=n(73935),s=n.n(r),l=n(37424),c=n(69987),u=n(99755);function d(){return(0,a.Z)(u.Iv,{header:pgettext("notifications title","Notifications"),styleName:"notifications"})}var p=n(87462),h=n(15861),m=n(64687),v=n.n(m),f=n(35486),Z=n(53904),g=n(60642),y=n(63026);const b=function(e){var t=e.title,n=e.subtitle,a=[];return n&&a.push(n),t&&a.push(t),a.push(misago.get("SETTINGS").forum_name),document.title=a.join(" | "),null};var k=n(59131),_=n(66462);function x(e){var t=e.children;return(0,a.Z)("ul",{className:"nav nav-pills"},void 0,t)}var N=n(94184),w=n.n(N);function C(e){var t=e.active,n=e.link,i=e.icon,o=e.children;return(0,a.Z)("li",{className:w()({active:t})},void 0,(0,a.Z)(c.rU,{to:n,activeClassName:""},void 0,!!i&&(0,a.Z)("span",{className:"material-icon"},void 0,i),o))}var R=n(92490);function E(e){var t=e.filter,n=misago.get("NOTIFICATIONS_URL");return(0,a.Z)(R.o8,{},void 0,(0,a.Z)(R.Z2,{auto:!0},void 0,(0,a.Z)(R.Eg,{},void 0,(0,a.Z)(x,{},void 0,(0,a.Z)(C,{active:"all"===t,link:n},void 0,pgettext("notifications nav","All")),(0,a.Z)(C,{active:"unread"===t,link:n+"unread/"},void 0,pgettext("notifications nav","Unread")),(0,a.Z)(C,{active:"read"===t,link:n+"read/"},void 0,pgettext("notifications nav","Read"))))))}var S,L,O,P=n(82211);function A(e){var t=e.baseUrl,n=e.data,i=e.disabled;return(0,a.Z)("div",{className:"misago-pagination"},void 0,(0,a.Z)(T,{url:t,disabled:i||!n||!n.hasPrevious},void 0,pgettext("notifications pagination","Latest")),(0,a.Z)(T,{url:t+"?before="+(n?n.firstCursor:""),disabled:i||!n||!n.hasPrevious},void 0,pgettext("notifications pagination","Newer")),(0,a.Z)(T,{url:t+"?after="+(n?n.lastCursor:""),disabled:i||!n||!n.hasNext},void 0,pgettext("notifications pagination","Older")))}function T(e){var t=e.disabled,n=e.children,i=e.url;return t?(0,a.Z)("button",{className:"btn btn-default",type:"disabled",disabled:!0},void 0,n):(0,a.Z)(c.rU,{to:i,className:"btn btn-default",activeClassName:""},void 0,n)}function I(e){var t=e.baseUrl,n=e.data,i=e.disabled,o=e.bottom,r=e.markAllAsRead;return(0,a.Z)(R.o8,{},void 0,(0,a.Z)(R.Z2,{},void 0,(0,a.Z)(R.Eg,{},void 0,(0,a.Z)(A,{baseUrl:t,data:n,disabled:i}))),S||(S=(0,a.Z)(R.tw,{})),(0,a.Z)(R.Z2,{className:w()({"hidden-xs":!o})},void 0,(0,a.Z)(R.Eg,{},void 0,(0,a.Z)(P.Z,{className:"btn-default btn-block",type:"button",disabled:i||!n||!n.unreadNotifications,onClick:r},void 0,L||(L=(0,a.Z)("span",{className:"material-icon"},void 0,"done_all")),pgettext("notifications","Mark all as read")))))}function B(e){return"unread"===e?pgettext("notifications title","Unread notifications"):"read"===e?pgettext("notifications title","Read notifications"):null}const j=(0,l.$j)()((function(e){var t=e.dispatch,n=e.location,i=e.route,r=n.query,s=i.props.filter,l=function(e){var t=misago.get("NOTIFICATIONS_URL");return"all"!==e&&(t+=e+"/"),t}(s);return(0,a.Z)(k.Z,{},void 0,(0,a.Z)(b,{title:pgettext("notifications title","Notifications"),subtitle:B(s)}),(0,a.Z)(E,{filter:s}),(0,a.Z)(y.Z,{filter:s,query:r},void 0,(function(e){var n,i=e.data,c=e.loading,u=e.error,d=e.refetch;return(0,a.Z)(g.D,{url:misago.get("NOTIFICATIONS_API")+"read-all/"},void 0,(function(e,m){var g,y=m.loading,b={baseUrl:l,data:i,disabled:c||y||!i||0===i.results.length,markAllAsRead:(g=(0,h.Z)(v().mark((function n(){return v().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:window.confirm(pgettext("notifications","Mark all notifications as read?"))&&e({onSuccess:function(){var e=(0,h.Z)(v().mark((function e(){return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:d(),t((0,f.yH)({unreadNotifications:null})),Z.Z.success(pgettext("notifications","All notifications have been marked as read."));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),onError:Z.Z.apiError});case 2:case"end":return n.stop()}}),n)}))),function(){return g.apply(this,arguments)})};return c||y?(0,a.Z)("div",{},void 0,o().createElement(I,b),O||(O=(0,a.Z)(_.Pu,{})),o().createElement(I,(0,p.Z)({},b,{bottom:!0}))):u?(0,a.Z)("div",{},void 0,o().createElement(I,b),n||(n=(0,a.Z)(_.lb,{error:u})),o().createElement(I,(0,p.Z)({},b,{bottom:!0}))):i?(!i.hasPrevious&&r&&window.history.replaceState({},"",l),(0,a.Z)("div",{},void 0,o().createElement(I,b),(0,a.Z)(_.uE,{filter:s,items:i.results,hasNext:i.hasNext,hasPrevious:i.hasPrevious}),o().createElement(I,(0,p.Z)({},b,{bottom:!0})))):null}))})))}));var D;n(4517);const U=function(){var e=misago.get("NOTIFICATIONS_URL");return(0,a.Z)("div",{className:"page page-notifications"},void 0,D||(D=(0,a.Z)(d,{})),(0,a.Z)(c.F0,{history:c.mW,routes:[{path:e,component:j,props:{filter:"all"}},{path:e+"unread/",component:j,props:{filter:"unread"}},{path:e+"read/",component:j,props:{filter:"read"}}]}))};var z,q=n(90287);misago.addInitializer({name:"component:notifications",initializer:function(e){var t=misago.get("NOTIFICATIONS_URL");if(document.location.pathname.startsWith(t)&&!document.location.pathname.startsWith(t+"disable-email/")&&e.get("isAuthenticated")){var n=document.getElementById("page-mount");s().render((0,a.Z)(l.zt,{store:q.Z.getStore()},void 0,z||(z=(0,a.Z)(U,{}))),n)}},after:"store"})},46016:(e,t,n)=>{"use strict";var a,i=n(37424),o=n(22928),r=n(15671),s=n(43144),l=n(97326),c=n(79340),u=n(6215),d=n(61120),p=n(4942),h=n(57588),m=n.n(h),v=n(30381),f=n.n(v),Z=n(37848);var g,y=function(e){(0,c.Z)(l,e);var t,n,i=(t=l,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function l(){return(0,r.Z)(this,l),i.apply(this,arguments)}return(0,s.Z)(l,[{key:"render",value:function(){return a||(a=(0,o.Z)("div",{className:"panel-body panel-body-loading"},void 0,(0,o.Z)(Z.Z,{className:"loader loader-spaced"})))}}]),l}(m().Component),b=n(33556),k=n(34458),_=n(55547),x=n(53328);var N,w=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,p.Z)((0,l.Z)(t),"update",(function(e){e.expires_on&&(e.expires_on=f()(e.expires_on)),t.setState({isLoaded:!0,error:null,ban:e})})),(0,p.Z)((0,l.Z)(t),"error",(function(e){t.setState({isLoaded:!0,error:e.detail,ban:null})})),k.Z.has("PROFILE_BAN")?t.initWithPreloadedData(k.Z.pop("PROFILE_BAN")):t.initWithoutPreloadedData(),t.startPolling(e.profile.api.ban),t}return(0,s.Z)(i,[{key:"initWithPreloadedData",value:function(e){e.expires_on&&(e.expires_on=f()(e.expires_on)),this.state={isLoaded:!0,ban:e}}},{key:"initWithoutPreloadedData",value:function(){this.state={isLoaded:!1}}},{key:"startPolling",value:function(e){_.Z.start({poll:"ban-details",url:e,frequency:9e4,update:this.update,error:this.error})}},{key:"componentDidMount",value:function(){x.Z.set({title:pgettext("profile ban details title","Ban details"),parent:this.props.profile.username})}},{key:"componentWillUnmount",value:function(){_.Z.stop("ban-details")}},{key:"getUserMessage",value:function(){return this.state.ban.user_message?(0,o.Z)("div",{className:"panel-body ban-message ban-user-message"},void 0,(0,o.Z)("h4",{},void 0,pgettext("profile ban details","User-shown ban message")),(0,o.Z)("div",{className:"lead",dangerouslySetInnerHTML:{__html:this.state.ban.user_message.html}})):null}},{key:"getStaffMessage",value:function(){return this.state.ban.staff_message?(0,o.Z)("div",{className:"panel-body ban-message ban-staff-message"},void 0,(0,o.Z)("h4",{},void 0,pgettext("profile ban details","Team-shown ban message")),(0,o.Z)("div",{className:"lead",dangerouslySetInnerHTML:{__html:this.state.ban.staff_message.html}})):null}},{key:"getExpirationMessage",value:function(){if(this.state.ban.expires_on){if(this.state.ban.expires_on.isAfter(f()())){var e=interpolate(pgettext("profile ban details","This ban expires on %(expires_on)s."),{expires_on:this.state.ban.expires_on.format("LL, LT")},!0),t=interpolate(pgettext("profile ban details","This ban expires %(expires_on)s."),{expires_on:this.state.ban.expires_on.fromNow()},!0);return(0,o.Z)("abbr",{title:e},void 0,t)}return pgettext("profile ban details","This ban has expired.")}return interpolate(pgettext("profile ban details","%(username)s's ban is permanent."),{username:this.props.profile.username},!0)}},{key:"getPanelBody",value:function(){return this.state.ban?Object.keys(this.state.ban).length?(0,o.Z)("div",{},void 0,this.getUserMessage(),this.getStaffMessage(),(0,o.Z)("div",{className:"panel-body ban-expires"},void 0,(0,o.Z)("h4",{},void 0,pgettext("profile ban details","Ban expiration")),(0,o.Z)("p",{className:"lead"},void 0,this.getExpirationMessage()))):(0,o.Z)("div",{},void 0,(0,o.Z)(b.Z,{message:pgettext("profile ban details","No ban is active at the moment.")})):this.state.error?(0,o.Z)("div",{},void 0,(0,o.Z)(b.Z,{icon:"error_outline",message:this.state.error})):g||(g=(0,o.Z)("div",{},void 0,(0,o.Z)(y,{})))}},{key:"render",value:function(){return(0,o.Z)("div",{className:"profile-ban-details"},void 0,(0,o.Z)("div",{className:"panel panel-default"},void 0,(0,o.Z)("div",{className:"panel-heading"},void 0,(0,o.Z)("h3",{className:"panel-title"},void 0,pgettext("profile ban details title","Ban details"))),this.getPanelBody()))}}]),i}(m().Component);function C(e){return e.display?(0,o.Z)(b.Z,{helpText:pgettext("user profile details","No profile details are editable at this time."),message:pgettext("user profile details","This option is currently unavailable.")}):null}function R(e){return e.display?N||(N=(0,o.Z)("div",{className:"panel-body"},void 0,(0,o.Z)(Z.Z,{}))):null}var E=n(60471);var S=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(){var e;(0,r.Z)(this,i);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e=a.call.apply(a,[this].concat(n)),(0,p.Z)((0,l.Z)(e),"onChange",(function(t){var n=e.props,a=n.field;(0,n.onChange)(a.fieldname,t.target.value)})),e}return(0,s.Z)(i,[{key:"render",value:function(){var e=this.props,t=e.disabled,n=e.field,a=e.value,i=n.input;return"select"===i.type?(0,o.Z)(E.Z,{choices:i.choices,disabled:t,id:"id_"+n.fieldname,onChange:this.onChange,value:a}):"textarea"===i.type?(0,o.Z)("textarea",{className:"form-control",disabled:t,id:"id_"+n.fieldname,onChange:this.onChange,rows:"4",type:"text",value:a}):"text"===i.type?(0,o.Z)("input",{className:"form-control",disabled:t,id:"id_"+n.fieldname,onChange:this.onChange,type:"text",value:a}):null}}]),i}(m().Component),L=n(96359);function O(e){var t=e.disabled,n=e.errors,a=e.fields,i=e.name,r=e.onChange,s=e.value;return(0,o.Z)("fieldset",{},void 0,(0,o.Z)("legend",{},void 0,i),a.map((function(e){return(0,o.Z)(L.Z,{for:"id_"+e.fieldname,helpText:e.help_text,label:e.label,validation:n[e.fieldname]},e.fieldname,(0,o.Z)(S,{disabled:t,field:e,onChange:r,value:s[e.fieldname]}))})))}var P=n(82211),A=n(43345),T=n(78657),I=n(53904);var B=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;(0,r.Z)(this,i),t=a.call(this,e),(0,p.Z)((0,l.Z)(t),"onChange",(function(e,n){t.setState((0,p.Z)({},e,n))})),t.state={isLoading:!1,errors:{}};for(var n=e.groups.length,o=0;o<n;o++)for(var s=e.groups[o],c=s.fields.length,u=0;u<c;u++){var d=s.fields[u].fieldname,h=s.fields[u].initial;t.state[d]=h}return t}return(0,s.Z)(i,[{key:"send",value:function(){var e=Object.assign({},this.state,{errors:null,isLoading:null});return T.Z.post(this.props.api,e)}},{key:"handleSuccess",value:function(e){this.props.onSuccess(e)}},{key:"handleError",value:function(e){400===e.status?(I.Z.error(gettext("Form contains errors.")),this.setState({errors:e})):I.Z.apiError(e)}},{key:"render",value:function(){var e=this;return(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"panel-body"},void 0,this.props.groups.map((function(t,n){return(0,o.Z)(O,{disabled:e.state.isLoading,errors:e.state.errors,fields:t.fields,name:t.name,onChange:e.onChange,value:e.state},n)}))),(0,o.Z)("div",{className:"panel-footer text-right"},void 0,(0,o.Z)(j,{disabled:this.state.isLoading,onCancel:this.props.onCancel})," ",(0,o.Z)(P.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,pgettext("user profile details form btn","Save changes"))))}}]),i}(A.Z);function j(e){var t=e.onCancel,n=e.disabled;return t?(0,o.Z)("button",{className:"btn btn-default",disabled:n,onClick:t,type:"button"},void 0,pgettext("user profile details form btn","Cancel")):null}var D,U=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),(t=a.call(this,e)).state={loading:!0,groups:null},t}return(0,s.Z)(i,[{key:"componentDidMount",value:function(){var e=this;T.Z.get(this.props.api).then((function(t){e.setState({loading:!1,groups:t})}),(function(t){I.Z.apiError(t),e.props.cancel&&e.props.cancel()}))}},{key:"render",value:function(){var e=this.state,t=e.groups,n=e.loading;return(0,o.Z)("div",{className:"panel panel-default panel-form"},void 0,(0,o.Z)("div",{className:"panel-heading"},void 0,(0,o.Z)("h3",{className:"panel-title"},void 0,pgettext("user profile details form title","Edit details"))),(0,o.Z)(R,{display:n}),(0,o.Z)(C,{display:!n&&!t.length}),(0,o.Z)(z,{api:this.props.api,display:!n&&t.length,groups:t,onCancel:this.props.onCancel,onSuccess:this.props.onSuccess}))}}]),i}(m().Component);function z(e){var t=e.api,n=e.display,a=e.groups,i=e.onCancel,r=e.onSuccess;return n?(0,o.Z)(B,{api:t,groups:a,onCancel:i,onSuccess:r}):null}function q(e){var t=e.api,n=e.display,a=e.onCancel,i=e.onSuccess;return n?(0,o.Z)(U,{api:t,onCancel:a,onSuccess:i}):null}function M(e){var t,n=e.isAuthenticated,a=e.profile;return t=n?pgettext("profile details empty","You are not sharing any details with others."):interpolate(pgettext("profile details empty","%(username)s is not sharing any details with others."),{username:a.username},!0),(0,o.Z)("div",{className:"panel panel-default"},void 0,(0,o.Z)("div",{className:"panel-body text-center lead"},void 0,t))}function F(e){var t=e.html,n=e.text,a=e.url;return t?(0,o.Z)("div",{className:"form-control-static col-md-9",dangerouslySetInnerHTML:{__html:t}}):(0,o.Z)("div",{className:"form-control-static col-md-9"},void 0,(0,o.Z)(H,{text:n,url:a}))}function H(e){var t=e.text,n=e.url;return n?(0,o.Z)("p",{},void 0,(0,o.Z)("a",{href:n,target:"_blank",rel:"nofollow"},void 0,t||n)):t?(0,o.Z)("p",{},void 0,t):null}function V(e){return(0,o.Z)("div",{className:"form-group"},void 0,(0,o.Z)("strong",{className:"control-label col-md-3"},void 0,e.name,":"),m().createElement(F,e))}function Y(e){var t=e.fields,n=e.name;return(0,o.Z)("div",{className:"panel panel-default panel-profile-details-group"},void 0,(0,o.Z)("div",{className:"panel-heading"},void 0,(0,o.Z)("h3",{className:"panel-title"},void 0,n)),(0,o.Z)("div",{className:"panel-body"},void 0,(0,o.Z)("div",{className:"form-horizontal"},void 0,t.map((function(e){var t=e.fieldname,n=e.html,a=e.name,i=e.text,r=e.url;return(0,o.Z)(V,{name:a,html:n,text:i,url:r},t)})))))}function G(e){var t=e.display,n=e.groups,a=e.isAuthenticated,i=e.loading,r=e.profile;return t?i?D||(D=(0,o.Z)(Z.Z,{})):n.length?(0,o.Z)("div",{},void 0,n.map((function(e,t){return(0,o.Z)(Y,{fields:e.fields,name:e.name},t)}))):(0,o.Z)(M,{isAuthenticated:a,profile:r}):null}var W=n(92490);const $=function(e){var t=e.onEdit,n=e.showEditButton;return(0,o.Z)(W.o8,{},void 0,(0,o.Z)(W.Z2,{auto:!0},void 0,(0,o.Z)(W.Eg,{auto:!0},void 0,(0,o.Z)("h3",{},void 0,pgettext("profile details title","Details")))),n&&(0,o.Z)(W.Z2,{},void 0,(0,o.Z)(W.Eg,{},void 0,(0,o.Z)("button",{className:"btn btn-default btn-outline btn-block",onClick:t,type:"button"},void 0,pgettext("profile details edit btn","Edit")))))};var Q=n(58598);var K=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(){return(0,r.Z)(this,i),a.apply(this,arguments)}return(0,s.Z)(i,[{key:"componentDidMount",value:function(){var e=this.props,t=e.data,n=e.dispatch,a=e.user;t&&t.id===a.id||T.Z.get(this.props.user.api.details).then((function(e){n((0,Q.zD)(e))}),(function(e){I.Z.apiError(e)}))}},{key:"render",value:function(){return this.props.children}}]),i}(m().Component);var X=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,p.Z)((0,l.Z)(t),"onCancel",(function(){t.setState({editing:!1})})),(0,p.Z)((0,l.Z)(t),"onEdit",(function(){t.setState({editing:!0})})),(0,p.Z)((0,l.Z)(t),"onSuccess",(function(e){var n,a=t.props,i=a.dispatch,o=a.isAuthenticated,r=a.profile;n=o?pgettext("profile details form","Your details have been changed."):interpolate(pgettext("profile details form","%(username)s's details have been changed."),{username:r.username},!0),I.Z.info(n),i((0,Q.zD)(e)),t.setState({editing:!1})})),t.state={editing:!1},t}return(0,s.Z)(i,[{key:"componentDidMount",value:function(){x.Z.set({title:pgettext("profile details title","Details"),parent:this.props.profile.username})}},{key:"render",value:function(){var e=this.props,t=e.dispatch,n=e.isAuthenticated,a=e.profile,i=e.profileDetails,r=i.id!==a.id;return(0,o.Z)(K,{data:i,dispatch:t,user:a},void 0,(0,o.Z)("div",{className:"profile-details"},void 0,(0,o.Z)($,{onEdit:this.onEdit,showEditButton:!!i.edit&&!this.state.editing}),(0,o.Z)(G,{display:!this.state.editing,groups:i.groups,isAuthenticated:n,loading:r,profile:a}),(0,o.Z)(q,{api:a.api.edit_details,dispatch:t,display:this.state.editing,onCancel:this.onCancel,onSuccess:this.onSuccess})))}}]),i}(m().Component),J=n(87462),ee=n(11005),te=n(21981),ne=n(90287);var ae,ie=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,p.Z)((0,l.Z)(t),"loadMore",(function(){t.setState({isLoading:!0}),t.loadItems(t.props.posts.next)})),t.state={isLoading:!1},t}return(0,s.Z)(i,[{key:"loadItems",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;T.Z.get(this.props.api,{start:t||0}).then((function(n){0===t?ne.Z.dispatch(te.zD(n)):ne.Z.dispatch(te.R3(n)),e.setState({isLoading:!1})}),(function(t){e.setState({isLoading:!1}),I.Z.apiError(t)}))}},{key:"componentDidMount",value:function(){x.Z.set({title:this.props.title,parent:this.props.profile.username}),this.loadItems()}},{key:"render",value:function(){return(0,o.Z)("div",{className:"profile-feed"},void 0,(0,o.Z)(W.o8,{},void 0,(0,o.Z)(W.Z2,{auto:!0},void 0,(0,o.Z)(W.Eg,{auto:!0},void 0,(0,o.Z)("h3",{},void 0,this.props.header)))),m().createElement(oe,(0,J.Z)({isLoading:this.state.isLoading,loadMore:this.loadMore},this.props)))}}]),i}(m().Component);function oe(e){return e.posts.isLoaded&&!e.posts.results.length?(0,o.Z)("p",{className:"lead"},void 0,e.emptyMessage):(0,o.Z)("div",{},void 0,(0,o.Z)(ee.Z,{isReady:e.posts.isLoaded,posts:e.posts.results,poster:e.profile}),(0,o.Z)(re,{isLoading:e.isLoading,loadMore:e.loadMore,next:e.posts.next}))}function re(e){return e.next?(0,o.Z)("div",{className:"pager-more"},void 0,(0,o.Z)(P.Z,{className:"btn btn-default btn-outline",loading:e.isLoading,onClick:e.loadMore},void 0,pgettext("profile load more btn","Show older activity"))):null}var se=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(){return(0,r.Z)(this,i),a.apply(this,arguments)}return(0,s.Z)(i,[{key:"getClassName",value:function(){return this.props.className?"form-search "+this.props.className:"form-search"}},{key:"render",value:function(){return(0,o.Z)("div",{className:this.getClassName()},void 0,(0,o.Z)("input",{type:"text",className:"form-control",value:this.props.value,onChange:this.props.onChange,placeholder:this.props.placeholder||pgettext("quick search placeholder","Search...")}),ae||(ae=(0,o.Z)("span",{className:"material-icon"},void 0,"search")))}}]),i}(m().Component),le=n(40429),ce=n(6935);var ue=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,p.Z)((0,l.Z)(t),"loadMore",(function(){t.setState({isBusy:!0}),t.loadUsers(t.state.page+1,t.state.search)})),(0,p.Z)((0,l.Z)(t),"search",(function(e){t.setState({isLoaded:!1,isBusy:!0,search:e.target.value,count:0,more:0,page:1,pages:1}),t.loadUsers(1,e.target.value)})),t.setSpecialProps(),k.Z.has(t.PRELOADED_DATA_KEY)?t.initWithPreloadedData(k.Z.pop(t.PRELOADED_DATA_KEY)):t.initWithoutPreloadedData(),t}return(0,s.Z)(i,[{key:"setSpecialProps",value:function(){this.PRELOADED_DATA_KEY="PROFILE_FOLLOWERS",this.TITLE=pgettext("profile followers title","Followers"),this.API_FILTER="followers"}},{key:"initWithPreloadedData",value:function(e){this.state={isLoaded:!0,isBusy:!1,search:"",count:e.count,more:e.more,page:e.page,pages:e.pages},ne.Z.dispatch((0,ce.ZB)(e.results))}},{key:"initWithoutPreloadedData",value:function(){this.state={isLoaded:!1,isBusy:!1,search:"",count:0,more:0,page:1,pages:1},this.loadUsers()}},{key:"loadUsers",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=this.props.profile.api[this.API_FILTER];T.Z.get(a,{search:n,page:t||1},"user-"+this.API_FILTER).then((function(n){1===t?ne.Z.dispatch((0,ce.ZB)(n.results)):ne.Z.dispatch((0,ce.R3)(n.results)),e.setState({isLoaded:!0,isBusy:!1,count:n.count,more:n.more,page:n.page,pages:n.pages})}),(function(e){I.Z.apiError(e)}))}},{key:"componentDidMount",value:function(){x.Z.set({title:this.TITLE,parent:this.props.profile.username})}},{key:"getLabel",value:function(){if(this.state.isLoaded){if(this.state.search){var e=npgettext("profile followers","Found %(users)s user.","Found %(users)s users.",this.state.count);return interpolate(e,{users:this.state.count},!0)}if(this.props.profile.id===this.props.user.id){var t=npgettext("profile followers","You have %(users)s follower.","You have %(users)s followers.",this.state.count);return interpolate(t,{users:this.state.count},!0)}var n=npgettext("profile followers","%(username)s has %(users)s follower.","%(username)s has %(users)s followers.",this.state.count);return interpolate(n,{username:this.props.profile.username,users:this.state.count},!0)}return pgettext("Loading...")}},{key:"getEmptyMessage",value:function(){return this.state.search?pgettext("profile followers","Search returned no users matching specified criteria."):this.props.user.id===this.props.profile.id?pgettext("profile followers","You have no followers."):interpolate(pgettext("profile followers","%(username)s has no followers."),{username:this.props.profile.username},!0)}},{key:"getMoreButton",value:function(){return this.state.more?(0,o.Z)("div",{className:"pager-more"},void 0,(0,o.Z)(P.Z,{className:"btn btn-default btn-outline",loading:this.state.isBusy,onClick:this.loadMore},void 0,interpolate(pgettext("profile followers","Show more (%(more)s)"),{more:this.state.more},!0))):null}},{key:"getListBody",value:function(){return this.state.isLoaded&&0===this.state.count?(0,o.Z)("p",{className:"lead"},void 0,this.getEmptyMessage()):(0,o.Z)("div",{},void 0,(0,o.Z)(le.Z,{cols:3,isReady:this.state.isLoaded,users:this.props.users}),this.getMoreButton())}},{key:"getClassName",value:function(){return"profile-"+this.API_FILTER}},{key:"render",value:function(){return(0,o.Z)("div",{className:this.getClassName()},void 0,(0,o.Z)(W.o8,{},void 0,(0,o.Z)(W.Z2,{auto:!0},void 0,(0,o.Z)(W.Eg,{auto:!0},void 0,(0,o.Z)("h3",{},void 0,this.getLabel()))),(0,o.Z)(W.Z2,{},void 0,(0,o.Z)(W.Eg,{},void 0,(0,o.Z)(se,{value:this.state.search,onChange:this.search,placeholder:pgettext("profile followers search","Search users...")})))),this.getListBody())}}]),i}(m().Component);var de=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(){return(0,r.Z)(this,i),a.apply(this,arguments)}return(0,s.Z)(i,[{key:"setSpecialProps",value:function(){this.PRELOADED_DATA_KEY="PROFILE_FOLLOWS",this.TITLE=pgettext("profile follows title","Follows"),this.API_FILTER="follows"}},{key:"getLabel",value:function(){if(this.state.isLoaded){if(this.state.search){var e=npgettext("profile follows","Found %(users)s user.","Found %(users)s users.",this.state.count);return interpolate(e,{users:this.state.count},!0)}if(this.props.profile.id===this.props.user.id){var t=npgettext("profile follows","You are following %(users)s user.","You are following %(users)s users.",this.state.count);return interpolate(t,{users:this.state.count},!0)}var n=npgettext("profile follows","%(username)s is following %(users)s user.","%(username)s is following %(users)s users.",this.state.count);return interpolate(n,{username:this.props.profile.username,users:this.state.count},!0)}return pgettext("profile follows","Loading...")}},{key:"getEmptyMessage",value:function(){return this.state.search?pgettext("profile follows","Search returned no users matching specified criteria."):this.props.user.id===this.props.profile.id?pgettext("profile follows","You are not following any users."):interpolate(pgettext("profile follows","%(username)s is not following any users."),{username:this.props.profile.username},!0)}}]),i}(ue);var pe,he,me=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(){return(0,r.Z)(this,i),a.apply(this,arguments)}return(0,s.Z)(i,[{key:"getEmptyMessage",value:function(){return this.props.emptyMessage?this.props.emptyMessage:pgettext("username history empty","Your account has no history of name changes.")}},{key:"render",value:function(){return(0,o.Z)("div",{className:"username-history ui-ready"},void 0,(0,o.Z)("ul",{className:"list-group"},void 0,(0,o.Z)("li",{className:"list-group-item empty-message"},void 0,this.getEmptyMessage())))}}]),i}(m().Component),ve=n(19605);var fe=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(){return(0,r.Z)(this,i),a.apply(this,arguments)}return(0,s.Z)(i,[{key:"renderUserAvatar",value:function(){return this.props.change.changed_by?(0,o.Z)("a",{href:this.props.change.changed_by.url,className:"user-avatar-wrapper"},void 0,(0,o.Z)(ve.ZP,{user:this.props.change.changed_by,size:"100"})):pe||(pe=(0,o.Z)("span",{className:"user-avatar-wrapper"},void 0,(0,o.Z)(ve.ZP,{size:"100"})))}},{key:"renderUsername",value:function(){return this.props.change.changed_by?(0,o.Z)("a",{href:this.props.change.changed_by.url,className:"item-title"},void 0,this.props.change.changed_by.username):(0,o.Z)("span",{className:"item-title"},void 0,this.props.change.changed_by_username)}},{key:"render",value:function(){return(0,o.Z)("li",{className:"list-group-item"},this.props.change.id,(0,o.Z)("div",{className:"change-avatar"},void 0,this.renderUserAvatar()),(0,o.Z)("div",{className:"change-author"},void 0,this.renderUsername()),(0,o.Z)("div",{className:"change"},void 0,(0,o.Z)("span",{className:"old-username"},void 0,this.props.change.old_username),he||(he=(0,o.Z)("span",{className:"material-icon"},void 0,"arrow_forward")),(0,o.Z)("span",{className:"new-username"},void 0,this.props.change.new_username)),(0,o.Z)("div",{className:"change-date"},void 0,(0,o.Z)("abbr",{title:this.props.change.changed_on.format("LLL")},void 0,this.props.change.changed_on.fromNow())))}}]),i}(m().Component);var Ze,ge,ye=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(){return(0,r.Z)(this,i),a.apply(this,arguments)}return(0,s.Z)(i,[{key:"render",value:function(){return(0,o.Z)("div",{className:"username-history ui-ready"},void 0,(0,o.Z)("ul",{className:"list-group"},void 0,this.props.changes.map((function(e){return(0,o.Z)(fe,{change:e},e.id)}))))}}]),i}(m().Component),be=n(44039);var ke=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(){return(0,r.Z)(this,i),a.apply(this,arguments)}return(0,s.Z)(i,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"getClassName",value:function(){return this.props.hiddenOnMobile?"list-group-item hidden-xs hidden-sm":"list-group-item"}},{key:"render",value:function(){return(0,o.Z)("li",{className:this.getClassName()},void 0,Ze||(Ze=(0,o.Z)("div",{className:"change-avatar"},void 0,(0,o.Z)("span",{className:"user-avatar"},void 0,(0,o.Z)(ve.ZP,{size:"100"})))),(0,o.Z)("div",{className:"change-author"},void 0,(0,o.Z)("span",{className:"ui-preview-text",style:{width:be.e(30,100)+"px"}},void 0," ")),(0,o.Z)("div",{className:"change"},void 0,(0,o.Z)("span",{className:"ui-preview-text",style:{width:be.e(30,70)+"px"}},void 0," "),ge||(ge=(0,o.Z)("span",{className:"material-icon"},void 0,"arrow_forward")),(0,o.Z)("span",{className:"ui-preview-text",style:{width:be.e(30,70)+"px"}},void 0," ")),(0,o.Z)("div",{className:"change-date"},void 0,(0,o.Z)("span",{className:"ui-preview-text",style:{width:be.e(80,140)+"px"}},void 0," ")))}}]),i}(m().Component);var _e,xe=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(){return(0,r.Z)(this,i),a.apply(this,arguments)}return(0,s.Z)(i,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"render",value:function(){return(0,o.Z)("div",{className:"username-history ui-preview"},void 0,(0,o.Z)("ul",{className:"list-group"},void 0,[0,1,2].map((function(e){return(0,o.Z)(ke,{hiddenOnMobile:e>0},e)}))))}}]),i}(m().Component);var Ne=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(){return(0,r.Z)(this,i),a.apply(this,arguments)}return(0,s.Z)(i,[{key:"render",value:function(){return this.props.isLoaded?this.props.changes.length?(0,o.Z)(ye,{changes:this.props.changes}):(0,o.Z)(me,{emptyMessage:this.props.emptyMessage}):_e||(_e=(0,o.Z)(xe,{}))}}]),i}(m().Component),we=n(48927);var Ce=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,p.Z)((0,l.Z)(t),"loadMore",(function(){t.setState({isBusy:!0}),t.loadChanges(t.state.page+1,t.state.search)})),(0,p.Z)((0,l.Z)(t),"search",(function(e){t.setState({isLoaded:!1,isBusy:!0,search:e.target.value,count:0,more:0,page:1,pages:1}),t.loadChanges(1,e.target.value)})),k.Z.has("PROFILE_NAME_HISTORY")?t.initWithPreloadedData(k.Z.pop("PROFILE_NAME_HISTORY")):t.initWithoutPreloadedData(),t}return(0,s.Z)(i,[{key:"initWithPreloadedData",value:function(e){this.state={isLoaded:!0,isBusy:!1,search:"",count:e.count,more:e.more,page:e.page,pages:e.pages},ne.Z.dispatch((0,we.ZB)(e.results))}},{key:"initWithoutPreloadedData",value:function(){this.state={isLoaded:!1,isBusy:!1,search:"",count:0,more:0,page:1,pages:1},this.loadChanges()}},{key:"loadChanges",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;T.Z.get(k.Z.get("USERNAME_CHANGES_API"),{user:this.props.profile.id,search:n,page:t||1},"search-username-history").then((function(n){1===t?ne.Z.dispatch((0,we.ZB)(n.results)):ne.Z.dispatch((0,we.R3)(n.results)),e.setState({isLoaded:!0,isBusy:!1,count:n.count,more:n.more,page:n.page,pages:n.pages})}),(function(e){I.Z.apiError(e)}))}},{key:"componentDidMount",value:function(){x.Z.set({title:pgettext("profile username history title","Username history"),parent:this.props.profile.username})}},{key:"getLabel",value:function(){if(this.state.isLoaded){if(this.state.search){var e=npgettext("profile username history","Found %(changes)s username change.","Found %(changes)s username changes.",this.state.count);return interpolate(e,{changes:this.state.count},!0)}if(this.props.profile.id===this.props.user.id){var t=npgettext("profile username history","Your username was changed %(changes)s time.","Your username was changed %(changes)s times.",this.state.count);return interpolate(t,{changes:this.state.count},!0)}var n=npgettext("profile username history","%(username)s's username was changed %(changes)s time.","%(username)s's username was changed %(changes)s times.",this.state.count);return interpolate(n,{username:this.props.profile.username,changes:this.state.count},!0)}return pgettext("profile username history","Loading...")}},{key:"getEmptyMessage",value:function(){return this.state.search?pgettext("profile username history","Search returned no username changes matching specified criteria."):this.props.user.id===this.props.profile.id?pgettext("username history empty","Your account has no history of name changes."):interpolate(pgettext("profile username history","%(username)s's username was never changed."),{username:this.props.profile.username},!0)}},{key:"getMoreButton",value:function(){return this.state.more?(0,o.Z)("div",{className:"pager-more"},void 0,(0,o.Z)(P.Z,{className:"btn btn-default btn-outline",loading:this.state.isBusy,onClick:this.loadMore},void 0,interpolate(pgettext("profile username history","Show older (%(more)s)"),{more:this.state.more},!0))):null}},{key:"render",value:function(){return(0,o.Z)("div",{className:"profile-username-history"},void 0,(0,o.Z)(W.o8,{},void 0,(0,o.Z)(W.Z2,{auto:!0},void 0,(0,o.Z)(W.Eg,{auto:!0},void 0,(0,o.Z)("h3",{},void 0,this.getLabel()))),(0,o.Z)(W.Z2,{},void 0,(0,o.Z)(W.Eg,{},void 0,(0,o.Z)(se,{value:this.state.search,onChange:this.search,placeholder:pgettext("profile username history search input","Search history...")})))),(0,o.Z)(Ne,{isLoaded:this.state.isLoaded,emptyMessage:this.getEmptyMessage(),changes:this.props["username-history"]}),this.getMoreButton())}}]),i}(m().Component),Re=n(82125),Ee=n(27519),Se=n(59131),Le=n(98936),Oe=n(99755);var Pe,Ae=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,p.Z)((0,l.Z)(t),"action",(function(){t.setState({isLoading:!0}),t.props.profile.is_followed?ne.Z.dispatch((0,Ee.r$)({is_followed:!1,followers:t.props.profile.followers-1})):ne.Z.dispatch((0,Ee.r$)({is_followed:!0,followers:t.props.profile.followers+1})),T.Z.post(t.props.profile.api.follow).then((function(e){t.setState({isLoading:!1}),ne.Z.dispatch((0,Ee.r$)(e))}),(function(e){t.setState({isLoading:!1}),I.Z.apiError(e)}))})),t.state={isLoading:!1},t}return(0,s.Z)(i,[{key:"getClassName",value:function(){return this.props.profile.is_followed?this.props.className+" btn-default btn-following":this.props.className+" btn-default btn-follow"}},{key:"getIcon",value:function(){return this.props.profile.is_followed?"favorite":"favorite_border"}},{key:"getLabel",value:function(){return this.props.profile.is_followed?pgettext("user profile follow btn","Following"):pgettext("user profile follow btn","Follow")}},{key:"render",value:function(){return(0,o.Z)(P.Z,{className:this.getClassName(),disabled:this.state.isLoading,onClick:this.action},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,this.getIcon()),this.getLabel())}}]),i}(m().Component),Te=n(64646);var Ie,Be,je=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(){var e;(0,r.Z)(this,i);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e=a.call.apply(a,[this].concat(n)),(0,p.Z)((0,l.Z)(e),"onClick",(function(){Te.Z.open({mode:"START_PRIVATE",submit:k.Z.get("PRIVATE_THREADS_API"),to:[e.props.profile]})})),e}return(0,s.Z)(i,[{key:"render",value:function(){var e=this.props.user.acl.can_start_private_threads,t=this.props.user.id===this.props.profile.id;return!e||t?null:(0,o.Z)("button",{className:this.props.className,onClick:this.onClick,type:"button"},void 0,Pe||(Pe=(0,o.Z)("span",{className:"material-icon"},void 0,"comment")),pgettext("profile message btn","Message"))}}]),i}(m().Component),De=n(3784),Ue=n(7227),ze=n(30337);var qe,Me,Fe=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),(t=a.call(this,e)).state={isLoaded:!1,isLoading:!1,error:null,is_avatar_locked:"",avatar_lock_user_message:"",avatar_lock_staff_message:""},t}return(0,s.Z)(i,[{key:"componentDidMount",value:function(){var e=this;T.Z.get(this.props.profile.api.moderate_avatar).then((function(t){e.setState({isLoaded:!0,is_avatar_locked:t.is_avatar_locked,avatar_lock_user_message:t.avatar_lock_user_message||"",avatar_lock_staff_message:t.avatar_lock_staff_message||""})}),(function(t){e.setState({isLoaded:!0,error:t.detail})}))}},{key:"clean",value:function(){return!!this.isValid()||(I.Z.error(this.validate().username[0]),!1)}},{key:"send",value:function(){return T.Z.post(this.props.profile.api.moderate_avatar,{is_avatar_locked:this.state.is_avatar_locked,avatar_lock_user_message:this.state.avatar_lock_user_message,avatar_lock_staff_message:this.state.avatar_lock_staff_message})}},{key:"handleSuccess",value:function(e){ne.Z.dispatch((0,ce.n1)(this.props.profile,e.avatar_hash)),I.Z.success(pgettext("profile avatar moderation","Avatar controls have been changed."))}},{key:"getFormBody",value:function(){return(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(L.Z,{label:pgettext("profile avatar moderation field","Lock avatar"),helpText:pgettext("profile avatar moderation field","Locking user avatar will prohibit user from changing his avatar and will reset his/her avatar to default one."),for:"id_is_avatar_locked"},void 0,(0,o.Z)(Ue.Z,{id:"id_is_avatar_locked",disabled:this.state.isLoading,iconOn:"lock_outline",iconOff:"lock_open",labelOn:pgettext("profile avatar moderation field","Disallow user from changing avatar"),labelOff:pgettext("profile avatar moderation field","Allow user to change avatar"),onChange:this.bindInput("is_avatar_locked"),value:this.state.is_avatar_locked})),(0,o.Z)(L.Z,{label:pgettext("profile avatar moderation field","User message"),helpText:pgettext("profile avatar moderation field","Optional message for user explaining why they are prohibited from changing their avatar."),for:"id_avatar_lock_user_message"},void 0,(0,o.Z)("textarea",{id:"id_avatar_lock_user_message",className:"form-control",rows:"4",disabled:this.state.isLoading,onChange:this.bindInput("avatar_lock_user_message"),value:this.state.avatar_lock_user_message})),(0,o.Z)(L.Z,{label:pgettext("profile avatar moderation field","Staff message"),helpText:pgettext("profile avatar moderation field","Optional message for forum team members explaining why the user is prohibited form changing their avatar."),for:"id_avatar_lock_staff_message"},void 0,(0,o.Z)("textarea",{id:"id_avatar_lock_staff_message",className:"form-control",rows:"4",disabled:this.state.isLoading,onChange:this.bindInput("avatar_lock_staff_message"),value:this.state.avatar_lock_staff_message}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-default","data-dismiss":"modal"},void 0,pgettext("profile avatar moderation btn","Close")),(0,o.Z)(P.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,pgettext("profile avatar moderation btn","Save changes"))))}},{key:"getModalBody",value:function(){return this.state.error?(0,o.Z)(ze.Z,{icon:"remove_circle_outline",message:this.state.error}):this.state.isLoaded?this.getFormBody():Ie||(Ie=(0,o.Z)(De.Z,{}))}},{key:"getClassName",value:function(){return this.state.error?"modal-dialog modal-message modal-avatar-controls":"modal-dialog modal-avatar-controls"}},{key:"render",value:function(){return(0,o.Z)("div",{className:this.getClassName(),role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":pgettext("modal","Close")},void 0,Be||(Be=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,pgettext("profile avatar moderation title","Avatar controls"))),this.getModalBody()))}}]),i}(A.Z),He=n(55210);var Ve,Ye,Ge,We=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),(t=a.call(this,e)).state={isLoaded:!1,isLoading:!1,error:null,username:"",validators:{username:[He.lG()]}},t}return(0,s.Z)(i,[{key:"componentDidMount",value:function(){var e=this;T.Z.get(this.props.profile.api.moderate_username).then((function(){e.setState({isLoaded:!0})}),(function(t){e.setState({isLoaded:!0,error:t.detail})}))}},{key:"clean",value:function(){return!!this.isValid()||(I.Z.error(this.validate().username[0]),!1)}},{key:"send",value:function(){return T.Z.post(this.props.profile.api.moderate_username,{username:this.state.username})}},{key:"handleSuccess",value:function(e){this.setState({username:""}),ne.Z.dispatch((0,we.KP)(e,this.props.profile,this.props.user)),ne.Z.dispatch((0,ce._S)(this.props.profile,e.username,e.slug)),I.Z.success(pgettext("profile username moderation","Username has been changed."))}},{key:"getFormBody",value:function(){return(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(L.Z,{label:pgettext("profile username moderation field","New username"),for:"id_username"},void 0,(0,o.Z)("input",{type:"text",id:"id_username",className:"form-control",disabled:this.state.isLoading,onChange:this.bindInput("username"),value:this.state.username}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,pgettext("profile username moderation btn","Cancel")),(0,o.Z)(P.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,pgettext("profile username moderation btn","Change username"))))}},{key:"getModalBody",value:function(){return this.state.error?(0,o.Z)(ze.Z,{icon:"remove_circle_outline",message:this.state.error}):this.state.isLoaded?this.getFormBody():qe||(qe=(0,o.Z)(De.Z,{}))}},{key:"getClassName",value:function(){return this.state.error?"modal-dialog modal-message modal-rename-user":"modal-dialog modal-rename-user"}},{key:"render",value:function(){return(0,o.Z)("div",{className:this.getClassName(),role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":pgettext("modal","Close")},void 0,Me||(Me=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,pgettext("profile username moderation title","Change username"))),this.getModalBody()))}}]),i}(A.Z);var $e,Qe,Ke,Xe=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,p.Z)((0,l.Z)(t),"countdown",(function(){window.setTimeout((function(){t.state.countdown>1?(t.setState({countdown:t.state.countdown-1}),t.countdown()):t.state.confirm||t.setState({confirm:!0})}),1e3)})),t.state={isLoaded:!1,isLoading:!1,isDeleted:!1,error:null,countdown:5,confirm:!1,with_content:!1},t}return(0,s.Z)(i,[{key:"componentDidMount",value:function(){var e=this;T.Z.get(this.props.profile.api.delete).then((function(){e.setState({isLoaded:!0}),e.countdown()}),(function(t){e.setState({isLoaded:!0,error:t.detail})}))}},{key:"send",value:function(){return T.Z.post(this.props.profile.api.delete,{with_content:this.state.with_content})}},{key:"handleSuccess",value:function(){_.Z.stop("user-profile"),this.state.with_content?this.setState({isDeleted:interpolate(pgettext("profile delete","%(username)s's account, threads, posts and other content has been deleted."),{username:this.props.profile.username},!0)}):this.setState({isDeleted:interpolate(pgettext("profile delete","%(username)s's account has been deleted and other content has been hidden."),{username:this.props.profile.username},!0)})}},{key:"getButtonLabel",value:function(){return this.state.confirm?interpolate(pgettext("profile delete btn","Delete %(username)s"),{username:this.props.profile.username},!0):interpolate(pgettext("profile delete btn","Please wait... (%(countdown)ss)"),{countdown:this.state.countdown},!0)}},{key:"getForm",value:function(){return(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(L.Z,{label:pgettext("profile delete","User content"),for:"id_with_content"},void 0,(0,o.Z)(Ue.Z,{id:"id_with_content",disabled:this.state.isLoading,labelOn:pgettext("profile delete content","Delete together with user's account"),labelOff:pgettext("profile delete content","Hide after deleting user's account"),onChange:this.bindInput("with_content"),value:this.state.with_content}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-default","data-dismiss":"modal"},void 0,pgettext("profile delete btn","Cancel")),(0,o.Z)(P.Z,{className:"btn-danger",loading:this.state.isLoading,disabled:!this.state.confirm},void 0,this.getButtonLabel())))}},{key:"getDeletedBody",value:function(){return(0,o.Z)("div",{className:"modal-body"},void 0,Ve||(Ve=(0,o.Z)("div",{className:"message-icon"},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,o.Z)("div",{className:"message-body"},void 0,(0,o.Z)("p",{className:"lead"},void 0,this.state.isDeleted),(0,o.Z)("p",{},void 0,(0,o.Z)("a",{href:k.Z.get("USERS_LIST_URL")},void 0,pgettext("profile delete link","Return to users list")))))}},{key:"getModalBody",value:function(){return this.state.error?(0,o.Z)(ze.Z,{icon:"remove_circle_outline",message:this.state.error}):this.state.isLoaded?this.state.isDeleted?this.getDeletedBody():this.getForm():Ye||(Ye=(0,o.Z)(De.Z,{}))}},{key:"getClassName",value:function(){return this.state.error||this.state.isDeleted?"modal-dialog modal-message modal-delete-account":"modal-dialog modal-delete-account"}},{key:"render",value:function(){return(0,o.Z)("div",{className:this.getClassName(),role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":pgettext("modal","Close")},void 0,Ge||(Ge=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,pgettext("profile delete title","Delete user account"))),this.getModalBody()))}}]),i}(A.Z),Je=n(59801);var et=function(e){return{tick:e.tick,user:e.auth,profile:e.profile}},tt=function(e){(0,c.Z)(h,e);var t,n,a=(t=h,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function h(){var e;(0,r.Z)(this,h);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e=a.call.apply(a,[this].concat(n)),(0,p.Z)((0,l.Z)(e),"showAvatarDialog",(function(){Je.Z.show((0,i.$j)(et)(Fe))})),(0,p.Z)((0,l.Z)(e),"showRenameDialog",(function(){Je.Z.show((0,i.$j)(et)(We))})),(0,p.Z)((0,l.Z)(e),"showDeleteDialog",(function(){Je.Z.show((0,i.$j)(et)(Xe))})),e}return(0,s.Z)(h,[{key:"render",value:function(){var e=this.props.moderation;return(0,o.Z)("ul",{className:"dropdown-menu dropdown-menu-right",role:"menu"},void 0,!!e.avatar&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-link",onClick:this.showAvatarDialog},void 0,$e||($e=(0,o.Z)("span",{className:"material-icon"},void 0,"portrait")),pgettext("profile moderation menu","Avatar controls"))),!!e.rename&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-link",onClick:this.showRenameDialog},void 0,Qe||(Qe=(0,o.Z)("span",{className:"material-icon"},void 0,"credit_card")),pgettext("profile moderation menu","Change username"))),!!e.delete&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-link",onClick:this.showDeleteDialog},void 0,Ke||(Ke=(0,o.Z)("span",{className:"material-icon"},void 0,"clear")),pgettext("profile moderation menu","Delete account"))))}}]),h}(m().Component),nt=n(24678);const at=function(e){var t=e.profile;return(0,o.Z)("ul",{className:"profile-data-list"},void 0,!1===t.is_active&&(0,o.Z)("li",{className:"user-account-disabled"},void 0,(0,o.Z)("abbr",{title:pgettext("profile data list","This user's account has been disabled by administrator.")},void 0,pgettext("profile data list","Account disabled"))),(0,o.Z)("li",{className:"user-status-display"},void 0,(0,o.Z)(nt.ZP,{user:t,status:t.status},void 0,(0,o.Z)(nt.Jj,{user:t,status:t.status}),(0,o.Z)(nt.pg,{user:t,status:t.status,className:"status-label"}))),t.rank.is_tab?(0,o.Z)("li",{className:"user-rank"},void 0,(0,o.Z)("a",{href:t.rank.url,className:"item-title"},void 0,t.rank.name)):(0,o.Z)("li",{className:"user-rank"},void 0,(0,o.Z)("span",{className:"item-title"},void 0,t.rank.name)),(t.title||t.rank.title)&&(0,o.Z)("li",{className:"user-title"},void 0,t.title||t.rank.title),(0,o.Z)("li",{className:"user-joined-on"},void 0,(0,o.Z)("abbr",{title:interpolate(pgettext("profile data list","Joined on %(joined_on)s"),{joined_on:t.joined_on.format("LL, LT")},!0)},void 0,interpolate(pgettext("profile data list","Joined %(joined_on)s"),{joined_on:t.joined_on.fromNow()},!0))),t.email&&(0,o.Z)("li",{className:"user-email"},void 0,(0,o.Z)("a",{href:"mailto:"+t.email,className:"item-title"},void 0,t.email)))};var it,ot,rt,st,lt,ct=function(){return(0,o.Z)("button",{className:"btn btn-default btn-icon btn-outline dropdown-toggle",type:"button",title:pgettext("profile options btn","Options"),"data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},void 0,lt||(lt=(0,o.Z)("span",{className:"material-icon"},void 0,"settings")))};const ut=function(e){var t=e.profile,n=e.user,a=e.moderation,i=e.message,r=e.follow;return(0,o.Z)(Oe.sP,{},void 0,(0,o.Z)(Oe.mr,{styleName:t.rank.css_class?"rank-"+t.rank.css_class:"profile"},void 0,(0,o.Z)(Oe.gC,{styleName:t.rank.css_class?"rank-"+t.rank.css_class:"profile"},void 0,(0,o.Z)("div",{className:"profile-page-header"},void 0,(0,o.Z)("div",{className:"profile-page-header-avatar"},void 0,(0,o.Z)(ve.ZP,{className:"user-avatar hidden-sm hidden-md hidden-lg",user:t,size:200,size2x:400}),(0,o.Z)(ve.ZP,{className:"user-avatar hidden-xs hidden-md hidden-lg",user:t,size:64,size2x:128}),(0,o.Z)(ve.ZP,{className:"user-avatar hidden-xs hidden-sm",user:t,size:128,size2x:256})),(0,o.Z)("h1",{},void 0,t.username))),(0,o.Z)(Oe.eA,{className:"profile-page-header-details"},void 0,(0,o.Z)(Le.gq,{},void 0,(0,o.Z)(Le.kw,{auto:!0},void 0,(0,o.Z)(Le.Z6,{},void 0,(0,o.Z)(at,{profile:t}))),i&&(0,o.Z)(Le.kw,{},void 0,(0,o.Z)(Le.Z6,{},void 0,(0,o.Z)(je,{className:"btn btn-default btn-block btn-outline",profile:t,user:n})),a.available&&!r&&(0,o.Z)(Le.Z6,{shrink:!0},void 0,(0,o.Z)("div",{className:"dropdown"},void 0,it||(it=(0,o.Z)(ct,{})),(0,o.Z)(tt,{profile:t,moderation:a})))),r&&(0,o.Z)(Le.kw,{},void 0,(0,o.Z)(Le.Z6,{},void 0,(0,o.Z)(Ae,{className:"btn btn-block btn-outline",profile:t})),a.available&&(0,o.Z)(Le.Z6,{shrink:!0},void 0,(0,o.Z)("div",{className:"dropdown"},void 0,ot||(ot=(0,o.Z)(ct,{})),(0,o.Z)(tt,{profile:t,moderation:a})))),a.available&&!r&&!i&&(0,o.Z)(Le.kw,{},void 0,(0,o.Z)(Le.Z6,{className:"hidden-xs",shrink:!0},void 0,(0,o.Z)("div",{className:"dropdown"},void 0,rt||(rt=(0,o.Z)(ct,{})),(0,o.Z)(tt,{profile:t,moderation:a}))),(0,o.Z)(Le.Z6,{className:"hidden-sm hidden-md hidden-lg"},void 0,(0,o.Z)("div",{className:"dropdown"},void 0,(0,o.Z)("button",{className:"btn btn-default btn-block btn-outline dropdown-toggle",type:"button","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},void 0,st||(st=(0,o.Z)("span",{className:"material-icon"},void 0,"settings")),pgettext("profile options btn","Options")),(0,o.Z)(tt,{profile:t,moderation:a}))))))))};var dt=n(69987),pt=n(94417);const ht=function(e){var t=e.baseUrl,n=e.page,a=e.pages;return(0,o.Z)("div",{className:"nav-container"},void 0,(0,o.Z)("div",{className:"dropdown hidden-sm hidden-md hidden-lg"},void 0,(0,o.Z)("button",{className:"btn btn-default btn-block btn-outline dropdown-toggle",type:"button","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,n.icon),n.name),(0,o.Z)("ul",{className:"dropdown-menu stick-to-bottom"},void 0,a.map((function(e){return(0,o.Z)("li",{},e.component,(0,o.Z)(dt.rU,{to:t+e.component+"/"},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,e.icon),e.name))})))),(0,o.Z)("ul",{className:"nav nav-pills hidden-xs",role:"menu"},void 0,a.map((function(e){return(0,o.Z)(pt.Z,{path:t+e.component+"/"},e.component,(0,o.Z)(dt.rU,{to:t+e.component+"/"},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,e.icon),e.name))}))))};var mt=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,p.Z)((0,l.Z)(t),"update",(function(e){ne.Z.dispatch((0,Ee.ZB)(e))})),t.startPolling(e.profile.api.index),t}return(0,s.Z)(i,[{key:"startPolling",value:function(e){_.Z.start({poll:"user-profile",url:e,frequency:9e4,update:this.update})}},{key:"render",value:function(){var e=this,t=k.Z.get("PROFILE").url,n=k.Z.get("PROFILE_PAGES"),a=n.filter((function(n){var a=t+n.component+"/";return e.props.location.pathname===a}))[0],i=this.props,r=i.profile,s=i.user,l=vt(r,s),c=!!s.acl.can_start_private_threads&&r.id!==s.id,u=!!r.acl.can_follow&&r.id!==s.id;return(0,o.Z)("div",{className:"page page-user-profile"},void 0,(0,o.Z)(ut,{profile:this.props.profile,user:this.props.user,moderation:l,message:c,follow:u}),(0,o.Z)(Se.Z,{},void 0,(0,o.Z)(ht,{baseUrl:t,page:a,pages:n}),this.props.children))}}]),i}(Re.Z),vt=function(e,t){var n={available:!1,rename:!1,avatar:!1,delete:!1};return t.is_anonymous||(n.rename=e.acl.can_rename,n.avatar=e.acl.can_moderate_avatar,n.delete=e.acl.can_delete,n.available=!!(n.rename||n.avatar||n.delete)),n};function ft(e){return{isAuthenticated:e.auth.user.id===e.profile.id,tick:e.tick.tick,user:e.auth.user,users:e.users,posts:e.posts,profile:e.profile,profileDetails:e["profile-details"],"username-history":e["username-history"]}}var Zt={posts:function(e){var t;t=e.user.id===e.profile.id?pgettext("profile posts","You have posted no messages."):interpolate(pgettext("profile posts","%(username)s posted no messages."),{username:e.profile.username},!0);var n=null;if(e.posts.isLoaded)if(e.profile.id===e.user.id){var a=npgettext("profile posts","You have posted %(posts)s message.","You have posted %(posts)s messages.",e.profile.posts);n=interpolate(a,{posts:e.profile.posts},!0)}else{var i=npgettext("profile posts","%(username)s has posted %(posts)s message.","%(username)s has posted %(posts)s messages.",e.profile.posts);n=interpolate(i,{username:e.profile.username,posts:e.profile.posts},!0)}else n=pgettext("profile posts","Loading...");return m().createElement(ie,(0,J.Z)({api:e.profile.api.posts,emptyMessage:t,header:n,title:pgettext("profile posts title","Posts")},e))},threads:function(e){var t;t=e.user.id===e.profile.id?pgettext("profile threads","You haven't started any threads."):interpolate(pgettext("profile threads","%(username)s hasn't started any threads"),{username:e.profile.username},!0);var n=null;if(e.posts.isLoaded)if(e.profile.id===e.user.id){var a=npgettext("profile threads","You have started %(threads)s thread.","You have started %(threads)s threads.",e.profile.threads);n=interpolate(a,{threads:e.profile.threads},!0)}else{var i=npgettext("profile threads","%(username)s has started %(threads)s thread.","%(username)s has started %(threads)s threads.",e.profile.threads);n=interpolate(i,{username:e.profile.username,threads:e.profile.threads},!0)}else n=pgettext("profile threads","Loading...");return m().createElement(ie,(0,J.Z)({api:e.profile.api.threads,emptyMessage:t,header:n,title:pgettext("profile threads title","Threads")},e))},followers:ue,follows:de,details:X,"username-history":Ce,"ban-details":w};function gt(){var e=[];return k.Z.get("PROFILE_PAGES").forEach((function(t){e.push(Object.assign({},t,{path:k.Z.get("PROFILE").url+t.component+"/",component:(0,i.$j)(ft)(Zt[t.component])}))})),e}var yt=n(39633);k.Z.addInitializer({name:"component:profile",initializer:function(e){e.has("PROFILE")&&e.has("PROFILE_PAGES")&&(0,yt.Z)({root:k.Z.get("PROFILE").url,component:(0,i.$j)(ft)(mt),paths:gt()})},after:"reducer:profile-hydrate"})},32488:(e,t,n)=>{"use strict";var a,i=n(34458),o=n(97326),r=n(4942),s=n(22928),l=n(15671),c=n(43144),u=n(79340),d=n(6215),p=n(61120),h=n(57588),m=n.n(h),v=n(82211),f=n(43345),Z=n(78657),g=n(53904),y=n(55210),b=n(93051);function k(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}var _=function(e){(0,u.Z)(n,e);var t=k(n);function n(e){var a;return(0,l.Z)(this,n),(a=t.call(this,e)).state={isLoading:!1,email:"",validators:{email:[y.Do()]}},a}return(0,c.Z)(n,[{key:"clean",value:function(){return!!this.isValid()||(g.Z.error(pgettext("request activation link form","Enter a valid e-mail address.")),!1)}},{key:"send",value:function(){return Z.Z.post(i.Z.get("SEND_ACTIVATION_API"),{email:this.state.email})}},{key:"handleSuccess",value:function(e){this.props.callback(e)}},{key:"handleError",value:function(e){["already_active","inactive_admin"].indexOf(e.code)>-1?g.Z.info(e.detail):403===e.status&&e.ban?(0,b.Z)(e.ban):g.Z.apiError(e)}},{key:"render",value:function(){return(0,s.Z)("div",{className:"well well-form well-form-request-activation-link"},void 0,(0,s.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,s.Z)("div",{className:"form-group"},void 0,(0,s.Z)("div",{className:"control-input"},void 0,(0,s.Z)("input",{type:"text",className:"form-control",placeholder:pgettext("request activation link form field","Your e-mail address"),disabled:this.state.isLoading,onChange:this.bindInput("email"),value:this.state.email}))),(0,s.Z)(v.Z,{className:"btn-primary btn-block",loading:this.state.isLoading},void 0,pgettext("request activation link form btn","Send link"))))}}]),n}(f.Z),x=function(e){(0,u.Z)(n,e);var t=k(n);function n(){return(0,l.Z)(this,n),t.apply(this,arguments)}return(0,c.Z)(n,[{key:"getMessage",value:function(){return interpolate(pgettext("request activation link form","Activation link was sent to %(email)s"),{email:this.props.user.email},!0)}},{key:"render",value:function(){return(0,s.Z)("div",{className:"well well-form well-form-request-activation-link well-done"},void 0,(0,s.Z)("div",{className:"done-message"},void 0,a||(a=(0,s.Z)("div",{className:"message-icon"},void 0,(0,s.Z)("span",{className:"material-icon"},void 0,"check"))),(0,s.Z)("div",{className:"message-body"},void 0,(0,s.Z)("p",{},void 0,this.getMessage())),(0,s.Z)("button",{className:"btn btn-primary btn-block",type:"button",onClick:this.props.callback},void 0,pgettext("request activation link form btn","Request another link"))))}}]),n}(m().Component),N=function(e){(0,u.Z)(n,e);var t=k(n);function n(e){var a;return(0,l.Z)(this,n),a=t.call(this,e),(0,r.Z)((0,o.Z)(a),"complete",(function(e){a.setState({complete:e})})),(0,r.Z)((0,o.Z)(a),"reset",(function(){a.setState({complete:!1})})),a.state={complete:!1},a}return(0,c.Z)(n,[{key:"render",value:function(){return this.state.complete?(0,s.Z)(x,{user:this.state.complete,callback:this.reset}):(0,s.Z)(_,{callback:this.complete})}}]),n}(m().Component),w=n(4869);i.Z.addInitializer({name:"component:request-activation-link",initializer:function(){document.getElementById("request-activation-link-mount")&&(0,w.Z)(N,"request-activation-link-mount",!1)},after:"store"})},11768:(e,t,n)=>{"use strict";var a,i,o=n(34458),r=n(97326),s=n(4942),l=n(22928),c=n(15671),u=n(43144),d=n(79340),p=n(6215),h=n(61120),m=n(57588),v=n.n(m),f=n(73935),Z=n.n(f),g=n(82211),y=n(43345),b=n(78657),k=n(53904),_=n(55210),x=n(93051);function N(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=(0,h.Z)(e);if(t){var i=(0,h.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,p.Z)(this,n)}}var w=function(e){(0,d.Z)(n,e);var t=N(n);function n(e){var a;return(0,c.Z)(this,n),(a=t.call(this,e)).state={isLoading:!1,email:"",validators:{email:[_.Do()]}},a}return(0,u.Z)(n,[{key:"clean",value:function(){return!!this.isValid()||(k.Z.error(pgettext("request password reset form","Enter a valid e-mail address.")),!1)}},{key:"send",value:function(){return b.Z.post(o.Z.get("SEND_PASSWORD_RESET_API"),{email:this.state.email})}},{key:"handleSuccess",value:function(e){this.props.callback(e)}},{key:"handleError",value:function(e){["inactive_user","inactive_admin"].indexOf(e.code)>-1?this.props.showInactivePage(e):403===e.status&&e.ban?(0,x.Z)(e.ban):k.Z.apiError(e)}},{key:"render",value:function(){return(0,l.Z)("div",{className:"well well-form well-form-request-password-reset"},void 0,(0,l.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,l.Z)("div",{className:"form-group"},void 0,(0,l.Z)("div",{className:"control-input"},void 0,(0,l.Z)("input",{type:"text",className:"form-control",placeholder:pgettext("request password reset form field","Your e-mail address"),disabled:this.state.isLoading,onChange:this.bindInput("email"),value:this.state.email}))),(0,l.Z)(g.Z,{className:"btn-primary btn-block",loading:this.state.isLoading},void 0,pgettext("request password reset form btn","Send link"))))}}]),n}(y.Z),C=function(e){(0,d.Z)(n,e);var t=N(n);function n(){return(0,c.Z)(this,n),t.apply(this,arguments)}return(0,u.Z)(n,[{key:"getMessage",value:function(){return interpolate(pgettext("request password reset form","Reset password link was sent to %(email)s"),{email:this.props.user.email},!0)}},{key:"render",value:function(){return(0,l.Z)("div",{className:"well well-form well-form-request-password-reset well-done"},void 0,(0,l.Z)("div",{className:"done-message"},void 0,a||(a=(0,l.Z)("div",{className:"message-icon"},void 0,(0,l.Z)("span",{className:"material-icon"},void 0,"check"))),(0,l.Z)("div",{className:"message-body"},void 0,(0,l.Z)("p",{},void 0,this.getMessage())),(0,l.Z)("button",{type:"button",className:"btn btn-primary btn-block",onClick:this.props.callback},void 0,pgettext("request password reset form btn","Request another link"))))}}]),n}(v().Component),R=function(e){(0,d.Z)(n,e);var t=N(n);function n(){return(0,c.Z)(this,n),t.apply(this,arguments)}return(0,u.Z)(n,[{key:"getActivateButton",value:function(){return"inactive_user"===this.props.activation?(0,l.Z)("p",{},void 0,(0,l.Z)("a",{href:o.Z.get("REQUEST_ACTIVATION_URL")},void 0,pgettext("request password reset form error","Activate your account."))):null}},{key:"render",value:function(){return(0,l.Z)("div",{className:"page page-message page-message-info page-forgotten-password-inactive"},void 0,(0,l.Z)("div",{className:"container"},void 0,(0,l.Z)("div",{className:"message-panel"},void 0,i||(i=(0,l.Z)("div",{className:"message-icon"},void 0,(0,l.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,l.Z)("div",{className:"message-body"},void 0,(0,l.Z)("p",{className:"lead"},void 0,pgettext("request password reset form error","Your account is inactive.")),(0,l.Z)("p",{},void 0,this.props.message),this.getActivateButton()))))}}]),n}(v().Component),E=function(e){(0,d.Z)(n,e);var t=N(n);function n(e){var a;return(0,c.Z)(this,n),a=t.call(this,e),(0,s.Z)((0,r.Z)(a),"complete",(function(e){a.setState({complete:e})})),(0,s.Z)((0,r.Z)(a),"reset",(function(){a.setState({complete:!1})})),a.state={complete:!1},a}return(0,u.Z)(n,[{key:"showInactivePage",value:function(e){Z().render((0,l.Z)(R,{activation:e.code,message:e.detail}),document.getElementById("page-mount"))}},{key:"render",value:function(){return this.state.complete?(0,l.Z)(C,{callback:this.reset,user:this.state.complete}):(0,l.Z)(w,{callback:this.complete,showInactivePage:this.showInactivePage})}}]),n}(v().Component),S=n(4869);o.Z.addInitializer({name:"component:request-password-reset",initializer:function(){document.getElementById("request-password-reset-mount")&&(0,S.Z)(E,"request-password-reset-mount",!1)},after:"store"})},61323:(e,t,n)=>{"use strict";var a,i=n(34458),o=n(97326),r=n(4942),s=n(22928),l=n(15671),c=n(43144),u=n(79340),d=n(6215),p=n(61120),h=n(57588),m=n.n(h),v=n(73935),f=n.n(v),Z=n(82211),g=n(43345),y=n(14467),b=n(78657),k=n(98274),_=n(59801),x=n(53904),N=n(93051),w=n(19755);function C(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}var R=function(e){(0,u.Z)(n,e);var t=C(n);function n(e){var a;return(0,l.Z)(this,n),(a=t.call(this,e)).state={isLoading:!1,password:""},a}return(0,c.Z)(n,[{key:"clean",value:function(){return!!this.state.password.trim().length||(x.Z.error(pgettext("password reset form","Enter new password.")),!1)}},{key:"send",value:function(){return b.Z.post(i.Z.get("CHANGE_PASSWORD_API"),{password:this.state.password})}},{key:"handleSuccess",value:function(e){this.props.callback(e)}},{key:"handleError",value:function(e){403===e.status&&e.ban?(0,N.Z)(e.ban):x.Z.apiError(e)}},{key:"render",value:function(){return(0,s.Z)("div",{className:"well well-form well-form-reset-password"},void 0,(0,s.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,s.Z)("div",{className:"form-group"},void 0,(0,s.Z)("div",{className:"control-input"},void 0,(0,s.Z)("input",{type:"password",className:"form-control",placeholder:pgettext("password reset form field","Enter new password"),disabled:this.state.isLoading,onChange:this.bindInput("password"),value:this.state.password}))),(0,s.Z)(Z.Z,{className:"btn-primary btn-block",loading:this.state.isLoading},void 0,pgettext("password reset form btn","Change password"))))}}]),n}(g.Z),E=function(e){(0,u.Z)(n,e);var t=C(n);function n(){return(0,l.Z)(this,n),t.apply(this,arguments)}return(0,c.Z)(n,[{key:"getMessage",value:function(){return interpolate(pgettext("password reset form","%(username)s, your password has been changed."),{username:this.props.user.username},!0)}},{key:"showSignIn",value:function(){_.Z.show(y.Z)}},{key:"render",value:function(){return(0,s.Z)("div",{className:"page page-message page-message-success page-forgotten-password-changed"},void 0,(0,s.Z)("div",{className:"container"},void 0,(0,s.Z)("div",{className:"message-panel"},void 0,a||(a=(0,s.Z)("div",{className:"message-icon"},void 0,(0,s.Z)("span",{className:"material-icon"},void 0,"check"))),(0,s.Z)("div",{className:"message-body"},void 0,(0,s.Z)("p",{className:"lead"},void 0,this.getMessage()),(0,s.Z)("p",{},void 0,pgettext("password reset form","Sign in using new password to continue.")),(0,s.Z)("p",{},void 0,(0,s.Z)("button",{type:"button",className:"btn btn-primary",onClick:this.showSignIn},void 0,pgettext("password reset form btn","Sign in")))))))}}]),n}(m().Component),S=function(e){(0,u.Z)(n,e);var t=C(n);function n(){var e;(0,l.Z)(this,n);for(var a=arguments.length,i=new Array(a),c=0;c<a;c++)i[c]=arguments[c];return e=t.call.apply(t,[this].concat(i)),(0,r.Z)((0,o.Z)(e),"complete",(function(e){k.Z.softSignOut(),w('#hidden-login-form input[name="next"]').remove(),f().render((0,s.Z)(E,{user:e}),document.getElementById("page-mount"))})),e}return(0,c.Z)(n,[{key:"render",value:function(){return(0,s.Z)(R,{callback:this.complete})}}]),n}(m().Component),L=n(4869);i.Z.addInitializer({name:"component:reset-password-form",initializer:function(){document.getElementById("reset-password-form-mount")&&(0,L.Z)(S,"reset-password-form-mount",!1)},after:"store"})},64752:(e,t,n)=>{"use strict";var a,i=n(22928),o=(n(57588),n(73935)),r=n.n(o),s=n(37424),l=n(11920),c=n(90287);misago.addInitializer({name:"component:search-overlay",initializer:function(e){var t=document.getElementById("search-mount");r().render((0,i.Z)(s.zt,{store:c.Z.getStore()},void 0,a||(a=(0,i.Z)(l.F,{}))),t)},after:"store"})},40949:(e,t,n)=>{"use strict";var a,i=n(37424),o=n(22928),r=n(87462),s=n(57588),l=n.n(s),c=n(59131),u=n(15671),d=n(43144),p=n(97326),h=n(79340),m=n(6215),v=n(61120),f=n(4942),Z=n(34458),g=n(43345),y=n(21981),b=n(16427),k=n(6935),_=n(78657),x=n(53904),N=n(90287),w=n(98936),C=n(99755);var R=function(e){(0,h.Z)(r,e);var t,n,i=(t=r,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,v.Z)(t);if(n){var i=(0,v.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,m.Z)(this,e)});function r(e){var t;return(0,u.Z)(this,r),t=i.call(this,e),(0,f.Z)((0,p.Z)(t),"onQueryChange",(function(e){t.changeValue("query",e.target.value)})),t.state={isLoading:!1,query:e.search.query},t}return(0,d.Z)(r,[{key:"componentDidMount",value:function(){this.state.query.length&&this.handleSubmit()}},{key:"clean",value:function(){return!!this.state.query.trim().length||(x.Z.error(pgettext("search form","You have to enter search query.")),!1)}},{key:"send",value:function(){N.Z.dispatch((0,b.Vx)({isLoading:!0}));var e=this.state.query.trim(),t=window.location.href,n=t.indexOf("?q=");return n>0&&(t=t.substring(0,n+3)),window.history.pushState({},"",t+encodeURIComponent(e)),_.Z.get(Z.Z.get("SEARCH_API"),{q:e})}},{key:"handleSuccess",value:function(e){N.Z.dispatch((0,b.Vx)({query:this.state.query.trim(),isLoading:!1,providers:e})),e.forEach((function(e){"users"===e.id?N.Z.dispatch((0,k.ZB)(e.results.results)):"threads"===e.id&&N.Z.dispatch((0,y.zD)(e.results))}))}},{key:"handleError",value:function(e){x.Z.apiError(e),N.Z.dispatch((0,b.Vx)({isLoading:!1}))}},{key:"render",value:function(){return(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)(C.sP,{},void 0,(0,o.Z)(C.mr,{styleName:"site-search"},void 0,(0,o.Z)(C.gC,{styleName:"site-search"},void 0,(0,o.Z)("h1",{},void 0,pgettext("search form title","Search"))),(0,o.Z)(C.eA,{className:"page-header-search-form"},void 0,(0,o.Z)(w.gq,{},void 0,(0,o.Z)(w.kw,{auto:!0},void 0,(0,o.Z)(w.Z6,{},void 0,(0,o.Z)("input",{className:"form-control",disabled:this.state.isLoading,type:"text",value:this.state.query,placeholder:pgettext("search form input","Search"),onChange:this.onQueryChange})),(0,o.Z)(w.Z6,{shrink:!0},void 0,(0,o.Z)("button",{className:"btn btn-secondary btn-icon btn-outline",title:pgettext("search form btn","Search"),disabled:this.state.isLoading},void 0,a||(a=(0,o.Z)("span",{className:"material-icon"},void 0,"search"))))))))))}}]),r}(g.Z),E=n(69987);function S(e){return(0,o.Z)("div",{className:"list-group nav-side"},void 0,e.providers.map((function(e){return(0,o.Z)(E.rU,{activeClassName:"active",className:"list-group-item",to:e.url},e.id,(0,o.Z)("span",{className:"material-icon"},void 0,e.icon),e.name,(0,o.Z)(L,{results:e.results}))})))}function L(e){if(!e.results)return null;var t=e.results.count;return t>1e6?t=Math.ceil(t/1e6)+"KK":t>1e3&&(t=Math.ceil(t/1e3)+"K"),(0,o.Z)("span",{className:"badge"},void 0,t)}function O(e){return(0,o.Z)("div",{className:"page page-search"},void 0,(0,o.Z)(R,{provider:e.provider,search:e.search}),(0,o.Z)(c.Z,{},void 0,(0,o.Z)("div",{className:"row"},void 0,(0,o.Z)("div",{className:"col-md-3"},void 0,(0,o.Z)(S,{providers:e.search.providers})),(0,o.Z)("div",{className:"col-md-9"},void 0,e.children,(0,o.Z)(P,{provider:e.provider,search:e.search})))))}function P(e){var t=null;if(e.search.providers.forEach((function(n){n.id===e.provider.id&&(t=n.time)})),null===t)return null;var n=pgettext("search time","Search took %(time)s s");return(0,o.Z)("footer",{className:"search-footer"},void 0,(0,o.Z)("p",{},void 0,interpolate(n,{time:t},!0)))}var A=n(11005),T=n(82211);function I(e){return(0,o.Z)("div",{},void 0,(0,o.Z)(A.Z,{isReady:!0,posts:e.results}),l().createElement(B,e))}n(69092);var B=function(e){(0,h.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,v.Z)(t);if(n){var i=(0,v.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,m.Z)(this,e)});function i(){var e;(0,u.Z)(this,i);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e=a.call.apply(a,[this].concat(n)),(0,f.Z)((0,p.Z)(e),"onClick",(function(){N.Z.dispatch((0,y.Vx)({isBusy:!0})),_.Z.get(e.props.provider.api,{q:e.props.query,page:e.props.next}).then((function(e){e.forEach((function(e){"threads"===e.id&&(N.Z.dispatch((0,y.R3)(e.results)),N.Z.dispatch((0,b.P0)(e)))})),N.Z.dispatch((0,y.Vx)({isBusy:!1}))}),(function(e){x.Z.apiError(e),N.Z.dispatch((0,y.Vx)({isBusy:!1}))}))})),e}return(0,d.Z)(i,[{key:"render",value:function(){return this.props.more?(0,o.Z)("div",{className:"pager-more"},void 0,(0,o.Z)(T.Z,{className:"btn btn-default btn-outline",loading:this.props.isBusy,onClick:this.onClick},void 0,pgettext("search threads btn","Show more"))):null}}]),i}(l().Component);function j(e){var t=e.children,n=e.loading,a=e.posts,i=e.query;return a&&a.count?t:i.length?(0,o.Z)("p",{className:"lead"},void 0,n?pgettext("search threads","Loading results..."):pgettext("search threads","No threads matching search query have been found.")):(0,o.Z)("p",{className:"lead"},void 0,pgettext("search threads","Enter at least two characters to search threads."))}var D=n(40429);function U(e){var t=e.children,n=e.loading,a=e.query;return e.users.length?t:a.length?(0,o.Z)("p",{className:"lead"},void 0,n?pgettext("search users","Loading results..."):pgettext("search users","No users matching search query have been found.")):(0,o.Z)("p",{className:"lead"},void 0,pgettext("search users","Enter at least two characters to search users."))}var z={threads:function(e){return(0,o.Z)(O,{provider:e.route.provider,search:e.search},void 0,(0,o.Z)(j,{loading:e.search.isLoading,query:e.search.query,posts:e.posts},void 0,l().createElement(I,(0,r.Z)({provider:e.route.provider,query:e.search.query},e.posts))))},users:function(e){return(0,o.Z)(O,{provider:e.route.provider,search:e.search},void 0,(0,o.Z)(U,{loading:e.search.isLoading,query:e.search.query,users:e.users},void 0,(0,o.Z)(D.Z,{cols:3,isReady:!e.search.isLoading,users:e.users})))}};function q(e){return{posts:e.posts,search:e.search,tick:e.tick.tick,user:e.auth.user,users:e.users}}var M=n(39633);Z.Z.addInitializer({name:"component:search",initializer:function(e){var t;"misago:search"===e.get("CURRENT_LINK")&&(0,M.Z)({paths:(t=Z.Z.get("SEARCH_PROVIDERS"),t.map((function(e){return{path:e.url,component:(0,i.$j)(q)(z[e.id]),provider:e}})))})},after:"store"})},78679:(e,t,n)=>{"use strict";var a,i=n(22928),o=(n(57588),n(73935)),r=n.n(o),s=n(37424),l=n(6333),c=n(90287);misago.addInitializer({name:"component:site-nav-overlay",initializer:function(e){var t=document.getElementById("site-nav-mount");r().render((0,i.Z)(s.zt,{store:c.Z.getStore()},void 0,a||(a=(0,i.Z)(l.Or,{}))),t)},after:"store"})},61814:(e,t,n)=>{"use strict";var a=n(37424),i=n(34458),o=n(22928),r=n(15671),s=n(43144),l=n(79340),c=n(6215),u=n(61120),d=n(57588);var p={info:"alert-info",success:"alert-success",warning:"alert-warning",error:"alert-danger"},h=function(e){(0,l.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function i(){return(0,r.Z)(this,i),a.apply(this,arguments)}return(0,s.Z)(i,[{key:"getSnackbarClass",value:function(){var e="alerts-snackbar";return this.props.isVisible?e+=" in":e+=" out",e}},{key:"render",value:function(){return(0,o.Z)("div",{className:this.getSnackbarClass()},void 0,(0,o.Z)("p",{className:"alert "+p[this.props.type]},void 0,this.props.message))}}]),i}(n.n(d)().Component);function m(e){return e.snackbar}var v=n(4869);i.Z.addInitializer({name:"component:snackbar",initializer:function(){(0,v.Z)((0,a.$j)(m)(h),"snackbar-mount")},after:"snackbar"})},95920:(e,t,n)=>{"use strict";var a=n(57588),i=n.n(a),o=n(22928),r=n(15671),s=n(43144),l=n(97326),c=n(79340),u=n(6215),d=n(61120),p=n(4942),h=n(34458),m=n(26106),v=n(82211),f=n(43345),Z=n(96359),g=n(78657),y=n(53904),b=n(55210),k=n(59131),_=n(99755);const x=function(e){var t=e.backendName,n=pgettext("social auth title","Sign in with %(backend)s"),a=interpolate(n,{backend:t},!0);return(0,o.Z)(_.sP,{},void 0,(0,o.Z)(_.mr,{styleName:"social-auth"},void 0,(0,o.Z)(_.gC,{styleName:"social-auth"},void 0,(0,o.Z)("h1",{},void 0,a))))};function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach((function(t){(0,p.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var C=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;(0,r.Z)(this,i),t=a.call(this,e),(0,p.Z)((0,l.Z)(t),"handlePrivacyPolicyChange",(function(e){var n=e.target.value;t.handleToggleAgreement("privacyPolicy",n)})),(0,p.Z)((0,l.Z)(t),"handleTermsOfServiceChange",(function(e){var n=e.target.value;t.handleToggleAgreement("termsOfService",n)})),(0,p.Z)((0,l.Z)(t),"handleToggleAgreement",(function(e,n){t.setState((function(a,i){if(null===a[e]){var o=w(w({},a.errors),{},(0,p.Z)({},e,null));return(0,p.Z)({errors:o},e,n)}var r=t.state.validators[e][0],s=w(w({},a.errors),{},(0,p.Z)({},e,[r(null)]));return(0,p.Z)({errors:s},e,null)}))}));var n={email:[b.Do()],username:[b.lG()]};return h.Z.get("TERMS_OF_SERVICE_ID")&&(n.termsOfService=[b.fT()]),h.Z.get("PRIVACY_POLICY_ID")&&(n.privacyPolicy=[b.jA()]),t.state={email:e.email||"",emailProtected:!!e.email,username:e.username||"",termsOfService:null,privacyPolicy:null,validators:n,errors:{},isLoading:!1},t}return(0,s.Z)(i,[{key:"clean",value:function(){if(this.validate(),-1!==[this.state.email.trim().length,this.state.username.trim().length].indexOf(0))return y.Z.error(pgettext("social auth form","Fill out all fields.")),!1;var e=this.state.validators;return h.Z.get("TERMS_OF_SERVICE_ID")&&null===this.state.termsOfService?(y.Z.error(e.termsOfService[0](null)),!1):!h.Z.get("PRIVACY_POLICY_ID")||null!==this.state.privacyPolicy||(y.Z.error(e.privacyPolicy[0](null)),!1)}},{key:"send",value:function(){return g.Z.post(this.props.url,{email:this.state.email,username:this.state.username,terms_of_service:this.state.termsOfService,privacy_policy:this.state.privacyPolicy})}},{key:"handleSuccess",value:function(e){(0,this.props.onRegistrationComplete)(e)}},{key:"handleError",value:function(e){if(200===e.status)(0,this.props.onRegistrationComplete)({activation:"active",step:"done",username:this.state.username});else if(400===e.status){var t={errors:e};e.email&&(t.emailProtected=!1),this.setState(t)}else y.Z.apiError(e)}},{key:"render",value:function(){var e=this.props.backend_name,t=this.state,n=t.email,a=t.emailProtected,i=t.username,r=t.isLoading,s=null;if(a){var l=pgettext("social auth form","Your e-mail address has been verified by %(backend)s.");s=interpolate(l,{backend:e},!0)}return(0,o.Z)("div",{className:"page page-social-auth page-social-auth-register"},void 0,(0,o.Z)(x,{backendName:e}),(0,o.Z)(k.Z,{},void 0,(0,o.Z)("div",{className:"row"},void 0,(0,o.Z)("div",{className:"col-md-6 col-md-offset-3"},void 0,(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"panel panel-default panel-form"},void 0,(0,o.Z)("div",{className:"panel-heading"},void 0,(0,o.Z)("h3",{className:"panel-title"},void 0,pgettext("social auth form title","Complete your account"))),(0,o.Z)("div",{className:"panel-body"},void 0,(0,o.Z)(Z.Z,{for:"id_username",label:pgettext("social auth form field","Username"),validation:this.state.errors.username},void 0,(0,o.Z)("input",{type:"text",id:"id_username",className:"form-control",disabled:r,onChange:this.bindInput("username"),value:i})),(0,o.Z)(Z.Z,{for:"id_email",label:pgettext("social auth form field","E-mail address"),helpText:s,validation:a?null:this.state.errors.email},void 0,(0,o.Z)("input",{type:"email",id:"id_email",className:"form-control",disabled:r||a,onChange:this.bindInput("email"),value:n})),(0,o.Z)(m.Z,{errors:this.state.errors,privacyPolicy:this.state.privacyPolicy,termsOfService:this.state.termsOfService,onPrivacyPolicyChange:this.handlePrivacyPolicyChange,onTermsOfServiceChange:this.handleTermsOfServiceChange})),(0,o.Z)("div",{className:"panel-footer"},void 0,(0,o.Z)(v.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,pgettext("social auth form btn","Sign in")))))))))}}]),i}(f.Z);const R=function(e){var t,n,a=e.activation,i=e.backend_name,r=e.username;return n="user"===a?pgettext("account activation required","%(username)s, your account has been created but you need to activate it before you will be able to sign in."):"admin"===a?pgettext("account activation required","%(username)s, your account has been created but the site administrator will have to activate it before you will be able to sign in."):pgettext("social auth complete","%(username)s, your account has been created and you have been signed in to it."),t="active"===a?"check":"info_outline",(0,o.Z)("div",{className:"page page-social-auth page-social-auth-register"},void 0,(0,o.Z)(x,{backendName:i}),(0,o.Z)(k.Z,{},void 0,(0,o.Z)("div",{className:"row"},void 0,(0,o.Z)("div",{className:"col-md-6 col-md-offset-3"},void 0,(0,o.Z)("div",{className:"panel panel-default panel-form"},void 0,(0,o.Z)("div",{className:"panel-heading"},void 0,(0,o.Z)("h3",{className:"panel-title"},void 0,pgettext("social auth complete title","Registration completed!"))),(0,o.Z)("div",{className:"panel-body panel-message-body"},void 0,(0,o.Z)("div",{className:"message-icon"},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,t)),(0,o.Z)("div",{className:"message-body"},void 0,(0,o.Z)("p",{className:"lead"},void 0,interpolate(n,{username:r},!0)),(0,o.Z)("p",{className:"help-block"},void 0,(0,o.Z)("a",{className:"btn btn-default",href:h.Z.get("MISAGO_PATH")},void 0,pgettext("social auth complete link","Return to forum index"))))))))))};var E=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,p.Z)((0,l.Z)(t),"handleRegistrationComplete",(function(e){var n=e.activation,a=e.email,i=e.step,o=e.username;t.setState({activation:n,email:a,step:i,username:o})})),t.state={step:e.step,activation:e.activation||"",email:e.email||"",username:e.username||""},t}return(0,s.Z)(i,[{key:"render",value:function(){var e=this.props,t=e.backend_name,n=e.url,a=this.state,i=a.activation,r=a.email,s=a.step,l=a.username;return"register"===s?(0,o.Z)(C,{backend_name:t,email:r,url:n,username:l,onRegistrationComplete:this.handleRegistrationComplete}):(0,o.Z)(R,{activation:i,backend_name:t,email:r,url:n,username:l})}}]),i}(i().Component),S=n(4869);h.Z.addInitializer({name:"component:social-auth",initializer:function(e){if("misago:social-complete"===e.get("CURRENT_LINK")){var t=e.get("SOCIAL_AUTH_FORM");(0,S.Z)(i().createElement(E,t),"page-mount")}},after:"store"})},44095:(e,t,n)=>{"use strict";var a,i,o=n(37424),r=n(22928),s=n(15671),l=n(43144),c=n(97326),u=n(79340),d=n(6215),p=n(61120),h=n(4942),m=n(57588),v=n.n(m),f=n(87462),Z=n(43345),g=n(96359),y=n(8154),b=n(7738),k=n(78657),_=n(59801),x=n(53904),N=n(90287);var w,C=function(e){(0,u.Z)(o,e);var t,n,i=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function o(e){var t;return(0,s.Z)(this,o),t=i.call(this,e),(0,h.Z)((0,c.Z)(t),"onUsernameChange",(function(e){t.changeValue("username",e.target.value)})),t.state={isLoading:!1,username:""},t}return(0,l.Z)(o,[{key:"clean",value:function(){return!!this.state.username.trim().length||(x.Z.error(pgettext("add private thread participant","You have to enter user name.")),!1)}},{key:"send",value:function(){return k.Z.patch(this.props.thread.api.index,[{op:"add",path:"participants",value:this.state.username},{op:"add",path:"acl",value:1}])}},{key:"handleSuccess",value:function(e){N.Z.dispatch((0,b.y8)(e)),N.Z.dispatch(y.gx(e.participants)),x.Z.success(pgettext("add private thread participant","New participant has been added to thread.")),_.Z.hide()}},{key:"render",value:function(){return(0,r.Z)("div",{className:"modal-dialog modal-sm",role:"document"},void 0,(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,a||(a=(0,r.Z)(R,{})),(0,r.Z)("div",{className:"modal-body"},void 0,(0,r.Z)(g.Z,{for:"id_username",label:pgettext("add private thread participant field","User to add")},void 0,(0,r.Z)("input",{id:"id_username",className:"form-control",disabled:this.state.isLoading,onChange:this.onUsernameChange,type:"text",value:this.state.username}))),(0,r.Z)("div",{className:"modal-footer"},void 0,(0,r.Z)("button",{className:"btn btn-block btn-primary",disabled:this.state.isLoading},void 0,pgettext("add private thread participant btn","Add participant")),(0,r.Z)("button",{className:"btn btn-block btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,pgettext("add private thread participant btn","Cancel"))))))}}]),o}(Z.Z);function R(e){return(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,i||(i=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("add private thread participant modal title","Add participant")))}var E=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(){var e;(0,s.Z)(this,i);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e=a.call.apply(a,[this].concat(n)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){_.Z.show((0,r.Z)(C,{thread:e.props.thread}))})),e}return(0,l.Z)(i,[{key:"render",value:function(){return this.props.thread.acl.can_add_participants?(0,r.Z)("div",{className:"col-xs-12 col-sm-3"},void 0,(0,r.Z)("button",{className:"btn btn-default btn-block",onClick:this.onClick,type:"button"},void 0,w||(w=(0,r.Z)("span",{className:"material-icon"},void 0,"person_add")),pgettext("add participant btn","Add participant"))):null}}]),i}(v().Component),S=n(34458);var L=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,s.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"onClick",(function(){var e,n,a=!1;if(t.isUser)a=window.confirm(pgettext("private thread owner change","Are you sure you want to take over this thread?"));else{var i=pgettext("private thread owner change","Are you sure you want to change thread owner to %(user)s?");a=window.confirm(interpolate(i,{user:t.props.participant.username},!0))}a&&(e=t.props.thread,n=t.props.participant,k.Z.patch(e.api.index,[{op:"replace",path:"owner",value:n.id},{op:"add",path:"acl",value:1}]).then((function(e){N.Z.dispatch((0,b.y8)(e)),N.Z.dispatch(y.gx(e.participants));var t=pgettext("thread participants actions","%(user)s has been made new thread owner.");x.Z.success(interpolate(t,{user:n.username},!0))}),(function(e){x.Z.apiError(e)})))})),t.isUser=e.participant.id===e.user.id,t}return(0,l.Z)(i,[{key:"render",value:function(){return this.props.participant.is_owner?null:this.props.thread.acl.can_change_owner?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,pgettext("private thread owner change btn","Make owner"))):null}}]),i}(v().Component);var O,P,A,T=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,s.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"onClick",(function(){var e,n,a=!1;if(t.isUser)a=window.confirm(pgettext("private thread leave","Are you sure you want to leave this thread?"));else{var i=pgettext("private thread leave","Are you sure you want to remove %(user)s from this thread?");a=window.confirm(interpolate(i,{user:t.props.participant.username},!0))}a&&(t.isUser?(e=t.props.thread,n=t.props.participant,k.Z.patch(e.api.index,[{op:"remove",path:"participants",value:n.id}]).then((function(){x.Z.success(pgettext("thread participants actions","You have left this thread.")),window.setTimeout((function(){window.location=S.Z.get("PRIVATE_THREADS_URL")}),3e3)}),(function(e){x.Z.apiError(e)}))):function(e,t){k.Z.patch(e.api.index,[{op:"remove",path:"participants",value:t.id},{op:"add",path:"acl",value:1}]).then((function(e){N.Z.dispatch((0,b.y8)(e)),N.Z.dispatch(y.gx(e.participants));var n=pgettext("thread participants actions","%(user)s has been removed from this thread.");x.Z.success(interpolate(n,{user:t.username},!0))}),(function(e){x.Z.apiError(e)}))}(t.props.thread,t.props.participant))})),t.isUser=e.participant.id===e.user.id,t}return(0,l.Z)(i,[{key:"render",value:function(){var e=this.props.user.acl.can_moderate_private_threads;return this.props.userIsOwner||this.isUser||e?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,this.isUser?pgettext("private thread leave btn","Leave thread"):pgettext("private thread leave btn","Remove"))):null}}]),i}(v().Component),I=n(19605);function B(e){var t=e.participant,n="btn btn-default";return t.is_owner&&(n="btn btn-primary"),n+=" btn-user btn-block",(0,r.Z)("div",{className:"col-xs-12 col-sm-3 col-md-2 participant-card"},void 0,(0,r.Z)("div",{className:"dropdown"},void 0,(0,r.Z)("button",{"aria-haspopup":"true","aria-expanded":"false",className:n,"data-toggle":"dropdown",type:"button"},void 0,(0,r.Z)(I.ZP,{size:"34",user:t}),(0,r.Z)("span",{className:"btn-text"},void 0,t.username)),(0,r.Z)("ul",{className:"dropdown-menu stick-to-bottom"},void 0,(0,r.Z)(j,{isOwner:t.is_owner}),O||(O=(0,r.Z)("li",{className:"dropdown-header"})),(0,r.Z)("li",{},void 0,(0,r.Z)("a",{href:t.url},void 0,pgettext("thread participants profile link","See profile"))),P||(P=(0,r.Z)("li",{role:"separator",className:"divider"})),v().createElement(L,e),v().createElement(T,e))))}function j(e){return e.isOwner?(0,r.Z)("li",{className:"dropdown-header dropdown-header-owner"},void 0,A||(A=(0,r.Z)("span",{className:"material-icon"},void 0,"start")),(0,r.Z)("span",{className:"icon-text"},void 0,pgettext("thread participants owner status","Thread owner"))):null}function D(e){var t=e.participants,n=e.thread,a=e.user,i=e.userIsOwner;return(0,r.Z)("div",{className:"participants-cards"},void 0,(0,r.Z)("div",{className:"row"},void 0,t.map((function(e){return(0,r.Z)(B,{participant:e,thread:n,user:a,userIsOwner:i},e.id)}))))}function U(e){return e.participants.length?(0,r.Z)("div",{className:"panel panel-default panel-participants"},void 0,(0,r.Z)("div",{className:"panel-body"},void 0,v().createElement(D,(0,f.Z)({userIsOwner:z(e.user,e.participants)},e)),(0,r.Z)("div",{className:"row"},void 0,(0,r.Z)(E,{thread:e.thread}),(0,r.Z)("div",{className:"col-xs-12 col-sm-9"},void 0,(0,r.Z)("p",{},void 0,function(e){var t=e.length,n=npgettext("thread participants stat","This thread has %(users)s participant.","This thread has %(users)s participants.",t);return interpolate(n,{users:t},!0)}(e.participants)))))):null}function z(e,t){return t[0].id===e.id}var q,M=n(30381),F=n.n(M);function H(e){return(0,r.Z)("div",{className:"poll-choices-bars"},void 0,e.poll.choices.map((function(t){return(0,r.Z)(V,{choice:t,poll:e.poll},t.hash)})))}function V(e){var t=0;return e.choice.votes&&e.poll.votes&&(t=Math.ceil(100*e.choice.votes/e.poll.votes)),(0,r.Z)("dl",{className:"dl-horizontal"},void 0,(0,r.Z)("dt",{},void 0,e.choice.label),(0,r.Z)("dd",{},void 0,(0,r.Z)("div",{className:"progress"},void 0,(0,r.Z)("div",{className:"progress-bar",role:"progressbar","aria-valuenow":t,"aria-valuemin":"0","aria-valuemax":"100",style:{width:t+"%"}},void 0,(0,r.Z)("span",{className:"sr-only"},void 0,G(e.votes,e.proc)))),(0,r.Z)("ul",{className:"list-unstyled list-inline poll-chart"},void 0,(0,r.Z)(Y,{proc:t,votes:e.choice.votes}),(0,r.Z)(W,{selected:e.choice.selected}))))}function Y(e){return(0,r.Z)("li",{className:"poll-chart-votes"},void 0,G(e.votes,e.proc))}function G(e,t){var n=npgettext("thread poll","%(votes)s vote, %(proc)s% of total.","%(votes)s votes, %(proc)s% of total.",e);return interpolate(n,{votes:e,proc:t},!0)}function W(e){return e.selected?(0,r.Z)("li",{className:"poll-chart-selected"},void 0,q||(q=(0,r.Z)("span",{className:"material-icon"},void 0,"check_box")),pgettext("thread poll","You've voted on this choice.")):null}var $,Q,K,X=n(30337),J=n(3784);var ee=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,s.Z)(this,i),(t=a.call(this,e)).state={isLoading:!0,error:null,data:[]},t}return(0,l.Z)(i,[{key:"componentDidMount",value:function(){var e=this;k.Z.get(this.props.poll.api.votes).then((function(t){var n=t.map((function(e){return Object.assign({},e,{voters:e.voters.map((function(e){return Object.assign({},e,{voted_on:F()(e.voted_on)})}))})}));e.setState({isLoading:!1,data:n})}),(function(t){e.setState({isLoading:!1,error:t.detail})}))}},{key:"render",value:function(){return(0,r.Z)("div",{className:"modal-dialog"+(this.state.error?" modal-message":" modal-sm"),role:"document"},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":pgettext("modal","Close")},void 0,$||($=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("thread poll","Poll votes"))),(0,r.Z)(te,{data:this.state.data,error:this.state.error,isLoading:this.state.isLoading})))}}]),i}(v().Component);function te(e){return e.isLoading?Q||(Q=(0,r.Z)(J.Z,{})):e.error?(0,r.Z)(X.Z,{icon:"error_outline",message:e.error}):(0,r.Z)(ne,{data:e.data})}function ne(e){return(0,r.Z)("div",{className:"modal-body modal-poll-votes"},void 0,(0,r.Z)("ul",{className:"list-unstyled votes-details"},void 0,e.data.map((function(e){return v().createElement(ae,(0,f.Z)({key:e.hash},e))}))))}function ae(e){return(0,r.Z)("li",{},void 0,(0,r.Z)("h4",{},void 0,e.label),(0,r.Z)(ie,{votes:e.votes}),(0,r.Z)(oe,{voters:e.voters}),K||(K=(0,r.Z)("hr",{})))}function ie(e){var t=npgettext("thread poll","%(votes)s user has voted for this choice.","%(votes)s users have voted for this choice.",e.votes),n=interpolate(t,{votes:e.votes},!0);return(0,r.Z)("p",{},void 0,n)}function oe(e){return e.voters.length?(0,r.Z)("ul",{className:"list-unstyled"},void 0,e.voters.map((function(e){return v().createElement(re,(0,f.Z)({key:e.username},e))}))):null}function re(e){return e.url?(0,r.Z)("li",{},void 0,(0,r.Z)("a",{className:"item-title",href:e.url},void 0,e.username)," ",(0,r.Z)(se,{voted_on:e.voted_on})):(0,r.Z)("li",{},void 0,(0,r.Z)("strong",{},void 0,e.username)," ",(0,r.Z)(se,{voted_on:e.voted_on}))}function se(e){return(0,r.Z)("abbr",{className:"text-muted",title:e.voted_on.format("LLL")},void 0,e.voted_on.fromNow())}var le=n(59752),ce=n(64646);function ue(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}function de(e){var t=e.isPollOver,n=e.poll,a=e.showVoting,i=e.thread;if(!function(e,t,n){return n.is_public||t.can_delete||t.can_edit||t.can_see_votes||t.can_vote&&!e&&(!n.hasSelectedChoices||n.allow_revotes)}(t,n.acl,n))return null;var o=[],s=n.acl.can_vote,l=!n.hasSelectedChoices||n.allow_revotes;return s&&l&&o.push(0),(n.is_public||n.acl.can_see_votes)&&o.push(1),n.acl.can_edit&&o.push(2),n.acl.can_delete&&o.push(3),(0,r.Z)("div",{className:"row poll-options"},void 0,(0,r.Z)(he,{controls:o,isPollOver:t,poll:n,showVoting:a}),(0,r.Z)(me,{controls:o,poll:n}),(0,r.Z)(ve,{controls:o,poll:n,thread:i,onClick:e.edit}),(0,r.Z)(fe,{controls:o,poll:n}))}function pe(e,t){var n="col-xs-6";return 1===e.length&&(n="col-xs-12"),3===e.length&&e[0]===t&&(n="col-xs-12"),n+" col-sm-3 col-md-2"}function he(e){var t=e.poll.acl.can_vote,n=!e.poll.hasSelectedChoices||e.poll.allow_revotes;return t&&n?(0,r.Z)("div",{className:pe(e.controls,0)},void 0,(0,r.Z)("button",{className:"btn btn-default btn-block btn-sm",disabled:e.poll.isBusy,onClick:e.showVoting,type:"button"},void 0,pgettext("thread poll","Vote"))):null}var me=function(e){(0,u.Z)(n,e);var t=ue(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){_.Z.show((0,r.Z)(ee,{poll:e.props.poll}))})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.poll.is_public||this.props.poll.acl.can_see_votes?(0,r.Z)("div",{className:pe(this.props.controls,1)},void 0,(0,r.Z)("button",{className:"btn btn-default btn-block btn-sm",disabled:this.props.poll.isBusy,onClick:this.onClick,type:"button"},void 0,pgettext("thread poll","See votes"))):null}}]),n}(v().Component);function ve(e){return e.poll.acl.can_edit?(0,r.Z)("div",{className:pe(e.controls,2)},void 0,(0,r.Z)("button",{className:"btn btn-default btn-block btn-sm",disabled:e.poll.isBusy,onClick:e.onClick,type:"button"},void 0,pgettext("thread poll","Edit"))):null}var fe=function(e){(0,u.Z)(n,e);var t=ue(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){if(!window.confirm(pgettext("thread poll","Are you sure you want to delete this poll? This action is not reversible.")))return!1;N.Z.dispatch(le.n6()),k.Z.delete(e.props.poll.api.index).then(e.handleSuccess,e.handleError)})),(0,h.Z)((0,c.Z)(e),"handleSuccess",(function(e){x.Z.success(pgettext("thread poll","Poll has been deleted")),N.Z.dispatch(le.Od()),N.Z.dispatch(b.y8(e))})),(0,h.Z)((0,c.Z)(e),"handleError",(function(e){x.Z.apiError(e),N.Z.dispatch(le.Ar())})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.poll.acl.can_delete?(0,r.Z)("div",{className:pe(this.props.controls,3)},void 0,(0,r.Z)("button",{className:"btn btn-default btn-block btn-sm",disabled:this.props.poll.isBusy,onClick:this.onClick,type:"button"},void 0,pgettext("thread poll","Delete"))):null}}]),n}(v().Component),Ze=n(89627),ge='<abbr title="%(absolute)s">%(relative)s</abbr>';function ye(e){return(0,r.Z)("ul",{className:"list-unstyled list-inline poll-details"},void 0,(0,r.Z)(we,{votes:e.poll.votes}),(0,r.Z)(xe,{poll:e.poll}),(0,r.Z)(Ce,{poll:e.poll}),(0,r.Z)(be,{poll:e.poll}))}function be(e){var t=interpolate((0,Ze.Z)(pgettext("thread poll","Started by %(poster)s %(posted_on)s.")),{poster:ke(e.poll),posted_on:_e(e.poll)},!0);return(0,r.Z)("li",{className:"poll-info-creation",dangerouslySetInnerHTML:{__html:t}})}function ke(e){return e.url.poster?interpolate('<a href="%(url)s" class="item-title">%(user)s</a>',{url:(0,Ze.Z)(e.url.poster),user:(0,Ze.Z)(e.poster_name)},!0):interpolate('<span class="item-title">%(user)s</span>',{user:(0,Ze.Z)(e.poster_name)},!0)}function _e(e){return interpolate(ge,{absolute:(0,Ze.Z)(e.posted_on.format("LLL")),relative:(0,Ze.Z)(e.posted_on.fromNow())},!0)}function xe(e){if(!e.poll.length)return null;var t=interpolate((0,Ze.Z)(pgettext("thread poll","Voting ends %(ends_on)s.")),{ends_on:Ne(e.poll)},!0);return(0,r.Z)("li",{className:"poll-info-ends-on",dangerouslySetInnerHTML:{__html:t}})}function Ne(e){return interpolate(ge,{absolute:(0,Ze.Z)(e.endsOn.format("LLL")),relative:(0,Ze.Z)(e.endsOn.fromNow())},!0)}function we(e){var t=npgettext("thread poll","%(votes)s vote.","%(votes)s votes.",e.votes),n=interpolate(t,{votes:e.votes},!0);return(0,r.Z)("li",{className:"poll-info-votes"},void 0,n)}function Ce(e){return e.poll.is_public?(0,r.Z)("li",{className:"poll-info-public"},void 0,pgettext("thread poll","Voting is public.")):null}function Re(e){return(0,r.Z)("div",{className:"panel panel-default panel-poll"},void 0,(0,r.Z)("div",{className:"panel-body"},void 0,(0,r.Z)("h2",{},void 0,e.poll.question),(0,r.Z)(ye,{poll:e.poll}),(0,r.Z)(H,{poll:e.poll}),(0,r.Z)(de,{isPollOver:e.isPollOver,poll:e.poll,edit:e.edit,showVoting:e.showVoting,thread:e.thread})))}function Ee(e){return(0,r.Z)("ul",{className:"list-unstyled list-inline poll-help"},void 0,(0,r.Z)(Se,{choicesLeft:e.choicesLeft}),(0,r.Z)(Le,{poll:e.poll}))}function Se(e){var t=e.choicesLeft;if(0===t)return(0,r.Z)("li",{className:"poll-help-choices-left"},void 0,pgettext("thread poll","You can't select any more choices."));var n=npgettext("thread poll","You can select %(choices)s more choice.","You can select %(choices)s more choices.",t),a=interpolate(n,{choices:t},!0);return(0,r.Z)("li",{className:"poll-help-choices-left"},void 0,a)}function Le(e){return e.poll.allow_revotes?(0,r.Z)("li",{className:"poll-help-allow-revotes"},void 0,pgettext("thread poll","You can change your vote later.")):(0,r.Z)("li",{className:"poll-help-no-revotes"},void 0,pgettext("thread poll","Votes are final."))}function Oe(e){return(0,r.Z)("ul",{className:"list-unstyled poll-select-choices"},void 0,e.choices.map((function(t){return(0,r.Z)(Pe,{choice:t,toggleChoice:e.toggleChoice},t.hash)})))}var Pe=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(){var e;(0,s.Z)(this,i);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e=a.call.apply(a,[this].concat(n)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){e.props.toggleChoice(e.props.choice.hash)})),e}return(0,l.Z)(i,[{key:"render",value:function(){return(0,r.Z)("li",{className:"poll-select-choice"},void 0,(0,r.Z)("button",{className:this.props.choice.selected?"btn btn-selected":"btn",onClick:this.onClick,type:"button"},void 0,(0,r.Z)("span",{className:"material-icon"},void 0,this.props.choice.selected?"check_box":"check_box_outline_blank"),(0,r.Z)("strong",{},void 0,this.props.choice.label)))}}]),i}(v().Component);function Ae(e,t){var n=[];for(var a in t){var i=t[a];i.selected&&n.push(i)}return e.allowed_choices-n.length}var Te=n(82211);var Ie=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,s.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"toggleChoice",(function(e){var n,a=function(e,t){for(var n in e){var a=e[n];if(a.hash===t)return a}return null}(t.state.choices,e);n=a.selected?t.deselectChoice(a,e):t.selectChoice(a,e),t.setState({choices:n,choicesLeft:Ae(t.props.poll,n)})})),(0,h.Z)((0,c.Z)(t),"selectChoice",(function(e,n){if(!Ae(t.props.poll,t.state.choices))for(var a in t.state.choices.slice()){var i=t.state.choices[a];if(i.selected&&i.hash!=n){i.selected=!1;break}}return t.state.choices.map((function(e){return Object.assign({},e,{selected:e.hash==n||e.selected})}))})),(0,h.Z)((0,c.Z)(t),"deselectChoice",(function(e,n){return t.state.choices.map((function(e){return Object.assign({},e,{selected:e.hash!=n&&e.selected})}))})),t.state={isLoading:!1,choices:e.poll.choices,choicesLeft:Ae(e.poll,e.poll.choices)},t}return(0,l.Z)(i,[{key:"clean",value:function(){return this.state.choicesLeft!==this.props.poll.allowed_choices||(x.Z.error(pgettext("thread poll vote","You need to select at least one choice.")),!1)}},{key:"send",value:function(){var e=[];for(var t in this.state.choices.slice()){var n=this.state.choices[t];n.selected&&e.push(n.hash)}return k.Z.post(this.props.poll.api.votes,e)}},{key:"handleSuccess",value:function(e){N.Z.dispatch(le.gx(e)),x.Z.success(pgettext("thread poll vote","Your vote has been saved.")),this.props.showResults()}},{key:"handleError",value:function(e){400===e.status?x.Z.error(e.detail):x.Z.apiError(e)}},{key:"render",value:function(){var e=[];return this.props.poll.acl.can_vote&&e.push(0),(this.props.poll.is_public||this.props.poll.acl.can_see_votes)&&e.push(1),this.props.poll.acl.can_edit&&e.push(2),this.props.poll.acl.can_delete&&e.push(3),(0,r.Z)("div",{className:"panel panel-default panel-poll"},void 0,(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"panel-body"},void 0,(0,r.Z)("h2",{},void 0,this.props.poll.question),(0,r.Z)(ye,{poll:this.props.poll}),(0,r.Z)(Oe,{choices:this.state.choices,toggleChoice:this.toggleChoice}),(0,r.Z)(Ee,{choicesLeft:this.state.choicesLeft,poll:this.props.poll})),(0,r.Z)("div",{className:"panel-footer"},void 0,(0,r.Z)("div",{className:"row"},void 0,(0,r.Z)("div",{className:pe(e,0)},void 0,(0,r.Z)(Te.Z,{className:"btn-primary btn-block btn-sm",loading:this.state.isLoading},void 0,pgettext("thread poll vote btn","Save your vote"))),(0,r.Z)("div",{className:pe(e,1)},void 0,(0,r.Z)("button",{className:"btn btn-default btn-block btn-sm",disabled:this.state.isLoading,onClick:this.props.showResults,type:"button"},void 0,pgettext("thread poll vote btn","See results"))),(0,r.Z)(ve,{controls:e,poll:this.props.poll,thread:this.props.thread,onClick:this.props.edit}),(0,r.Z)(fe,{controls:e,poll:this.props.poll})))))}}]),i}(Z.Z);var Be,je=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;(0,s.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"showResults",(function(){t.setState({showResults:!0})})),(0,h.Z)((0,c.Z)(t),"showVoting",(function(){t.setState({showResults:!1})}));var n=!0;return e.user.id&&!e.poll.hasSelectedChoices&&(n=!1),t.state={showResults:n},t}return(0,l.Z)(i,[{key:"render",value:function(){if(!this.props.thread.poll)return null;var e=function(e){return!!e.length&&F()().isAfter(e.endsOn)}(this.props.poll);return e||!this.props.poll.acl.can_vote||this.state.showResults?v().createElement(Re,(0,f.Z)({isPollOver:e,showVoting:this.showVoting},this.props)):v().createElement(Ie,(0,f.Z)({showResults:this.showResults},this.props))}}]),i}(v().Component),De=n(54031);function Ue(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}var ze=function(e){(0,u.Z)(n,e);var t=Ue(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onAdd",(function(){var t=e.props.choices.slice();t.push({hash:(0,De.ZP)(12),label:""}),e.props.setChoices(t)})),(0,h.Z)((0,c.Z)(e),"onChange",(function(t,n){var a=e.props.choices.map((function(e){return e.hash===t&&(e.label=n),e}));e.props.setChoices(a)})),(0,h.Z)((0,c.Z)(e),"onDelete",(function(t){var n=e.props.choices.filter((function(e){return e.hash!==t}));e.props.setChoices(n)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this;return(0,r.Z)("div",{className:"poll-choices-control"},void 0,(0,r.Z)("ul",{className:"list-group"},void 0,this.props.choices.map((function(t){return(0,r.Z)(qe,{canDelete:e.props.choices.length>2,choice:t,disabled:e.props.disabled,onChange:e.onChange,onDelete:e.onDelete},t.hash)}))),(0,r.Z)("button",{className:"btn btn-default btn-sm",disabled:this.props.disabled,onClick:this.onAdd,type:"button"},void 0,pgettext("thread poll","Add choice")))}}]),n}(v().Component),qe=function(e){(0,u.Z)(n,e);var t=Ue(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onChange",(function(t){e.props.onChange(e.props.choice.hash,t.target.value)})),(0,h.Z)((0,c.Z)(e),"onDelete",(function(){(0===e.props.choice.label.length||window.confirm(pgettext("thread poll","Are you sure you want to remove this choice?")))&&e.props.onDelete(e.props.choice.hash)})),e}return(0,l.Z)(n,[{key:"render",value:function(){return(0,r.Z)("li",{className:"list-group-item"},void 0,(0,r.Z)("button",{className:"btn",disabled:!this.props.canDelete||this.props.disabled,onClick:this.onDelete,title:pgettext("thread poll","Remove this choice"),type:"button"},void 0,Be||(Be=(0,r.Z)("span",{className:"material-icon"},void 0,"close"))),(0,r.Z)("input",{disabled:this.props.disabled,maxLength:"255",placeholder:pgettext("thread poll","Poll choice"),type:"text",onChange:this.onChange,value:this.props.choice.label}))}}]),n}(v().Component),Me=n(7227);var Fe=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;(0,s.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"setChoices",(function(e){t.setState((function(t){return{choices:e,errors:Object.assign({},t.errors,{choices:null})}}))})),(0,h.Z)((0,c.Z)(t),"onCancel",(function(){if(""===t.state.question&&t.state.choices&&t.state.choices.every((function(e){return""===e.label}))&&0===t.state.length&&1===t.state.allowed_choices)return t.props.close();(t.props.poll?window.confirm(pgettext("thread poll","Are you sure you want to discard changes?")):window.confirm(pgettext("thread poll","Are you sure you want to discard new poll?")))&&t.props.close()}));var n=e.poll.id?e.poll:{question:"",choices:[{hash:"choice-10000",label:""},{hash:"choice-20000",label:""}],length:0,allowed_choices:1,allow_revotes:0,is_public:0};return t.state={isLoading:!1,isEdit:!!n.id,question:n.question,choices:n.choices,length:n.length,allowed_choices:n.allowed_choices,allow_revotes:n.allow_revotes,is_public:n.is_public,validators:{question:[],choices:[],length:[],allowed_choices:[]},errors:{}},t}return(0,l.Z)(i,[{key:"send",value:function(){var e={question:this.state.question,choices:this.state.choices,length:this.state.length,allowed_choices:this.state.allowed_choices,allow_revotes:this.state.allow_revotes,is_public:this.state.is_public};return this.state.isEdit?k.Z.put(this.props.poll.api.index,e):k.Z.post(this.props.thread.api.poll,e)}},{key:"handleSuccess",value:function(e){N.Z.dispatch(le.gx(e)),this.state.isEdit?x.Z.success(pgettext("thread poll","Poll has been edited.")):x.Z.success(pgettext("thread poll","Poll has been posted.")),this.props.close()}},{key:"handleError",value:function(e){400===e.status?(e.non_field_errors&&(e.allowed_choices=e.non_field_errors),this.setState({errors:Object.assign({},e)}),x.Z.error(gettext("Form contains errors."))):x.Z.apiError(e)}},{key:"render",value:function(){return(0,r.Z)("div",{className:"poll-form"},void 0,(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"panel panel-default panel-form"},void 0,(0,r.Z)("div",{className:"panel-heading"},void 0,(0,r.Z)("h3",{className:"panel-title"},void 0,this.state.isEdit?pgettext("thread poll","Edit poll"):pgettext("thread poll","Add poll"))),(0,r.Z)("div",{className:"panel-body"},void 0,(0,r.Z)("fieldset",{},void 0,(0,r.Z)("legend",{},void 0,pgettext("thread poll","Question and choices")),(0,r.Z)(g.Z,{label:pgettext("thread poll","Poll question"),for:"id_questions",validation:this.state.errors.question},void 0,(0,r.Z)("input",{className:"form-control",disabled:this.state.isLoading,id:"id_questions",onChange:this.bindInput("question"),type:"text",maxLength:"255",value:this.state.question})),(0,r.Z)(g.Z,{label:pgettext("thread poll","Available choices"),validation:this.state.errors.choices},void 0,(0,r.Z)(ze,{choices:this.state.choices,disabled:this.state.isLoading,setChoices:this.setChoices}))),(0,r.Z)("fieldset",{},void 0,(0,r.Z)("legend",{},void 0,pgettext("thread poll","Voting")),(0,r.Z)("div",{className:"row"},void 0,(0,r.Z)("div",{className:"col-xs-12 col-sm-6"},void 0,(0,r.Z)(g.Z,{label:pgettext("thread poll","Poll length"),helpText:pgettext("thread poll","Enter number of days for which voting in this poll should be possible or zero to run this poll indefinitely."),for:"id_length",validation:this.state.errors.length},void 0,(0,r.Z)("input",{className:"form-control",disabled:this.state.isLoading,id:"id_length",onChange:this.bindInput("length"),type:"text",value:this.state.length}))),(0,r.Z)("div",{className:"col-xs-12 col-sm-6"},void 0,(0,r.Z)(g.Z,{label:pgettext("thread poll","Allowed choices"),for:"id_allowed_choices",validation:this.state.errors.allowed_choices},void 0,(0,r.Z)("input",{className:"form-control",disabled:this.state.isLoading,id:"id_allowed_choices",onChange:this.bindInput("allowed_choices"),type:"text",maxLength:"255",value:this.state.allowed_choices})))),(0,r.Z)("div",{className:"row"},void 0,(0,r.Z)(He,{bindInput:this.bindInput,disabled:this.state.isLoading,isEdit:this.state.isEdit,value:this.state.is_public}),(0,r.Z)("div",{className:"col-xs-12 col-sm-6"},void 0,(0,r.Z)(g.Z,{label:pgettext("thread poll","Allow vote changes"),for:"id_allow_revotes"},void 0,(0,r.Z)(Me.Z,{id:"id_allow_revotes",disabled:this.state.isLoading,iconOn:"check",iconOff:"close",labelOn:pgettext("thread poll","Allow participants to change their vote"),labelOff:pgettext("thread poll","Don't allow participants to change their vote"),onChange:this.bindInput("allow_revotes"),value:this.state.allow_revotes})))))),(0,r.Z)("div",{className:"panel-footer text-right"},void 0,(0,r.Z)("button",{className:"btn btn-default",disabled:this.state.isLoading,onClick:this.onCancel,type:"button"},void 0,pgettext("thread poll","Cancel"))," ",(0,r.Z)(Te.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,this.state.isEdit?pgettext("thread poll","Save changes"):pgettext("thread poll","Post poll"))))))}}]),i}(Z.Z);function He(e){return e.isEdit?null:(0,r.Z)("div",{className:"col-xs-12 col-sm-6"},void 0,(0,r.Z)(g.Z,{label:pgettext("thread poll","Make voting public"),helpText:pgettext("thread poll","Making voting public will allow everyone to access detailed list of votes, showing which users voted for which choices and at which times. This option can't be changed after poll's creation. Moderators may see voting details for all polls."),for:"id_is_public"},void 0,(0,r.Z)(Me.Z,{id:"id_is_public",disabled:e.disabled,iconOn:"visibility",iconOff:"visibility_off",labelOn:pgettext("thread poll","Votes are public"),labelOff:pgettext("thread poll","Votes are hidden"),onChange:e.bindInput("is_public"),value:e.value})))}var Ve={changed_title:"edit",pinned_globally:"bookmark",pinned_locally:"bookmark_border",unpinned:"panorama_fish_eye",moved:"arrow_forward",merged:"call_merge",approved:"done",opened:"lock_open",closed:"lock_outline",unhid:"visibility",hid:"visibility_off",changed_owner:"grade",tookover:"grade",added_participant:"person_add",owner_left:"person_outline",participant_left:"person_outline",removed_participant:"remove_circle_outline"};const Ye=function(e){return(0,r.Z)("span",{className:"event-icon-bg"},void 0,(0,r.Z)("span",{className:"material-icon"},void 0,Ve[e.post.event_type]))};var Ge=n(92747);function We(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}function $e(e){return e.post.acl.can_hide?(0,r.Z)("li",{className:"event-controls"},void 0,v().createElement(Qe,e),v().createElement(Ke,e),v().createElement(Xe,e)):null}var Qe=function(e){(0,u.Z)(n,e);var t=We(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){N.Z.dispatch(Ge.r$(e.props.post,{is_hidden:!0,hidden_on:F()(),hidden_by_name:e.props.user.username,url:Object.assign(e.props.post.url,{hidden_by:e.props.user.url})})),k.Z.patch(e.props.post.api.index,[{op:"replace",path:"is-hidden",value:!0}]).then((function(t){N.Z.dispatch(Ge.r$(e.props.post,t))}),(function(t){400===t.status?x.Z.error(t.detail[0]):x.Z.apiError(t),N.Z.dispatch(Ge.r$(e.props.post,{is_hidden:!1}))}))})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.is_hidden?null:(0,r.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,pgettext("event hide btn","Hide"))}}]),n}(v().Component),Ke=function(e){(0,u.Z)(n,e);var t=We(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){N.Z.dispatch(Ge.r$(e.props.post,{is_hidden:!1})),k.Z.patch(e.props.post.api.index,[{op:"replace",path:"is-hidden",value:!1}]).then((function(t){N.Z.dispatch(Ge.r$(e.props.post,t))}),(function(t){400===t.status?x.Z.error(t.detail[0]):x.Z.apiError(t),N.Z.dispatch(Ge.r$(e.props.post,{is_hidden:!0}))}))})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.is_hidden?(0,r.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,pgettext("event reveal btn","Unhide")):null}}]),n}(v().Component),Xe=function(e){(0,u.Z)(n,e);var t=We(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){window.confirm(pgettext("event delete","Are you sure you wish to delete this event? This action is not reversible!"))&&e.delete()})),(0,h.Z)((0,c.Z)(e),"delete",(function(){N.Z.dispatch(Ge.r$(e.props.post,{isDeleted:!0})),k.Z.delete(e.props.post.api.index).then((function(){x.Z.success(pgettext("event delete","Event has been deleted."))}),(function(t){400===t.status?x.Z.error(t.detail[0]):x.Z.apiError(t),N.Z.dispatch(Ge.r$(e.props.post,{isDeleted:!1}))}))})),e}return(0,l.Z)(n,[{key:"render",value:function(){return(0,r.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,pgettext("event delete btn","Delete"))}}]),n}(v().Component),Je='<span class="item-title">%(user)s</span>',et='<a href="%(url)s" class="item-title">%(user)s</a>';function tt(e){return(0,r.Z)("ul",{className:"list-inline event-info"},void 0,v().createElement(nt,e),v().createElement(at,e),v().createElement($e,e))}function nt(e){if(e.post.is_hidden){var t;t=e.post.url.hidden_by?interpolate(et,{url:(0,Ze.Z)(e.post.url.hidden_by),user:(0,Ze.Z)(e.post.hidden_by_name)},!0):interpolate(Je,{user:(0,Ze.Z)(e.post.hidden_by_name)},!0);var n=interpolate('<abbr title="%(absolute)s">%(relative)s</abbr>',{absolute:(0,Ze.Z)(e.post.hidden_on.format("LLL")),relative:(0,Ze.Z)(e.post.hidden_on.fromNow())},!0),a=interpolate((0,Ze.Z)(pgettext("event info","Hidden by %(event_by)s %(event_on)s.")),{event_by:t,event_on:n},!0);return(0,r.Z)("li",{className:"event-hidden-message",dangerouslySetInnerHTML:{__html:a}})}return null}function at(e){var t;t=e.post.poster?interpolate(et,{url:(0,Ze.Z)(e.post.poster.url),user:(0,Ze.Z)(e.post.poster_name)},!0):interpolate(Je,{user:(0,Ze.Z)(e.post.poster_name)},!0);var n=interpolate('<a href="%(url)s" title="%(absolute)s">%(relative)s</a>',{url:(0,Ze.Z)(e.post.url.index),absolute:(0,Ze.Z)(e.post.posted_on.format("LLL")),relative:(0,Ze.Z)(e.post.posted_on.fromNow())},!0),a=interpolate((0,Ze.Z)(pgettext("event info","By %(event_by)s %(event_on)s.")),{event_by:t,event_on:n},!0);return(0,r.Z)("li",{className:"event-posters",dangerouslySetInnerHTML:{__html:a}})}var it={pinned_globally:pgettext("event message","Thread has been pinned globally."),pinned_locally:pgettext("event message","Thread has been pinned in category."),unpinned:pgettext("event message","Thread has been unpinned."),approved:pgettext("event message","Thread has been approved."),opened:pgettext("event message","Thread has been opened."),closed:pgettext("event message","Thread has been closed."),unhid:pgettext("event message","Thread has been revealed."),hid:pgettext("event message","Thread has been made hidden."),tookover:pgettext("event message","Took thread over."),owner_left:pgettext("event message","Owner has left thread. This thread is now closed."),participant_left:pgettext("event message","Participant has left thread.")},ot='<a href="%(url)s" class="item-title">%(name)s</a>',rt='<span class="item-title">%(name)s</span>';function st(e){return it[e.post.event_type]?(0,r.Z)("p",{className:"event-message"},void 0,it[e.post.event_type]):"changed_title"===e.post.event_type?v().createElement(lt,e):"moved"===e.post.event_type?v().createElement(ct,e):"merged"===e.post.event_type?v().createElement(ut,e):"changed_owner"===e.post.event_type?v().createElement(dt,e):"added_participant"===e.post.event_type?v().createElement(pt,e):"removed_participant"===e.post.event_type?v().createElement(ht,e):null}function lt(e){var t=(0,Ze.Z)(pgettext("event message","Thread title has been changed from %(old_title)s.")),n=interpolate(rt,{name:(0,Ze.Z)(e.post.event_context.old_title)},!0),a=interpolate(t,{old_title:n},!0);return(0,r.Z)("p",{className:"event-message",dangerouslySetInnerHTML:{__html:a}})}function ct(e){var t=(0,Ze.Z)(pgettext("event message","Thread has been moved from %(from_category)s.")),n=interpolate(ot,{url:(0,Ze.Z)(e.post.event_context.from_category.url),name:(0,Ze.Z)(e.post.event_context.from_category.name)},!0),a=interpolate(t,{from_category:n},!0);return(0,r.Z)("p",{className:"event-message",dangerouslySetInnerHTML:{__html:a}})}function ut(e){var t=(0,Ze.Z)(pgettext("event message","The %(merged_thread)s thread has been merged into this thread.")),n=interpolate(rt,{name:(0,Ze.Z)(e.post.event_context.merged_thread)},!0),a=interpolate(t,{merged_thread:n},!0);return(0,r.Z)("p",{className:"event-message",dangerouslySetInnerHTML:{__html:a}})}function dt(e){var t=(0,Ze.Z)(pgettext("event message","Changed thread owner to %(user)s.")),n=interpolate(ot,{url:(0,Ze.Z)(e.post.event_context.user.url),name:(0,Ze.Z)(e.post.event_context.user.username)},!0),a=interpolate(t,{user:n},!0);return(0,r.Z)("p",{className:"event-message",dangerouslySetInnerHTML:{__html:a}})}function pt(e){var t=(0,Ze.Z)(pgettext("event message","Added %(user)s to thread.")),n=interpolate(ot,{url:(0,Ze.Z)(e.post.event_context.user.url),name:(0,Ze.Z)(e.post.event_context.user.username)},!0),a=interpolate(t,{user:n},!0);return(0,r.Z)("p",{className:"event-message",dangerouslySetInnerHTML:{__html:a}})}function ht(e){var t=(0,Ze.Z)(pgettext("event message","Removed %(user)s from thread.")),n=interpolate(ot,{url:(0,Ze.Z)(e.post.event_context.user.url),name:(0,Ze.Z)(e.post.event_context.user.username)},!0),a=interpolate(t,{user:n},!0);return(0,r.Z)("p",{className:"event-message",dangerouslySetInnerHTML:{__html:a}})}function mt(e){return e.post.is_read?null:(0,r.Z)("div",{className:"event-label"},void 0,(0,r.Z)("span",{className:"label label-unread"},void 0,pgettext("event unread label","New event")))}var vt=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,s.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"initialize",(function(e){t.initialized=!0,t.observer=new IntersectionObserver((function(e){return e.forEach(t.callback)})),t.observer.observe(e)})),(0,h.Z)((0,c.Z)(t),"callback",(function(e){!e.isIntersecting||t.props.post.is_read||t.primed||(window.setTimeout((function(){k.Z.post(t.props.post.api.read)}),0),t.primed=!0,t.destroy())})),t.initialized=!1,t.primed=!1,t.observer=null,t}return(0,l.Z)(i,[{key:"destroy",value:function(){this.observer&&(this.observer.disconnect(),this.observer=null)}},{key:"componentWillUnmount",value:function(){this.destroy()}},{key:"render",value:function(){var e=this,t=!this.initialized&&!this.primed&&!this.props.post.is_read;return v().createElement("div",{className:this.props.className,ref:function(n){n&&t&&e.initialize(n)}},this.props.children)}}]),i}(v().Component);function ft(e){var t="event";return e.post.isDeleted?t="hide":e.post.is_hidden&&(t="event post-hidden"),(0,r.Z)("li",{id:"post-"+e.post.id,className:t},void 0,(0,r.Z)(mt,{post:e.post}),(0,r.Z)("div",{className:"event-body"},void 0,(0,r.Z)("div",{className:"event-icon"},void 0,v().createElement(Ye,e)),(0,r.Z)(vt,{className:"event-content",post:e.post},void 0,v().createElement(st,e),v().createElement(tt,e))))}var Zt=n(69130),gt=n(48772);function yt(e){return(0,r.Z)("div",{className:"col-xs-12 col-md-6"},void 0,v().createElement(bt,e),(0,r.Z)("div",{className:"post-attachment"},void 0,(0,r.Z)("a",{href:e.attachment.url.index,className:"attachment-name item-title",target:"_blank"},void 0,e.attachment.filename),v().createElement(xt,e)))}function bt(e){return e.attachment.is_image?(0,r.Z)("div",{className:"post-attachment-preview"},void 0,v().createElement(_t,e)):(0,r.Z)("div",{className:"post-attachment-preview"},void 0,v().createElement(kt,e))}function kt(e){return(0,r.Z)("a",{href:e.attachment.url.index,className:"material-icon"},void 0,"insert_drive_file")}function _t(e){var t=e.attachment.url.thumb||e.attachment.url.index;return(0,r.Z)("a",{className:"post-thumbnail",href:e.attachment.url.index,target:"_blank",style:{backgroundImage:'url("'+(0,Ze.Z)(t)+'")'}})}function xt(e){var t;t=e.attachment.url.uploader?interpolate('<a href="%(url)s" class="item-title">%(user)s</a>',{url:(0,Ze.Z)(e.attachment.url.uploader),user:(0,Ze.Z)(e.attachment.uploader_name)},!0):interpolate('<span class="item-title">%(user)s</span>',{user:(0,Ze.Z)(e.attachment.uploader_name)},!0);var n=interpolate('<abbr title="%(absolute)s">%(relative)s</abbr>',{absolute:(0,Ze.Z)(e.attachment.uploaded_on.format("LLL")),relative:(0,Ze.Z)(e.attachment.uploaded_on.fromNow())},!0),a=interpolate((0,Ze.Z)(pgettext("post attachment","%(filetype)s, %(size)s, uploaded by %(uploader)s %(uploaded_on)s.")),{filetype:e.attachment.filetype,size:(0,gt.Z)(e.attachment.size),uploader:t,uploaded_on:n},!0);return(0,r.Z)("p",{className:"post-attachment-description",dangerouslySetInnerHTML:{__html:a}})}function Nt(e){return function(e){return(!e.is_hidden||e.acl.can_see_hidden)&&e.attachments}(e.post)?(0,r.Z)("div",{className:"post-attachments"},void 0,(0,Zt.Z)(e.post.attachments,2).map((function(e){var t=e.map((function(e){return e?e.id:0})).join("_");return(0,r.Z)(wt,{row:e},t)}))):null}function wt(e){return(0,r.Z)("div",{className:"row"},void 0,e.row.map((function(e){return(0,r.Z)(yt,{attachment:e},e?e.id:0)})))}var Ct,Rt,Et,St,Lt,Ot,Pt,At=n(69092);function Tt(e){return e.post.is_hidden&&!e.post.acl.can_see_hidden?v().createElement(Bt,e):e.post.content?v().createElement(It,e):v().createElement(jt,e)}function It(e){var t=e.post,n="@"+(t.poster?t.poster.username:t.poster_name);return(0,r.Z)(vt,{className:"post-body",post:t},void 0,(0,r.Z)(At.Z,{author:n,markup:t.content}))}function Bt(e){var t;t=e.post.hidden_by?interpolate('<a href="%(url)s" class="item-title">%(user)s</a>',{url:(0,Ze.Z)(e.post.url.hidden_by),user:(0,Ze.Z)(e.post.hidden_by_name)},!0):interpolate('<span class="item-title">%(user)s</span>',{user:(0,Ze.Z)(e.post.hidden_by_name)},!0);var n=interpolate('<abbr class="last-title" title="%(absolute)s">%(relative)s</abbr>',{absolute:(0,Ze.Z)(e.post.hidden_on.format("LLL")),relative:(0,Ze.Z)(e.post.hidden_on.fromNow())},!0),a=interpolate((0,Ze.Z)(pgettext("post body hidden","Hidden by %(hidden_by)s %(hidden_on)s.")),{hidden_by:t,hidden_on:n},!0);return(0,r.Z)(vt,{className:"post-body post-body-hidden",post:e.post},void 0,(0,r.Z)("p",{className:"lead"},void 0,pgettext("post body hidden","This post is hidden. You cannot see its contents.")),(0,r.Z)("p",{className:"text-muted",dangerouslySetInnerHTML:{__html:a}}))}function jt(e){return(0,r.Z)(vt,{className:"post-body post-body-invalid",post:e.post},void 0,(0,r.Z)("p",{className:"lead"},void 0,pgettext("post body invalid","This post's contents cannot be displayed.")),(0,r.Z)("p",{className:"text-muted"},void 0,pgettext("post body invalid","This error is caused by invalid post content manipulation.")))}function Dt(e){var t=e.post,n=e.thread,a=e.user;if(!Mt(t)||t.id!==n.best_answer)return null;var i;return i=a.id&&n.best_answer_marked_by===a.id?interpolate(pgettext("post best answer flag","Marked as best answer by you %(marked_on)s."),{marked_on:n.best_answer_marked_on.fromNow()},!0):interpolate(pgettext("post best answer flag","Marked as best answer by %(marked_by)s %(marked_on)s."),{marked_by:n.best_answer_marked_by_name,marked_on:n.best_answer_marked_on.fromNow()},!0),(0,r.Z)("div",{className:"post-status-message post-status-best-answer"},void 0,Ct||(Ct=(0,r.Z)("span",{className:"material-icon"},void 0,"check_box")),(0,r.Z)("p",{},void 0,i))}function Ut(e){return Mt(e.post)&&e.post.is_hidden?(0,r.Z)("div",{className:"post-status-message post-status-hidden"},void 0,Rt||(Rt=(0,r.Z)("span",{className:"material-icon"},void 0,"visibility_off")),(0,r.Z)("p",{},void 0,pgettext("post hidden flag","This post is hidden. Only users with permission may see its contents."))):null}function zt(e){return Mt(e.post)&&e.post.is_unapproved?(0,r.Z)("div",{className:"post-status-message post-status-unapproved"},void 0,Et||(Et=(0,r.Z)("span",{className:"material-icon"},void 0,"remove_circle_outline")),(0,r.Z)("p",{},void 0,pgettext("post unapproved flag","This post is unapproved. Only users with permission to approve posts and its author may see its contents."))):null}function qt(e){return Mt(e.post)&&e.post.is_protected?(0,r.Z)("div",{className:"post-status-message post-status-protected visible-xs-block"},void 0,St||(St=(0,r.Z)("span",{className:"material-icon"},void 0,"lock_outline")),(0,r.Z)("p",{},void 0,pgettext("post protected flag","This post is protected. Only moderators may change it."))):null}function Mt(e){return!e.is_hidden||e.acl.can_see_hidden}function Ft(e){N.Z.dispatch(Ge.r$(e.post,{is_unapproved:!1})),Qt(e,[{op:"replace",path:"is-unapproved",value:!1}],{is_unapproved:e.post.is_unapproved})}function Ht(e){N.Z.dispatch(Ge.r$(e.post,{is_protected:!0})),Qt(e,[{op:"replace",path:"is-protected",value:!0}],{is_protected:e.post.is_protected})}function Vt(e){N.Z.dispatch(Ge.r$(e.post,{is_protected:!1})),Qt(e,[{op:"replace",path:"is-protected",value:!1}],{is_protected:e.post.is_protected})}function Yt(e){N.Z.dispatch(Ge.r$(e.post,{is_hidden:!0,hidden_on:F()(),hidden_by_name:e.user.username,url:Object.assign(e.post.url,{hidden_by:e.user.url})})),Qt(e,[{op:"replace",path:"is-hidden",value:!0}],{is_hidden:e.post.is_hidden,hidden_on:e.post.hidden_on,hidden_by_name:e.post.hidden_by_name,url:e.post.url})}function Gt(e){N.Z.dispatch(Ge.r$(e.post,{is_hidden:!1})),Qt(e,[{op:"replace",path:"is-hidden",value:!1}],{is_hidden:e.post.is_hidden})}function Wt(e){var t=e.post.last_likes||[],n=[e.user].concat(t),a=n.length>3?n.slice(0,-1):n;N.Z.dispatch(Ge.r$(e.post,{is_liked:!0,likes:e.post.likes+1,last_likes:a})),Qt(e,[{op:"replace",path:"is-liked",value:!0}],{is_liked:e.post.is_liked,likes:e.post.likes,last_likes:e.post.last_likes})}function $t(e){N.Z.dispatch(Ge.r$(e.post,{is_liked:!1,likes:e.post.likes-1,last_likes:e.post.last_likes.filter((function(t){return!t.id||t.id!==e.user.id}))}));var t={is_liked:e.post.is_liked,likes:e.post.likes,last_likes:e.post.last_likes};Qt(e,[{op:"replace",path:"is-liked",value:!1}],t)}function Qt(e,t,n){k.Z.patch(e.post.api.index,t).then((function(t){N.Z.dispatch(Ge.r$(e.post,t))}),(function(t){400===t.status?x.Z.error(t.detail[0]):x.Z.apiError(t),N.Z.dispatch(Ge.r$(e.post,n))}))}function Kt(e){window.confirm(pgettext("post delete","Are you sure you want to delete this post? This action is not reversible!"))&&(N.Z.dispatch(Ge.r$(e.post,{isDeleted:!0})),k.Z.delete(e.post.api.index).then((function(){x.Z.success(pgettext("post delete","Post has been deleted."))}),(function(t){400===t.status?x.Z.error(t.detail):x.Z.apiError(t),N.Z.dispatch(Ge.r$(e.post,{isDeleted:!1}))})))}function Xt(e){var t=e.post,n=e.user;N.Z.dispatch(b.Vx({best_answer:t.id,best_answer_is_protected:t.is_protected,best_answer_marked_on:F()(),best_answer_marked_by:n.id,best_answer_marked_by_name:n.username,best_answer_marked_by_slug:n.slug})),en(e,[{op:"replace",path:"best-answer",value:t.id},{op:"add",path:"acl",value:!0}],{best_answer:e.thread.best_answer,best_answer_is_protected:e.thread.best_answer_is_protected,best_answer_marked_on:e.thread.best_answer_marked_on,best_answer_marked_by:e.thread.best_answer_marked_by,best_answer_marked_by_name:e.thread.best_answer_marked_by_name,best_answer_marked_by_slug:e.thread.best_answer_marked_by_slug})}function Jt(e){var t=e.post;N.Z.dispatch(b.Vx({best_answer:null,best_answer_is_protected:!1,best_answer_marked_on:null,best_answer_marked_by:null,best_answer_marked_by_name:null,best_answer_marked_by_slug:null})),en(e,[{op:"remove",path:"best-answer",value:t.id},{op:"add",path:"acl",value:!0}],{best_answer:e.thread.best_answer,best_answer_is_protected:e.thread.best_answer_is_protected,best_answer_marked_on:e.thread.best_answer_marked_on,best_answer_marked_by:e.thread.best_answer_marked_by,best_answer_marked_by_name:e.thread.best_answer_marked_by_name,best_answer_marked_by_slug:e.thread.best_answer_marked_by_slug})}function en(e,t,n){k.Z.patch(e.thread.api.index,t).then((function(e){e.best_answer_marked_on&&(e.best_answer_marked_on=F()(e.best_answer_marked_on)),N.Z.dispatch(b.Vx(e))}),(function(e){400===e.status?x.Z.error(e.detail[0]):x.Z.apiError(e),N.Z.dispatch(b.Vx(n))}))}var tn,nn,an,on,rn=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,s.Z)(this,i),(t=a.call(this,e)).state={isReady:!1,error:null,likes:[]},t}return(0,l.Z)(i,[{key:"componentDidMount",value:function(){var e=this;k.Z.get(this.props.post.api.likes).then((function(t){e.setState({isReady:!0,likes:t.map(sn)})}),(function(t){e.setState({isReady:!0,error:t.detail})}))}},{key:"render",value:function(){return this.state.error?(0,r.Z)(ln,{className:"modal-message"},void 0,(0,r.Z)(X.Z,{message:this.state.error})):this.state.isReady?this.state.likes.length?(0,r.Z)(ln,{className:"modal-sm",likes:this.state.likes},void 0,(0,r.Z)(cn,{likes:this.state.likes})):(0,r.Z)(ln,{className:"modal-message"},void 0,(0,r.Z)(X.Z,{message:pgettext("post likes modal","No users have liked this post.")})):Lt||(Lt=(0,r.Z)(ln,{className:"modal-sm"},void 0,(0,r.Z)(J.Z,{})))}}]),i}(v().Component);function sn(e){return Object.assign({},e,{liked_on:F()(e.liked_on)})}function ln(e){var t=e.className,n=e.children,a=e.likes,i=pgettext("post likes modal title","Post Likes");if(a){var o=a.length,s=npgettext("post likes modal","%(likes)s like","%(likes)s likes",o);i=interpolate(s,{likes:o},!0)}return(0,r.Z)("div",{className:"modal-dialog "+(t||""),role:"document"},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,Ot||(Ot=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,i)),n))}function cn(e){return(0,r.Z)("div",{className:"modal-body modal-post-likers"},void 0,(0,r.Z)("ul",{className:"media-list"},void 0,e.likes.map((function(e){return v().createElement(un,(0,f.Z)({key:e.id},e))}))))}function un(e){if(e.url){var t={id:e.liker_id,avatars:e.avatars};return(0,r.Z)("li",{className:"media"},void 0,(0,r.Z)("div",{className:"media-left"},void 0,(0,r.Z)("a",{className:"user-avatar",href:e.url},void 0,(0,r.Z)(I.ZP,{size:"50",user:t}))),(0,r.Z)("div",{className:"media-body"},void 0,(0,r.Z)("a",{className:"item-title",href:e.url},void 0,e.username)," ",(0,r.Z)(dn,{likedOn:e.liked_on})))}return(0,r.Z)("li",{className:"media"},void 0,Pt||(Pt=(0,r.Z)("div",{className:"media-left"},void 0,(0,r.Z)("span",{className:"user-avatar"},void 0,(0,r.Z)(I.ZP,{size:"50"})))),(0,r.Z)("div",{className:"media-body"},void 0,(0,r.Z)("strong",{},void 0,e.username)," ",(0,r.Z)(dn,{likedOn:e.liked_on})))}function dn(e){return(0,r.Z)("span",{className:"text-muted",title:e.likedOn.format("LLL")},void 0,e.likedOn.fromNow())}function pn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}function hn(e){return function(e){return(!e.is_hidden||e.acl.can_see_hidden)&&(e.acl.can_reply||e.acl.can_edit||e.acl.can_see_likes&&(e.last_likes||[]).length||e.acl.can_like)}(e.post)?(0,r.Z)("div",{className:"post-footer"},void 0,v().createElement(mn,e),v().createElement(vn,e),v().createElement(fn,e),v().createElement(Zn,(0,f.Z)({lastLikes:e.post.last_likes,likes:e.post.likes},e)),v().createElement(gn,(0,f.Z)({likes:e.post.likes},e)),v().createElement(_n,e),v().createElement(xn,e),v().createElement(Nn,e)):null}var mn=function(e){(0,u.Z)(n,e);var t=pn(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Xt(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props,t=e.post,n=e.thread;return n.acl.can_mark_best_answer&&t.acl.can_mark_as_best_answer?n.best_answer&&!n.acl.can_change_best_answer?null:(0,r.Z)("button",{className:"hidden-xs btn btn-default btn-sm pull-left",disabled:this.props.post.isBusy||t.id===n.best_answer,onClick:this.onClick,type:"button"},void 0,tn||(tn=(0,r.Z)("span",{className:"material-icon"},void 0,"check_box")),pgettext("post footer btn","Best answer")):null}}]),n}(v().Component),vn=function(e){(0,u.Z)(n,e);var t=pn(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Xt(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props,t=e.post,n=e.thread;return n.acl.can_mark_best_answer&&t.acl.can_mark_as_best_answer?n.best_answer&&!n.acl.can_change_best_answer?null:(0,r.Z)("button",{className:"visible-xs-inline-block btn btn-default btn-sm pull-left",disabled:this.props.post.isBusy||t.id===n.best_answer,onClick:this.onClick,type:"button"},void 0,nn||(nn=(0,r.Z)("span",{className:"material-icon"},void 0,"check_box"))):null}}]),n}(v().Component),fn=function(e){(0,u.Z)(n,e);var t=pn(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){e.props.post.is_liked?$t(e.props):Wt(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){if(!this.props.post.acl.can_like)return null;var e="btn btn-default btn-sm pull-left";return this.props.post.is_liked&&(e="btn btn-success btn-sm pull-left"),(0,r.Z)("button",{className:e,disabled:this.props.post.isBusy,onClick:this.onClick,type:"button"},void 0,this.props.post.is_liked?pgettext("post footer btn","Liked"):pgettext("post footer btn","Like"))}}]),n}(v().Component),Zn=function(e){(0,u.Z)(n,e);var t=pn(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){_.Z.show((0,r.Z)(rn,{post:e.props.post}))})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=(this.props.post.last_likes||[]).length>0;return this.props.post.acl.can_see_likes&&e?2===this.props.post.acl.can_see_likes?(0,r.Z)("button",{className:"btn btn-link btn-sm pull-left hidden-xs",onClick:this.onClick,type:"button"},void 0,yn(this.props.likes,this.props.lastLikes)):(0,r.Z)("p",{className:"pull-left hidden-xs"},void 0,yn(this.props.likes,this.props.lastLikes)):null}}]),n}(v().Component),gn=function(e){(0,u.Z)(n,e);var t=pn(n);function n(){return(0,s.Z)(this,n),t.apply(this,arguments)}return(0,l.Z)(n,[{key:"render",value:function(){var e=(this.props.post.last_likes||[]).length>0;return this.props.post.acl.can_see_likes&&e?2===this.props.post.acl.can_see_likes?(0,r.Z)("button",{className:"btn btn-link btn-sm likes-compact pull-left visible-xs-block",onClick:this.onClick,type:"button"},void 0,an||(an=(0,r.Z)("span",{className:"material-icon"},void 0,"favorite")),this.props.likes):(0,r.Z)("p",{className:"likes-compact pull-left visible-xs-block"},void 0,on||(on=(0,r.Z)("span",{className:"material-icon"},void 0,"favorite")),this.props.likes):null}}]),n}(Zn);function yn(e,t){var n=t.slice(0,3).map((function(e){return e.username}));if(1==n.length)return interpolate(pgettext("post likes","%(user)s likes this."),{user:n[0]},!0);var a=e-n.length,i=n.slice(0,-1).join(", "),o=n.slice(-1)[0],r=interpolate(pgettext("post likes","%(users)s and %(last_user)s"),{users:i,last_user:o},!0);if(0===a)return interpolate(pgettext("post likes","%(users)s like this."),{users:r},!0);var s=npgettext("post likes","%(users)s and %(likes)s other user like this.","%(users)s and %(likes)s other users like this.",a);return interpolate(s,{users:n.join(", "),likes:a},!0)}var bn,kn,_n=function(e){(0,u.Z)(n,e);var t=pn(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){ce.Z.open({mode:"REPLY",thread:e.props.thread,config:e.props.thread.api.editor,submit:e.props.thread.api.posts.index})})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_reply?(0,r.Z)("button",{className:"btn btn-default btn-sm pull-right",type:"button",onClick:this.onClick},void 0,pgettext("post footer btn","Reply")):null}}]),n}(v().Component),xn=function(e){(0,u.Z)(n,e);var t=pn(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){ce.Z.open({mode:"QUOTE",thread:e.props.thread,config:e.props.thread.api.editor,submit:e.props.thread.api.posts.index,context:{reply:e.props.post.id}})})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_reply?(0,r.Z)("button",{className:"btn btn-default btn-sm pull-right",type:"button",onClick:this.onClick},void 0,pgettext("post footer btn","Quote")):null}}]),n}(v().Component),Nn=function(e){(0,u.Z)(n,e);var t=pn(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){ce.Z.open({mode:"EDIT",thread:e.props.thread,post:e.props.post,config:e.props.post.api.editor,submit:e.props.post.api.index})})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_edit?(0,r.Z)("button",{className:"hidden-xs btn btn-default btn-sm pull-right",type:"button",onClick:this.onClick},void 0,pgettext("post footer btn","Edit")):null}}]),n}(v().Component);var wn=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,s.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"onUrlChange",(function(e){t.changeValue("url",e.target.value)})),t.state={isLoading:!1,url:"",validators:{url:[]},errors:{}},t}return(0,l.Z)(i,[{key:"clean",value:function(){return!!this.state.url.trim().length||(x.Z.error(pgettext("post move modal","You have to enter link to the other thread.")),!1)}},{key:"send",value:function(){return k.Z.post(this.props.thread.api.posts.move,{new_thread:this.state.url,posts:[this.props.post.id]})}},{key:"handleSuccess",value:function(e){N.Z.dispatch(Ge.r$(this.props.post,{isDeleted:!0})),_.Z.hide(),x.Z.success(pgettext("post move modal","Selected post was moved to the other thread."))}},{key:"handleError",value:function(e){400===e.status?x.Z.error(e.detail):x.Z.apiError(e)}},{key:"render",value:function(){return(0,r.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,bn||(bn=(0,r.Z)(Cn,{})),(0,r.Z)("div",{className:"modal-body"},void 0,(0,r.Z)(g.Z,{for:"id_url",label:pgettext("post move modal field","Link to thread you want to move post to")},void 0,(0,r.Z)("input",{className:"form-control",disabled:this.state.isLoading,id:"id_url",onChange:this.onUrlChange,value:this.state.url}))),(0,r.Z)("div",{className:"modal-footer"},void 0,(0,r.Z)("button",{className:"btn btn-primary",disabled:this.state.isLoading},void 0,pgettext("post move modal btn","Move post"))))))}}]),i}(Z.Z);function Cn(e){return(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,kn||(kn=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("post move modal title","Move post")))}function Rn(e){return(0,r.Z)("div",{className:"modal-body post-changelog-diff"},void 0,(0,r.Z)("ul",{className:"list-unstyled"},void 0,e.diff.map((function(e,t){return(0,r.Z)(En,{item:e},t)}))))}function En(e){return"?"===e.item[0]?null:(0,r.Z)("li",{className:(t=e.item,n="diff-item","-"===t[0]?n+=" diff-item-sub":"+"===t[0]&&(n+=" diff-item-add"),n)},void 0,e.item.substr(2));var t,n}var Sn,Ln,On,Pn=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(){var e;(0,s.Z)(this,i);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e=a.call.apply(a,[this].concat(n)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){e.props.revertEdit(e.props.edit.id)})),e}return(0,l.Z)(i,[{key:"render",value:function(){return this.props.canRevert?(0,r.Z)("div",{className:"modal-footer visible-xs-block"},void 0,(0,r.Z)(Te.Z,{className:"btn-default btn-sm btn-block",disabled:this.props.disabled,onClick:this.onClick,title:pgettext("post revert btn","Revert post to state from before this edit.")},void 0,pgettext("post revert btn","Revert"))):null}}]),i}(v().Component);var An,Tn,In=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(){var e;(0,s.Z)(this,i);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e=a.call.apply(a,[this].concat(n)),(0,h.Z)((0,c.Z)(e),"goLast",(function(){e.props.goToEdit()})),(0,h.Z)((0,c.Z)(e),"goForward",(function(){e.props.goToEdit(e.props.edit.next)})),(0,h.Z)((0,c.Z)(e),"goBack",(function(){e.props.goToEdit(e.props.edit.previous)})),(0,h.Z)((0,c.Z)(e),"revertEdit",(function(){e.props.revertEdit(e.props.edit.id)})),e}return(0,l.Z)(i,[{key:"render",value:function(){return(0,r.Z)("div",{className:"modal-toolbar post-changelog-toolbar"},void 0,(0,r.Z)("div",{className:"row"},void 0,(0,r.Z)("div",{className:"col-xs-12 col-sm-4"},void 0,(0,r.Z)("div",{className:"row"},void 0,(0,r.Z)("div",{className:"col-xs-4"},void 0,(0,r.Z)(Bn,{disabled:this.props.disabled,edit:this.props.edit,onClick:this.goBack})),(0,r.Z)("div",{className:"col-xs-4"},void 0,(0,r.Z)(jn,{disabled:this.props.disabled,edit:this.props.edit,onClick:this.goForward})),(0,r.Z)("div",{className:"col-xs-4"},void 0,(0,r.Z)(Dn,{disabled:this.props.disabled,edit:this.props.edit,onClick:this.goLast})))),(0,r.Z)("div",{className:"col-xs-12 col-sm-5 xs-margin-top-half post-change-label"},void 0,(0,r.Z)(zn,{edit:this.props.edit})),(0,r.Z)(Un,{canRevert:this.props.canRevert,disabled:this.props.disabled,onClick:this.revertEdit})))}}]),i}(v().Component);function Bn(e){return(0,r.Z)(Te.Z,{className:"btn-default btn-block btn-icon btn-sm",disabled:e.disabled||!e.edit.previous,onClick:e.onClick,title:pgettext("post history modal btn","See previous change")},void 0,Sn||(Sn=(0,r.Z)("span",{className:"material-icon"},void 0,"chevron_left")))}function jn(e){return(0,r.Z)(Te.Z,{className:"btn-default btn-block btn-icon btn-sm",disabled:e.disabled||!e.edit.next,onClick:e.onClick,title:pgettext("post history modal btn","See next change")},void 0,Ln||(Ln=(0,r.Z)("span",{className:"material-icon"},void 0,"chevron_right")))}function Dn(e){return(0,r.Z)(Te.Z,{className:"btn-default btn-block btn-icon btn-sm",disabled:e.disabled||!e.edit.next,onClick:e.onClick,title:pgettext("post history modal btn","See previous change")},void 0,On||(On=(0,r.Z)("span",{className:"material-icon"},void 0,"last_page")))}function Un(e){return e.canRevert?(0,r.Z)("div",{className:"col-sm-3 hidden-xs"},void 0,(0,r.Z)(Te.Z,{className:"btn-default btn-sm btn-block",disabled:e.disabled,onClick:e.onClick,title:pgettext("post revert btn","Revert post to state from before this edit.")},void 0,pgettext("post revert btn","Revert"))):null}function zn(e){var t;t=e.edit.url.editor?interpolate('<a href="%(url)s" class="item-title">%(user)s</a>',{url:(0,Ze.Z)(e.edit.url.editor),user:(0,Ze.Z)(e.edit.editor_name)},!0):interpolate('<span class="item-title">%(user)s</span>',{user:(0,Ze.Z)(e.edit.editor_name)},!0);var n=interpolate('<abbr title="%(absolute)s">%(relative)s</abbr>',{absolute:(0,Ze.Z)(e.edit.edited_on.format("LLL")),relative:(0,Ze.Z)(e.edit.edited_on.fromNow())},!0),a=interpolate((0,Ze.Z)(pgettext("post history modal","By %(edited_by)s %(edited_on)s.")),{edited_by:t,edited_on:n},!0);return(0,r.Z)("p",{dangerouslySetInnerHTML:{__html:a}})}function qn(e){return Object.assign({},e,{edited_on:F()(e.edited_on)})}var Mn=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,s.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"goToEdit",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;t.setState({isBusy:!0});var n=t.props.post.api.edits;null!==e&&(n+="?edit="+e),k.Z.get(n).then((function(e){t.setState({isReady:!0,isBusy:!1,edit:qn(e)})}),(function(e){t.setState({isReady:!0,isBusy:!1,error:e.detail})}))})),(0,h.Z)((0,c.Z)(t),"revertEdit",(function(e){if(!t.state.isBusy&&window.confirm(pgettext("post revert","Are you sure you with to revert this post to the state from before this edit?"))){t.setState({isBusy:!0});var n=t.props.post.api.edits+"?edit="+e;k.Z.post(n).then((function(e){var t=Ge.ZB(e);N.Z.dispatch(Ge.r$(e,t)),x.Z.success(pgettext("post revert","Post has been reverted to previous state.")),_.Z.hide()}),(function(e){x.Z.apiError(e),t.setState({isBusy:!1})}))}})),t.state={isReady:!1,isBusy:!0,canRevert:e.post.acl.can_edit,error:null,edit:null},t}return(0,l.Z)(i,[{key:"componentDidMount",value:function(){this.goToEdit()}},{key:"render",value:function(){return this.state.error?(0,r.Z)(Fn,{className:"modal-dialog modal-message"},void 0,(0,r.Z)(X.Z,{message:this.state.error})):this.state.isReady?(0,r.Z)(Fn,{},void 0,(0,r.Z)(In,{canRevert:this.state.canRevert,disabled:this.state.isBusy,edit:this.state.edit,goToEdit:this.goToEdit,revertEdit:this.revertEdit}),(0,r.Z)(Rn,{diff:this.state.edit.diff}),(0,r.Z)(Pn,{canRevert:this.state.canRevert,disabled:this.state.isBusy,edit:this.state.edit,revertEdit:this.revertEdit})):An||(An=(0,r.Z)(Fn,{},void 0,(0,r.Z)(J.Z,{})))}}]),i}(v().Component);function Fn(e){return(0,r.Z)("div",{className:e.className||"modal-dialog",role:"document"},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,Tn||(Tn=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("post history modal title","Post edits history"))),e.children))}var Hn,Vn,Yn,Gn,Wn,$n,Qn=n(57026),Kn=n(60471),Xn=n(55210);function Jn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}function ea(e){return v().createElement(ma,(0,f.Z)({},e,{Form:va}))}var ta,na,aa,ia,oa,ra,sa,la,ca,ua,da,pa,ha,ma=function(e){(0,u.Z)(n,e);var t=Jn(n);function n(e){var a;return(0,s.Z)(this,n),(a=t.call(this,e)).state={isLoaded:!1,isError:!1,categories:[]},a}return(0,l.Z)(n,[{key:"componentDidMount",value:function(){var e=this;k.Z.get(misago.get("THREAD_EDITOR_API")).then((function(t){var n=t.map((function(e){return Object.assign(e,{disabled:!1===e.post,label:e.name,value:e.id,post:e.post})}));e.setState({isLoaded:!0,categories:n})}),(function(t){e.setState({isError:t.detail})}))}},{key:"render",value:function(){return this.state.isError?(0,r.Z)(Za,{message:this.state.isError}):this.state.isLoaded?v().createElement(va,(0,f.Z)({},this.props,{categories:this.state.categories})):Hn||(Hn=(0,r.Z)(fa,{}))}}]),n}(v().Component),va=function(e){(0,u.Z)(n,e);var t=Jn(n);function n(e){var a;return(0,s.Z)(this,n),a=t.call(this,e),(0,h.Z)((0,c.Z)(a),"onCategoryChange",(function(e){var t=e.target.value,n={category:t};a.acl[t].can_pin_threads<n.weight&&(n.weight=0),a.acl[t].can_hide_threads||(n.is_hidden=0),a.acl[t].can_close_threads||(n.is_closed=!1),a.setState(n)})),a.state={isLoading:!1,title:"",category:null,categories:e.categories,weight:0,is_hidden:0,is_closed:!1,validators:{title:[Xn.C1()]},errors:{}},a.isHiddenChoices=[{value:0,icon:"visibility",label:pgettext("thread hidden switch choice","No")},{value:1,icon:"visibility_off",label:pgettext("thread hidden switch choice","Yes")}],a.isClosedChoices=[{value:!1,icon:"lock_outline",label:pgettext("thread closed switch choice","No")},{value:!0,icon:"lock",label:pgettext("thread closed switch choice","Yes")}],a.acl={},a.props.categories.forEach((function(e){e.post&&(a.state.category||(a.state.category=e.id),a.acl[e.id]={can_pin_threads:e.post.pin,can_close_threads:e.post.close,can_hide_threads:e.post.hide})})),a}return(0,l.Z)(n,[{key:"clean",value:function(){return!!this.isValid()||(x.Z.error(gettext("Form contains errors.")),this.setState({errors:this.validate()}),!1)}},{key:"send",value:function(){return k.Z.post(this.props.thread.api.posts.split,{title:this.state.title,category:this.state.category,weight:this.state.weight,is_hidden:this.state.is_hidden,is_closed:this.state.is_closed,posts:[this.props.post.id]})}},{key:"handleSuccess",value:function(e){N.Z.dispatch(Ge.r$(this.props.post,{isDeleted:!0})),_.Z.hide(),x.Z.success(pgettext("post split modal","Selected post was split into new thread."))}},{key:"handleError",value:function(e){400===e.status?(this.setState({errors:Object.assign({},this.state.errors,e)}),x.Z.error(gettext("Form contains errors."))):x.Z.apiError(e)}},{key:"getWeightChoices",value:function(){var e=[{value:0,icon:"remove",label:pgettext("thread weight choice","Not pinned")},{value:1,icon:"bookmark_border",label:pgettext("thread weight choice","Pinned in category")}];return 2==this.acl[this.state.category].can_pin_threads&&e.push({value:2,icon:"bookmark",label:pgettext("thread weight choice","Pinned globally")}),e}},{key:"renderWeightField",value:function(){return this.acl[this.state.category].can_pin_threads?(0,r.Z)(g.Z,{label:pgettext("posts split modal field","Thread weight"),for:"id_weight",labelClass:"col-sm-4",controlClass:"col-sm-8"},void 0,(0,r.Z)(Kn.Z,{id:"id_weight",onChange:this.bindInput("weight"),value:this.state.weight,choices:this.getWeightChoices()})):null}},{key:"renderHiddenField",value:function(){return this.acl[this.state.category].can_hide_threads?(0,r.Z)(g.Z,{label:pgettext("posts split modal field","Hide thread"),for:"id_is_hidden",labelClass:"col-sm-4",controlClass:"col-sm-8"},void 0,(0,r.Z)(Kn.Z,{id:"id_is_closed",onChange:this.bindInput("is_hidden"),value:this.state.is_hidden,choices:this.isHiddenChoices})):null}},{key:"renderClosedField",value:function(){return this.acl[this.state.category].can_close_threads?(0,r.Z)(g.Z,{label:pgettext("posts split modal field","Close thread"),for:"id_is_closed",labelClass:"col-sm-4",controlClass:"col-sm-8"},void 0,(0,r.Z)(Kn.Z,{id:"id_is_closed",onChange:this.bindInput("is_closed"),value:this.state.is_closed,choices:this.isClosedChoices})):null}},{key:"render",value:function(){return(0,r.Z)(ga,{className:"modal-dialog"},void 0,(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"modal-body"},void 0,(0,r.Z)(g.Z,{label:pgettext("posts split modal field","Thread title"),for:"id_title",labelClass:"col-sm-4",controlClass:"col-sm-8",validation:this.state.errors.title},void 0,(0,r.Z)("input",{id:"id_title",className:"form-control",type:"text",onChange:this.bindInput("title"),value:this.state.title})),Vn||(Vn=(0,r.Z)("div",{className:"clearfix"})),(0,r.Z)(g.Z,{label:pgettext("posts split modal field","Category"),for:"id_category",labelClass:"col-sm-4",controlClass:"col-sm-8",validation:this.state.errors.category},void 0,(0,r.Z)(Qn.Z,{id:"id_category",onChange:this.onCategoryChange,value:this.state.category,choices:this.state.categories})),Yn||(Yn=(0,r.Z)("div",{className:"clearfix"})),this.renderWeightField(),this.renderHiddenField(),this.renderClosedField()),(0,r.Z)("div",{className:"modal-footer"},void 0,(0,r.Z)(Te.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,pgettext("posts split modal btn","Split post")))))}}]),n}(Z.Z);function fa(){return Gn||(Gn=(0,r.Z)(ga,{className:"modal-dialog"},void 0,(0,r.Z)(J.Z,{})))}function Za(e){return(0,r.Z)(ga,{className:"modal-dialog modal-message"},void 0,Wn||(Wn=(0,r.Z)("div",{className:"message-icon"},void 0,(0,r.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,r.Z)("div",{className:"message-body"},void 0,(0,r.Z)("p",{className:"lead"},void 0,pgettext("post split modal","You can't move this post at the moment.")),(0,r.Z)("p",{},void 0,e.message)))}function ga(e){return(0,r.Z)("div",{className:e.className,role:"document"},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,$n||($n=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("posts split modal title","Split post into new thread"))),e.children))}function ya(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}function ba(e){return(0,r.Z)("ul",{className:"dropdown-menu dropdown-menu-right stick-to-bottom"},void 0,v().createElement(_a,e),v().createElement(xa,e),v().createElement(Na,e),v().createElement(wa,e),v().createElement(Ca,e),v().createElement(Ra,e),v().createElement(Ea,e),v().createElement(Sa,e),v().createElement(La,e),v().createElement(Oa,e),v().createElement(Pa,e),v().createElement(Aa,e),v().createElement(Ta,e))}var ka,_a=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){var t=window.location.protocol+"//";t+=window.location.host,t+=e.props.post.url.index,prompt(pgettext("post permalink","Permament link to this post:"),t)})),e}return(0,l.Z)(n,[{key:"render",value:function(){return(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,ta||(ta=(0,r.Z)("span",{className:"material-icon"},void 0,"link")),pgettext("post options permalink btn","Permament link")))}}]),n}(v().Component),xa=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){ce.Z.open({mode:"EDIT",thread:e.props.thread,post:e.props.post,config:e.props.post.api.editor,submit:e.props.post.api.index})})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_edit?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,na||(na=(0,r.Z)("span",{className:"material-icon"},void 0,"edit")),pgettext("post options edit btn","Edit"))):null}}]),n}(v().Component),Na=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Xt(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props,t=e.post,n=e.thread;return n.acl.can_mark_best_answer&&t.acl.can_mark_as_best_answer?t.id===n.best_answer||n.best_answer&&!n.acl.can_change_best_answer?null:(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,aa||(aa=(0,r.Z)("span",{className:"material-icon"},void 0,"check_box")),pgettext("post options best answer btn","Mark as best answer"))):null}}]),n}(v().Component),wa=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Jt(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props,t=e.post,n=e.thread;return t.id!==n.best_answer?null:n.acl.can_unmark_best_answer?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,ia||(ia=(0,r.Z)("span",{className:"material-icon"},void 0,"check_box_outline_blank")),pgettext("post options best answer btn","Unmark best answer"))):null}}]),n}(v().Component),Ca=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){_.Z.show((0,r.Z)(Mn,{post:e.props.post}))})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.post.is_hidden&&!this.props.post.acl.can_see_hidden,t=0===this.props.post.edits;if(e||t)return null;var n=npgettext("post edits","This post was edited %(edits)s time.","This post was edited %(edits)s times.",this.props.post.edits);return interpolate(n,{edits:this.props.post.edits},!0),(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,oa||(oa=(0,r.Z)("span",{className:"material-icon"},void 0,"edit")),pgettext("post options edit btn","Changes history")))}}]),n}(v().Component),Ra=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Ft(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_approve&&this.props.post.is_unapproved?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,ra||(ra=(0,r.Z)("span",{className:"material-icon"},void 0,"done")),pgettext("post options approve btn","Approve"))):null}}]),n}(v().Component),Ea=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){_.Z.show(v().createElement(wn,e.props))})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_move?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,sa||(sa=(0,r.Z)("span",{className:"material-icon"},void 0,"arrow_forward")),pgettext("post options move btn","Move"))):null}}]),n}(v().Component),Sa=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){_.Z.show(v().createElement(ea,e.props))})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_move?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,la||(la=(0,r.Z)("span",{className:"material-icon"},void 0,"call_split")),pgettext("post options split btn","Split"))):null}}]),n}(v().Component),La=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Ht(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_protect?this.props.post.is_protected?null:(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,ca||(ca=(0,r.Z)("span",{className:"material-icon"},void 0,"lock_outline")),pgettext("post options protect btn","Protect"))):null}}]),n}(v().Component),Oa=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Vt(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_protect&&this.props.post.is_protected?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,ua||(ua=(0,r.Z)("span",{className:"material-icon"},void 0,"lock_open")),pgettext("post options protect btn","Remove protection"))):null}}]),n}(v().Component),Pa=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Yt(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props,t=e.post,n=e.thread;return t.id===n.best_answer?null:t.acl.can_hide?t.is_hidden?null:(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,da||(da=(0,r.Z)("span",{className:"material-icon"},void 0,"visibility_off")),pgettext("post options hide btn","Hide"))):null}}]),n}(v().Component),Aa=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Gt(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_unhide&&this.props.post.is_hidden?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,pa||(pa=(0,r.Z)("span",{className:"material-icon"},void 0,"visibility")),pgettext("post options hide btn","Unhide"))):null}}]),n}(v().Component),Ta=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Kt(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props,t=e.post,n=e.thread;return t.id===n.best_answer?null:t.acl.can_delete?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,ha||(ha=(0,r.Z)("span",{className:"material-icon"},void 0,"clear")),pgettext("post options delete btn","Delete"))):null}}]),n}(v().Component);function Ia(e){return(0,r.Z)("div",{className:"pull-right dropdown"},void 0,ka||(ka=(0,r.Z)("button",{"aria-expanded":"true","aria-haspopup":"true",className:"btn btn-default btn-icon dropdown-toggle","data-toggle":"dropdown",type:"button"},void 0,(0,r.Z)("span",{className:"material-icon"},void 0,"expand_more"))),v().createElement(ba,e))}var Ba=n(21981);var ja,Da=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(){var e;(0,s.Z)(this,i);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e=a.call.apply(a,[this].concat(n)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){e.props.post.isSelected?N.Z.dispatch(Ba._H(e.props.post)):N.Z.dispatch(Ba.Ys(e.props.post))})),e}return(0,l.Z)(i,[{key:"render",value:function(){return this.props.thread.acl.can_merge_posts||(e=this.props.post.acl).can_approve||e.can_hide||e.can_protect||e.can_unhide||e.can_delete||e.can_move?(0,r.Z)("div",{className:"pull-right"},void 0,(0,r.Z)("button",{className:"btn btn-default btn-icon",onClick:this.onClick,type:"button"},void 0,(0,r.Z)("span",{className:"material-icon"},void 0,this.props.post.isSelected?"check_box":"check_box_outline_blank"))):null;var e}}]),i}(v().Component),Ua=n(24678),za=n(16069);function qa(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}function Ma(e){return(0,r.Z)("div",{className:"post-heading"},void 0,v().createElement(Fa,e),v().createElement(Ha,e),v().createElement(Va,e),v().createElement(Ya,e),v().createElement($a,e),v().createElement(Qa,e),v().createElement(Ka,e),v().createElement(Da,e),v().createElement(Ia,e))}function Fa(e){return e.post.is_read?null:(0,r.Z)("span",{className:"label label-unread hidden-xs"},void 0,pgettext("post unread label","New post"))}function Ha(e){return e.post.is_read?null:(0,r.Z)("span",{className:"label label-unread visible-xs-inline-block"},void 0,pgettext("post unread label","New"))}function Va(e){return(0,r.Z)("a",{href:e.post.url.index,className:"btn btn-link posted-on hidden-xs"},void 0,(0,r.Z)(za.Z,{datetime:e.post.posted_on.toISOString()}))}function Ya(e){return(0,r.Z)("a",{href:e.post.url.index,className:"btn btn-link posted-on visible-xs-inline-block"},void 0,e.post.posted_on.fromNow())}var Ga,Wa,$a=function(e){(0,u.Z)(n,e);var t=qa(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){_.Z.show((0,r.Z)(Mn,{post:e.props.post}))})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.post.is_hidden&&!this.props.post.acl.can_see_hidden,t=0===this.props.post.edits;if(e||t)return null;var n=npgettext("post edits stat","This post was edited %(edits)s time.","This post was edited %(edits)s times.",this.props.post.edits),a=interpolate(n,{edits:this.props.post.edits},!0),i=npgettext("post edits stat","edited %(edits)s time","edited %(edits)s times",this.props.post.edits);return(0,r.Z)("button",{className:"btn btn-link btn-see-edits hidden-xs",onClick:this.onClick,title:a,type:"button"},void 0,interpolate(i,{edits:this.props.post.edits},!0))}}]),n}(v().Component),Qa=function(e){(0,u.Z)(n,e);var t=qa(n);function n(){return(0,s.Z)(this,n),t.apply(this,arguments)}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.post.is_hidden&&!this.props.post.acl.can_see_hidden,t=0===this.props.post.edits;if(e||t)return null;var n=npgettext("post edits stat","%(edits)s edit","%(edits)s edits",this.props.post.edits);return(0,r.Z)("button",{className:"btn btn-link btn-see-edits visible-xs-inline-block",onClick:this.onClick,type:"button"},void 0,interpolate(n,{edits:this.props.post.edits},!0))}}]),n}($a);function Ka(e){var t=e.post.poster&&e.post.poster.id===e.user.id,n=e.post.acl.can_protect;return e.user.id&&e.post.is_protected&&(t||n)?(0,r.Z)("span",{className:"label label-protected hidden-xs",title:pgettext("post protected label","This post is protected and may not be edited.")},void 0,ja||(ja=(0,r.Z)("span",{className:"material-icon"},void 0,"lock_outline")),pgettext("post protected label","protected")):null}function Xa(e){var t=e.post,n=e.thread;return(0,r.Z)("div",{className:"post-side post-side-anonymous"},void 0,(0,r.Z)(Da,{post:t,thread:n}),(0,r.Z)(Ia,{post:t,thread:n}),(0,r.Z)("div",{className:"media"},void 0,Ga||(Ga=(0,r.Z)("div",{className:"media-left"},void 0,(0,r.Z)("span",{},void 0,(0,r.Z)(I.ZP,{className:"poster-avatar",size:100})))),(0,r.Z)("div",{className:"media-body"},void 0,(0,r.Z)("span",{className:"media-heading item-title"},void 0,t.poster_name),(0,r.Z)("span",{className:"user-title user-title-anonymous"},void 0,pgettext("post removed poster username","Removed user")))))}function Ja(e){var t=e.title,n=e.rank;return n.is_tab||!!t||!!n.title}function ei(e){var t=e.poster,n=npgettext("poster stats","%(posts)s post","%(posts)s posts",t.posts),a="user-postcount";return Ja(t)&&(a+=" hidden-xs hidden-sm"),(0,r.Z)("span",{className:a},void 0,interpolate(n,{posts:t.posts},!0))}function ti(e){var t=e.poster,n="hidden-xs";return Ja(t)&&(n+=" hidden-sm"),(0,r.Z)("span",{className:n},void 0,(0,r.Z)(Ua.ZP,{status:t.status},void 0,(0,r.Z)(Ua.pg,{status:t.status,user:t})))}function ni(e){var t=e.rank,n=e.title||t.title;if(!n&&t.is_tab&&(n=t.name),!n)return null;var a="user-title";return t.css_class&&(a+=" user-title-"+t.css_class),t.is_tab?(0,r.Z)("div",{className:a},void 0,(0,r.Z)("a",{href:t.url},void 0,n)):(0,r.Z)("div",{className:a},void 0,n)}function ai(e){var t=e.post,n=e.thread,a=t.poster;return(0,r.Z)("div",{className:"post-side post-side-registered"},void 0,(0,r.Z)(Da,{post:t,thread:n}),(0,r.Z)(Ia,{post:t,thread:n}),(0,r.Z)("div",{className:"media"},void 0,(0,r.Z)("div",{className:"media-left"},void 0,(0,r.Z)("a",{href:a.url},void 0,(0,r.Z)(I.ZP,{className:"poster-avatar",size:100,user:a}))),(0,r.Z)("div",{className:"media-body"},void 0,(0,r.Z)("div",{className:"media-heading"},void 0,(0,r.Z)("a",{className:"item-title",href:a.url},void 0,a.username),(0,r.Z)(Ua.ZP,{status:a.status},void 0,(0,r.Z)(Ua.Jj,{status:a.status}))),(0,r.Z)(ni,{rank:a.rank,title:a.title}),(0,r.Z)(ti,{poster:a}),(0,r.Z)(ei,{poster:a}))))}function ii(e){return e.post.poster?v().createElement(ai,e):v().createElement(Xa,e)}function oi(e){var t="post";return e.post.isDeleted?t="hide":e.post.is_hidden&&!e.post.acl.can_see_hidden&&(t="post post-hidden"),e.post.poster&&e.post.poster.rank.css_class&&(t+=" post-"+e.post.poster.rank.css_class),e.post.is_read||(t+=" post-new"),(0,r.Z)("li",{id:"post-"+e.post.id,className:t},void 0,(0,r.Z)("div",{className:"panel panel-default panel-post"},void 0,(0,r.Z)("div",{className:"panel-body"},void 0,v().createElement(ii,e),(0,r.Z)("div",{className:"panel-content"},void 0,v().createElement(Ma,e),v().createElement(Dt,e),v().createElement(zt,e),v().createElement(qt,e),v().createElement(Ut,e),v().createElement(Tt,e),v().createElement(Nt,e),v().createElement(hn,e)))))}const ri=function(){return(0,r.Z)("li",{className:"post"},void 0,(0,r.Z)("div",{className:"panel panel-default panel-post"},void 0,(0,r.Z)("div",{className:"panel-body"},void 0,(0,r.Z)("div",{className:"post-side post-side-registered"},void 0,(0,r.Z)("div",{className:"media"},void 0,Wa||(Wa=(0,r.Z)("div",{className:"media-left"},void 0,(0,r.Z)("span",{},void 0,(0,r.Z)(I.ZP,{className:"poster-avatar",size:"100"})))),(0,r.Z)("div",{className:"media-body"},void 0,(0,r.Z)("span",{className:"media-heading item-title"},void 0,(0,r.Z)("span",{className:"ui-preview-text",style:{width:"80px"}},void 0," ")),(0,r.Z)("span",{className:"user-title user-title-anonymous"},void 0,(0,r.Z)("span",{className:"ui-preview-text",style:{width:"60px"}},void 0," "))))),(0,r.Z)("div",{className:"panel-content"},void 0,(0,r.Z)("div",{className:"post-body"},void 0,(0,r.Z)("article",{className:"misago-markup"},void 0,(0,r.Z)("p",{className:"ui-preview-text",style:{width:"100%"}},void 0," "),(0,r.Z)("p",{className:"ui-preview-text",style:{width:"70%"}},void 0," "),(0,r.Z)("p",{className:"ui-preview-text hidden-xs hidden-sm",style:{width:"85%"}},void 0," ")))))))};var si;function li(e){return e.posts.isLoaded?(0,r.Z)("ul",{className:"posts-list ui-ready"},void 0,e.posts.results.map((function(t){return v().createElement(ci,(0,f.Z)({key:t.id,post:t},e))}))):si||(si=(0,r.Z)("ul",{className:"posts-list ui-preview"},void 0,(0,r.Z)(ri,{})))}function ci(e){return e.post.is_event?v().createElement(ft,e):v().createElement(oi,e)}var ui,di,pi,hi,mi,vi,fi,Zi=n(55547),gi=n(53328),yi=n(9771),bi=n(59131),ki=n(98936);const _i=function(e){var t=e.thread;return(0,r.Z)("ul",{className:"thread-flags"},void 0,2==t.weight&&(0,r.Z)("li",{className:"thread-flag-pinned-globally",title:pgettext("thread flag","Pinned globally")},void 0,ui||(ui=(0,r.Z)("span",{className:"material-icon"},void 0,"bookmark"))),1==t.weight&&(0,r.Z)("li",{className:"thread-flag-pinned-locally",title:pgettext("thread flag","Pinned in category")},void 0,di||(di=(0,r.Z)("span",{className:"material-icon"},void 0,"bookmark_outline"))),t.best_answer&&(0,r.Z)("li",{className:"thread-flag-answered",title:pgettext("thread flag","Answered")},void 0,pi||(pi=(0,r.Z)("span",{className:"material-icon"},void 0,"check_circle"))),t.has_poll&&(0,r.Z)("li",{className:"thread-flag-poll",title:pgettext("thread flag","Poll")},void 0,hi||(hi=(0,r.Z)("span",{className:"material-icon"},void 0,"poll"))),(t.is_unapproved||t.has_unapproved_posts)&&(0,r.Z)("li",{className:"thread-flag-unapproved",title:t.is_unapproved?pgettext("thread flag","Awaiting approval"):pgettext("thread flag","Has unapproved posts")},void 0,mi||(mi=(0,r.Z)("span",{className:"material-icon"},void 0,"visibility"))),t.is_closed&&(0,r.Z)("li",{className:"thread-flag-closed",title:pgettext("thread flag","Closed")},void 0,vi||(vi=(0,r.Z)("span",{className:"material-icon"},void 0,"lock"))),t.is_hidden&&(0,r.Z)("li",{className:"thread-flag-hidden",title:pgettext("thread flag","Hidden")},void 0,fi||(fi=(0,r.Z)("span",{className:"material-icon"},void 0,"visibility_off"))))};var xi;const Ni=function(e){var t=e.thread;return(0,r.Z)("span",{className:"threads-replies",title:interpolate(npgettext("thread replies stat","%(replies)s reply","%(replies)s replies",t.replies),{replies:t.replies},!0)},void 0,xi||(xi=(0,r.Z)("span",{className:"material-icon"},void 0,"chat_bubble_outline")),t.replies>980?Math.round(t.replies/1e3)+"K":t.replies)};var wi;const Ci=function(e){var t=e.thread;return(0,r.Z)("div",{className:"thread-user-card"},void 0,(0,r.Z)("div",{className:"thread-user-card-media"},void 0,t.starter?(0,r.Z)("a",{href:t.url.starter},void 0,(0,r.Z)(I.ZP,{size:40,user:t.starter})):wi||(wi=(0,r.Z)(I.ZP,{size:40}))),(0,r.Z)("div",{className:"thread-user-card-body"},void 0,(0,r.Z)("div",{className:"thread-user-card-header"},void 0,t.starter?(0,r.Z)("a",{className:"item-title",href:t.url.starter,title:pgettext("thread starter info","Thread author")},void 0,t.starter.username):(0,r.Z)("span",{className:"item-title",title:pgettext("thread starter info","Thread author")},void 0,t.starter_name)),(0,r.Z)("div",{},void 0,(0,r.Z)("span",{className:"text-muted",title:interpolate(pgettext("thread starter info","Started on: %(timestamp)s"),{timestamp:t.started_on.format("LLL")},!0)},void 0,t.started_on.fromNow()))))};var Ri,Ei,Si=n(99755),Li=n(12891);var Oi,Pi=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,s.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"handleSuccess",(function(e){t.handleSuccessUnmounted(e),t.setState({isLoading:!0}),_.Z.hide()})),(0,h.Z)((0,c.Z)(t),"handleSuccessUnmounted",(function(e){N.Z.dispatch(b.Ar()),N.Z.dispatch(b.Vx(e))})),(0,h.Z)((0,c.Z)(t),"handleError",(function(e){N.Z.dispatch(b.Ar()),400===e.status?x.Z.error(e.detail[0]):x.Z.apiError(e)})),(0,h.Z)((0,c.Z)(t),"onChange",(function(e){t.changeValue("title",e.target.value)})),t.state={isLoading:!1,title:e.thread.title,validators:{title:(0,Li.jn)()},errors:{}},t}return(0,l.Z)(i,[{key:"clean",value:function(){if(!this.state.title.trim().length)return x.Z.error(pgettext("thread title form","You have to enter thread title.")),!1;var e=this.validate();return!e.title||(x.Z.error(e.title[0]),!1)}},{key:"send",value:function(){return N.Z.dispatch(b.n6()),k.Z.patch(this.props.thread.api.index,[{op:"replace",path:"title",value:this.state.title}])}},{key:"render",value:function(){return(0,r.Z)("div",{className:"modal-dialog modal-lg",role:"document"},void 0,(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,Ri||(Ri=(0,r.Z)(Ai,{})),(0,r.Z)("div",{className:"modal-body"},void 0,(0,r.Z)(g.Z,{for:"id_modal_title",label:pgettext("thread title form field","Thread title")},void 0,(0,r.Z)("input",{className:"form-control",disabled:this.state.isLoading||this.props.thread.isBusy,id:"id_modal_title",onChange:this.onChange,value:this.state.title}))),(0,r.Z)("div",{className:"modal-footer"},void 0,(0,r.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,pgettext("thread title form btn","Cancel")),(0,r.Z)("button",{className:"btn btn-primary",disabled:this.state.isLoading||this.props.thread.isBusy},void 0,pgettext("thread title form btn","Change title"))))))}}]),i}(Z.Z);function Ai(e){return(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,Ei||(Ei=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("thread title form title","Change title")))}var Ti,Ii,Bi=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,s.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"handleSuccess",(function(e){t.props.onSuccess(e),_.Z.hide()})),(0,h.Z)((0,c.Z)(t),"handleError",(function(e){t.props.onError(e)})),(0,h.Z)((0,c.Z)(t),"onBestAnswerChange",(function(e){t.changeValue("bestAnswer",e.target.value)})),(0,h.Z)((0,c.Z)(t),"onPollChange",(function(e){t.changeValue("poll",e.target.value)})),t.state={isLoading:!1,bestAnswer:"0",poll:"0"},t}return(0,l.Z)(i,[{key:"clean",value:function(){return!this.props.polls||"0"!==this.state.poll||window.confirm(pgettext("merge threads conflict form","Are you sure you want to delete all polls?"))}},{key:"send",value:function(){var e=Object.assign({},this.props.data,{best_answer:this.state.bestAnswer,poll:this.state.poll});return k.Z.post(this.props.api,e)}},{key:"render",value:function(){return(0,r.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,Oi||(Oi=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("merge threads conflict modal title","Merge threads"))),(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"modal-body"},void 0,(0,r.Z)(ji,{choices:this.props.bestAnswers,onChange:this.onBestAnswerChange,value:this.state.bestAnswer}),(0,r.Z)(Di,{choices:this.props.polls,onChange:this.onPollChange,value:this.state.poll})),(0,r.Z)("div",{className:"modal-footer"},void 0,(0,r.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,pgettext("merge threads conflict btn","Cancel")),(0,r.Z)(Te.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,pgettext("merge threads conflict btn","Merge threads"))))))}}]),i}(Z.Z);function ji(e){var t=e.choices,n=e.onChange,a=e.value;return t?(0,r.Z)(g.Z,{label:pgettext("merge threads conflict best answer","Best answer"),helpText:pgettext("merge threads conflict best answer","Select the best answer for your newly merged thread. No posts will be deleted during the merge."),for:"id_best_answer"},void 0,(0,r.Z)("select",{className:"form-control",id:"id_best_answer",onChange:n,value:a},void 0,t.map((function(e){return(0,r.Z)("option",{value:e[0]},e[0],e[1])})))):null}function Di(e){var t=e.choices,n=e.onChange,a=e.value;return t?(0,r.Z)(g.Z,{label:pgettext("merge threads conflict poll","Poll"),helpText:pgettext("merge threads conflict poll","Select the poll for your newly merged thread. Rejected polls will be permanently deleted and cannot be recovered."),for:"id_poll"},void 0,(0,r.Z)("select",{className:"form-control",id:"id_poll",onChange:n,value:a},void 0,t.map((function(e){return(0,r.Z)("option",{value:e[0]},e[0],e[1])})))):null}var Ui,zi,qi,Mi,Fi,Hi,Vi=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,s.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"handleSuccess",(function(e){t.handleSuccessUnmounted(e),t.setState({isLoading:!0})})),(0,h.Z)((0,c.Z)(t),"handleSuccessUnmounted",(function(e){x.Z.success(pgettext("thread merge form","Thread has been merged with other one.")),window.location=e.url})),(0,h.Z)((0,c.Z)(t),"handleError",(function(e){N.Z.dispatch(b.Ar()),400===e.status?e.best_answers||e.polls?_.Z.show((0,r.Z)(Bi,{api:t.props.thread.api.merge,bestAnswers:e.best_answers,data:{other_thread:t.state.url},polls:e.polls,onError:t.handleError,onSuccess:t.handleSuccessUnmounted})):e.best_answer?x.Z.error(e.best_answer[0]):e.poll?x.Z.error(e.poll[0]):x.Z.error(e.detail):x.Z.apiError(e)})),(0,h.Z)((0,c.Z)(t),"onUrlChange",(function(e){t.changeValue("url",e.target.value)})),t.state={isLoading:!1,url:"",validators:{url:[]},errors:{}},t}return(0,l.Z)(i,[{key:"clean",value:function(){return!!this.state.url.trim().length||(x.Z.error(pgettext("thread merge form","You have to enter link to the other thread.")),!1)}},{key:"send",value:function(){return N.Z.dispatch(b.n6()),k.Z.post(this.props.thread.api.merge,{other_thread:this.state.url})}},{key:"render",value:function(){return(0,r.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,Ti||(Ti=(0,r.Z)(Yi,{})),(0,r.Z)("div",{className:"modal-body"},void 0,(0,r.Z)(g.Z,{for:"id_url",label:pgettext("thread merge form field","Link to thread you want to merge with"),help_text:pgettext("thread merge form field","Merge will delete current thread and move its contents to the thread specified here.")},void 0,(0,r.Z)("input",{className:"form-control",disabled:this.state.isLoading||this.props.thread.isBusy,id:"id_url",onChange:this.onUrlChange,value:this.state.url}))),(0,r.Z)("div",{className:"modal-footer"},void 0,(0,r.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,pgettext("thread merge form btn","Cancel")),(0,r.Z)("button",{className:"btn btn-primary",disabled:this.state.isLoading||this.props.thread.isBusy},void 0,pgettext("thread merge form btn","Merge thread"))))))}}]),i}(Z.Z);function Yi(e){return(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,Ii||(Ii=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("thread merge form title","Merge thread")))}var Gi,Wi,$i,Qi,Ki,Xi,Ji,eo,to,no,ao,io,oo=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,s.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"onCategoryChange",(function(e){t.changeValue("category",e.target.value)})),t.state={isReady:!1,isLoading:!1,isError:!1,category:null,categories:[]},t}return(0,l.Z)(i,[{key:"componentDidMount",value:function(){var e=this;k.Z.get(S.Z.get("THREAD_EDITOR_API")).then((function(t){var n=null,a=t.map((function(e){return!1===e.post||n||(n=e.id),Object.assign(e,{disabled:!1===e.post,label:e.name,value:e.id})}));e.setState({isReady:!0,category:n,categories:a})}),(function(t){e.setState({isError:t.detail})}))}},{key:"send",value:function(){return N.Z.dispatch(b.n6()),k.Z.patch(this.props.thread.api.index,[{op:"replace",path:"category",value:this.state.category}])}},{key:"handleSuccess",value:function(){k.Z.get(this.props.thread.api.posts.index,{page:this.props.posts.page}).then((function(e){N.Z.dispatch(b.gx(e)),N.Z.dispatch(Ba.zD(e.post_set)),N.Z.dispatch(b.Ar()),x.Z.success(pgettext("thread move form","Thread has been moved.")),_.Z.hide()}),(function(e){N.Z.dispatch(b.Ar()),x.Z.apiError(e)}))}},{key:"handleError",value:function(e){400===e.status?x.Z.error(e.detail[0]):x.Z.apiError(e)}},{key:"render",value:function(){return this.state.isReady?(0,r.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,Ui||(Ui=(0,r.Z)(ro,{})),(0,r.Z)("div",{className:"modal-body"},void 0,(0,r.Z)(g.Z,{for:"id_category",label:pgettext("thread move form field","New category")},void 0,(0,r.Z)(Qn.Z,{choices:this.state.categories,disabled:this.state.isLoading||this.props.thread.isBusy,id:"id_category",onChange:this.onCategoryChange,value:this.state.category}))),(0,r.Z)("div",{className:"modal-footer"},void 0,(0,r.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,pgettext("thread move form btn","Cancel")),(0,r.Z)("button",{className:"btn btn-primary",disabled:this.state.isLoading||this.props.thread.isBusy},void 0,pgettext("thread move form btn","Move thread")))))):this.state.isError?(0,r.Z)(lo,{message:this.state.isError}):zi||(zi=(0,r.Z)(so,{}))}}]),i}(Z.Z);function ro(e){return(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,qi||(qi=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("thread move form title","Move thread")))}function so(e){return Mi||(Mi=(0,r.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,(0,r.Z)(ro,{}),(0,r.Z)(J.Z,{}))))}function lo(e){return(0,r.Z)("div",{className:"modal-dialog modal-message",role:"document"},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,Fi||(Fi=(0,r.Z)(ro,{})),Hi||(Hi=(0,r.Z)("div",{className:"message-icon"},void 0,(0,r.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,r.Z)("div",{className:"message-body"},void 0,(0,r.Z)("p",{className:"lead"},void 0,pgettext("thread move form","You can't move this thread at the moment.")),(0,r.Z)("p",{},void 0,e.message),(0,r.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,pgettext("thread move form dismiss btn","Ok")))))}var co=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(){var e;(0,s.Z)(this,i);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e=a.call.apply(a,[this].concat(n)),(0,h.Z)((0,c.Z)(e),"callApi",(function(t,n){N.Z.dispatch(b.n6()),t.push({op:"add",path:"acl",value:!0}),k.Z.patch(e.props.thread.api.index,t).then((function(e){N.Z.dispatch(b.Vx(e)),N.Z.dispatch(b.Ar()),x.Z.success(n)}),(function(e){N.Z.dispatch(b.Ar()),400===e.status?x.Z.error(e.detail[0]):x.Z.apiError(e)}))})),(0,h.Z)((0,c.Z)(e),"changeTitle",(function(){_.Z.show((0,r.Z)(Pi,{thread:e.props.thread}))})),(0,h.Z)((0,c.Z)(e),"pinGlobally",(function(){e.callApi([{op:"replace",path:"weight",value:2}],pgettext("thread moderation","Thread has been pinned globally."))})),(0,h.Z)((0,c.Z)(e),"pinLocally",(function(){e.callApi([{op:"replace",path:"weight",value:1}],pgettext("thread moderation","Thread has been pinned in category."))})),(0,h.Z)((0,c.Z)(e),"unpin",(function(){e.callApi([{op:"replace",path:"weight",value:0}],pgettext("thread moderation","Thread has been unpinned."))})),(0,h.Z)((0,c.Z)(e),"approve",(function(){e.callApi([{op:"replace",path:"is-unapproved",value:!1}],pgettext("thread moderation","Thread has been approved."))})),(0,h.Z)((0,c.Z)(e),"open",(function(){e.callApi([{op:"replace",path:"is-closed",value:!1}],gettext("Thread has been opened."))})),(0,h.Z)((0,c.Z)(e),"close",(function(){e.callApi([{op:"replace",path:"is-closed",value:!0}],pgettext("thread moderation","Thread has been closed."))})),(0,h.Z)((0,c.Z)(e),"unhide",(function(){e.callApi([{op:"replace",path:"is-hidden",value:!1}],pgettext("thread moderation","Thread has been made visible."))})),(0,h.Z)((0,c.Z)(e),"hide",(function(){e.callApi([{op:"replace",path:"is-hidden",value:!0}],pgettext("thread moderation","Thread has been made hidden."))})),(0,h.Z)((0,c.Z)(e),"move",(function(){_.Z.show((0,r.Z)(oo,{posts:e.props.posts,thread:e.props.thread}))})),(0,h.Z)((0,c.Z)(e),"merge",(function(){_.Z.show((0,r.Z)(Vi,{thread:e.props.thread}))})),(0,h.Z)((0,c.Z)(e),"delete",(function(){window.confirm(pgettext("thread moderation","Are you sure you want to delete this thread?"))&&(N.Z.dispatch(b.n6()),k.Z.delete(e.props.thread.api.index).then((function(t){x.Z.success(pgettext("thread moderation","Thread has been deleted.")),window.location=e.props.thread.category.url.index}),(function(e){N.Z.dispatch(b.Ar()),x.Z.apiError(e)})))})),e}return(0,l.Z)(i,[{key:"render",value:function(){var e=this.props.moderation;return(0,r.Z)("ul",{className:"dropdown-menu dropdown-menu-right stick-to-bottom"},void 0,!!e.edit&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.changeTitle,type:"button"},void 0,Gi||(Gi=(0,r.Z)("span",{className:"material-icon"},void 0,"edit")),pgettext("thread moderation btn","Change title"))),!!e.pinGlobally&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.pinGlobally,type:"button"},void 0,Wi||(Wi=(0,r.Z)("span",{className:"material-icon"},void 0,"bookmark")),pgettext("thread moderation btn","Pin globally"))),!!e.pinLocally&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.pinLocally,type:"button"},void 0,$i||($i=(0,r.Z)("span",{className:"material-icon"},void 0,"bookmark_border")),pgettext("thread moderation btn","Pin in category"))),!!e.unpin&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.unpin,type:"button"},void 0,Qi||(Qi=(0,r.Z)("span",{className:"material-icon"},void 0,"panorama_fish_eye")),pgettext("thread moderation btn","Unpin"))),!!e.move&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.move,type:"button"},void 0,Ki||(Ki=(0,r.Z)("span",{className:"material-icon"},void 0,"arrow_forward")),pgettext("thread moderation btn","Move"))),!!e.merge&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.merge,type:"button"},void 0,Xi||(Xi=(0,r.Z)("span",{className:"material-icon"},void 0,"call_merge")),pgettext("thread moderation btn","Merge"))),!!e.approve&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.approve,type:"button"},void 0,Ji||(Ji=(0,r.Z)("span",{className:"material-icon"},void 0,"done")),pgettext("thread moderation btn","Approve"))),!!e.open&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.open,type:"button"},void 0,eo||(eo=(0,r.Z)("span",{className:"material-icon"},void 0,"lock_open")),pgettext("thread moderation btn","Open"))),!!e.close&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.close,type:"button"},void 0,to||(to=(0,r.Z)("span",{className:"material-icon"},void 0,"lock_outline")),pgettext("thread moderation btn","Close"))),!!e.unhide&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.unhide,type:"button"},void 0,no||(no=(0,r.Z)("span",{className:"material-icon"},void 0,"visibility")),pgettext("thread moderation btn","Unhide"))),!!e.hide&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.hide,type:"button"},void 0,ao||(ao=(0,r.Z)("span",{className:"material-icon"},void 0,"visibility_off")),pgettext("thread moderation btn","Hide"))),!!e.delete&&(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",onClick:this.delete,type:"button"},void 0,io||(io=(0,r.Z)("span",{className:"material-icon"},void 0,"clear")),pgettext("thread moderation btn","Delete"))))}}]),i}(v().Component);const uo=co;var po;const ho=function(e){var t=e.thread,n=e.posts,a=e.moderation;return(0,r.Z)("div",{className:"dropdown"},void 0,(0,r.Z)("button",{type:"button",className:"btn btn-default btn-outline btn-icon dropdown-toggle",title:pgettext("thread options btn","Thread options"),"data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",disabled:t.isBusy},void 0,po||(po=(0,r.Z)("span",{className:"material-icon"},void 0,"settings"))),(0,r.Z)(uo,{thread:t,posts:n,moderation:a}))};var mo,vo,fo,Zo=n(94184),go=n.n(Zo),yo=n(60642),bo=n(49021);const ko=(0,o.$j)()((function(e){var t=e.dispatch,n=e.dropup,a=e.stickToBottom,i=e.thread;return(0,r.Z)(yo.D,{url:i.api.watch},void 0,(function(e,o){var s,l=o.loading;function c(n){i.notifications!==n&&(t((0,b.Vx)({notifications:n})),e({json:{notifications:n},onError:function(e){x.Z.apiError(e),t((0,b.Vx)({notifications:i.notifications}))}}))}return(0,r.Z)("div",{className:n?"dropup":"dropdown"},void 0,(0,r.Z)("button",{className:"btn btn-default btn-outline btn-block","aria-expanded":"true","aria-haspopup":"true","data-toggle":"dropdown",type:"button"},void 0,(0,r.Z)("span",{className:"material-icon"},void 0,2===(s=i.notifications)?"mail":1===s?"notifications_active":"notifications_none"),function(e){return e?pgettext("watch thread","Watching"):pgettext("watch thread","Watch")}(i.notifications)),(0,r.Z)("ul",{className:go()("dropdown-menu dropdown-menu-right",{"stick-to-bottom":a})},void 0,(0,r.Z)(bo.iC,{},void 0,pgettext("watch thread","Notify about new replies")),(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",disabled:l,onClick:function(){return c(2)}},void 0,mo||(mo=(0,r.Z)("span",{className:"material-icon"},void 0,"mail")),pgettext("watch thread","On site and with e-mail"))),(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",disabled:l,onClick:function(){return c(1)}},void 0,vo||(vo=(0,r.Z)("span",{className:"material-icon"},void 0,"notifications_active")),pgettext("watch thread","On site only"))),(0,r.Z)("li",{},void 0,(0,r.Z)("button",{className:"btn btn-link",disabled:l,onClick:function(){return c(0)}},void 0,fo||(fo=(0,r.Z)("span",{className:"material-icon"},void 0,"notifications_none")),pgettext("watch thread","Don't notify")))))}))})),_o=function(e){var t=e.children,n=e.className;return(0,r.Z)("ul",{className:go()("breadcrumbs",n)},void 0,t)},xo=function(e){var t=e.category,n=e.className;return(0,r.Z)("li",{className:go()("breadcrumbs-item",n)},void 0,(0,r.Z)("a",{href:t.url.index},void 0,(0,r.Z)("span",{className:"material-icon",style:{color:t.color||"inherit"}},void 0,"label"),!!t.short_name&&(0,r.Z)("span",{className:"breadcrumbs-item-name hidden-sm hidden-md hidden-lg",title:t.name},void 0,t.short_name),!!t.short_name&&(0,r.Z)("span",{className:"breadcrumbs-item-name hidden-xs"},void 0,t.name),!t.short_name&&(0,r.Z)("span",{className:"breadcrumbs-item-name"},void 0,t.name)))};var No;const wo=function(e){var t=e.category,n=e.className;return(0,r.Z)("li",{className:go()("breadcrumbs-item",n)},void 0,(0,r.Z)("a",{href:t.url.index},void 0,No||(No=(0,r.Z)("span",{className:"material-icon"},void 0,"chevron_right")),(0,r.Z)("span",{className:"breadcrumbs-item-name"},void 0,"root_category"===t.special_role?pgettext("breadcrumb","Threads"):pgettext("breadcrumb","Private threads"))))},Co=function(e){var t=e.breadcrumbs;return(0,r.Z)(_o,{},void 0,t.map((function(e){return e.special_role?(0,r.Z)(wo,{category:e},e.id):(0,r.Z)(xo,{category:e},e.id)})))};var Ro;const Eo=function(e){var t=e.styleName,n=e.thread,a=e.posts,i=e.user,o=e.moderation;return(0,r.Z)(Si.sP,{},void 0,(0,r.Z)(Si.mr,{styleName:t},void 0,(0,r.Z)(Si.gC,{styleName:t},void 0,(0,r.Z)(Co,{breadcrumbs:n.path}),(0,r.Z)("h1",{},void 0,n.title)),(0,r.Z)(Si.eA,{className:"page-header-thread-details"},void 0,(0,r.Z)(ki.gq,{},void 0,(0,r.Z)(ki.kw,{auto:!0},void 0,(0,r.Z)(ki.Z6,{shrink:!0},void 0,(0,r.Z)(Ci,{thread:n})),Ro||(Ro=(0,r.Z)(ki.Z6,{auto:!0})),n.replies>0&&(0,r.Z)(ki.Z6,{shrink:!0},void 0,(0,r.Z)(Ni,{thread:n})),function(e){return e.is_closed||e.is_hidden||e.is_unapproved||e.weight>0||e.best_answer||e.has_poll||e.has_unapproved_posts}(n)&&(0,r.Z)(ki.Z6,{shrink:!0},void 0,(0,r.Z)(_i,{thread:n}))),i.is_authenticated&&(0,r.Z)(ki.kw,{},void 0,(0,r.Z)(ki.Z6,{},void 0,(0,r.Z)(ko,{thread:n})),o.enabled&&(0,r.Z)(ki.Z6,{shrink:!0},void 0,(0,r.Z)(ho,{thread:n,posts:a,moderation:o})))))))};var So,Lo,Oo,Po,Ao,To,Io,Bo,jo=n(92490),Do=n(69987);function Uo(){window.scrollTo(0,0)}var zo=(0,Do.EN)((function(e){var t=e.router,n=e.baseUrl,a=e.posts,i=e.scrollToTop;return(0,r.Z)("div",{className:"thread-paginator"},void 0,a.isLoaded&&a.first?(0,r.Z)(Do.rU,{className:"btn btn-default btn-outline btn-icon",to:n,title:pgettext("paginator","Go to first page"),onClick:i?Uo:null},void 0,So||(So=(0,r.Z)("span",{className:"material-icon"},void 0,"first_page"))):(0,r.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:pgettext("paginator","Go to first page"),type:"button",disabled:!0},void 0,Lo||(Lo=(0,r.Z)("span",{className:"material-icon"},void 0,"first_page"))),a.isLoaded&&a.previous?(0,r.Z)(Do.rU,{className:"btn btn-default btn-outline btn-icon",to:n+(a.previous>1?a.previous+"/":""),title:pgettext("paginator","Go to previous page"),onClick:i?Uo:null},void 0,Oo||(Oo=(0,r.Z)("span",{className:"material-icon"},void 0,"chevron_left"))):(0,r.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:pgettext("paginator","Go to previous page"),type:"button",disabled:!0},void 0,Po||(Po=(0,r.Z)("span",{className:"material-icon"},void 0,"chevron_left"))),(0,r.Z)(bo.Lt,{toggle:function(e){var t,n,i=e.aria,o=e.toggle;return v().createElement("button",(0,f.Z)({},i,{className:"btn btn-default btn-block btn-outline",type:"button",disabled:!a.isLoaded,onClick:o}),(t=a.page,n=a.pages,pgettext("paginator","Page %(page)s of %(pages)s").replace("%(page)s",t).replace("%(pages)s",n)))},onOpen:function(e){e.querySelector("input").focus()}},void 0,(function(e){var o=e.close;return(0,r.Z)("form",{className:"thread-paginator-form",onSubmit:function(e){if(a.isLoaded){var r=new FormData(e.target),s=parseInt(r.get("page"));if(s&&s!=a.page&&s>=1&&s<=a.pages){var l=s>1?n+s+"/":n;t.push({pathname:l})}}e.preventDefault(),o(),i&&Uo()}},void 0,(0,r.Z)("input",{className:"form-control",name:"page",type:"number",min:1,max:a.pages,placeholder:pgettext("paginator input","Page"),disabled:!a.isLoaded}),(0,r.Z)("button",{className:"btn btn-primary",type:"submit",disabled:!a.isLoaded},void 0,pgettext("paginator","Go")))})),a.isLoaded&&a.next?(0,r.Z)(Do.rU,{className:"btn btn-default btn-outline btn-icon",to:n+a.next+"/",title:pgettext("paginator","Go to next page"),onClick:i?Uo:null},void 0,Ao||(Ao=(0,r.Z)("span",{className:"material-icon"},void 0,"chevron_right"))):(0,r.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:pgettext("paginator","Go to next page"),type:"button",disabled:!0},void 0,To||(To=(0,r.Z)("span",{className:"material-icon"},void 0,"chevron_right"))),a.isLoaded&&a.last?(0,r.Z)(Do.rU,{className:"btn btn-default btn-outline btn-icon",to:n+a.last+"/",title:pgettext("paginator","Go to last page"),onClick:i?Uo:null},void 0,Io||(Io=(0,r.Z)("span",{className:"material-icon"},void 0,"last_page"))):(0,r.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:pgettext("paginator","Go to last page"),type:"button",disabled:!0},void 0,Bo||(Bo=(0,r.Z)("span",{className:"material-icon"},void 0,"last_page"))))}));const qo=zo;var Mo,Fo,Ho;function Vo(e){var t=e.errors,n=e.posts;return(0,r.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,Mo||(Mo=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("thread posts moderation modal title","Moderation"))),(0,r.Z)("div",{className:"modal-body"},void 0,(0,r.Z)("p",{className:"lead"},void 0,pgettext("thread posts moderation modal","One or more posts could not be changed:")),(0,r.Z)("ul",{className:"list-unstyled list-errored-items"},void 0,t.map((function(e){return(0,r.Z)(Yo,{errors:e.detail,post:n[e.id]},e.id)}))))))}function Yo(e){var t=e.errors,n=e.post,a=interpolate(pgettext("thread posts moderation modal","%(username)s on %(posted_on)s"),{posted_on:n.posted_on.format("LL, LT"),username:n.poster_name},!0);return(0,r.Z)("li",{},void 0,(0,r.Z)("h5",{},void 0,a,":"),t.map((function(e,t){return(0,r.Z)("p",{},t,e)})))}function Go(e){var t=e.selection,n=t.map((function(e){return{id:e.id,is_unapproved:!1}})),a=t.map((function(e){return{id:e.id,is_unapproved:e.is_unapproved}}));Xo(e,[{op:"replace",path:"is-unapproved",value:!1}],n,a)}function Wo(e){var t=e.selection,n=t.map((function(e){return{id:e.id,is_protected:!0}})),a=t.map((function(e){return{id:e.id,is_protected:e.is_protected}}));Xo(e,[{op:"replace",path:"is-protected",value:!0}],n,a)}function $o(e){var t=e.selection,n=t.map((function(e){return{id:e.id,is_protected:!1}})),a=t.map((function(e){return{id:e.id,is_protected:e.is_protected}}));Xo(e,[{op:"replace",path:"is-protected",value:!1}],n,a)}function Qo(e){var t=e.selection,n=t.map((function(t){return{id:t.id,is_hidden:!0,hidden_on:F()(),hidden_by_name:e.user.username,url:Object.assign(t.url,{hidden_by:e.user.url})}})),a=t.map((function(e){return{id:e.id,is_hidden:e.is_hidden,hidden_on:e.hidden_on,hidden_by_name:e.hidden_by_name,url:e.url}}));Xo(e,[{op:"replace",path:"is-hidden",value:!0}],n,a)}function Ko(e){var t=e.selection,n=t.map((function(t){return{id:t.id,is_hidden:!1,hidden_on:F()(),hidden_by_name:e.user.username,url:Object.assign(t.url,{hidden_by:e.user.url})}})),a=t.map((function(e){return{id:e.id,is_hidden:e.is_hidden,hidden_on:e.hidden_on,hidden_by_name:e.hidden_by_name,url:e.url}}));Xo(e,[{op:"replace",path:"is-hidden",value:!1}],n,a)}function Xo(e,t,n,a){var i=e.selection,o=e.thread;n.forEach((function(e){Ge.r$(e,e)})),N.Z.dispatch(Ba.kR());var s={ops:t,ids:i.map((function(e){return e.id}))};k.Z.patch(o.api.posts.index,s).then((function(e){e.forEach((function(e){N.Z.dispatch(Ge.r$(e,e))}))}),(function(e){if(400!==e.status)return a.forEach((function(e){N.Z.dispatch(Ge.r$(e,e))})),x.Z.apiError(e);var t=[],n=[];e.forEach((function(e){e.detail?(t.push(e),n.push(e.id)):N.Z.dispatch(Ge.r$(e,e)),a.forEach((function(e){-1!==n.indexOf(e)&&N.Z.dispatch(Ge.r$(e,e))}))}));var o={};i.forEach((function(e){o[e.id]=e})),_.Z.show((0,r.Z)(Vo,{errors:t,posts:o}))}))}function Jo(e){window.confirm(pgettext("merge posts","Are you sure you want to merge selected posts? This action is not reversible!"))&&(e.selection.slice(1).map((function(e){N.Z.dispatch(Ge.r$(e,{isDeleted:!0}))})),k.Z.post(e.thread.api.posts.merge,{posts:e.selection.map((function(e){return e.id}))}).then((function(e){N.Z.dispatch(Ge.r$(e,Ge.ZB(e)))}),(function(t){400===t.status?x.Z.error(t.detail):x.Z.apiError(t),e.selection.slice(1).map((function(e){N.Z.dispatch(Ge.r$(e,{isDeleted:!1}))}))})),N.Z.dispatch(Ba.kR()))}function er(e){if(window.confirm(pgettext("delete posts","Are you sure you want to delete selected posts? This action is not reversible!"))){e.selection.map((function(e){N.Z.dispatch(Ge.r$(e,{isDeleted:!0}))}));var t=e.selection.map((function(e){return e.id}));k.Z.delete(e.thread.api.posts.index,t).then((function(){}),(function(t){400===t.status?x.Z.error(t.detail):x.Z.apiError(t),e.selection.map((function(e){N.Z.dispatch(Ge.r$(e,{isDeleted:!1}))}))})),N.Z.dispatch(Ba.kR())}}var tr,nr,ar,ir,or,rr,sr=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,s.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"onUrlChange",(function(e){t.changeValue("url",e.target.value)})),t.state={isLoading:!1,url:"",validators:{url:[]},errors:{}},t}return(0,l.Z)(i,[{key:"clean",value:function(){return!!this.state.url.trim().length||(x.Z.error(pgettext("thread posts moderation move","You have to enter link to the other thread.")),!1)}},{key:"send",value:function(){return k.Z.post(this.props.thread.api.posts.move,{new_thread:this.state.url,posts:this.props.selection.map((function(e){return e.id}))})}},{key:"handleSuccess",value:function(e){this.props.selection.forEach((function(e){N.Z.dispatch(Ge.r$(e,{isDeleted:!0}))})),_.Z.hide(),x.Z.success(pgettext("thread posts moderation move","Selected posts were moved to the other thread."))}},{key:"handleError",value:function(e){400===e.status?x.Z.error(e.detail):x.Z.apiError(e)}},{key:"render",value:function(){return(0,r.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,Fo||(Fo=(0,r.Z)(lr,{})),(0,r.Z)("div",{className:"modal-body"},void 0,(0,r.Z)(g.Z,{for:"id_url",label:pgettext("thread posts moderation move","Link to thread you want to move posts to")},void 0,(0,r.Z)("input",{className:"form-control",disabled:this.state.isLoading,id:"id_url",onChange:this.onUrlChange,value:this.state.url}))),(0,r.Z)("div",{className:"modal-footer"},void 0,(0,r.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,pgettext("thread posts moderation move btn","Cancel")),(0,r.Z)("button",{className:"btn btn-primary",disabled:this.state.isLoading},void 0,pgettext("thread posts moderation move btn","Move posts"))))))}}]),i}(Z.Z);function lr(e){return(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,Ho||(Ho=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("thread posts moderation move title","Move posts")))}function cr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}function ur(e){return v().createElement(br,(0,f.Z)({},e,{Form:kr}))}var dr,pr,hr,mr,vr,fr,Zr,gr,yr,br=function(e){(0,u.Z)(n,e);var t=cr(n);function n(e){var a;return(0,s.Z)(this,n),(a=t.call(this,e)).state={isLoaded:!1,isError:!1,categories:[]},a}return(0,l.Z)(n,[{key:"componentDidMount",value:function(){var e=this;k.Z.get(misago.get("THREAD_EDITOR_API")).then((function(t){var n=t.map((function(e){return Object.assign(e,{disabled:!1===e.post,label:e.name,value:e.id,post:e.post})}));e.setState({isLoaded:!0,categories:n})}),(function(t){e.setState({isError:t.detail})}))}},{key:"render",value:function(){return this.state.isError?(0,r.Z)(xr,{message:this.state.isError}):this.state.isLoaded?v().createElement(kr,(0,f.Z)({},this.props,{categories:this.state.categories})):tr||(tr=(0,r.Z)(_r,{}))}}]),n}(v().Component),kr=function(e){(0,u.Z)(n,e);var t=cr(n);function n(e){var a;return(0,s.Z)(this,n),a=t.call(this,e),(0,h.Z)((0,c.Z)(a),"onCategoryChange",(function(e){var t=e.target.value,n={category:t};a.acl[t].can_pin_threads<n.weight&&(n.weight=0),a.acl[t].can_hide_threads||(n.is_hidden=0),a.acl[t].can_close_threads||(n.is_closed=!1),a.setState(n)})),a.state={isLoading:!1,title:"",category:null,categories:e.categories,weight:0,is_hidden:0,is_closed:!1,validators:{title:[Xn.C1()]},errors:{}},a.isHiddenChoices=[{value:0,icon:"visibility",label:pgettext("thread hidden switch choice","No")},{value:1,icon:"visibility_off",label:pgettext("thread hidden switch choice","Yes")}],a.isClosedChoices=[{value:!1,icon:"lock_outline",label:pgettext("thread closed switch choice","No")},{value:!0,icon:"lock",label:pgettext("thread closed switch choice","Yes")}],a.acl={},a.props.categories.forEach((function(e){e.post&&(a.state.category||(a.state.category=e.id),a.acl[e.id]={can_pin_threads:e.post.pin,can_close_threads:e.post.close,can_hide_threads:e.post.hide})})),a}return(0,l.Z)(n,[{key:"clean",value:function(){return!!this.isValid()||(x.Z.error(gettext("Form contains errors.")),this.setState({errors:this.validate()}),!1)}},{key:"send",value:function(){return k.Z.post(this.props.thread.api.posts.split,{title:this.state.title,category:this.state.category,weight:this.state.weight,is_hidden:this.state.is_hidden,is_closed:this.state.is_closed,posts:this.props.selection.map((function(e){return e.id}))})}},{key:"handleSuccess",value:function(e){this.props.selection.forEach((function(e){N.Z.dispatch(Ge.r$(e,{isDeleted:!0}))})),_.Z.hide(),x.Z.success(pgettext("posts moderation split","Selected posts were split into new thread."))}},{key:"handleError",value:function(e){400===e.status?(this.setState({errors:Object.assign({},this.state.errors,e)}),x.Z.error(gettext("Form contains errors."))):403===e.status&&Array.isArray(e)?_.Z.show((0,r.Z)(Vo,{errors:e})):x.Z.apiError(e)}},{key:"getWeightChoices",value:function(){var e=[{value:0,icon:"remove",label:pgettext("thread weight choice","Not pinned")},{value:1,icon:"bookmark_border",label:pgettext("thread weight choice","Pinned in category")}];return 2==this.acl[this.state.category].can_pin_threads&&e.push({value:2,icon:"bookmark",label:pgettext("thread weight choice","Pinned globally")}),e}},{key:"renderWeightField",value:function(){return this.acl[this.state.category].can_pin_threads?(0,r.Z)(g.Z,{label:pgettext("posts moderation split field","Thread weight"),for:"id_weight",labelClass:"col-sm-4",controlClass:"col-sm-8"},void 0,(0,r.Z)(Kn.Z,{id:"id_weight",onChange:this.bindInput("weight"),value:this.state.weight,choices:this.getWeightChoices()})):null}},{key:"renderHiddenField",value:function(){return this.acl[this.state.category].can_hide_threads?(0,r.Z)(g.Z,{label:pgettext("posts moderation split field","Hide thread"),for:"id_is_hidden",labelClass:"col-sm-4",controlClass:"col-sm-8"},void 0,(0,r.Z)(Kn.Z,{id:"id_is_closed",onChange:this.bindInput("is_hidden"),value:this.state.is_hidden,choices:this.isHiddenChoices})):null}},{key:"renderClosedField",value:function(){return this.acl[this.state.category].can_close_threads?(0,r.Z)(g.Z,{label:pgettext("posts moderation split field","Close thread"),for:"id_is_closed",labelClass:"col-sm-4",controlClass:"col-sm-8"},void 0,(0,r.Z)(Kn.Z,{id:"id_is_closed",onChange:this.bindInput("is_closed"),value:this.state.is_closed,choices:this.isClosedChoices})):null}},{key:"render",value:function(){return(0,r.Z)(Nr,{className:"modal-dialog"},void 0,(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"modal-body"},void 0,(0,r.Z)(g.Z,{label:pgettext("posts moderation split field","Thread title"),for:"id_title",labelClass:"col-sm-4",controlClass:"col-sm-8",validation:this.state.errors.title},void 0,(0,r.Z)("input",{id:"id_title",className:"form-control",type:"text",onChange:this.bindInput("title"),value:this.state.title})),nr||(nr=(0,r.Z)("div",{className:"clearfix"})),(0,r.Z)(g.Z,{label:pgettext("posts moderation split field","Category"),for:"id_category",labelClass:"col-sm-4",controlClass:"col-sm-8",validation:this.state.errors.category},void 0,(0,r.Z)(Qn.Z,{id:"id_category",onChange:this.onCategoryChange,value:this.state.category,choices:this.state.categories})),ar||(ar=(0,r.Z)("div",{className:"clearfix"})),this.renderWeightField(),this.renderHiddenField(),this.renderClosedField()),(0,r.Z)("div",{className:"modal-footer"},void 0,(0,r.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,pgettext("posts moderation split btn","Cancel")),(0,r.Z)(Te.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,pgettext("posts moderation split btn","Split posts")))))}}]),n}(Z.Z);function _r(){return ir||(ir=(0,r.Z)(Nr,{className:"modal-dialog"},void 0,(0,r.Z)(J.Z,{})))}function xr(e){return(0,r.Z)(Nr,{className:"modal-dialog modal-message"},void 0,or||(or=(0,r.Z)("div",{className:"message-icon"},void 0,(0,r.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,r.Z)("div",{className:"message-body"},void 0,(0,r.Z)("p",{className:"lead"},void 0,pgettext("posts moderation split","You can't move selected posts at the moment.")),(0,r.Z)("p",{},void 0,e.message),(0,r.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,pgettext("posts moderation split dismiss btn","Ok"))))}function Nr(e){return(0,r.Z)("div",{className:e.className,role:"document"},void 0,(0,r.Z)("div",{className:"modal-content"},void 0,(0,r.Z)("div",{className:"modal-header"},void 0,(0,r.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,rr||(rr=(0,r.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,r.Z)("h4",{className:"modal-title"},void 0,pgettext("posts moderation split title","Split posts into new thread"))),e.children))}function wr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}function Cr(e){return(0,r.Z)("ul",{className:"dropdown-menu dropdown-menu-right stick-to-bottom"},void 0,v().createElement(Er,e),v().createElement(Sr,e),v().createElement(Lr,e),v().createElement(Or,e),v().createElement(Pr,e),v().createElement(Ar,e),v().createElement(Ir,e),v().createElement(Tr,e),v().createElement(Br,e))}var Rr,Er=function(e){(0,u.Z)(n,e);var t=wr(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Go(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.selection.find((function(e){return e.acl.can_approve&&e.is_unapproved}));return e?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,dr||(dr=(0,r.Z)("span",{className:"material-icon"},void 0,"done")),pgettext("thread posts moderation","Approve"))):null}}]),n}(v().Component),Sr=function(e){(0,u.Z)(n,e);var t=wr(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Jo(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.selection.length>1&&this.props.selection.find((function(e){return e.acl.can_merge}));return e?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,pr||(pr=(0,r.Z)("span",{className:"material-icon"},void 0,"call_merge")),pgettext("thread posts moderation","Merge"))):null}}]),n}(v().Component),Lr=function(e){(0,u.Z)(n,e);var t=wr(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){_.Z.show(v().createElement(sr,e.props))})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.selection.find((function(e){return e.acl.can_move}));return e?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,hr||(hr=(0,r.Z)("span",{className:"material-icon"},void 0,"arrow_forward")),pgettext("thread posts moderation","Move"))):null}}]),n}(v().Component),Or=function(e){(0,u.Z)(n,e);var t=wr(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){_.Z.show(v().createElement(ur,e.props))})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.selection.find((function(e){return e.acl.can_move}));return e?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,mr||(mr=(0,r.Z)("span",{className:"material-icon"},void 0,"call_split")),pgettext("thread posts moderation","Split"))):null}}]),n}(v().Component),Pr=function(e){(0,u.Z)(n,e);var t=wr(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Wo(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.selection.find((function(e){return!e.is_protected&&e.acl.can_protect}));return e?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,vr||(vr=(0,r.Z)("span",{className:"material-icon"},void 0,"lock_outline")),pgettext("thread posts moderation","Protect"))):null}}]),n}(v().Component),Ar=function(e){(0,u.Z)(n,e);var t=wr(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){$o(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.selection.find((function(e){return e.is_protected&&e.acl.can_protect}));return e?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,fr||(fr=(0,r.Z)("span",{className:"material-icon"},void 0,"lock_open")),pgettext("thread posts moderation","Unprotect"))):null}}]),n}(v().Component),Tr=function(e){(0,u.Z)(n,e);var t=wr(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Qo(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.selection.find((function(e){return e.acl.can_hide&&!e.is_hidden}));return e?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,Zr||(Zr=(0,r.Z)("span",{className:"material-icon"},void 0,"visibility_off")),pgettext("thread posts moderation","Hide"))):null}}]),n}(v().Component),Ir=function(e){(0,u.Z)(n,e);var t=wr(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Ko(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.selection.find((function(e){return e.acl.can_unhide&&e.is_hidden}));return e?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,gr||(gr=(0,r.Z)("span",{className:"material-icon"},void 0,"visibility")),pgettext("thread posts moderation","Unhide"))):null}}]),n}(v().Component),Br=function(e){(0,u.Z)(n,e);var t=wr(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){er(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.selection.find((function(e){return e.acl.can_delete}));return e?(0,r.Z)("li",{},void 0,(0,r.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,yr||(yr=(0,r.Z)("span",{className:"material-icon"},void 0,"clear")),pgettext("thread posts moderation","Delete"))):null}}]),n}(v().Component);const jr=function(e){var t=e.thread,n=e.user,a=e.selection,i=e.dropup;return(0,r.Z)("div",{className:i?"dropup":"dropdown"},void 0,(0,r.Z)("button",{type:"button",className:"btn btn-default btn-outline btn-icon dropdown-toggle",title:pgettext("post options btn","Posts options"),"data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",disabled:0===a.length},void 0,Rr||(Rr=(0,r.Z)("span",{className:"material-icon"},void 0,"settings"))),(0,r.Z)(Cr,{thread:t,user:n,selection:a}))};var Dr;const Ur=function(e){var t=e.onClick;return(0,r.Z)("button",{className:"btn btn-primary btn-outline btn-block",type:"button",onClick:t},void 0,Dr||(Dr=(0,r.Z)("span",{className:"material-icon"},void 0,"chat")),pgettext("thread reply btn","Reply"))};var zr;const qr=function(e){var t=e.thread,n=e.posts,a=e.user,i=e.selection,o=e.moderation,s=e.onReply;return(0,r.Z)(jo.o8,{},void 0,n.pages>1&&(0,r.Z)(jo.Z2,{},void 0,(0,r.Z)(jo.Eg,{},void 0,(0,r.Z)(qo,{baseUrl:t.url.index,posts:n,scrollToTop:!0}))),zr||(zr=(0,r.Z)(jo.tw,{})),a.is_authenticated&&(0,r.Z)(jo.Z2,{},void 0,(0,r.Z)(jo.Eg,{className:"hidden-xs"},void 0,(0,r.Z)(ko,{thread:t,dropup:!0})),t.acl.can_reply&&(0,r.Z)(jo.Eg,{},void 0,(0,r.Z)(Ur,{onClick:s})),o.enabled&&(0,r.Z)(jo.Eg,{shrink:!0},void 0,(0,r.Z)(jr,{thread:t,user:a,selection:i,dropup:!0}))),a.is_authenticated&&(0,r.Z)(jo.Z2,{className:"hidden-sm hidden-md hidden-lg"},void 0,(0,r.Z)(jo.Eg,{},void 0,(0,r.Z)(ko,{thread:t,dropup:!0}))))};var Mr,Fr;const Hr=function(){return(0,r.Z)(jo.o8,{className:"thread-toolbar-third"},void 0,Mr||(Mr=(0,r.Z)(jo.tw,{})),(0,r.Z)(jo.Z2,{},void 0,(0,r.Z)(jo.Eg,{},void 0,(0,r.Z)("button",{className:"btn btn-muted btn-block",type:"button",onClick:function(){return window.scrollTo(0,0)}},void 0,Fr||(Fr=(0,r.Z)("span",{className:"material-icon"},void 0,"arrow_upward")),pgettext("go up","Go to top")))))};var Vr;const Yr=function(e){var t=e.compact,n=e.disabled,a=e.onClick;return(0,r.Z)("button",{className:go()("btn btn-default btn-outline",{"btn-block":!t,"btn-icon":t}),type:"button",title:t?pgettext("thread poll btn","Add poll"):null,disabled:n,onClick:a},void 0,Vr||(Vr=(0,r.Z)("span",{className:"material-icon"},void 0,"poll")),!t&&pgettext("thread poll btn","Add poll"))};var Gr,Wr,$r,Qr,Kr,Xr;const Jr=function(e){var t=e.user,n=e.thread,a=e.posts;return(0,r.Z)("div",{className:"dropdown"},void 0,(0,r.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:pgettext("thread shortcuts btn","Shortcuts"),"aria-expanded":"true","aria-haspopup":"true","data-toggle":"dropdown",type:"button"},void 0,Gr||(Gr=(0,r.Z)("span",{className:"material-icon"},void 0,"bookmark"))),(0,r.Z)("ul",{className:"dropdown-menu"},void 0,!!a.first&&(0,r.Z)("li",{},void 0,(0,r.Z)(Do.rU,{className:"btn btn-link",href:n.url.index},void 0,Wr||(Wr=(0,r.Z)("span",{className:"material-icon"},void 0,"place")),pgettext("thread shortcut btn","Go to first post"))),t.is_authenticated&&n.is_new&&(0,r.Z)("li",{},void 0,(0,r.Z)("a",{className:"btn btn-link",href:n.url.new_post},void 0,$r||($r=(0,r.Z)("span",{className:"material-icon"},void 0,"comment")),pgettext("thread shortcut btn","Go to new post"))),n.best_answer&&(0,r.Z)("li",{},void 0,(0,r.Z)("a",{className:"btn btn-link",href:n.url.best_answer},void 0,Qr||(Qr=(0,r.Z)("span",{className:"material-icon"},void 0,"check_circle")),pgettext("thread shortcut btn","Go to best answer"))),n.has_unapproved_posts&&n.acl.can_approve&&(0,r.Z)("li",{},void 0,(0,r.Z)("a",{className:"btn btn-link",href:n.url.unapproved_post},void 0,Kr||(Kr=(0,r.Z)("span",{className:"material-icon"},void 0,"visibility")),pgettext("thread shortcut btn","Go to unapproved post"))),(0,r.Z)("li",{},void 0,(0,r.Z)("a",{className:"btn btn-link",href:n.url.last_post},void 0,Xr||(Xr=(0,r.Z)("span",{className:"material-icon"},void 0,"reply")),pgettext("thread shortcut btn","Go to last post")))))};var es;const ts=function(e){var t=e.thread,n=e.posts,a=e.user,i=e.pollDisabled,o=e.selection,s=e.moderation,l=e.onPoll,c=e.onReply;return(0,r.Z)(jo.o8,{},void 0,(0,r.Z)(jo.Z2,{className:"hidden-xs"},void 0,(0,r.Z)(jo.Eg,{},void 0,(0,r.Z)(Jr,{posts:n,thread:t,user:a})),n.pages>1&&(0,r.Z)(jo.Eg,{},void 0,(0,r.Z)(qo,{baseUrl:t.url.index,posts:n}))),es||(es=(0,r.Z)(jo.tw,{})),t.acl.can_start_poll&&!t.poll&&(0,r.Z)(jo.Z2,{className:"hidden-xs"},void 0,(0,r.Z)(jo.Eg,{},void 0,(0,r.Z)(Yr,{disabled:i,onClick:l}))),t.acl.can_reply?(0,r.Z)(jo.Z2,{},void 0,(0,r.Z)(jo.Eg,{className:"hidden-sm hidden-md hidden-lg",shrink:!0},void 0,(0,r.Z)(Jr,{posts:n,thread:t,user:a})),(0,r.Z)(jo.Eg,{},void 0,(0,r.Z)(Ur,{onClick:c})),t.acl.can_start_poll&&!t.poll&&(0,r.Z)(jo.Eg,{className:"hidden-sm hidden-md hidden-lg",shrink:!0},void 0,(0,r.Z)(Yr,{disabled:i,onClick:l,compact:!0})),s.enabled&&(0,r.Z)(jo.Eg,{className:"hidden-xs",shrink:!0},void 0,(0,r.Z)(jr,{thread:t,user:a,selection:o}))):(0,r.Z)(jo.Z2,{},void 0,(0,r.Z)(jo.Eg,{className:"hidden-sm hidden-md hidden-lg",shrink:!0},void 0,(0,r.Z)(Jr,{posts:n,thread:t,user:a})),t.acl.can_start_poll&&!t.poll&&(0,r.Z)(jo.Eg,{},void 0,(0,r.Z)(Yr,{disabled:i,onClick:l})),s.enabled&&(0,r.Z)(jo.Eg,{shrink:!0},void 0,(0,r.Z)(jr,{thread:t,user:a,selection:o}))),n.pages>1&&(0,r.Z)(jo.Z2,{className:"hidden-sm hidden-md hidden-lg"},void 0,(0,r.Z)(jo.Eg,{},void 0,(0,r.Z)(qo,{baseUrl:t.url.index,posts:n}))))};var ns;var as=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,s.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"update",(function(e){N.Z.dispatch(b.gx(e)),N.Z.dispatch(Ba.zD(e.post_set)),e.participants&&N.Z.dispatch(y.gx(e.participants)),e.poll&&N.Z.dispatch(le.gx(e.poll)),t.setPageTitle()})),(0,h.Z)((0,c.Z)(t),"openPollForm",(function(){t.setState({editPoll:!0})})),(0,h.Z)((0,c.Z)(t),"closePollForm",(function(){t.setState({editPoll:!1})})),(0,h.Z)((0,c.Z)(t),"openReplyForm",(function(){ce.Z.open({mode:"REPLY",thread:t.props.thread,config:t.props.thread.api.editor,submit:t.props.thread.api.posts.index})})),t.state={editPoll:!1},t}return(0,l.Z)(i,[{key:"componentDidMount",value:function(){this.shouldFetchData()&&(this.fetchData(),this.setPageTitle()),this.startPollingApi()}},{key:"componentDidUpdate",value:function(){this.shouldFetchData()&&(this.fetchData(),this.startPollingApi(),this.setPageTitle())}},{key:"componentWillUnmount",value:function(){this.stopPollingApi()}},{key:"shouldFetchData",value:function(){return!!this.props.posts.isLoaded&&1*(this.props.params.page||1)!=this.props.posts.page}},{key:"fetchData",value:function(){var e=this;N.Z.dispatch(Ba.Rz()),k.Z.get(this.props.thread.api.posts.index,{page:this.props.params.page||1},"posts").then((function(t){e.update(t)}),(function(e){x.Z.apiError(e)}))}},{key:"startPollingApi",value:function(){Zi.Z.start({poll:"thread-posts",url:this.props.thread.api.posts.index,data:{page:this.props.params.page||1},update:this.update,frequency:12e4,delayed:!0})}},{key:"stopPollingApi",value:function(){Zi.Z.stop("thread-posts")}},{key:"setPageTitle",value:function(){gi.Z.set({title:this.props.thread.title,parent:this.props.thread.category.name,page:1*(this.props.params.page||1)})}},{key:"render",value:function(){var e=this.props.thread.category,t="page page-thread";e.css_class&&(t+=" page-thread-"+e.css_class);var n="private_threads"===e.special_role?"private-threads":e.css_class||"category-threads",a=is(this.props.thread,this.props.user),i=os(this.props.posts.results,this.props.user),o=this.props.posts.results.filter((function(e){return e.isSelected}));return(0,r.Z)("div",{className:t},void 0,(0,r.Z)(Eo,{styleName:n,thread:this.props.thread,posts:this.props.posts,user:this.props.user,moderation:a}),(0,r.Z)(bi.Z,{},void 0,(0,r.Z)(U,{participants:this.props.participants,thread:this.props.thread,user:this.props.user}),(0,r.Z)(ts,{thread:this.props.thread,posts:this.props.posts,user:this.props.user,selection:o,moderation:i,pollDisabled:this.state.editPoll,onPoll:this.openPollForm,onReply:this.openReplyForm}),this.state.editPoll?(0,r.Z)(Fe,{poll:this.props.poll,thread:this.props.thread,close:this.closePollForm}):(0,r.Z)(je,{poll:this.props.poll,thread:this.props.thread,user:this.props.user,edit:this.openPollForm}),this.props.thread.acl.can_reply?(0,r.Z)(yi.mv,{posting:{mode:"REPLY",thread:this.props.thread,config:this.props.thread.api.editor,submit:this.props.thread.api.posts.index}},void 0,v().createElement(li,this.props)):v().createElement(li,this.props),(0,r.Z)(qr,{thread:this.props.thread,posts:this.props.posts,user:this.props.user,selection:o,moderation:i,onReply:this.openReplyForm}),ns||(ns=(0,r.Z)(Hr,{}))))}}]),i}(v().Component),is=function(e,t){var n={enabled:!1,edit:!1,approve:!1,close:!1,open:!1,hide:!1,unhide:!1,move:!1,merge:!1,pinGlobally:!1,pinLocally:!1,unpin:!1,delete:!1};return t.is_authenticated?(n.edit=e.acl.can_edit,n.approve=e.acl.can_approve&&e.is_unapproved,n.close=e.acl.can_close&&!e.is_closed,n.open=e.acl.can_close&&e.is_closed,n.hide=e.acl.can_hide&&!e.is_hidden,n.unhide=e.acl.can_unhide&&e.is_hidden,n.move=e.acl.can_move,n.merge=e.acl.can_merge,n.pinGlobally=e.acl.can_pin_globally&&e.weight<2,n.pinLocally=e.acl.can_pin&&1!==e.weight,n.unpin=e.acl.can_pin&&1===e.weight||e.acl.can_pin_globally&&2===e.weight,n.delete=e.acl.can_delete,n.enabled=n.edit||n.approve||n.close||n.open||n.hide||n.unhide||n.move||n.merge||n.pinGlobally||n.pinLocally||n.unpin||n.delete,n):n},os=function(e,t){var n={enabled:!1,approve:!1,move:!1,merge:!1,protect:!1,hide:!1,delete:!1};return t.is_authenticated?(e.forEach((function(e){e.is_event||(e.acl.can_approve&&e.is_unapproved&&(n.approve=!0),e.acl.can_move&&(n.move=!0),e.acl.can_merge&&(n.merge=!0),(e.acl.can_protect||e.acl.can_unprotect)&&(n.protect=!0),(e.acl.can_hide||e.acl.can_unhide)&&(n.hide=!0),e.acl.can_delete&&(n.delete=!0),(n.approve||n.move||n.merge||n.protect||n.hide||n.delete)&&(n.enabled=!0))})),n):n};function rs(e){return{participants:e.participants,poll:e.poll,posts:e.posts,thread:e.thread,tick:e.tick.tick,user:e.auth.user}}var ss=n(39633);S.Z.addInitializer({name:"component:thread",initializer:function(e){var t,n;e.has("THREAD")&&e.has("POSTS")&&(0,ss.Z)({paths:(t=S.Z.get("THREAD"),n=t.url.index.replace(t.slug+"-"+t.pk,":slug"),[{path:n,component:(0,o.$j)(rs)(as)},{path:n+":page/",component:(0,o.$j)(rs)(as)}])})},after:"store"})},63290:(e,t,n)=>{"use strict";var a,i=n(22928),o=(n(57588),n(73935)),r=n.n(o),s=n(37424),l=n(28166),c=n(90287);misago.addInitializer({name:"component:user-nav-overlay",initializer:function(e){var t=document.getElementById("user-nav-mount");r().render((0,i.Z)(s.zt,{store:c.Z.getStore()},void 0,a||(a=(0,i.Z)(l.Qm,{}))),t)},after:"store"})},77031:(e,t,n)=>{"use strict";var a,i=n(22928),o=n(15671),r=n(43144),s=n(79340),l=n(6215),c=n(61120),u=n(57588),d=n.n(u),p=n(37424),h=n(97326),m=n(4942),v=n(59131),f=n(69987),Z=n(94417),g=function(e,t){var n=e;return"rank"===t.component?n+=t.slug:n+=t.component,n+"/"};const y=function(e){var t=e.baseUrl,n=e.page,o=e.pages;return(0,i.Z)("div",{className:"nav-container"},void 0,(0,i.Z)("div",{className:"dropdown hidden-sm hidden-md hidden-lg"},void 0,(0,i.Z)("button",{className:"btn btn-default btn-block btn-outline dropdown-toggle",type:"button","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},void 0,a||(a=(0,i.Z)("span",{className:"material-icon"},void 0,"menu")),n.name),(0,i.Z)("ul",{className:"dropdown-menu stick-to-bottom"},void 0,o.map((function(e){var n=g(t,e);return(0,i.Z)("li",{},n,(0,i.Z)(f.rU,{to:n},void 0,e.name))})))),(0,i.Z)("ul",{className:"nav nav-pills hidden-xs",role:"menu"},void 0,o.map((function(e){var n=g(t,e);return(0,i.Z)(Z.Z,{path:n},n,(0,i.Z)(f.rU,{to:n},void 0,e.name))}))))};var b,k,_=function(e){(0,s.Z)(u,e);var t,n,a=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function u(){return(0,o.Z)(this,u),a.apply(this,arguments)}return(0,r.Z)(u,[{key:"getEmptyMessage",value:function(){return interpolate(npgettext("top posters empty","No users have posted any new messages during last %(days)s day.","No users have posted any new messages during last %(days)s days.",this.props.trackedPeriod),{days:this.props.trackedPeriod},!0)}},{key:"render",value:function(){return(0,i.Z)("div",{className:"active-posters-list"},void 0,(0,i.Z)(v.Z,{},void 0,(0,i.Z)(y,{baseUrl:misago.get("USERS_LIST_URL"),page:this.props.page,pages:misago.get("USERS_LISTS")}),(0,i.Z)("p",{className:"lead"},void 0,this.getEmptyMessage())))}}]),u}(d().Component),x=n(19605),N=n(44039);var w=function(e){(0,s.Z)(u,e);var t,n,a=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function u(){return(0,o.Z)(this,u),a.apply(this,arguments)}return(0,r.Z)(u,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"getClassName",value:function(){return this.props.hiddenOnMobile?"list-group-item hidden-xs hidden-sm":"list-group-item"}},{key:"render",value:function(){return(0,i.Z)("li",{className:this.getClassName()},void 0,b||(b=(0,i.Z)("div",{className:"rank-user-avatar"},void 0,(0,i.Z)("span",{},void 0,(0,i.Z)(x.ZP,{size:"50"})))),(0,i.Z)("div",{className:"rank-user"},void 0,(0,i.Z)("div",{className:"user-name"},void 0,(0,i.Z)("span",{className:"item-title"},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:N.e(30,80)+"px"}},void 0," "))),(0,i.Z)("div",{className:"user-details"},void 0,(0,i.Z)("span",{className:"user-status"},void 0,k||(k=(0,i.Z)("span",{className:"status-icon ui-preview-text"},void 0," ")),(0,i.Z)("span",{className:"status-label ui-preview-text hidden-xs hidden-sm",style:{width:N.e(30,50)+"px"}},void 0," ")),(0,i.Z)("span",{className:"rank-name"},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:N.e(30,50)+"px"}},void 0," ")),(0,i.Z)("span",{className:"user-title hidden-xs hidden-sm"},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:N.e(30,50)+"px"}},void 0," "))),(0,i.Z)("div",{className:"user-compact-stats visible-xs-block"},void 0,(0,i.Z)("span",{className:"rank-position"},void 0,(0,i.Z)("strong",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:N.e(20,30)+"px"}},void 0," ")),(0,i.Z)("small",{},void 0,pgettext("top posters list item","Rank"))),(0,i.Z)("span",{className:"rank-posts-counted"},void 0,(0,i.Z)("strong",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:N.e(20,30)+"px"}},void 0," ")),(0,i.Z)("small",{},void 0,pgettext("top posters list item","Ranked posts"))))),(0,i.Z)("div",{className:"rank-position hidden-xs"},void 0,(0,i.Z)("strong",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:N.e(20,30)+"px"}},void 0," ")),(0,i.Z)("small",{},void 0,pgettext("top posters list item","Rank"))),(0,i.Z)("div",{className:"rank-posts-counted hidden-xs"},void 0,(0,i.Z)("strong",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:N.e(20,30)+"px"}},void 0," ")),(0,i.Z)("small",{},void 0,pgettext("top posters list item","Ranked posts"))),(0,i.Z)("div",{className:"rank-posts-total hidden-xs"},void 0,(0,i.Z)("strong",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:N.e(20,30)+"px"}},void 0," ")),(0,i.Z)("small",{},void 0,pgettext("top posters list item","Total posts"))))}}]),u}(d().Component);var C,R=function(e){(0,s.Z)(u,e);var t,n,a=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function u(){return(0,o.Z)(this,u),a.apply(this,arguments)}return(0,r.Z)(u,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"render",value:function(){return(0,i.Z)("div",{className:"active-posters-list"},void 0,(0,i.Z)(v.Z,{},void 0,(0,i.Z)(y,{baseUrl:misago.get("USERS_LIST_URL"),page:this.props.page,pages:misago.get("USERS_LISTS")}),(0,i.Z)("p",{className:"lead ui-preview"},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:N.e(50,220)+"px"}},void 0," ")),(0,i.Z)("div",{className:"active-posters ui-preview"},void 0,(0,i.Z)("ul",{className:"list-group"},void 0,[0,1,2].map((function(e){return(0,i.Z)(w,{hiddenOnMobile:e>0},e)}))))))}}]),u}(d().Component),E=n(24678),S=n(34458);var L=function(e){(0,s.Z)(u,e);var t,n,a=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function u(){return(0,o.Z)(this,u),a.apply(this,arguments)}return(0,r.Z)(u,[{key:"getClassName",value:function(){return this.props.rank.css_class?"list-group-item list-group-rank-"+this.props.rank.css_class:"list-group-item"}},{key:"getUserStatus",value:function(){return this.props.user.status?(0,i.Z)(E.ZP,{user:this.props.user,status:this.props.user.status},void 0,(0,i.Z)(E.Jj,{user:this.props.user,status:this.props.user.status}),(0,i.Z)(E.pg,{user:this.props.user,status:this.props.user.status,className:"status-label hidden-xs hidden-sm"})):(0,i.Z)("span",{className:"user-status"},void 0,C||(C=(0,i.Z)("span",{className:"status-icon ui-preview-text"},void 0," ")),(0,i.Z)("span",{className:"status-label ui-preview-text hidden-xs hidden-sm",style:{width:N.e(30,50)+"px"}},void 0," "))}},{key:"getRankName",value:function(){if(!this.props.rank.is_tab)return(0,i.Z)("span",{className:"rank-name item-title"},void 0,this.props.rank.name);var e=S.Z.get("USERS_LIST_URL")+this.props.rank.slug+"/";return(0,i.Z)(f.rU,{to:e,className:"rank-name item-title"},void 0,this.props.rank.name)}},{key:"getUserTitle",value:function(){return this.props.user.title?(0,i.Z)("span",{className:"user-title hidden-xs hidden-sm"},void 0,this.props.user.title):null}},{key:"render",value:function(){return(0,i.Z)("li",{className:this.getClassName()},void 0,(0,i.Z)("div",{className:"rank-user-avatar"},void 0,(0,i.Z)("a",{href:this.props.user.url},void 0,(0,i.Z)(x.ZP,{user:this.props.user,size:50,size2x:64}))),(0,i.Z)("div",{className:"rank-user"},void 0,(0,i.Z)("div",{className:"user-name"},void 0,(0,i.Z)("a",{href:this.props.user.url,className:"item-title"},void 0,this.props.user.username)),(0,i.Z)("div",{className:"user-details"},void 0,this.getUserStatus(),this.getRankName(),this.getUserTitle()),(0,i.Z)("div",{className:"user-compact-stats visible-xs-block"},void 0,(0,i.Z)("span",{className:"rank-position"},void 0,(0,i.Z)("strong",{},void 0,"#",this.props.counter),(0,i.Z)("small",{},void 0,pgettext("top posters list item","Rank"))),(0,i.Z)("span",{className:"rank-posts-counted"},void 0,(0,i.Z)("strong",{},void 0,this.props.user.meta.score),(0,i.Z)("small",{},void 0,pgettext("top posters list item","Ranked posts"))))),(0,i.Z)("div",{className:"rank-position hidden-xs"},void 0,(0,i.Z)("strong",{},void 0,"#",this.props.counter),(0,i.Z)("small",{},void 0,pgettext("top posters list item","Rank"))),(0,i.Z)("div",{className:"rank-posts-counted hidden-xs"},void 0,(0,i.Z)("strong",{},void 0,this.props.user.meta.score),(0,i.Z)("small",{},void 0,pgettext("top posters list item","Ranked posts"))),(0,i.Z)("div",{className:"rank-posts-total hidden-xs"},void 0,(0,i.Z)("strong",{},void 0,this.props.user.posts),(0,i.Z)("small",{},void 0,pgettext("top posters list item","Total posts"))))}}]),u}(d().Component);var O=function(e){(0,s.Z)(u,e);var t,n,a=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function u(){return(0,o.Z)(this,u),a.apply(this,arguments)}return(0,r.Z)(u,[{key:"getLeadMessage",value:function(){var e=npgettext("top posters list","%(posters)s top poster from last %(days)s days.","%(posters)s top posters from last %(days)s days.",this.props.count);return interpolate(e,{posters:this.props.count,days:this.props.trackedPeriod},!0)}},{key:"render",value:function(){return(0,i.Z)("div",{className:"active-posters-list"},void 0,(0,i.Z)(v.Z,{},void 0,(0,i.Z)(y,{baseUrl:misago.get("USERS_LIST_URL"),page:this.props.page,pages:misago.get("USERS_LISTS")}),(0,i.Z)("p",{className:"lead"},void 0,this.getLeadMessage()),(0,i.Z)("div",{className:"active-posters ui-ready"},void 0,(0,i.Z)("ul",{className:"list-group"},void 0,this.props.users.map((function(e,t){return(0,i.Z)(L,{user:e,rank:e.rank,counter:t+1},e.id)}))))))}}]),u}(d().Component),P=n(6935),A=n(55547),T=n(90287),I=n(53328);var B=function(e){(0,s.Z)(u,e);var t,n,a=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function u(e){var t;return(0,o.Z)(this,u),t=a.call(this,e),(0,m.Z)((0,h.Z)(t),"update",(function(e){T.Z.dispatch((0,P.ZB)(e.results)),t.setState({isLoaded:!0,trackedPeriod:e.tracked_period,count:e.count})})),S.Z.has("USERS")?t.initWithPreloadedData(S.Z.pop("USERS")):t.initWithoutPreloadedData(),t.startPolling(),t}return(0,r.Z)(u,[{key:"initWithPreloadedData",value:function(e){this.state={isLoaded:!0,trackedPeriod:e.tracked_period,count:e.count},T.Z.dispatch((0,P.ZB)(e.results))}},{key:"initWithoutPreloadedData",value:function(){this.state={isLoaded:!1}}},{key:"startPolling",value:function(){A.Z.start({poll:"active-posters",url:S.Z.get("USERS_API"),data:{list:"active"},frequency:9e4,update:this.update})}},{key:"componentDidMount",value:function(){I.Z.set({title:this.props.route.extra.name,parent:pgettext("users page title","Users")})}},{key:"componentWillUnmount",value:function(){A.Z.stop("active-posters")}},{key:"render",value:function(){var e={name:this.props.route.extra.name};return this.state.isLoaded?this.state.count>0?(0,i.Z)(O,{page:e,users:this.props.users,trackedPeriod:this.state.trackedPeriod,count:this.state.count}):(0,i.Z)(_,{page:e,trackedPeriod:this.state.trackedPeriod}):(0,i.Z)(R,{page:e})}}]),u}(d().Component);var j=function(e){(0,s.Z)(u,e);var t,n,a=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function u(){return(0,o.Z)(this,u),a.apply(this,arguments)}return(0,r.Z)(u,[{key:"getClassName",value:function(){return this.props.copy&&this.props.copy.length&&1===function(e,t){if(e=(e+"").toLowerCase(),(t=(t+"").toLowerCase()).length<=0)return 0;for(var n=0,a=0,i=t.length;(a=e.indexOf(t,a))>=0;)n+=1,a+=i;return n}(this.props.copy,"<p")&&-1===this.props.copy.indexOf("<br")?"page-lead lead":"page-lead"}},{key:"render",value:function(){return this.props.copy&&this.props.copy.length?(0,i.Z)("div",{className:this.getClassName(),dangerouslySetInnerHTML:{__html:this.props.copy}}):null}}]),u}(d().Component),D=n(40429);const U=function(e){var t=e.users;return(0,i.Z)(D.Z,{cols:4,isReady:!0,showStatus:!0,users:t})};var z;const q=function(e){(0,s.Z)(u,e);var t,n,a=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function u(){var e;(0,o.Z)(this,u);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e=a.call.apply(a,[this].concat(n)),(0,m.Z)((0,h.Z)(e),"render",(function(){return z||(z=(0,i.Z)(D.Z,{cols:4,isReady:!1}))})),e}return(0,r.Z)(u,[{key:"shouldComponentUpdate",value:function(){return!1}}]),u}(d().Component);var M=n(92490);const F=function(e){var t=e.users;return t.more?(0,i.Z)("p",{},void 0,interpolate(npgettext("rank users list","There is %(more)s more user with this rank.","There are %(more)s more users with this rank.",t.more),{more:t.more},!0)):(0,i.Z)("p",{},void 0,pgettext("rank users list empty","There are no more users with this rank."))};var H,V,Y,G,W,$,Q,K;const X=function(e){var t=e.baseUrl,n=e.users;return(0,i.Z)("div",{className:"misago-pagination"},void 0,n.isLoaded&&n.first?(0,i.Z)(f.rU,{className:"btn btn-default btn-outline btn-icon",to:t,title:pgettext("rank users list paginator","Go to first page")},void 0,H||(H=(0,i.Z)("span",{className:"material-icon"},void 0,"first_page"))):(0,i.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:pgettext("rank users list paginator","Go to first page"),type:"button",disabled:!0},void 0,V||(V=(0,i.Z)("span",{className:"material-icon"},void 0,"first_page"))),n.isLoaded&&n.previous?(0,i.Z)(f.rU,{className:"btn btn-default btn-outline btn-icon",to:t+(n.previous>1?n.previous+"/":""),title:pgettext("rank users list paginator","Go to previous page")},void 0,Y||(Y=(0,i.Z)("span",{className:"material-icon"},void 0,"chevron_left"))):(0,i.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:pgettext("rank users list paginator","Go to previous page"),type:"button",disabled:!0},void 0,G||(G=(0,i.Z)("span",{className:"material-icon"},void 0,"chevron_left"))),n.isLoaded&&n.next?(0,i.Z)(f.rU,{className:"btn btn-default btn-outline btn-icon",to:t+n.next+"/",title:pgettext("rank users list paginator","Go to next page")},void 0,W||(W=(0,i.Z)("span",{className:"material-icon"},void 0,"chevron_right"))):(0,i.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:pgettext("rank users list paginator","Go to next page"),type:"button",disabled:!0},void 0,$||($=(0,i.Z)("span",{className:"material-icon"},void 0,"chevron_right"))),n.isLoaded&&n.last?(0,i.Z)(f.rU,{className:"btn btn-default btn-outline btn-icon",to:t+n.last+"/",title:pgettext("rank users list paginator","Go to last page")},void 0,Q||(Q=(0,i.Z)("span",{className:"material-icon"},void 0,"last_page"))):(0,i.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:pgettext("rank users list paginator","Go to last page"),type:"button",disabled:!0},void 0,K||(K=(0,i.Z)("span",{className:"material-icon"},void 0,"last_page"))))},J=function(e){var t=e.baseUrl,n=e.users;return(0,i.Z)(M.o8,{},void 0,(0,i.Z)(M.Z2,{},void 0,(0,i.Z)(M.Eg,{},void 0,(0,i.Z)(X,{baseUrl:t,users:n}))),(0,i.Z)(M.Z2,{auto:!0},void 0,(0,i.Z)(M.Eg,{},void 0,(0,i.Z)(F,{users:n}))))};var ee;var te=function(e){(0,s.Z)(u,e);var t,n,a=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function u(e){var t;return(0,o.Z)(this,u),t=a.call(this,e),(0,m.Z)((0,h.Z)(t),"update",(function(e){T.Z.dispatch((0,P.ZB)(e.results)),e.isLoaded=!0,t.setState(e)})),S.Z.has("USERS")?t.initWithPreloadedData(S.Z.pop("USERS")):t.initWithoutPreloadedData(),t.startPolling(e.params.page||1),t}return(0,r.Z)(u,[{key:"initWithPreloadedData",value:function(e){this.state=Object.assign(e,{isLoaded:!0}),T.Z.dispatch((0,P.ZB)(e.results))}},{key:"initWithoutPreloadedData",value:function(){this.state={isLoaded:!1}}},{key:"startPolling",value:function(e){A.Z.start({poll:"rank-users",url:S.Z.get("USERS_API"),data:{rank:this.props.route.rank.id,page:e},frequency:9e4,update:this.update})}},{key:"componentDidMount",value:function(){I.Z.set({title:this.props.route.rank.name,page:this.props.params.page||null,parent:pgettext("users page title","Users")})}},{key:"componentWillUnmount",value:function(){A.Z.stop("rank-users")}},{key:"componentWillReceiveProps",value:function(e){this.props.params.page!==e.params.page&&(I.Z.set({title:this.props.route.rank.name,page:e.params.page||null,parent:pgettext("users page title","Users")}),this.setState({isLoaded:!1}),A.Z.stop("rank-users"),this.startPolling(e.params.page))}},{key:"getClassName",value:function(){return this.props.route.rank.css_class?"rank-users-list rank-users-"+this.props.route.rank.css_class:"rank-users-list"}},{key:"getRankDescription",value:function(){return this.props.route.rank.description?(0,i.Z)("div",{className:"rank-description"},void 0,(0,i.Z)(j,{copy:this.props.route.rank.description.html})):null}},{key:"getComponent",value:function(){return this.state.isLoaded?this.state.count>0?(0,i.Z)(U,{users:this.props.users}):(0,i.Z)("p",{className:"lead"},void 0,pgettext("rank users list","There are no users with this rank at the moment.")):ee||(ee=(0,i.Z)(q,{}))}},{key:"render",value:function(){return(0,i.Z)("div",{className:this.getClassName()},void 0,(0,i.Z)(v.Z,{},void 0,(0,i.Z)(y,{baseUrl:S.Z.get("USERS_LIST_URL"),page:{name:this.props.route.rank.name},pages:S.Z.get("USERS_LISTS")}),this.getRankDescription(),this.getComponent(),(0,i.Z)(J,{baseUrl:S.Z.get("USERS_LIST_URL")+this.props.route.rank.slug+"/",users:this.state})))}}]),u}(d().Component),ne=n(82125),ae=n(99755);var ie=function(e){(0,s.Z)(u,e);var t,n,a=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function u(){return(0,o.Z)(this,u),a.apply(this,arguments)}return(0,r.Z)(u,[{key:"render",value:function(){return(0,i.Z)("div",{className:"page page-users-lists"},void 0,(0,i.Z)(ae.sP,{},void 0,(0,i.Z)(ae.mr,{styleName:"users-lists"},void 0,(0,i.Z)(ae.gC,{styleName:"users-lists"},void 0,(0,i.Z)("h1",{},void 0,pgettext("users page title","Users"))))),this.props.children)}}]),u}(ne.Z);function oe(e){return{tick:e.tick.tick,user:e.auth.user,users:e.users}}function re(){var e=[];return S.Z.get("USERS_LISTS").forEach((function(t){"rank"===t.component?(e.push({path:S.Z.get("USERS_LIST_URL")+t.slug+"/:page/",component:(0,p.$j)(oe)(te),rank:t}),e.push({path:S.Z.get("USERS_LIST_URL")+t.slug+"/",component:(0,p.$j)(oe)(te),rank:t})):"active-posters"===t.component&&e.push({path:S.Z.get("USERS_LIST_URL")+t.component+"/",component:(0,p.$j)(oe)(B),extra:{name:t.name}})})),e}var se=n(39633);S.Z.addInitializer({name:"component:users",initializer:function(e){e.has("USERS_LISTS")&&(0,se.Z)({root:S.Z.get("USERS_LIST_URL"),component:ie,paths:re()})},after:"store"})},97751:(e,t,n)=>{"use strict";var a=n(34458),i=n(96142);a.Z.addInitializer({name:"include",initializer:function(e){i.Z.init(e.get("STATIC_URL"))}})},76093:(e,t,n)=>{"use strict";var a=n(34458),i=n(62833);a.Z.addInitializer({name:"local-storage",initializer:function(){i.Z.init("misago_")}})},87336:(e,t,n)=>{"use strict";var a=n(34458),i=n(15671),o=n(43144),r=n(4869),s=n(19755);const l=new(function(){function e(){(0,i.Z)(this,e)}return(0,o.Z)(e,[{key:"init",value:function(e){this._element=e,this._component=null}},{key:"show",value:function(e){this._component===e?this.hide():(this._component=e,(0,r.Z)(e,this._element.id),s(this._element).addClass("open"))}},{key:"showConnected",value:function(e,t){this._component===e?this.hide():(this._component=e,(0,r.Z)(t,this._element.id,!0),s(this._element).addClass("open"))}},{key:"hide",value:function(){s(this._element).removeClass("open"),this._component=null}}]),e}());a.Z.addInitializer({name:"dropdown",initializer:function(){var e=document.getElementById("mobile-navbar-dropdown-mount");e&&l.init(e)},before:"store"})},47549:(e,t,n)=>{"use strict";var a=n(34458),i=n(59801);a.Z.addInitializer({name:"modal",initializer:function(){var e=document.getElementById("modal-mount");e&&i.Z.init(e)},before:"store"})},22331:(e,t,n)=>{"use strict";var a=n(30381),i=n.n(a),o=n(34458),r=n(19755);o.Z.addInitializer({name:"moment",initializer:function(){i().locale(r("html").attr("lang"))}})},21513:(e,t,n)=>{"use strict";var a=n(34458),i=n(53328);a.Z.addInitializer({name:"page-title",initializer:function(e){i.Z.init(e.get("SETTINGS").forum_index_title,e.get("SETTINGS").forum_name)}})},98749:(e,t,n)=>{"use strict";var a=n(34458),i=n(78657),o=n(53904),r=n(55547);a.Z.addInitializer({name:"polls",initializer:function(){r.Z.init(i.Z,o.Z)}})},98251:(e,t,n)=>{"use strict";var a=n(34458),i=n(78657),o=n(64646),r=n(53904);a.Z.addInitializer({name:"posting",initializer:function(){o.Z.init(i.Z,r.Z,document.getElementById("posting-mount"))}})},6720:(e,t,n)=>{"use strict";var a=n(34458),i=n(35486),o=n(90287);a.Z.addInitializer({name:"reducer:auth",initializer:function(e){o.Z.addReducer("auth",i.ZP,Object.assign({isAuthenticated:e.get("isAuthenticated"),isAnonymous:!e.get("isAuthenticated"),user:e.get("user")},i.E3))},before:"store"})},66806:(e,t,n)=>{"use strict";var a=n(34458),i=n(993),o=n(90287);a.Z.addInitializer({name:"reducer:overlay",initializer:function(e){o.Z.addReducer("overlay",i.ZP,i.E3)},before:"store"})},10846:(e,t,n)=>{"use strict";var a=n(34458),i=n(8154),o=n(90287);a.Z.addInitializer({name:"reducer:participants",initializer:function(){var e=null;a.Z.has("THREAD")&&(e=a.Z.get("THREAD").participants),o.Z.addReducer("participants",i.ZP,e||[])},before:"store"})},18255:(e,t,n)=>{"use strict";var a=n(34458),i=n(59752),o=n(90287);a.Z.addInitializer({name:"reducer:poll",initializer:function(){var e;e=a.Z.has("THREAD")&&a.Z.get("THREAD").poll?(0,i.ZB)(a.Z.get("THREAD").poll):{},o.Z.addReducer("poll",i.ZP,e)},before:"store"})},14113:(e,t,n)=>{"use strict";var a=n(34458),i=n(21981),o=n(90287);a.Z.addInitializer({name:"reducer:posts",initializer:function(){var e;e=a.Z.has("POSTS")?(0,i.ZB)(a.Z.get("POSTS")):{isLoaded:!1,isBusy:!1},o.Z.addReducer("posts",i.ZP,e)},before:"store"})},24444:(e,t,n)=>{"use strict";var a=n(34458),i=n(58598),o=n(90287);a.Z.addInitializer({name:"reducer:profile-details",initializer:function(){var e=null;a.Z.has("PROFILE_DETAILS")&&(e=a.Z.get("PROFILE_DETAILS")),o.Z.addReducer("profile-details",i.ZP,e||{})},before:"store"})},1764:(e,t,n)=>{"use strict";var a=n(34458),i=n(27519),o=n(90287);a.Z.addInitializer({name:"reducer:profile-hydrate",initializer:function(){a.Z.has("PROFILE")&&o.Z.dispatch((0,i.ZB)(a.Z.get("PROFILE")))},after:"store"})},68351:(e,t,n)=>{"use strict";var a=n(34458),i=n(27519),o=n(90287);a.Z.addInitializer({name:"reducer:profile",initializer:function(){o.Z.addReducer("profile",i.ZP,{})},before:"store"})},81521:(e,t,n)=>{"use strict";var a=n(34458),i=n(16427),o=n(90287);a.Z.addInitializer({name:"reducer:search",initializer:function(){o.Z.addReducer("search",i.ZP,Object.assign({},i.E3,{providers:a.Z.get("SEARCH_PROVIDERS")||[],query:a.Z.get("SEARCH_QUERY")||""}))},before:"store"})},68585:(e,t,n)=>{"use strict";var a=n(34458);function i(e,t){if(-1===e.indexOf(t)){var n=e.slice();return n.push(t),n}return e.filter((function(e){return e!==t}))}var o="SELECT_ALL",r="SELECT_NONE",s="SELECT_ITEM";function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(t.type){case o:return t.items;case r:return[];case s:return i(e,t.item);default:return e}}var c=n(90287);a.Z.addInitializer({name:"reducer:selection",initializer:function(){c.Z.addReducer("selection",l,[])},before:"store"})},41229:(e,t,n)=>{"use strict";var a=n(34458),i=n(27346),o=n(90287);a.Z.addInitializer({name:"reducer:snackbar",initializer:function(){o.Z.addReducer("snackbar",i.ZP,i.E3)},before:"store"})},43589:(e,t,n)=>{"use strict";var a=n(34458),i=n(7738),o=n(90287);a.Z.addInitializer({name:"reducer:thread",initializer:function(){var e;e=a.Z.has("THREAD")?(0,i.ZB)(a.Z.get("THREAD")):{isBusy:!1},o.Z.addReducer("thread",i.ZP,e)},before:"store"})},62894:(e,t,n)=>{"use strict";var a=n(34458),i=(n(30381),n(89759)),o="APPEND_THREADS",r="DELETE_THREAD",s="FILTER_THREADS",l="HYDRATE_THREADS",c="PATCH_THREAD",u="SORT_THREADS",d=["can_announce","can_approve","can_close","can_hide","can_move","can_merge","can_pin","can_review"];function p(e){return Object.assign({},e,{moderation:(t=e.acl,n=[],d.forEach((function(e){t[e]&&n.push(e)})),n)});var t,n}function h(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(t.type){case o:var n=(0,i.Z)(t.items.map(p),e);return n.sort(t.sorting);case r:return e.filter((function(e){return e.id!==t.thread.id}));case s:return e.filter((function(e){var n=t.categoriesMap[e.category];return n.lft>=t.category.lft&&n.rght<=t.category.rght||2==e.weight}));case l:return t.items.map(p);case c:var a=e.map((function(e){return e.id===t.thread.id?Object.assign({},e,t.patch):e}));return t.sorting?a.sort(t.sorting):a;case u:return e.sort(t.sorting);default:return e}}var m=n(90287);a.Z.addInitializer({name:"reducer:threads",initializer:function(){m.Z.addReducer("threads",h,[])},before:"store"})},33934:(e,t,n)=>{"use strict";var a=n(34458),i=n(85586),o=n(90287);a.Z.addInitializer({name:"reducer:tick",initializer:function(){o.Z.addReducer("tick",i.ZP,i.E3)},before:"store"})},85577:(e,t,n)=>{"use strict";var a=n(34458),i=n(48927),o=n(90287);a.Z.addInitializer({name:"reducer:username-history",initializer:function(){o.Z.addReducer("username-history",i.ZP,[])},before:"store"})},83526:(e,t,n)=>{"use strict";var a=n(34458),i=n(6935),o=n(90287);a.Z.addInitializer({name:"reducer:users",initializer:function(){o.Z.addReducer("users",i.ZP,[])},before:"store"})},43060:(e,t,n)=>{"use strict";var a=n(34458),i=n(53904),o=n(90287);a.Z.addInitializer({name:"snackbar",initializer:function(){i.Z.init(o.Z)},after:"store"})},92292:(e,t,n)=>{"use strict";var a=n(34458),i=n(90287);a.Z.addInitializer({name:"store",initializer:function(){i.Z.init()},before:"_end"})},33409:(e,t,n)=>{"use strict";var a=n(34458),i=n(85586),o=n(90287);a.Z.addInitializer({name:"tick-start",initializer:function(){window.setInterval((function(){o.Z.dispatch((0,i.bq)())}),5e4)},after:"store"})},31341:(e,t,n)=>{"use strict";var a=n(34458),i=n(96142),o=n(59940);a.Z.addInitializer({name:"zxcvbn",initializer:function(){o.Z.init(i.Z)}})},35486:(e,t,n)=>{"use strict";n.d(t,{E3:()=>i,ZP:()=>h,r$:()=>u,w7:()=>p,yH:()=>c,zB:()=>d});var a=n(6935),i={signedIn:!1,signedOut:!1},o="UPDATE_AUTHENTICATED_USER",r="PATCH_USER",s="SIGN_IN",l="SIGN_OUT";function c(e){return{type:o,data:e}}function u(e){return{type:r,patch:e}}function d(e){return{type:s,user:e}}function p(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return{type:l,soft:e}}function h(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(t.type){case r:var n=Object.assign({},e);return n.user=Object.assign({},e.user,t.patch),n;case o:var c=Object.assign({},e);return c.user=Object.assign({},e.user,t.data),c;case s:return Object.assign({},e,{signedIn:t.user});case l:return Object.assign({},e,{isAuthenticated:!1,isAnonymous:!0,signedOut:!t.soft});case a.oB:if(e.isAuthenticated&&e.user.id===t.userId){var u=Object.assign({},e);return u.user=Object.assign({},e.user,{avatars:t.avatars}),u}return e;case a.D9:if(e.isAuthenticated&&e.user.id===t.userId){var d=Object.assign({},e);return d.user=Object.assign({},e.user,{username:t.username,slug:t.slug}),d}return e;default:return e}}},993:(e,t,n)=>{"use strict";n.d(t,{AU:()=>c,E3:()=>m,T5:()=>p,UL:()=>u,ZP:()=>v,hN:()=>d,xv:()=>h});var a="OPEN_SITE_NAV",i="OPEN_SEARCH",o="OPEN_NOTIFICATIONS",r="OPEN_PRIVATE_THREADS",s="OPEN_USER_NAV",l="CLOSE_OVERLAYS";function c(){return{type:a}}function u(){return{type:i}}function d(){return{type:o}}function p(){return{type:s}}function h(){return{type:l}}var m={siteNav:!1,search:!1,notifications:!1,privateThreads:!1,userNav:!1};function v(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(t.type){case a:return Object.assign({},e,m,{siteNav:!0});case i:return Object.assign({},e,m,{search:!0});case o:return Object.assign({},e,m,{notifications:!0});case r:return Object.assign({},e,m,{privateThreads:!0});case s:return Object.assign({},e,m,{userNav:!0});case l:return Object.assign({},e,m);default:return e}}},8154:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>o,gx:()=>i});var a="REPLACE_PARTICIPANTS";function i(e){return{type:a,state:e}}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t.type===a?t.state:e}},59752:(e,t,n)=>{"use strict";n.d(t,{Ar:()=>p,Od:()=>m,ZB:()=>u,ZH:()=>s,ZP:()=>v,b9:()=>l,gx:()=>h,n6:()=>d});var a=n(30381),i=n.n(a),o="BUSY_POLL",r="RELEASE_POLL",s="REMOVE_POLL",l="REPLACE_POLL",c="UPDATE_POLL";function u(e){var t=!1;for(var n in e.choices)if(e.choices[n].selected){t=!0;break}return Object.assign({},e,{posted_on:i()(e.posted_on),hasSelectedChoices:t,endsOn:e.length?i()(e.posted_on).add(e.length,"days"):null,isBusy:!1})}function d(){return{type:o}}function p(){return{type:r}}function h(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:l,state:t?e:u(e)}}function m(){return{type:s}}function v(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(t.type){case o:return Object.assign({},e,{isBusy:!0});case r:return Object.assign({},e,{isBusy:!1});case s:return{isBusy:!1};case l:return t.state;case c:return Object.assign({},e,t.data);default:return e}}},92747:(e,t,n)=>{"use strict";n.d(t,{Qu:()=>r,ZB:()=>s,ZP:()=>u,r$:()=>c});var a=n(30381),i=n.n(a),o=n(6935),r="PATCH_POST";function s(e){return Object.assign({},e,{posted_on:i()(e.posted_on),updated_on:i()(e.updated_on),hidden_on:i()(e.hidden_on),attachments:e.attachments?e.attachments.map(l):null,poster:e.poster?(0,o.Ru)(e.poster):null,isSelected:!1,isBusy:!1,isDeleted:!1})}function l(e){return Object.assign({},e,{uploaded_on:i()(e.uploaded_on)})}function c(e,t){return{type:r,post:e,patch:t}}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t.type===r&&e.id==t.post.id?Object.assign({},e,t.patch):e}},21981:(e,t,n)=>{"use strict";n.d(t,{R3:()=>f,Rz:()=>Z,Vx:()=>g,Ys:()=>d,ZB:()=>m,ZP:()=>y,_H:()=>p,kR:()=>h,zD:()=>v});var a=n(92747),i="APPEND_POSTS",o="SELECT_POST",r="DESELECT_POST",s="DESELECT_POSTS",l="LOAD_POSTS",c="UNLOAD_POSTS",u="UPDATE_POSTS";function d(e){return{type:o,post:e}}function p(e){return{type:r,post:e}}function h(){return{type:s}}function m(e){return Object.assign({},e,{results:e.results.map(a.ZB),isLoaded:!0,isBusy:!1,isSelected:!1})}function v(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:l,state:t?e:m(e)}}function f(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:i,state:t?e:m(e)}}function Z(){return{type:c}}function g(e){return{type:u,update:e}}function y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(t.type){case o:var n=e.results.map((function(e){return e.id==t.post.id?Object.assign({},e,{isSelected:!0}):e}));return Object.assign({},e,{results:n});case r:var d=e.results.map((function(e){return e.id==t.post.id?Object.assign({},e,{isSelected:!1}):e}));return Object.assign({},e,{results:d});case s:var p=e.results.map((function(e){return Object.assign({},e,{isSelected:!1})}));return Object.assign({},e,{results:p});case i:var h=e.results.slice(),m=e.results.map((function(e){return e.id}));return t.state.results.map((function(e){-1===m.indexOf(e.id)&&h.push(e)})),Object.assign({},t.state,{results:h});case l:return t.state;case c:return Object.assign({},e,{isLoaded:!1});case u:return Object.assign({},e,t.update);case a.Qu:var v=e.results.map((function(e){return(0,a.ZP)(e,t)}));return Object.assign({},e,{results:v});default:return e}}},58598:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>o,zD:()=>i});var a="LOAD_DETAILS";function i(e){return{type:a,newState:e}}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t.type===a?t.newState:e}},27519:(e,t,n)=>{"use strict";n.d(t,{ZB:()=>l,ZP:()=>u,r$:()=>c});var a=n(30381),i=n.n(a),o=n(6935),r="HYDRATE_PROFILE",s="PATCH_PROFILE";function l(e){return{type:r,profile:e}}function c(e){return{type:s,patch:e}}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(t.type){case r:return Object.assign({},t.profile,{joined_on:i()(t.profile.joined_on),status:(0,o.$q)(t.profile.status)});case s:return Object.assign({},e,t.patch);case o.oB:return e.id===t.userId?Object.assign({},e,{avatars:t.avatars}):e;case o.D9:return e.id===t.userId?Object.assign({},e,{username:t.username,slug:t.slug}):e;default:return e}}},16427:(e,t,n)=>{"use strict";n.d(t,{E3:()=>r,P0:()=>l,Vx:()=>s,ZP:()=>c});var a="REPLACE_SEARCH",i="UPDATE_SEARCH",o="UPDATE_SEARCH_PROVIDER",r={isLoading:!1,query:"",providers:[]};function s(e){return{type:i,update:e}}function l(e){return{type:o,provider:e}}function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(t.type){case a:return t.state;case i:return Object.assign({},e,t.update);case o:return Object.assign({},e,{providers:e.providers.map((function(e){return e.id===t.provider.id?t.provider:e}))});default:return e}}},27346:(e,t,n)=>{"use strict";n.d(t,{E3:()=>a,OV:()=>r,ZP:()=>l,p2:()=>s});var a={type:"info",message:"",isVisible:!1},i="SHOW_SNACKBAR",o="HIDE_SNACKBAR";function r(e,t){return{type:i,message:e,messageType:t}}function s(){return{type:o}}function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t.type===i?{type:t.messageType,message:t.message,isVisible:!0}:t.type===o?Object.assign({},e,{isVisible:!1}):e}},7738:(e,t,n)=>{"use strict";n.d(t,{Ar:()=>h,Vx:()=>v,ZB:()=>d,ZP:()=>Z,gx:()=>m,n6:()=>p,y8:()=>f});var a=n(30381),i=n.n(a),o=n(59752),r="BUSY_THREAD",s="RELEASE_THREAD",l="REPLACE_THREAD",c="UPDATE_THREAD",u="UPDATE_THREAD_ACL";function d(e){return Object.assign({},e,{started_on:i()(e.started_on),last_post_on:i()(e.last_post_on),best_answer_marked_on:e.best_answer_marked_on?i()(e.best_answer_marked_on):null,isBusy:!1})}function p(){return{type:r}}function h(){return{type:s}}function m(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:l,state:t?e:d(e)}}function v(e){return{type:c,data:e}}function f(e){return{type:u,data:e}}function Z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(t.type){case r:return Object.assign({},e,{isBusy:!0});case s:return Object.assign({},e,{isBusy:!1});case o.ZH:return Object.assign({},e,{poll:null});case o.b9:return Object.assign({},e,{poll:t.state});case l:return t.state;case c:return Object.assign({},e,t.data);case u:var n=Object.assign({},e.acl,t.data);return Object.assign({},e,{acl:n});default:return e}}},85586:(e,t,n)=>{"use strict";n.d(t,{E3:()=>a,ZP:()=>r,bq:()=>o});var a={tick:0},i="TICK";function o(){return{type:i}}function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t.type===i?Object.assign({},e,{tick:e.tick+1}):e}},48927:(e,t,n)=>{"use strict";n.d(t,{KP:()=>u,R3:()=>d,ZB:()=>p,ZP:()=>m});var a=n(30381),i=n.n(a),o=n(6935),r=n(89759),s="ADD_NAME_CHANGE",l="APPEND_HISTORY",c="HYDRATE_HISTORY";function u(e,t,n){return{type:s,change:e,user:t,changedBy:n}}function d(e){return{type:l,items:e}}function p(e){return{type:c,items:e}}function h(e){return Object.assign({},e,{changed_on:i()(e.changed_on)})}function m(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(t.type){case s:var n=e.slice();return n.unshift({id:Math.floor(Date.now()/1e3),changed_by:t.changedBy,changed_by_username:t.changedBy.username,changed_on:i()(),new_username:t.change.username,old_username:t.user.username}),n;case l:return(0,r.Z)(e,t.items.map(h));case c:return t.items.map(h);case o.oB:return e.map((function(e){return(e=Object.assign({},e)).changed_by&&e.changed_by.id===t.userId&&(e.changed_by=Object.assign({},e.changed_by,{avatars:t.avatars})),e}));case o.D9:return e.map((function(e){return(e=Object.assign({},e)).changed_by&&e.changed_by.id===t.userId&&(e.changed_by=Object.assign({},e.changed_by,{username:t.username,slug:t.slug})),Object.assign({},e)}));default:return e}}},6935:(e,t,n)=>{"use strict";n.d(t,{$q:()=>p,D9:()=>c,R3:()=>u,Ru:()=>h,ZB:()=>d,ZP:()=>f,_S:()=>v,n1:()=>m,oB:()=>l});var a=n(30381),i=n.n(a),o=n(89759),r="APPEND_USERS",s="HYDRATE_USERS",l="UPDATE_AVATAR",c="UPDATE_USERNAME";function u(e){return{type:r,items:e}}function d(e){return{type:s,items:e}}function p(e){return e?Object.assign({},e,{last_click:e.last_click?i()(e.last_click):null,banned_until:e.banned_until?i()(e.banned_until):null}):null}function h(e){return Object.assign({},e,{joined_on:i()(e.joined_on),status:p(e.status)})}function m(e,t){return{type:l,userId:e.id,avatars:t}}function v(e,t,n){return{type:c,userId:e.id,username:t,slug:n}}function f(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(t.type){case r:return(0,o.Z)(e,t.items.map(h));case s:return t.items.map(h);case l:return e.map((function(e){return(e=Object.assign({},e)).id===t.userId&&(e.avatars=t.avatars),e}));default:return e}}},59180:()=>{document.body.addEventListener("click",(function(e){var t=e.target.getAttribute("misago-scroll-to");if(t){e.preventDefault();var n=document.querySelector(t);n&&n.scrollIntoView({behavior:"instant"})}}))},78657:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var a=n(15671),i=n(43144),o=n(19755);const r=new(function(){function e(){(0,a.Z)(this,e),this._cookieName=null,this._csrfToken=null,this._locks={}}return(0,i.Z)(e,[{key:"init",value:function(e){this._cookieName=e}},{key:"getCsrfToken",value:function(){if(-1!==document.cookie.indexOf(this._cookieName)){var e=new RegExp(this._cookieName+"=([^;]*)"),t=document.cookie.match(e)[0];return t?t.split("=")[1]:null}return null}},{key:"request",value:function(e,t,n){var a=this;return new Promise((function(i,r){var s={url:t,method:e,headers:{"X-CSRFToken":a.getCsrfToken()},data:n?JSON.stringify(n):null,contentType:"application/json; charset=utf-8",dataType:"json",success:function(e){i(e)},error:function(e){var t=e.responseJSON||{};t.status=e.status,0===t.status&&(t.detail=pgettext("ajax client error","Could not connect to the site.")),404===t.status&&(t.detail&&"NOT FOUND"!==t.detail||(t.detail=pgettext("ajax client error","Action link is invalid."))),500!==t.status||t.detail||(t.detail=pgettext("ajax client error","Unknown error has occurred.")),t.statusText=e.statusText,r(t)}};o.ajax(s)}))}},{key:"get",value:function(e,t,n){if(t&&(e+="?"+o.param(t)),n){var a=this;return this._locks[n]&&(this._locks[n].url=e),this._locks[n]&&this._locks[n].waiter?{then:function(){}}:this._locks[n]&&this._locks[n].wait?(this._locks[n].waiter=!0,new Promise((function(t,i){var o=function e(o){a._locks[n].wait?window.setTimeout((function(){e(o)}),300):a._locks[n].url!==o?e(a._locks[n].url):(a._locks[n].waiter=!1,a.request("GET",a._locks[n].url).then((function(i){a._locks[n].url===o?t(i):(a._locks[n].waiter=!0,e(a._locks[n].url))}),(function(t){a._locks[n].url===o?i(t):(a._locks[n].waiter=!0,e(a._locks[n].url))})))};window.setTimeout((function(){o(e)}),300)}))):(this._locks[n]={url:e,wait:!0,waiter:!1},new Promise((function(t,i){a.request("GET",e).then((function(i){a._locks[n].wait=!1,a._locks[n].url===e&&t(i)}),(function(t){a._locks[n].wait=!1,a._locks[n].url===e&&i(t)}))})))}return this.request("GET",e)}},{key:"post",value:function(e,t){return this.request("POST",e,t)}},{key:"patch",value:function(e,t){return this.request("PATCH",e,t)}},{key:"put",value:function(e,t){return this.request("PUT",e,t)}},{key:"delete",value:function(e,t){return this.request("DELETE",e,t)}},{key:"upload",value:function(e,t,n){var a=this;return new Promise((function(i,r){var s={url:e,method:"POST",headers:{"X-CSRFToken":a.getCsrfToken()},data:t,contentType:!1,processData:!1,xhr:function(){var e=new window.XMLHttpRequest;return e.upload.addEventListener("progress",(function(e){e.lengthComputable&&n(Math.round(e.loaded/e.total*100))}),!1),e},success:function(e){i(e)},error:function(e){var t=e.responseJSON||{};t.status=e.status,0===t.status&&(t.detail=pgettext("api error","Could not connect to the site.")),413!==t.status||t.detail||(t.detail=pgettext("api error","Upload was rejected by the site as too large.")),404===t.status&&(t.detail&&"NOT FOUND"!==t.detail||(t.detail=pgettext("api error","Action link is invalid."))),500!==t.status||t.detail||(t.detail=pgettext("api error","Unknown error has occurred.")),t.statusText=e.statusText,r(t)}};o.ajax(s)}))}}]),e}())},98274:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var a=n(15671),i=n(43144),o=n(35486);const r=new(function(){function e(){(0,a.Z)(this,e)}return(0,i.Z)(e,[{key:"init",value:function(e,t,n){this._store=e,this._local=t,this._modal=n,this.syncSession(),this.watchState()}},{key:"syncSession",value:function(){var e=this._store.getState().auth;e.isAuthenticated?this._local.set("auth",{isAuthenticated:!0,username:e.user.username}):this._local.set("auth",{isAuthenticated:!1})}},{key:"watchState",value:function(){var e=this,t=this._store.getState().auth;this._local.watch("auth",(function(n){n.isAuthenticated?e._store.dispatch((0,o.zB)({username:n.username})):t.isAuthenticated&&e._store.dispatch((0,o.w7)())})),this._modal.hide()}},{key:"signIn",value:function(e){this._store.dispatch((0,o.zB)(e)),this._local.set("auth",{isAuthenticated:!0,username:e.username}),this._modal.hide()}},{key:"signOut",value:function(){this._store.dispatch((0,o.w7)()),this._local.set("auth",{isAuthenticated:!1}),this._modal.hide()}},{key:"softSignOut",value:function(){this._store.dispatch((0,o.w7)(!0)),this._local.set("auth",{isAuthenticated:!1}),this._modal.hide()}}]),e}())},93825:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>y});var a,i=n(22928),o=n(79340),r=n(6215),s=n(61120),l=n(15671),c=n(43144),u=n(57588),d=n.n(u),p=n(96359);function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=(0,s.Z)(e);if(t){var i=(0,s.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,r.Z)(this,n)}}var m=function(){function e(){(0,l.Z)(this,e)}return(0,c.Z)(e,[{key:"init",value:function(e,t,n,a){this._context=e,this._ajax=t,this._include=n,this._snackbar=a}}]),e}(),v=function(e){(0,o.Z)(n,e);var t=h(n);function n(){return(0,l.Z)(this,n),t.apply(this,arguments)}return(0,c.Z)(n,[{key:"load",value:function(){return new Promise((function(e){e()}))}},{key:"validator",value:function(){return null}},{key:"component",value:function(){return null}}]),n}(m),f=function(e){(0,o.Z)(n,e);var t=h(n);function n(){return(0,l.Z)(this,n),t.apply(this,arguments)}return(0,c.Z)(n,[{key:"load",value:function(){var e=this;return new Promise((function(t,n){e._ajax.get(e._context.get("CAPTCHA_API")).then((function(n){e.question=n.question,e.helpText=n.help_text,t()}),(function(){e._snackbar.error(pgettext("captcha field","Failed to load CAPTCHA.")),n()}))}))}},{key:"validator",value:function(){return[]}},{key:"component",value:function(e){return(0,i.Z)(p.Z,{label:this.question,for:"id_captcha",labelClass:e.labelClass||"",controlClass:e.controlClass||"",validation:e.form.state.errors.captcha,helpText:this.helpText||null},void 0,(0,i.Z)("input",{"aria-describedby":"id_captcha_status",className:"form-control",disabled:e.form.state.isLoading,id:"id_captcha",onChange:e.form.bindInput("captcha"),type:"text",value:e.form.state.captcha}))}}]),n}(m),Z=function(e){(0,o.Z)(n,e);var t=h(n);function n(){return(0,l.Z)(this,n),t.apply(this,arguments)}return(0,c.Z)(n,[{key:"componentDidMount",value:function(){var e=this;grecaptcha.render("recaptcha",{sitekey:this.props.siteKey,callback:function(t){e.props.binding({target:{value:t}})}})}},{key:"render",value:function(){return a||(a=(0,i.Z)("div",{id:"recaptcha"}))}}]),n}(d().Component),g=function(e){(0,o.Z)(n,e);var t=h(n);function n(){return(0,l.Z)(this,n),t.apply(this,arguments)}return(0,c.Z)(n,[{key:"load",value:function(){return this._include.include("https://www.google.com/recaptcha/api.js",!0),new Promise((function(e){!function t(){"undefined"==typeof grecaptcha?window.setTimeout((function(){t()}),200):e()}()}))}},{key:"validator",value:function(){return[]}},{key:"component",value:function(e){return(0,i.Z)(p.Z,{label:pgettext("captcha field","Please solve the quick test"),for:"id_captcha",labelClass:e.labelClass||"",controlClass:e.controlClass||"",validation:e.form.state.errors.captcha,helpText:pgettext("captcha field","This test helps us prevent automated spam registrations on the site.")},void 0,(0,i.Z)(Z,{binding:e.form.bindInput("captcha"),siteKey:this._context.get("SETTINGS").recaptcha_site_key}))}}]),n}(m);const y=new(function(){function e(){(0,l.Z)(this,e)}return(0,c.Z)(e,[{key:"init",value:function(e,t,n,a){switch(e.get("SETTINGS").captcha_type){case"no":this._captcha=new v;break;case"qa":this._captcha=new f;break;case"re":this._captcha=new g}this._captcha.init(e,t,n,a)}},{key:"load",value:function(){return this._captcha.load()}},{key:"validator",value:function(){return this._captcha.validator()}},{key:"component",value:function(e){return this._captcha.component(e)}}]),e}())},96142:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var a=n(15671),i=n(43144),o=n(19755);const r=new(function(){function e(){(0,a.Z)(this,e)}return(0,i.Z)(e,[{key:"init",value:function(e){this._staticUrl=e,this._included=[]}},{key:"include",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];-1===this._included.indexOf(e)&&(this._included.push(e),this._include(e,t))}},{key:"_include",value:function(e,t){o.ajax({url:(t?"":this._staticUrl)+e,cache:!0,dataType:"script"})}}]),e}())},62833:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var a=n(15671),i=n(43144),o=window.localStorage;const r=new(function(){function e(){(0,a.Z)(this,e)}return(0,i.Z)(e,[{key:"init",value:function(e){var t=this;this._prefix=e,this._watchers=[],window.addEventListener("storage",(function(e){var n=JSON.parse(e.newValue);t._watchers.forEach((function(t){t.key===e.key&&e.oldValue!==e.newValue&&t.callback(n)}))}))}},{key:"set",value:function(e,t){o.setItem(this._prefix+e,JSON.stringify(t))}},{key:"get",value:function(e){var t=o.getItem(this._prefix+e);return t?JSON.parse(t):null}},{key:"watch",value:function(e,t){this._watchers.push({key:this._prefix+e,callback:t})}}]),e}())},59801:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var a=n(15671),i=n(43144),o=n(73935),r=n.n(o),s=n(4869),l=n(19755);const c=new(function(){function e(){(0,a.Z)(this,e)}return(0,i.Z)(e,[{key:"init",value:function(e){var t=this;this._element=e,this._modal=l(e).modal({show:!1}),this._modal.on("hidden.bs.modal",(function(){r().unmountComponentAtNode(t._element)}))}},{key:"show",value:function(e){(0,s.Z)(e,this._element.id),this._modal.modal("show")}},{key:"hide",value:function(){this._modal.modal("hide")}}]),e}())},53328:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var a=n(15671),i=n(43144);const o=new(function(){function e(){(0,a.Z)(this,e)}return(0,i.Z)(e,[{key:"init",value:function(e,t){this._indexTitle=e,this._forumName=t}},{key:"set",value:function(e){if(e){"string"==typeof e&&(e={title:e});var t=e.title;e.page>1&&(t+=" ("+interpolate(pgettext("page title pagination","page: %(page)s"),{page:e.page},!0)+")"),e.parent&&(t+=" | "+e.parent),document.title=t+" | "+this._forumName}else document.title=this._indexTitle||this._forumName}}]),e}())},55547:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var a=n(15671),i=n(43144);const o=new(function(){function e(){(0,a.Z)(this,e)}return(0,i.Z)(e,[{key:"init",value:function(e,t){this._ajax=e,this._snackbar=t,this._polls={}}},{key:"start",value:function(e){var t=this;this.stop(e.poll);var n=function n(){t._polls[e.poll]=e,t._ajax.get(e.url,e.data||null).then((function(a){t._polls[e.poll]._stopped||(e.update(a),t._polls[e.poll].timeout=window.setTimeout(n,e.frequency))}),(function(n){t._polls[e.poll]._stopped||(e.error?e.error(n):t._snackbar.apiError(n))}))};e.delayed?this._polls[e.poll]={timeout:window.setTimeout(n,e.frequency)}:n()}},{key:"stop",value:function(e){this._polls[e]&&(window.clearTimeout(this._polls[e].timeout),this._polls[e]._stopped=!0)}}]),e}())},64646:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var a=n(15671),i=n(43144),o=n(4942),r=n(57588),s=n.n(r),l=n(73935),c=n.n(l),u=n(9771),d=n(4869);const p=new(function(){function e(){var t=this;(0,a.Z)(this,e),(0,o.Z)(this,"close",(function(){t.unsetBeforeUnload(),t._props=null,t._isOpen&&!t._isClosing&&(t._isClosing=!0,t._mount.classList.remove("show"),window.setTimeout((function(){c().unmountComponentAtNode(t._mount),t._observer.unobserve(t._mount),t._spacer.style.height="0px;",t._isClosing=!1,t._isOpen=!1,t._mode=null}),300))}))}return(0,i.Z)(e,[{key:"init",value:function(e,t,n){var a=this;this._ajax=e,this._snackbar=t,this._mount=n,this._mode=null,this._spacer=document.getElementById("posting-spacer"),this._observer=new ResizeObserver((function(e){a._spacer.style.height=e[0].contentRect.height+"px"})),this._isOpen=!1,this._isClosing=!1,this._beforeunloadSet=!1,this._props=null}},{key:"isOpen",value:function(){return this._isOpen}},{key:"setBeforeUnload",value:function(){this._beforeunloadSet||(window.addEventListener("beforeunload",this.beforeUnload,{capture:!0}),this._beforeunloadSet=!0)}},{key:"unsetBeforeUnload",value:function(){window.removeEventListener("beforeunload",this.beforeUnload,{capture:!0}),this._beforeunloadSet=!1}},{key:"beforeUnload",value:function(e){return e.returnValue="true","true"}},{key:"open",value:function(e){if(!1===this._isOpen)"QUOTE"===e.mode?this._mode="REPLY":this._mode=e.mode,this._isOpen=e.submit,this._realOpen(Object.assign({},e,{mode:this._mode}));else if("QUOTE"===e.mode)this._realOpen(Object.assign({},this._props,{config:e.config,context:e.context}));else if(this._isOpen!==e.submit){var t=gettext("You are already working on other message. Do you want to discard it?");window.confirm(t)&&(this._mode=e.mode,this._isOpen=e.submit,this._realOpen(e))}else"REPLY"==this._mode&&"REPLY"==e.mode&&this._realOpen(e)}},{key:"_realOpen",value:function(e){(0,d.Z)(s().createElement(u.ZP,e),this._mount.id),this._props=e,this._mount.classList.add("show"),this._observer.observe(this._mount),this.setBeforeUnload()}}]),e}())},53904:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var a=n(15671),i=n(43144),o=n(4942),r=n(27346);const s=new(function(){function e(){var t=this;(0,a.Z)(this,e),(0,o.Z)(this,"alert",(function(e,n){t._timeout?(window.clearTimeout(t._timeout),t._store.dispatch((0,r.p2)()),t._timeout=window.setTimeout((function(){t._timeout=null,t.alert(e,n)}),300)):(t._store.dispatch((0,r.OV)(e,n)),t._timeout=window.setTimeout((function(){t._store.dispatch((0,r.p2)()),t._timeout=null}),5e3))})),(0,o.Z)(this,"info",(function(e){t.alert(e,"info")})),(0,o.Z)(this,"success",(function(e){t.alert(e,"success")})),(0,o.Z)(this,"warning",(function(e){t.alert(e,"warning")})),(0,o.Z)(this,"error",(function(e){t.alert(e,"error")})),(0,o.Z)(this,"apiError",(function(e){var n=e.data?e.data.detail:e.detail;n||(n=0===e.status?pgettext("api error","Could not connect to the site."):404===e.status?pgettext("api error","Action link is invalid."):pgettext("api error","Unknown error has occurred.")),403===e.status&&"Permission denied"===n&&(n=pgettext("api error","You don't have permission to perform this action.")),t.error(n)}))}return(0,i.Z)(e,[{key:"init",value:function(e){this._store=e,this._timeout=null}}]),e}())},90287:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var a=n(15671),i=n(43144),o=n(41438);const r=new(function(){function e(){(0,a.Z)(this,e),this._store=null,this._reducers={},this._initialState={}}return(0,i.Z)(e,[{key:"addReducer",value:function(e,t,n){this._reducers[e]=t,this._initialState[e]=n}},{key:"init",value:function(){this._store=(0,o.createStore)((0,o.combineReducers)(this._reducers),this._initialState)}},{key:"getStore",value:function(){return this._store}},{key:"getState",value:function(){return this._store.getState()}},{key:"dispatch",value:function(e){return this._store.dispatch(e)}}]),e}())},59940:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var a=n(15671),i=n(43144);const o=new(function(){function e(){(0,a.Z)(this,e)}return(0,i.Z)(e,[{key:"init",value:function(e){this._include=e,this._isLoaded=!1}},{key:"scorePassword",value:function(e,t){return this._isLoaded?zxcvbn(e,t).score:0}},{key:"load",value:function(){return this._isLoaded?this._loadedPromise():(this._include.include("misago/js/zxcvbn.js"),this._loadingPromise())}},{key:"_loadingPromise",value:function(){var e=this;return new Promise((function(t,n){!function a(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;(i+=1)>200?n():"undefined"==typeof zxcvbn?window.setTimeout((function(){a(i)}),200):(e._isLoaded=!0,t())}()}))}},{key:"_loadedPromise",value:function(){return new Promise((function(e){e()}))}}]),e}())},93051:(e,t,n)=>{"use strict";n.d(t,{Z:()=>k});var a,i=n(22928),o=n(30381),r=n.n(o),s=n(57588),l=n.n(s),c=n(73935),u=n.n(c),d=n(37424),p=n(15671),h=n(43144),m=n(79340),v=n(6215),f=n(61120);var Z=function(e){(0,m.Z)(s,e);var t,n,o=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,f.Z)(t);if(n){var i=(0,f.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,v.Z)(this,e)});function s(){return(0,p.Z)(this,s),o.apply(this,arguments)}return(0,h.Z)(s,[{key:"getReasonMessage",value:function(){return this.props.message.html?(0,i.Z)("div",{className:"lead",dangerouslySetInnerHTML:{__html:this.props.message.html}}):(0,i.Z)("p",{className:"lead"},void 0,this.props.message.plain)}},{key:"getExpirationMessage",value:function(){if(this.props.expires){if(this.props.expires.isAfter(r()())){var e=interpolate(pgettext("banned page","This ban expires on %(expires_on)s."),{expires_on:this.props.expires.format("LL, LT")},!0),t=interpolate(pgettext("banned page","This ban expires %(expires_on)s."),{expires_on:this.props.expires.fromNow()},!0);return(0,i.Z)("abbr",{title:e},void 0,t)}return pgettext("banned page","This ban has expired.")}return pgettext("banned page","This ban is permanent.")}},{key:"render",value:function(){return(0,i.Z)("div",{className:"page page-error page-error-banned"},void 0,(0,i.Z)("div",{className:"container"},void 0,(0,i.Z)("div",{className:"message-panel"},void 0,a||(a=(0,i.Z)("div",{className:"message-icon"},void 0,(0,i.Z)("span",{className:"material-icon"},void 0,"highlight_off"))),(0,i.Z)("div",{className:"message-body"},void 0,this.getReasonMessage(),(0,i.Z)("p",{className:"message-footnote"},void 0,this.getExpirationMessage())))))}}]),s}(l().Component),g=n(34458),y=n(90287),b=(0,d.$j)((function(e){return e.tick}))(Z);function k(e,t){if(u().render((0,i.Z)(d.zt,{store:y.Z.getStore()},void 0,(0,i.Z)(b,{message:e.message,expires:e.expires_on?r()(e.expires_on):null})),document.getElementById("page-mount")),void 0===t||t){var n=g.Z.get("SETTINGS").forum_name;document.title=pgettext("banned error title","You are banned")+" | "+n,window.history.pushState({},"",g.Z.get("BANNED_URL"))}}},69130:(e,t,n)=>{"use strict";function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=[],i=[];if(e.forEach((function(e){i.push(e),i.length===t&&(a.push(i),i=[])})),!1!==n&&i.length>0&&i.length<t)for(var o=i.length;o<t;o++)i.push(n);return i.length&&a.push(i),a}n.d(t,{Z:()=>a})},89759:(e,t,n)=>{"use strict";function a(e,t){var n=[];return e.concat(t).filter((function(e){return-1===n.indexOf(e.id)&&(n.push(e.id),!0)}))}n.d(t,{Z:()=>a})},89627:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var a={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};function i(e){return e.replace(/[&<>"']/g,(function(e){return a[e]}))}},48772:(e,t,n)=>{"use strict";function a(e){return e>1073741824?i(e/1073741824)+" GB":e>1048576?i(e/1048576)+" MB":e>1024?i(e/1024)+" KB":i(e)+" B"}function i(e){return e.toFixed(1)}n.d(t,{Z:()=>a})},54031:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>o});var a="12345678990abcdefghijklmnopqrstuvwxyz",i=a.length;function o(e){for(var t=[],n=0;n<e;n++){var o=Math.floor(Math.random()*i);t.push(a[o])}return t.join("")}},4869:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var a=n(22928),i=(n(57588),n(73935)),o=n.n(i),r=n(37424),s=n(90287);function l(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=document.getElementById(t),l=e.props?e:(0,a.Z)(e,{});i&&(n?o().render((0,a.Z)(r.zt,{store:s.Z.getStore()},void 0,l),i):o().render(l,i))}},44039:(e,t,n)=>{"use strict";function a(e,t){return Math.floor(Math.random()*(t-e+1))+e}n.d(t,{e:()=>a})},39633:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var a=n(22928),i=(n(57588),n(73935)),o=n.n(i),r=n(37424),s=n(69987),l=n(90287),c=document.getElementById("page-mount");function u(e){var t={component:e.component||null,childRoutes:[]};e.root?t.childRoutes=[{path:e.root,onEnter:function(t,n){n(null,e.paths[0].path)}}].concat(e.paths):t.childRoutes=e.paths,o().render((0,a.Z)(r.zt,{store:l.Z.getStore()},void 0,(0,a.Z)(s.F0,{routes:t,history:s.mW})),c)}},55210:(e,t,n)=>{"use strict";n.d(t,{BS:()=>d,C1:()=>r,Do:()=>c,Ei:()=>u,HR:()=>p,Vb:()=>v,fT:()=>s,gS:()=>h,jA:()=>l,lG:()=>m});var a=/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i,i=new RegExp("^[0-9a-z_]+$","i"),o=new RegExp("[0-9a-z]","i");function r(e){return function(t){if(!1===t||null===t||0===String(t).trim().length)return e||gettext("This field is required.")}}function s(e){var t=pgettext("agreement validator","You have to accept the terms of service.");return r(e||t)}function l(e){var t=pgettext("agreement validator","You have to accept the privacy policy.");return r(e||t)}function c(e){return function(t){if(!a.test(t))return e||pgettext("email validator","Enter a valid e-mail address.")}}function u(e,t){return function(n){var a="",i=n.trim().length;if(i<e)return a=t?t(e,i):npgettext("value length validator","Ensure this value has at least %(limit_value)s character (it has %(show_value)s).","Ensure this value has at least %(limit_value)s characters (it has %(show_value)s).",e),interpolate(a,{limit_value:e,show_value:i},!0)}}function d(e,t){return function(n){var a="",i=n.trim().length;if(i>e)return a=t?t(e,i):npgettext("value length validator","Ensure this value has at most %(limit_value)s character (it has %(show_value)s).","Ensure this value has at most %(limit_value)s characters (it has %(show_value)s).",e),interpolate(a,{limit_value:e,show_value:i},!0)}}function p(e){return u(e,(function(e){return npgettext("username length validator","Username must be at least %(limit_value)s character long.","Username must be at least %(limit_value)s characters long.",e)}))}function h(e){return d(e,(function(e){return npgettext("username length validator","Username cannot be longer than %(limit_value)s character.","Username cannot be longer than %(limit_value)s characters.",e)}))}function m(){return function(e){var t=e.trim();return i.test(t)?o.test(t)?void 0:pgettext("username validator","Username must contain Latin alphabet letters or digits."):pgettext("username validator","Username can only contain Latin alphabet letters, digits, and an underscore sign.")}}function v(e){return function(t){var n=t.length;if(n<e){var a=npgettext("password length validator","Valid password must be at least %(limit_value)s character long.","Valid password must be at least %(limit_value)s characters long.",e);return interpolate(a,{limit_value:e,show_value:n},!0)}}}},46700:(e,t,n)=>{var a={"./af":42786,"./af.js":42786,"./ar":30867,"./ar-dz":14130,"./ar-dz.js":14130,"./ar-kw":96135,"./ar-kw.js":96135,"./ar-ly":56440,"./ar-ly.js":56440,"./ar-ma":47702,"./ar-ma.js":47702,"./ar-sa":16040,"./ar-sa.js":16040,"./ar-tn":37100,"./ar-tn.js":37100,"./ar.js":30867,"./az":31083,"./az.js":31083,"./be":9808,"./be.js":9808,"./bg":68338,"./bg.js":68338,"./bm":67438,"./bm.js":67438,"./bn":8905,"./bn-bd":76225,"./bn-bd.js":76225,"./bn.js":8905,"./bo":11560,"./bo.js":11560,"./br":1278,"./br.js":1278,"./bs":80622,"./bs.js":80622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":50877,"./cv.js":50877,"./cy":47373,"./cy.js":47373,"./da":24780,"./da.js":24780,"./de":59740,"./de-at":60217,"./de-at.js":60217,"./de-ch":60894,"./de-ch.js":60894,"./de.js":59740,"./dv":5300,"./dv.js":5300,"./el":50837,"./el.js":50837,"./en-au":78348,"./en-au.js":78348,"./en-ca":77925,"./en-ca.js":77925,"./en-gb":22243,"./en-gb.js":22243,"./en-ie":46436,"./en-ie.js":46436,"./en-il":47207,"./en-il.js":47207,"./en-in":44175,"./en-in.js":44175,"./en-nz":76319,"./en-nz.js":76319,"./en-sg":31662,"./en-sg.js":31662,"./eo":92915,"./eo.js":92915,"./es":55655,"./es-do":55251,"./es-do.js":55251,"./es-mx":96112,"./es-mx.js":96112,"./es-us":71146,"./es-us.js":71146,"./es.js":55655,"./et":5603,"./et.js":5603,"./eu":77763,"./eu.js":77763,"./fa":76959,"./fa.js":76959,"./fi":11897,"./fi.js":11897,"./fil":42549,"./fil.js":42549,"./fo":94694,"./fo.js":94694,"./fr":94470,"./fr-ca":63049,"./fr-ca.js":63049,"./fr-ch":52330,"./fr-ch.js":52330,"./fr.js":94470,"./fy":5044,"./fy.js":5044,"./ga":29295,"./ga.js":29295,"./gd":2101,"./gd.js":2101,"./gl":38794,"./gl.js":38794,"./gom-deva":27884,"./gom-deva.js":27884,"./gom-latn":23168,"./gom-latn.js":23168,"./gu":95349,"./gu.js":95349,"./he":24206,"./he.js":24206,"./hi":30094,"./hi.js":30094,"./hr":30316,"./hr.js":30316,"./hu":22138,"./hu.js":22138,"./hy-am":11423,"./hy-am.js":11423,"./id":29218,"./id.js":29218,"./is":90135,"./is.js":90135,"./it":90626,"./it-ch":10150,"./it-ch.js":10150,"./it.js":90626,"./ja":39183,"./ja.js":39183,"./jv":24286,"./jv.js":24286,"./ka":12105,"./ka.js":12105,"./kk":47772,"./kk.js":47772,"./km":18758,"./km.js":18758,"./kn":79282,"./kn.js":79282,"./ko":33730,"./ko.js":33730,"./ku":1408,"./ku.js":1408,"./ky":33291,"./ky.js":33291,"./lb":36841,"./lb.js":36841,"./lo":55466,"./lo.js":55466,"./lt":57010,"./lt.js":57010,"./lv":37595,"./lv.js":37595,"./me":39861,"./me.js":39861,"./mi":35493,"./mi.js":35493,"./mk":95966,"./mk.js":95966,"./ml":87341,"./ml.js":87341,"./mn":5115,"./mn.js":5115,"./mr":10370,"./mr.js":10370,"./ms":9847,"./ms-my":41237,"./ms-my.js":41237,"./ms.js":9847,"./mt":72126,"./mt.js":72126,"./my":56165,"./my.js":56165,"./nb":64924,"./nb.js":64924,"./ne":16744,"./ne.js":16744,"./nl":93901,"./nl-be":59814,"./nl-be.js":59814,"./nl.js":93901,"./nn":83877,"./nn.js":83877,"./oc-lnc":92135,"./oc-lnc.js":92135,"./pa-in":15858,"./pa-in.js":15858,"./pl":64495,"./pl.js":64495,"./pt":89520,"./pt-br":57971,"./pt-br.js":57971,"./pt.js":89520,"./ro":96459,"./ro.js":96459,"./ru":21793,"./ru.js":21793,"./sd":40950,"./sd.js":40950,"./se":10490,"./se.js":10490,"./si":90124,"./si.js":90124,"./sk":64249,"./sk.js":64249,"./sl":14985,"./sl.js":14985,"./sq":51104,"./sq.js":51104,"./sr":49131,"./sr-cyrl":79915,"./sr-cyrl.js":79915,"./sr.js":49131,"./ss":85893,"./ss.js":85893,"./sv":98760,"./sv.js":98760,"./sw":91172,"./sw.js":91172,"./ta":27333,"./ta.js":27333,"./te":23110,"./te.js":23110,"./tet":52095,"./tet.js":52095,"./tg":27321,"./tg.js":27321,"./th":9041,"./th.js":9041,"./tk":19005,"./tk.js":19005,"./tl-ph":75768,"./tl-ph.js":75768,"./tlh":89444,"./tlh.js":89444,"./tr":72397,"./tr.js":72397,"./tzl":28254,"./tzl.js":28254,"./tzm":51106,"./tzm-latn":30699,"./tzm-latn.js":30699,"./tzm.js":51106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":67691,"./uk.js":67691,"./ur":13795,"./ur.js":13795,"./uz":6791,"./uz-latn":60588,"./uz-latn.js":60588,"./uz.js":6791,"./vi":65666,"./vi.js":65666,"./x-pseudo":14378,"./x-pseudo.js":14378,"./yo":75805,"./yo.js":75805,"./zh-cn":83839,"./zh-cn.js":83839,"./zh-hk":55726,"./zh-hk.js":55726,"./zh-mo":99807,"./zh-mo.js":99807,"./zh-tw":74152,"./zh-tw.js":74152};function i(e){var t=o(e);return n(t)}function o(e){if(!n.o(a,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return a[e]}i.keys=function(){return Object.keys(a)},i.resolve=o,e.exports=i,i.id=46700}},i={};function o(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={id:e,loaded:!1,exports:{}};return a[e].call(n.exports,n,n.exports,o),n.loaded=!0,n.exports}o.m=a,e=[],o.O=(t,n,a,i)=>{if(!n){var r=1/0;for(u=0;u<e.length;u++){for(var[n,a,i]=e[u],s=!0,l=0;l<n.length;l++)(!1&i||r>=i)&&Object.keys(o.O).every((e=>o.O[e](n[l])))?n.splice(l--,1):(s=!1,i<r&&(r=i));if(s){e.splice(u--,1);var c=a();void 0!==c&&(t=c)}}return t}i=i||0;for(var u=e.length;u>0&&e[u-1][2]>i;u--)e[u]=e[u-1];e[u]=[n,a,i]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,n)=>(o.f[n](e,t),t)),[])),o.u=e=>"hljs.js",o.miniCssF=e=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},n="misago:",o.l=(e,a,i,r)=>{if(t[e])t[e].push(a);else{var s,l;if(void 0!==i)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var d=c[u];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==n+i){s=d;break}}s||(l=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,o.nc&&s.setAttribute("nonce",o.nc),s.setAttribute("data-webpack",n+i),s.src=e),t[e]=[a];var p=(n,a)=>{s.onerror=s.onload=null,clearTimeout(h);var i=t[e];if(delete t[e],s.parentNode&&s.parentNode.removeChild(s),i&&i.forEach((e=>e(a))),n)return n(a)},h=setTimeout(p.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=p.bind(null,s.onerror),s.onload=p.bind(null,s.onload),l&&document.head.appendChild(s)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),(()=>{var e={174:0};o.f.j=(t,n)=>{var a=o.o(e,t)?e[t]:void 0;if(0!==a)if(a)n.push(a[2]);else{var i=new Promise(((n,i)=>a=e[t]=[n,i]));n.push(a[2]=i);var r=o.p+o.u(t),s=new Error;o.l(r,(n=>{if(o.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var i=n&&("load"===n.type?"missing":n.type),r=n&&n.target&&n.target.src;s.message="Loading chunk "+t+" failed.\n("+i+": "+r+")",s.name="ChunkLoadError",s.type=i,s.request=r,a[1](s)}}),"chunk-"+t,t)}},o.O.j=t=>0===e[t];var t=(t,n)=>{var a,i,[r,s,l]=n,c=0;if(r.some((t=>0!==e[t]))){for(a in s)o.o(s,a)&&(o.m[a]=s[a]);if(l)var u=l(o)}for(t&&t(n);c<r.length;c++)i=r[c],o.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return o.O(u)},n=self.webpackChunkmisago=self.webpackChunkmisago||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),o.O(void 0,[736],(()=>o(34458))),o.O(void 0,[736],(()=>o(58339))),o.O(void 0,[736],(()=>o(64109))),o.O(void 0,[736],(()=>o(46226))),o.O(void 0,[736],(()=>o(93240))),o.O(void 0,[736],(()=>o(75147))),o.O(void 0,[736],(()=>o(4894))),o.O(void 0,[736],(()=>o(29223))),o.O(void 0,[736],(()=>o(73806))),o.O(void 0,[736],(()=>o(27015))),o.O(void 0,[736],(()=>o(88097))),o.O(void 0,[736],(()=>o(46016))),o.O(void 0,[736],(()=>o(32488))),o.O(void 0,[736],(()=>o(11768))),o.O(void 0,[736],(()=>o(61323))),o.O(void 0,[736],(()=>o(64752))),o.O(void 0,[736],(()=>o(40949))),o.O(void 0,[736],(()=>o(78679))),o.O(void 0,[736],(()=>o(61814))),o.O(void 0,[736],(()=>o(95920))),o.O(void 0,[736],(()=>o(44095))),o.O(void 0,[736],(()=>o(63290))),o.O(void 0,[736],(()=>o(77031))),o.O(void 0,[736],(()=>o(97751))),o.O(void 0,[736],(()=>o(76093))),o.O(void 0,[736],(()=>o(87336))),o.O(void 0,[736],(()=>o(47549))),o.O(void 0,[736],(()=>o(22331))),o.O(void 0,[736],(()=>o(21513))),o.O(void 0,[736],(()=>o(98749))),o.O(void 0,[736],(()=>o(98251))),o.O(void 0,[736],(()=>o(6720))),o.O(void 0,[736],(()=>o(66806))),o.O(void 0,[736],(()=>o(10846))),o.O(void 0,[736],(()=>o(18255))),o.O(void 0,[736],(()=>o(14113))),o.O(void 0,[736],(()=>o(24444))),o.O(void 0,[736],(()=>o(1764))),o.O(void 0,[736],(()=>o(68351))),o.O(void 0,[736],(()=>o(81521))),o.O(void 0,[736],(()=>o(68585))),o.O(void 0,[736],(()=>o(41229))),o.O(void 0,[736],(()=>o(43589))),o.O(void 0,[736],(()=>o(62894))),o.O(void 0,[736],(()=>o(33934))),o.O(void 0,[736],(()=>o(85577))),o.O(void 0,[736],(()=>o(83526))),o.O(void 0,[736],(()=>o(43060))),o.O(void 0,[736],(()=>o(92292))),o.O(void 0,[736],(()=>o(33409)));var r=o.O(void 0,[736],(()=>o(31341)));r=o.O(r)})();
 //# sourceMappingURL=misago.js.map
\ No newline at end of file


Test patch:
diff --git a/misago/parser/tests/test_urls.py b/misago/parser/tests/test_urls.py
index 5431c56c2..d1ea79401 100644
--- a/misago/parser/tests/test_urls.py
+++ b/misago/parser/tests/test_urls.py
@@ -21,6 +21,7 @@ from ..patterns.urls import clean_url
         "www.example.com",
         "www.sub.domain.example-test.com/lorem?ipsum=123",
         "https://misago-project.org",
+        "https://i.ytimg.com/vi/aaaaaa/hq720.jpg?sqp=-oaymw&rs=AOn4C-KhMkw",
         "/t/table-test/1346/",
         "/a/thumb/fI7RjdAPf2Uk1i60QZpzbwRSCKOzT0T9ZF6omFHwXu0WLPWgHVLMnHgpqtnsiOsK/599/?shva=1",
     ),