diff --git a/devproject/test_settings.py b/devproject/test_settings.py index 9a76d9006c..a605a4ba4e 100644 --- a/devproject/test_settings.py +++ b/devproject/test_settings.py @@ -38,6 +38,9 @@ # Test assertions expect english locale LANGUAGE_CODE = "en-us" +# Test assertions expect specific TZ +TIME_ZONE = "UTC" + # Register test post validator MISAGO_POST_VALIDATORS = ["misago.core.testproject.validators.test_post_validator"] diff --git a/frontend/src/formats.js b/frontend/src/formats.js index 7754db2ad9..81b623349b 100644 --- a/frontend/src/formats.js +++ b/frontend/src/formats.js @@ -1,15 +1,15 @@ export const locale = window.misago_locale || "en-us" export const momentAgo = pgettext("time ago", "moment ago") -export const momentAgoNarrow = pgettext("time ago", "now") +export const momentAgoShort = pgettext("time ago", "now") export const dayAt = pgettext("day at time", "%(day)s at %(time)s") -export const soonAt = pgettext("day at time", "at %(time)s") +export const soonAt = pgettext("day at time", "Today at %(time)s") export const tomorrowAt = pgettext("day at time", "Tomorrow at %(time)s") export const yesterdayAt = pgettext("day at time", "Yesterday at %(time)s") -export const minuteShort = pgettext("short minutes", "%(time)sm") -export const hourShort = pgettext("short hours", "%(time)sh") -export const dayShort = pgettext("short days", "%(time)sd") +export const minutesShort = pgettext("short minutes", "%(time)sm") +export const hoursShort = pgettext("short hours", "%(time)sh") +export const daysShort = pgettext("short days", "%(time)sd") export const thisYearShort = pgettext("short month", "%(day)s %(month)s") export const otherYearShort = pgettext("short month", "%(month)s %(year)s") @@ -57,12 +57,12 @@ export function dateRelative(date) { } if (absDiff < 60 * 47) { - const minutes = Math.ceil(absDiff / 60) * sign + const minutes = Math.round(absDiff / 60) * sign return relativeNumeric.format(minutes, "minute") } if (absDiff < 3600 * 3) { - const hours = Math.ceil(absDiff / 3600) * sign + const hours = Math.round(absDiff / 3600) * sign return relativeNumeric.format(hours, "hour") } @@ -125,22 +125,22 @@ export function dateRelativeShort(date) { const absDiff = Math.abs(Math.round((date - now) / 1000)) if (absDiff < 60) { - return momentAgoNarrow + return momentAgoShort } if (absDiff < 60 * 55) { - const minutes = Math.ceil(absDiff / 60) - return minuteShort.replace("%(time)s", minutes) + const minutes = Math.round(absDiff / 60) + return minutesShort.replace("%(time)s", minutes) } if (absDiff < 3600 * 24) { - const hours = Math.ceil(absDiff / 3600) - return hourShort.replace("%(time)s", hours) + const hours = Math.round(absDiff / 3600) + return hoursShort.replace("%(time)s", hours) } if (absDiff < 86400 * 7) { - const days = Math.ceil(absDiff / 86400) - return dayShort.replace("%(time)s", days) + const days = Math.round(absDiff / 86400) + return daysShort.replace("%(time)s", days) } const parts = {} diff --git a/misago/formats/daterelative.py b/misago/formats/daterelative.py index 187fd2fd01..702bae95c5 100644 --- a/misago/formats/daterelative.py +++ b/misago/formats/daterelative.py @@ -1,8 +1,7 @@ from datetime import datetime, timedelta -from math import ceil from django.utils import timezone -from django.utils.formats import date_format, time_format +from django.utils.formats import date_format from django.utils.translation import npgettext, pgettext @@ -15,7 +14,7 @@ def date_relative(value: datetime) -> str: return pgettext("time ago", "moment ago") if delta < 60 * 47: - minutes = ceil(delta / 60) + minutes = round(delta / 60) if past: return npgettext( "minutes ago", @@ -32,7 +31,7 @@ def date_relative(value: datetime) -> str: ) % {"time": minutes} if delta < 3600 * 3: - hours = ceil(delta / 3600) + hours = round(delta / 3600) if past: return npgettext( "hours ago", @@ -50,24 +49,26 @@ def date_relative(value: datetime) -> str: if is_same_day(now, value): if past: - return time_format(value) + return time_short(value) - return pgettext("day at time", "at %(time)s") % {"time": time_format(value)} + return pgettext("day at time", "Today at %(time)s") % { + "time": time_short(value) + } if is_yesterday(now, value): return pgettext("day at time", "Yesterday at %(time)s") % { - "time": time_format(value) + "time": time_short(value) } if is_tomorrow(now, value): return pgettext("day at time", "Tomorrow at %(time)s") % { - "time": time_format(value) + "time": time_short(value) } if past and delta < 3600 * 24 * 6: return pgettext("day at time", "%(day)s at %(time)s") % { "day": date_format(value, "l"), - "time": time_format(value), + "time": time_short(value), } if is_same_year(now, value): @@ -102,18 +103,26 @@ def date_relative_short(value: datetime) -> str: return pgettext("time ago", "now") if delta < 60 * 55: - minutes = ceil(delta / 60) + minutes = round(delta / 60) return pgettext("short minutes", "%(time)sm") % {"time": minutes} if delta < 3600 * 24: - hours = ceil(delta / 3600) + hours = round(delta / 3600) return pgettext("short hours", "%(time)sh") % {"time": hours} if delta < 86400 * 7: - days = ceil(delta / 86400) + days = round(delta / 86400) return pgettext("short days", "%(time)sd") % {"time": days} if now.year == value.year: return date_format(value, pgettext("short this year", "j M")) return date_format(value, pgettext("short other year", "M y")) + + +def time_short(value: datetime) -> str: + return date_format( + value, + pgettext("time short", "g:i A"), + use_l10n=False, + ) diff --git a/misago/formats/tests/test_date_relative.py b/misago/formats/tests/test_date_relative.py index 5c47a731e1..7042179b41 100644 --- a/misago/formats/tests/test_date_relative.py +++ b/misago/formats/tests/test_date_relative.py @@ -1 +1,100 @@ +from datetime import timedelta + +from django.utils import timezone +from freezegun import freeze_time + from ..daterelative import date_relative + + +def test_date_relative_formats_recent_date(): + assert date_relative(timezone.now()) == "moment ago" + + +def test_date_relative_formats_date_few_seconds_ago(): + timestamp = timezone.now() - timedelta(seconds=5) + assert date_relative(timestamp) == "moment ago" + + +def test_date_relative_formats_date_few_seconds_in_future(): + timestamp = timezone.now() + timedelta(seconds=5) + assert date_relative(timestamp) == "moment ago" + + +def test_date_relative_formats_date_few_minutes_ago(): + timestamp = timezone.now() - timedelta(minutes=5) + assert date_relative(timestamp) == "5 minutes ago" + + +def test_date_relative_formats_date_few_minutes_in_future(): + timestamp = timezone.now() + timedelta(minutes=5) + assert date_relative(timestamp) == "In 5 minutes" + + +def test_date_relative_formats_date_few_hours_ago(): + timestamp = timezone.now() - timedelta(hours=2) + assert date_relative(timestamp) == "2 hours ago" + + +def test_date_relative_formats_date_few_hours_in_future(): + timestamp = timezone.now() + timedelta(hours=2) + assert date_relative(timestamp) == "In 2 hours" + + +@freeze_time("2024-07-27 21:37") +def test_date_relative_formats_date_today(): + timestamp = timezone.now() - timedelta(hours=7) + assert date_relative(timestamp) == "2:37 PM" + + +@freeze_time("2024-07-27 11:37") +def test_date_relative_formats_date_today_in_future(): + timestamp = timezone.now() + timedelta(hours=7) + assert date_relative(timestamp) == "Today at 6:37 PM" + + +@freeze_time("2024-07-27 15:12") +def test_date_relative_formats_date_yesterday(): + timestamp = timezone.now() - timedelta(hours=24) + assert date_relative(timestamp) == "Yesterday at 3:12 PM" + + +@freeze_time("2024-07-27 15:12") +def test_date_relative_formats_date_tomorrow(): + timestamp = timezone.now() + timedelta(hours=24) + assert date_relative(timestamp) == "Tomorrow at 3:12 PM" + + +@freeze_time("2024-07-27 15:12") +def test_date_relative_formats_date_few_days_ago(): + timestamp = timezone.now() - timedelta(hours=72) + assert date_relative(timestamp) == "Wednesday at 3:12 PM" + + +@freeze_time("2024-07-23 00:00") +def test_date_relative_uses_hours_instead_of_midnight(): + timestamp = timezone.now() - timedelta(hours=24) + assert date_relative(timestamp) == "Yesterday at 12:00 AM" + + +@freeze_time("2024-07-23 00:00") +def test_date_relative_uses_day_and_month_for_past_date_this_year(): + timestamp = timezone.now() - timedelta(days=100) + assert date_relative(timestamp) == "April 14" + + +@freeze_time("2024-07-23 00:00") +def test_date_relative_uses_day_and_month_for_future_date_this_year(): + timestamp = timezone.now() + timedelta(days=100) + assert date_relative(timestamp) == "October 31" + + +@freeze_time("2024-07-23 00:00") +def test_date_relative_uses_day_and_month_for_date_previous_year(): + timestamp = timezone.now() - timedelta(days=400) + assert date_relative(timestamp) == "June 19, 2023" + + +@freeze_time("2024-07-23 00:00") +def test_date_relative_uses_day_and_month_for_date_next_year(): + timestamp = timezone.now() + timedelta(days=400) + assert date_relative(timestamp) == "August 27, 2025" diff --git a/misago/formats/tests/test_date_relative_short.py b/misago/formats/tests/test_date_relative_short.py new file mode 100644 index 0000000000..198492d69e --- /dev/null +++ b/misago/formats/tests/test_date_relative_short.py @@ -0,0 +1,37 @@ +from datetime import timedelta + +from django.utils import timezone +from freezegun import freeze_time + +from ..daterelative import date_relative_short + + +def test_date_relative_short_formats_recent_date(): + assert date_relative_short(timezone.now()) == "now" + + +def test_date_relative_short_formats_date_few_minutes_ago(): + timestamp = timezone.now() - timedelta(minutes=5) + assert date_relative_short(timestamp) == "5m" + + +def test_date_relative_short_formats_date_few_hours_ago(): + timestamp = timezone.now() - timedelta(hours=5) + assert date_relative_short(timestamp) == "5h" + + +def test_date_relative_short_formats_date_few_days_ago(): + timestamp = timezone.now() - timedelta(hours=5 * 24) + assert date_relative_short(timestamp) == "5d" + + +@freeze_time("2024-07-27 15:12") +def test_date_relative_short_formats_date_from_this_year(): + timestamp = timezone.now() - timedelta(days=100) + assert date_relative_short(timestamp) == "18 Apr" + + +@freeze_time("2024-07-27 15:12") +def test_date_relative_short_formats_date_from_other_year(): + timestamp = timezone.now() - timedelta(days=400) + assert date_relative_short(timestamp) == "Jun 23" diff --git a/misago/static/misago/js/misago.js b/misago/static/misago/js/misago.js index 9debc50843..896b6e4ad5 100644 --- a/misago/static/misago/js/misago.js +++ b/misago/static/misago/js/misago.js @@ -1,2 +1,2 @@ -(()=>{var e,t,n,a={60642:(e,t,n)=>{"use strict";n.d(t,{b:()=>m,D:()=>f});var a=n(15861),i=n(15671),o=n(43144),s=n(97326),r=n(79340),l=n(6215),c=n(61120),u=n(4942),d=n(64687),p=n.n(d),h=n(57588),v=n.n(h);var m=function(e){(0,r.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,s.Z)(t),"hasCache",(function(e){return t.props.cache&&t.props.cache[e]})),(0,u.Z)((0,s.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,s.Z)(t),"setCache",(function(e,n){t.props.cache&&(t.props.cache[e]=n)})),(0,u.Z)((0,s.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,s.Z)(t),"refetch",(function(){t.request(t.props.url)})),(0,u.Z)((0,s.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}(v().Component);var f=function(e){(0,r.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,s.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}(v().Component);function Z(e){return e.json?{"Content-Type":"application/json; charset=utf-8","X-CSRFToken":b()}:{"X-CSRFToken":b()}}function g(e){if(e.json)return JSON.stringify(e.json)}function b(){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:()=>v,YV:()=>Z,kE:()=>g,Aw:()=>b,Xi:()=>y,KE:()=>_,iC:()=>k});var a=n(15671),i=n(43144),o=n(97326),s=n(79340),r=n(6215),l=n(61120),c=n(4942),u=n(94184),d=n.n(u),p=n(57588),h=n.n(p);var v=function(e){(0,s.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,r.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:m(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 m(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 b(e){var t=e.className,n=e.children;return(0,f.Z)("div",{className:d()("dropdown-header",t)},void 0,n)}function y(e){var t=e.className,n=e.children;return(0,f.Z)("li",{className:d()("dropdown-menu-item",t)},void 0,n)}function _(e){var t=e.className,n=e.children;return(0,f.Z)("div",{className:d()("dropdown-pills",t)},void 0,n)}function k(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:()=>s,Z6:()=>r,kw:()=>l});var a=n(22928),i=n(94184),o=n.n(i);n(57588);const s=function(e){var t=e.children,n=e.className;return(0,a.Z)("div",{className:o()("flex-row",n)},void 0,t)},r=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:()=>r,PB:()=>c,Zn:()=>u,WI:()=>l,WE:()=>d,j0:()=>p});var a,i=n(22928),o=n(94184),s=n.n(o);function r(e){var t=e.className,n=e.children;return(0,i.Z)("ul",{className:s()("list-group",t)},void 0,n)}function l(e){var t=e.className,n=e.children;return(0,i.Z)("li",{className:s()("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:s()("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:s()("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:s()("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:s()("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),s=n(60642);function r(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)(s.b,{url:r(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:()=>y,lb:()=>_,Pu:()=>k});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:s(t)})}function s(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 r=n(94184),l=n.n(r);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 v(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 m(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 b(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)(v,{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)(m,{notification:t})),(0,a.Z)("div",{className:"notifications-list-item-col-timestamp"},void 0,(0,a.Z)(g,{notification:t}))))}function y(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)(b,{notification:e},e.id)})))}function _(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 k(){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:()=>b,i:()=>_});var a=n(22928),i=n(15671),o=n(43144),s=n(97326),r=n(79340),l=n(6215),c=n(61120),u=n(4942),d=n(94184),p=n.n(d),h=n(57588),v=n.n(h),m=n(37424),f=n(993);var Z="has-overlay",g=function(e){(0,r.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,s.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}(v().Component);const b=(0,m.$j)()(g);var y;const _=(0,m.$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,y||(y=(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:()=>r,gC:()=>l,sP:()=>c,eA:()=>u,Iv:()=>d});var a,i=n(22928),o=n(94184),s=n.n(o);n(57588);const r=function(e){var t=e.children,n=e.className,o=e.styleName;return(0,i.Z)("div",{className:s()("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:s()("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:s()("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)(r,{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),s=n(97326),r=n(79340),l=n(6215),c=n(61120),u=n(4942),d=n(94184),p=n.n(d),h=n(57588),v=n.n(h),m=n(78657),f=n(93825),Z=n(59801),g=n(53904),b=n(37848),y=n(87462),_=n(82211),k=n(43345),N=n(96359),x=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.")],O=function(e){(0,r.Z)(u,e);var t,n,s=(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=s.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;x.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=x.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}(v().Component),L=n(26106),P=n(47235),T=n(99170),A=n(98274),B=n(93051),I=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;t0?g.Z.error(e.__all__[0]):g.Z.error(gettext("Form contains errors."))):403===e.status&&e.ban?((0,B.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)(N.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)(N.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)(N.Z,{label:pgettext("register modal field","Password"),for:"id_password",validation:this.state.errors.password,extra:(0,a.Z)(O,{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)(L.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)(_.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,pgettext("register modal btn","Register account"))))))}}]),n}(k.Z),M=function(e){(0,r.Z)(n,e);var t=z(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}(v().Component),F=function(e){(0,r.Z)(n,e);var t=z(n);function n(e){var a;return(0,i.Z)(this,n),a=t.call(this,e),(0,u.Z)((0,s.Z)(a),"completeRegistration",(function(e){"active"===e.activation?(Z.Z.hide(),A.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}):v().createElement(q,(0,y.Z)({callback:this.completeRegistration},this.props))}}]),n}(v().Component);const H=function(e){(0,r.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,s.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(),m.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?U||(U=(0,a.Z)(b.Z,{})):null)}}]),h}(v().Component)},26106:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var a=n(22928),i=(n(57588),n(99170)),o=n(89627),s=function(e){var t=e.agreement,n=e.checked,i=e.errors,s=e.url,r=e.value,l=e.onChange;if(!s)return null;var c=interpolate('%(agreement)s',{agreement:(0,o.Z)(t),url:(0,o.Z)(s)},!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:r,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 r=function(e){var t=e.errors,n=e.privacyPolicy,o=e.termsOfService,r=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)(s,{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)(s,{agreement:pgettext("register form agreement prompt","the privacy policy"),checked:null!==n,errors:t.privacyPolicy,url:p,value:d,onChange:r})):null}},62989:(e,t,n)=>{"use strict";n.d(t,{E:()=>T,F:()=>I});var a=n(22928),i=n(57588),o=n.n(i),s=n(15671),r=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 v(){return(0,a.Z)(h,{},void 0,(0,a.Z)(p.j0,{message:pgettext("search cta","Enter search query (at least 3 characters).")}))}var m=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.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)(m.Z,{datetime:t.posted_on}))))))}var Z,g,b,y=n(19605);function _(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)(y.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)(m.Z,{datetime:t.joined_on}))))))}function k(e){var t=e.query,n=e.results,i=n[0],o=n[1],s=i.results.count;return(0,a.Z)(h,{},void 0,o.results.results.map((function(e){return(0,a.Z)(_,{user:e},e.id)})),i.results.results.map((function(e){return(0,a.Z)(f,{post:e},e.id)})),s>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 N(){return(0,a.Z)(h,{},void 0,(0,a.Z)(p.PB,{message:pgettext("search results","The search returned no results.")}))}function x(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,s.Z)(this,o),(t=i.call(this,e)).state={query:t.props.query.trim()},t.debounce=null,t}return(0,r.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)(v,{})):i?g||(g=(0,a.Z)(C,{})):o?(0,a.Z)(x,{error:o}):function(e){if(null===e)return!0;var t=0;return e.forEach((function(e){t+=e.results.count})),0===t}(n)?b||(b=(0,a.Z)(N,{})):null!==n?(0,a.Z)(k,{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 O=n(97326),L=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,s.Z)(this,i),t=a.call(this,e),(0,L.Z)((0,O.Z)(t),"setQuery",(function(e){t.setState({query:e})})),t.state={query:""},t}return(0,r.Z)(i,[{key:"render",value:function(){return this.props.children({query:this.state.query,setQuery:this.setQuery})}}]),i}(o().Component);function T(){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 A=n(37424),B=n(64836);const I=(0,A.$j)((function(e){return{open:e.overlay.search}}))((function(e){var t=e.open;return(0,a.Z)(B.a,{open:t,onOpen:function(){window.setTimeout((function(){document.querySelector("#search-mount .form-control-search").focus()}),0)}},void 0,(0,a.Z)(B.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})))})))}))},80261:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var a,i=n(22928),o=n(94184),s=n.n(o),r=(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:s()("btn btn-sign-in",n,{"btn-block":t}),href:c.LOGIN_URL,onClick:o},void 0,pgettext("cta","Sign in")):(0,i.Z)("button",{className:s()("btn btn-sign-in",n,{"btn-block":t}),type:"button",onClick:function(){o&&o(),r.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:()=>m,Or:()=>g});var a,i,o,s=n(22928),r=n(94184),l=n.n(r),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,r=e.dropdown,c=e.overlay,h=misago.get("MISAGO_PATH"),v=misago.get("SETTINGS"),m=misago.get("main_menu"),f=misago.get("extraMenuItems"),Z=misago.get("extraFooterItems"),g=misago.get("categories_menu"),b=misago.get("usersLists"),y=v.enable_oauth2_client,_=[];m.forEach((function(e){_.push({title:e.label,url:e.url})})),_.push({title:pgettext("site nav","Search"),url:h+"search/"});var k=[],N=misago.get("TERMS_OF_SERVICE_TITLE"),x=misago.get("TERMS_OF_SERVICE_URL");N&&x&&k.push({title:N,url:x});var w=misago.get("PRIVACY_POLICY_TITLE"),C=misago.get("PRIVACY_POLICY_URL");return w&&C&&k.push({title:w,url:C}),(0,s.Z)("ul",{className:l()("site-nav-menu",{"dropdown-menu-list":r,"overlay-menu-list":c})},void 0,t&&(0,s.Z)(u.Aw,{className:"site-nav-sign-in-message"},void 0,pgettext("cta","You are not signed in")),t&&(0,s.Z)(u.KE,{className:"site-nav-sign-in-options"},void 0,(0,s.Z)(p.Z,{onClick:n}),!y&&(0,s.Z)(d.Z,{onClick:n})),(0,s.Z)(u.iC,{},void 0,v.forum_name),_.map((function(e){return(0,s.Z)(u.Xi,{},e.url,(0,s.Z)("a",{href:e.url},void 0,e.title))})),f.map((function(e,t){return(0,s.Z)(u.Xi,{className:e.className},t,(0,s.Z)("a",{href:e.url,target:e.targetBlank?"_blank":null,rel:e.rel},void 0,e.title))})),!!b.length&&(a||(a=(0,s.Z)(u.YV,{className:"site-nav-users-divider"}))),!!b.length&&(0,s.Z)(u.iC,{className:"site-nav-users"},void 0,pgettext("site nav section","Users")),b.map((function(e){return(0,s.Z)(u.Xi,{},e.url,(0,s.Z)("a",{href:e.url},void 0,e.name))})),i||(i=(0,s.Z)(u.YV,{className:"site-nav-categories-divider"})),(0,s.Z)(u.iC,{className:"site-nav-categories"},void 0,pgettext("site nav section","Categories")),g.map((function(e){return e.is_vanilla?(0,s.Z)(u.Xi,{className:"site-nav-category-header"},e.id,(0,s.Z)("a",{href:e.url},void 0,e.name)):(0,s.Z)(u.Xi,{className:l()("site-nav-category",{"site-nav-category-last":e.last})},e.id,(0,s.Z)("a",{href:e.url},void 0,(0,s.Z)("span",{},void 0,e.name),(0,s.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)))})),(!!k.length||!!Z.length)&&(o||(o=(0,s.Z)(u.YV,{className:"site-nav-footer-divider"}))),(!!k.length||!!Z.length)&&(0,s.Z)(u.iC,{className:"site-nav-footer"},void 0,pgettext("site nav section","Footer")),Z.map((function(e,t){return(0,s.Z)(u.Xi,{className:e.className},t,(0,s.Z)("a",{href:e.url,target:e.targetBlank?"_blank":null,rel:e.rel},void 0,e.title))})),k.map((function(e){return(0,s.Z)(u.Xi,{},e.url,(0,s.Z)("a",{href:e.url},void 0,e.title))})))}));const v=h;function m(e){var t=e.close;return(0,s.Z)(v,{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,s.Z)(Z.a,{open:n},void 0,(0,s.Z)(Z.i,{},void 0,pgettext("site nav title","Menu")),(0,s.Z)(v,{close:function(){return t((0,f.xv)())},overlay:!0}))}))},47235:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var a,i=n(22928),o=(n(57588),n(99170)),s=function(e){var t=e.className,n=e.text;return n?(0,i.Z)("h5",{className:t||""},void 0,n):null};const r=function(e){var t=e.buttonClassName,n=e.buttonLabel,r=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)(s,{className:c,text:l}),(0,i.Z)("div",{className:"row"},void 0,u.map((function(e){var a=e.pk,o=e.name,s=e.button_text,r=e.button_color,l=e.url,c="btn btn-block btn-default btn-social-"+a,u=r?{color:r}:null,d=s||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)(s,{className:c,text:r}))}},16069:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var a=n(22928),i=n(15671),o=n(43144),s=n(97326),r=n(79340),l=n(6215),c=n(61120),u=n(4942),d=n(57588),p=n.n(d),h=n(75557);function v(e){return{tick:e.tick+1}}const m=function(e){(0,r.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,s.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(v),t.scheduleNextUpdate()}),5e4):n<86400&&(t.timeout=window.setTimeout((function(){t.setState(v)}),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:()=>s,Eg:()=>r,Z2:()=>l,tw:()=>c});var a=n(22928),i=n(94184),o=n.n(i);n(57588);const s=function(e){var t=e.children,n=e.className;return(0,a.Z)("nav",{className:o()("toolbar",n)},void 0,t)},r=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:()=>re});var a,i=n(42982),o=n(22928),s=n(15671),r=n(43144),l=n(97326),c=n(79340),u=n(6215),d=n(61120),p=n(4942),h=n(94184),v=n.n(h),m=n(57588),f=n.n(m),Z=n(37424),g=n(59801),b=n(19605),y=n(82211),_=n(37848),k=n(78657),N=n(53904);var x,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,s.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,r.Z)(h,[{key:"callApi",value:function(e){var t=this;if(this.state.isLoading)return!1;this.setState({isLoading:!0}),k.Z.post(this.props.user.api.avatar,{avatar:e}).then((function(e){t.setState({isLoading:!1}),N.Z.success(e.detail),t.props.onComplete(e)}),(function(e){400===e.status?(N.Z.error(e.detail),t.setState({isLoading:!1})):t.props.showError(e)}))}},{key:"getGravatarButton",value:function(){return this.props.options.gravatar?(0,o.Z)(y.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)(y.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)(y.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)(y.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)(b.ZP,{size:"200",user:e}),a||(a=(0,o.Z)(_.Z,{}))):(0,o.Z)("div",{className:"avatar-preview"},void 0,(0,o.Z)(b.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)(y.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,s.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");k.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),N.Z.success(e.detail)}),(function(e){400===e.status?(N.Z.error(e.detail),t.setState({isLoading:!1})):t.props.showError(e)}))})),t.state={isLoading:!1,deviceRatio:1},t}return(0,r.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();aa.height){var i=(a.width*n-e.getAvatarSize())/-2;t.cropit("offset",{x:i,y:0})}else if(a.widththis.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)(y.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)(y.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),T=(n(99170),n(69130));function A(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 B,I,j,D=function(e){(0,c.Z)(n,e);var t=A(n);function n(){var e;(0,s.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o2}:t.state={options:e.options,optionsMore:!1},t}return(0,r.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 s=misago.get("ADMIN_URL");return(0,o.Z)("ul",{className:v()("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")))),$||($=(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,W||(W=(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))),!!s&&(0,o.Z)(ee.Xi,{},void 0,(0,o.Z)("a",{href:s,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:v()("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),se=n(64836);const re=(0,Z.$j)((function(e){return{isOpen:e.overlay.userNav}}))((function(e){var t=e.dispatch,n=e.isOpen;return(0,o.Z)(se.a,{open:n},void 0,(0,o.Z)(se.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(99170));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:s(e.user,t),srcSet:s(e.user,n),width:e.height||t,height:e.height||t})}function s(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),s=n(43144),r=n(79340),l=n(6215),c=n(61120),u=n(57588),d=n.n(u),p=n(37848);var h=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,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,s.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),s=n(79340),r=n(6215),l=n(61120),c=n(57588);var u=function(e){(0,s.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,r.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:()=>m});var a=n(15671),i=n(43144),o=n(97326),s=n(79340),r=n(6215),l=n(61120),c=n(4942),u=n(57588),d=n.n(u),p=n(55210),h=n(53904);var v=(0,p.C1)(),m=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,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,r.Z)(this,e)});function d(){var e;(0,a.Z)(this,d);for(var t=arguments.length,n=new Array(t),i=0;i{"use strict";n.d(t,{Z:()=>u});var a=n(22928),i=n(15671),o=n(43144),s=n(79340),r=n(6215),l=n(61120),c=n(57588);var u=function(e){(0,s.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,r.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),s=n(6215),r=n(61120),l=n(94184),c=n.n(l),u=n(57588),d=n.n(u),p=n(4942),h=n(19755),v=new RegExp("^.*(?:(?:youtu.be/|v/|vi/|u/w/|embed/)|(?:(?:watch)??v(?:i)?=|&v(?:i)?=))([^#&?]*).*");const m=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;ia"),n=0;n');h(e).replaceWith(a),a.wrap('
')}}]),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(v);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,r.Z)(t);if(n){var i=(0,r.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,a.Z)(this,u),l.apply(this,arguments)}return(0,i.Z)(u,[{key:"componentDidMount",value:function(){m.render(this.documentNode),Z(this.documentNode).find(".spoiler-reveal").click(b)}},{key:"componentDidUpdate",value:function(e,t){m.render(this.documentNode),Z(this.documentNode).find(".spoiler-reveal").click(b)}},{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 b(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),s=n(43144),r=n(79340),l=n(6215),c=n(61120),u=n(57588),d=n.n(u),p=n(37848);var h=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,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,s.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),s=n(79340),r=n(6215),l=n(61120);n(57588);var c=function(e){(0,s.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,r.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),s=n(79340),r=n(6215),l=n(61120),c=n(57588);var u=function(e){(0,s.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,r.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:()=>x});var a=n(22928),i=n(57588),o=n.n(i),s=n(69092);function r(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)(s.Z,{markup: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 v(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 m(e){var t=e.post;return(0,a.Z)("div",{className:"post-side post-side-anonymous"},void 0,(0,a.Z)(v,{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)(v,{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)(m,{post:t})}function b(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)(r,{post:t})))))}var y,_,k=n(44039);function N(){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,y||(y=(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:k.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:k.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:k.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:k.e(30,200)+"px"}},void 0," ")," ",(0,a.Z)("span",{className:"ui-preview-text",style:{width:k.e(30,200)+"px"}},void 0," ")," ",(0,a.Z)("span",{className:"ui-preview-text",style:{width:k.e(30,200)+"px"}},void 0," ")))))))))}function x(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)(b,{post:e,poster:i},e.id)}))):_||(_=(0,a.Z)(N,{}))}},9771:(e,t,n)=>{"use strict";n.d(t,{mv:()=>m,ZP:()=>cn,MO:()=>A,Fi:()=>N});var a,i=n(57588),o=n.n(i),s=n(22928),r=n(43144),l=n(15671),c=n(97326),u=n(79340),d=n(6215),p=n(61120),h=n(4942),v=n(64646);var m=function(e){(0,u.Z)(m,e);var t,n,i=(t=m,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 m(e){var t;return(0,l.Z)(this,m),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(v.Z.isOpen()){var e=A();e&&!e.disabled&&(e.quote(N(t.state.range)),t.setState({range:null,rect:null}),f())}else{var n=N(t.state.range);v.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,s.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,s.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,s.Z)("div",{className:"quote-control-arrow"})),(0,s.Z)("div",{className:"quote-control-inner"},void 0,(0,s.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,r.Z)(m)}(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)&&b(n)&&y(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},b=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},y=function e(t){for(var n=0;n0)return!0;if("IMG"===a.nodeName)return!0;if(e(a))return!0}return!1},_=n(42982),k=n(70885);const N=function(e){var t=x(e),n=L(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 x=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 O(t);for(var n=t.parentNode;n;){if(E(n))return O(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},O=function(e){return e.dataset?{syntax:e.dataset.syntax||null}:{syntax:null}},L=function(e,t){for(var n="",a=0;a0&&(0,s.Z)("li",{},void 0,(0,K.Z)(n.size))))),!!n.id&&(0,s.Z)("div",{className:"markup-editor-attachment-buttons"},void 0,(0,s.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,r,e)}},void 0,J||(J=(0,s.Z)("span",{className:"material-icon"},void 0,"flip_to_front"))),(0,s.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,s.Z)("span",{className:"material-icon"},void 0,"close")))),!n.id&&!!n.key&&(0,s.Z)("div",{className:"markup-editor-attachment-buttons"},void 0,n.error&&(0,s.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,s.Z)("span",{className:"material-icon"},void 0,"warning"))),(0,s.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,s.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,s.Z)("div",{className:"markup-editor-attachments"},void 0,(0,s.Z)("div",{className:"markup-editor-attachments-container"},void 0,t.map((function(e){return(0,s.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,r=e.submitText,l=e.showPreview,c=e.closePreview,u=e.enableProtection,d=e.disableProtection;return(0,s.Z)("div",{className:"markup-editor-footer"},void 0,!!t&&(0,s.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,s.Z)("span",{className:"material-icon"},void 0,o?"lock":"lock_open")),!!t&&(0,s.Z)("div",{},void 0,(0,s.Z)(de.Z,{className:"btn-default hidden-xs",type:"button",disabled:n,onClick:function(){o?d():u()}},void 0,(0,s.Z)("span",{className:"material-icon"},void 0,o?"lock":"lock_open"),o?pgettext("markup editor","Protected"):pgettext("markup editor","Protect"))),ue||(ue=(0,s.Z)("div",{className:"markup-editor-spacer"})),i?(0,s.Z)(de.Z,{className:"btn-default btn-auto",type:"button",onClick:c},void 0,pgettext("markup editor","Edit")):(0,s.Z)(de.Z,{className:"btn-default btn-auto",disabled:n||a,type:"button",onClick:l},void 0,pgettext("markup editor","Preview")),(0,s.Z)(de.Z,{className:"btn-primary btn-auto",disabled:n||a},void 0,r||pgettext("markup editor","Post")))};var he,ve=n(96359);var me=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(),s=t.state.text.trim();if(0===s.length)return t.setState({error:gettext("This field is required.")}),!1;var r=a.prefix.trim().length?"\n\n":"";return ie(Object.assign({},a,{text:s}),i,r+"```"+o+"\n"+s+"\n```\n\n"),Q.Z.hide(),!1})),t.state={error:null,syntax:"",text:e.selection.text},t}return(0,r.Z)(i,[{key:"render",value:function(){var e=this;return(0,s.Z)("div",{className:"modal-dialog modal-lg",role:"document"},void 0,(0,s.Z)("div",{className:"modal-content"},void 0,(0,s.Z)("div",{className:"modal-header"},void 0,(0,s.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,he||(he=(0,s.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,s.Z)("h4",{className:"modal-title"},void 0,pgettext("markup editor","Code"))),(0,s.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,s.Z)("div",{className:"modal-body"},void 0,(0,s.Z)(ve.Z,{for:"markup_code_syntax",label:pgettext("markup editor","Syntax highlighting")},void 0,(0,s.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,s.Z)("option",{value:""},void 0,pgettext("markup editor","No syntax highlighting")),fe.map((function(e){var t=e.value,n=e.name;return(0,s.Z)("option",{value:t},t,n)})))),(0,s.Z)(ve.Z,{for:"markup_code_text",label:pgettext("markup editor","Code to insert"),validation:this.state.error?[this.state.error]:void 0},void 0,(0,s.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,s.Z)("div",{className:"modal-footer"},void 0,(0,s.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,pgettext("markup editor","Cancel")),(0,s.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=me;var ge,be,ye,_e,ke,Ne,xe,we,Ce,Re,Ee,Se,Oe,Le,Pe,Te,Ae,Be,Ie,je,De,ze,Ue,qe,Me,Fe,He,Ve,Ye,Ge,$e,We,Qe,Ke,Xe,Je,et,tt,nt,at,it,ot,st,rt,lt;function ct(){return(0,s.Z)("div",{className:"modal-dialog modal-lg",role:"document"},void 0,(0,s.Z)("div",{className:"modal-content"},void 0,(0,s.Z)("div",{className:"modal-header"},void 0,(0,s.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,ge||(ge=(0,s.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,s.Z)("h4",{className:"modal-title"},void 0,pgettext("markup help","Formatting help"))),(0,s.Z)("div",{className:"modal-body formatting-help"},void 0,(0,s.Z)("h4",{},void 0,pgettext("markup help","Emphasis text")),(0,s.Z)(ut,{markup:pgettext("markup help","_This text will have emphasis_"),result:(0,s.Z)("p",{},void 0,(0,s.Z)("em",{},void 0,pgettext("markup help","This text will have emphasis")))}),be||(be=(0,s.Z)("hr",{})),(0,s.Z)("h4",{},void 0,pgettext("markup help","Bold text")),(0,s.Z)(ut,{markup:pgettext("markup help","**This text will be bold**"),result:(0,s.Z)("p",{},void 0,(0,s.Z)("strong",{},void 0,pgettext("markup help","This text will be bold")))}),ye||(ye=(0,s.Z)("hr",{})),(0,s.Z)("h4",{},void 0,pgettext("markup help","Removed text")),(0,s.Z)(ut,{markup:pgettext("markup help","~~This text will be removed~~"),result:(0,s.Z)("p",{},void 0,(0,s.Z)("del",{},void 0,pgettext("markup help","This text will be removed")))}),_e||(_e=(0,s.Z)("hr",{})),(0,s.Z)("h4",{},void 0,pgettext("markup help","Bold text (BBCode)")),(0,s.Z)(ut,{markup:pgettext("markup help","[b]This text will be bold[/b]"),result:(0,s.Z)("p",{},void 0,(0,s.Z)("b",{},void 0,pgettext("markup help","This text will be bold")))}),ke||(ke=(0,s.Z)("hr",{})),(0,s.Z)("h4",{},void 0,pgettext("markup help","Underlined text (BBCode)")),(0,s.Z)(ut,{markup:pgettext("markup help","[u]This text will be underlined[/u]"),result:(0,s.Z)("p",{},void 0,(0,s.Z)("u",{},void 0,pgettext("markup help","This text will be underlined")))}),Ne||(Ne=(0,s.Z)("hr",{})),(0,s.Z)("h4",{},void 0,pgettext("markup help","Italics text (BBCode)")),(0,s.Z)(ut,{markup:pgettext("markup help","[i]This text will be in italics[/i]"),result:(0,s.Z)("p",{},void 0,(0,s.Z)("i",{},void 0,pgettext("markup help","This text will be in italics")))}),xe||(xe=(0,s.Z)("hr",{})),(0,s.Z)("h4",{},void 0,pgettext("markup help","Link")),we||(we=(0,s.Z)(ut,{markup:"",result:(0,s.Z)("p",{},void 0,(0,s.Z)("a",{href:"#"},void 0,"example.com"))})),Ce||(Ce=(0,s.Z)("hr",{})),(0,s.Z)("h4",{},void 0,pgettext("markup help","Link with text")),(0,s.Z)(ut,{markup:"["+pgettext("markup help","Link text")+"](http://example.com)",result:(0,s.Z)("p",{},void 0,(0,s.Z)("a",{href:"#"},void 0,pgettext("markup help","Link text")))}),Re||(Re=(0,s.Z)("hr",{})),(0,s.Z)("h4",{},void 0,pgettext("markup help","Link (BBCode)")),Ee||(Ee=(0,s.Z)(ut,{markup:"[url]http://example.com[/url]",result:(0,s.Z)("p",{},void 0,(0,s.Z)("a",{href:"#"},void 0,"example.com"))})),Se||(Se=(0,s.Z)("hr",{})),(0,s.Z)("h4",{},void 0,pgettext("markup help","Link with text (BBCode)")),(0,s.Z)(ut,{markup:"[url=http://example.com]"+pgettext("markup help","Link text")+"[/url]",result:(0,s.Z)("p",{},void 0,(0,s.Z)("a",{href:"#"},void 0,pgettext("markup help","Link text")))}),Oe||(Oe=(0,s.Z)("hr",{})),(0,s.Z)("h4",{},void 0,pgettext("markup help","Image")),Le||(Le=(0,s.Z)(ut,{markup:"!(http://dummyimage.com/38/38)",result:(0,s.Z)("p",{},void 0,(0,s.Z)("img",{alt:"",src:"http://dummyimage.com/38/38"}))})),Pe||(Pe=(0,s.Z)("hr",{})),(0,s.Z)("h4",{},void 0,pgettext("markup help","Image with alternate text")),(0,s.Z)(ut,{markup:"!["+pgettext("markup help","Image text")+"](http://dummyimage.com/38/38)",result:(0,s.Z)("p",{},void 0,(0,s.Z)("img",{alt:pgettext("markup help","Image text"),src:"http://dummyimage.com/38/38"}))}),Te||(Te=(0,s.Z)("hr",{})),(0,s.Z)("h4",{},void 0,pgettext("markup help","Image (BBCode)")),Ae||(Ae=(0,s.Z)(ut,{markup:"[img]http://dummyimage.com/38/38[/img]",result:(0,s.Z)("p",{},void 0,(0,s.Z)("img",{alt:"",src:"http://dummyimage.com/38/38"}))})),Be||(Be=(0,s.Z)("hr",{})),(0,s.Z)("h4",{},void 0,pgettext("markup help","Mention user by their name")),Ie||(Ie=(0,s.Z)(ut,{markup:"@username",result:(0,s.Z)("p",{},void 0,(0,s.Z)("a",{href:"#"},void 0,"@username"))})),je||(je=(0,s.Z)("hr",{})),(0,s.Z)("h4",{},void 0,pgettext("markup help","Heading 1")),(0,s.Z)(ut,{markup:pgettext("markup help","# First level heading"),result:(0,s.Z)("h1",{},void 0,pgettext("markup help","First level heading"))}),De||(De=(0,s.Z)("hr",{})),(0,s.Z)("h4",{},void 0,pgettext("markup help","Heading 2")),(0,s.Z)(ut,{markup:pgettext("markup help","## Second level heading"),result:(0,s.Z)("h2",{},void 0,pgettext("markup help","Second level heading"))}),ze||(ze=(0,s.Z)("hr",{})),(0,s.Z)("h4",{},void 0,pgettext("markup help","Heading 3")),(0,s.Z)(ut,{markup:pgettext("markup help","### Third level heading"),result:(0,s.Z)("h3",{},void 0,pgettext("markup help","Third level heading"))}),Ue||(Ue=(0,s.Z)("hr",{})),(0,s.Z)("h4",{},void 0,pgettext("markup help","Heading 4")),(0,s.Z)(ut,{markup:pgettext("markup help","#### Fourth level heading"),result:(0,s.Z)("h4",{},void 0,pgettext("markup help","Fourth level heading"))}),qe||(qe=(0,s.Z)("hr",{})),(0,s.Z)("h4",{},void 0,pgettext("markup help","Heading 5")),(0,s.Z)(ut,{markup:pgettext("markup help","##### Fifth level heading"),result:(0,s.Z)("h5",{},void 0,pgettext("markup help","Fifth level heading"))}),Me||(Me=(0,s.Z)("hr",{})),(0,s.Z)("h4",{},void 0,pgettext("markup help","Unordered list")),Fe||(Fe=(0,s.Z)(ut,{markup:"- Lorem ipsum\n- Dolor met\n- Vulputate lectus",result:(0,s.Z)("ul",{},void 0,(0,s.Z)("li",{},void 0,"Lorem ipsum"),(0,s.Z)("li",{},void 0,"Dolor met"),(0,s.Z)("li",{},void 0,"Vulputate lectus"))})),He||(He=(0,s.Z)("hr",{})),(0,s.Z)("h4",{},void 0,pgettext("markup help","Ordered list")),Ve||(Ve=(0,s.Z)(ut,{markup:"1. Lorem ipsum\n2. Dolor met\n3. Vulputate lectus",result:(0,s.Z)("ol",{},void 0,(0,s.Z)("li",{},void 0,"Lorem ipsum"),(0,s.Z)("li",{},void 0,"Dolor met"),(0,s.Z)("li",{},void 0,"Vulputate lectus"))})),Ye||(Ye=(0,s.Z)("hr",{})),(0,s.Z)("h4",{},void 0,pgettext("markup help","Quote text")),(0,s.Z)(ut,{markup:"> "+pgettext("markup help","Quoted text"),result:(0,s.Z)("blockquote",{},void 0,(0,s.Z)("p",{},void 0,pgettext("markup help","Quoted text")))}),Ge||(Ge=(0,s.Z)("hr",{})),(0,s.Z)("h4",{},void 0,pgettext("markup help","Quote text (BBCode)")),(0,s.Z)(ut,{markup:"[quote]\n"+pgettext("markup help","Quoted text")+"\n[/quote]",result:(0,s.Z)("aside",{className:"quote-block"},void 0,(0,s.Z)("div",{className:"quote-heading"},void 0,gettext("Quoted message:")),(0,s.Z)("blockquote",{className:"quote-body"},void 0,(0,s.Z)("p",{},void 0,pgettext("markup help","Quoted text"))))}),$e||($e=(0,s.Z)("hr",{})),(0,s.Z)("h4",{},void 0,pgettext("markup help","Quote text with author (BBCode)")),(0,s.Z)(ut,{markup:'[quote="'+pgettext("markup help","Quote author")+'"]\n'+pgettext("markup help","Quoted text")+"\n[/quote]",result:(0,s.Z)("aside",{className:"quote-block"},void 0,(0,s.Z)("div",{className:"quote-heading"},void 0,pgettext("markup help","Quote author has written:")),(0,s.Z)("blockquote",{className:"quote-body"},void 0,(0,s.Z)("p",{},void 0,pgettext("markup help","Quoted text"))))}),We||(We=(0,s.Z)("hr",{})),(0,s.Z)("h4",{},void 0,pgettext("markup help","Spoiler")),(0,s.Z)(ut,{markup:"[spoiler]\n"+pgettext("markup help","Secret text")+"\n[/spoiler]",result:(0,s.Z)(pt,{},void 0,pgettext("markup help","Secret text"))}),Qe||(Qe=(0,s.Z)("hr",{})),(0,s.Z)("h4",{},void 0,pgettext("markup help","Inline code")),(0,s.Z)(ut,{markup:pgettext("markup help","`Inline code`"),result:(0,s.Z)("p",{},void 0,(0,s.Z)("code",{},void 0,pgettext("markup help","Inline code")))}),Ke||(Ke=(0,s.Z)("hr",{})),(0,s.Z)("h4",{},void 0,pgettext("markup help","Code block")),Xe||(Xe=(0,s.Z)(ut,{markup:'```\nalert("Hello world!");\n```',result:(0,s.Z)("pre",{},void 0,(0,s.Z)("code",{className:"hljs"},void 0,'alert("Hello world!");'))})),Je||(Je=(0,s.Z)("hr",{})),(0,s.Z)("h4",{},void 0,pgettext("markup help","Code block with syntax highlighting")),et||(et=(0,s.Z)(ut,{markup:'```python\nprint("Hello world!");\n```',result:(0,s.Z)("pre",{},void 0,(0,s.Z)("code",{className:"hljs language-python"},void 0,(0,s.Z)("span",{className:"hljs-built_in"},void 0,"print"),'("Hello world!");'))})),tt||(tt=(0,s.Z)("hr",{})),(0,s.Z)("h4",{},void 0,pgettext("markup help","Code block (BBCode)")),nt||(nt=(0,s.Z)(ut,{markup:'[code]\nalert("Hello world!");\n[/code]',result:(0,s.Z)("pre",{},void 0,(0,s.Z)("code",{className:"hljs"},void 0,'alert("Hello world!");'))})),at||(at=(0,s.Z)("hr",{})),(0,s.Z)("h4",{},void 0,pgettext("markup help","Code block with syntax highlighting (BBCode)")),it||(it=(0,s.Z)(ut,{markup:'[code="python"]\nprint("Hello world!");\n[/code]',result:(0,s.Z)("pre",{},void 0,(0,s.Z)("code",{className:"hljs language-python"},void 0,(0,s.Z)("span",{className:"hljs-built_in"},void 0,"print"),'("Hello world!");'))})),ot||(ot=(0,s.Z)("hr",{})),(0,s.Z)("h4",{},void 0,pgettext("markup help","Horizontal rule")),st||(st=(0,s.Z)(ut,{markup:"Lorem ipsum\n- - -\nDolor met",result:(0,s.Z)("div",{},void 0,(0,s.Z)("p",{},void 0,"Lorem ipsum"),(0,s.Z)("hr",{}),(0,s.Z)("p",{},void 0,"Dolor met"))})),rt||(rt=(0,s.Z)("hr",{})),(0,s.Z)("h4",{},void 0,pgettext("markup help","Horizontal rule (BBCode)")),lt||(lt=(0,s.Z)(ut,{markup:"Lorem ipsum\n[hr]\nDolor met",result:(0,s.Z)("div",{},void 0,(0,s.Z)("p",{},void 0,"Lorem ipsum"),(0,s.Z)("hr",{}),(0,s.Z)("p",{},void 0,"Dolor met"))}))),(0,s.Z)("div",{className:"modal-footer"},void 0,(0,s.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,s.Z)("div",{className:"formatting-help-item"},void 0,(0,s.Z)("div",{className:"formatting-help-item-markup"},void 0,(0,s.Z)("pre",{},void 0,(0,s.Z)("code",{},void 0,t))),(0,s.Z)("div",{className:"formatting-help-item-preview"},void 0,(0,s.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,r.Z)(i,[{key:"render",value:function(){var e=this;return(0,s.Z)("aside",{className:this.state.reveal?"spoiler-block revealed":"spoiler-block"},void 0,(0,s.Z)("blockquote",{className:"spoiler-body"},void 0,(0,s.Z)("p",{},void 0,this.props.children)),!this.state.reveal&&(0,s.Z)("div",{className:"spoiler-overlay"},void 0,(0,s.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 vt(e){return ht.test(e.trim())}const mt=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(),s=t.state.url.trim();return 0===s.length?(t.setState({error:gettext("This field is required.")}),!1):(o.length>0?ie(a,i,"!["+o+"]("+s+")"):ie(a,i,"!("+s+")"),Q.Z.hide(),!1)}));var n=e.selection.text.trim(),o=vt(n);return t.state={error:null,text:o?"":n,url:o?n:""},t}return(0,r.Z)(i,[{key:"render",value:function(){var e=this;return(0,s.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,s.Z)("div",{className:"modal-content"},void 0,(0,s.Z)("div",{className:"modal-header"},void 0,(0,s.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,dt||(dt=(0,s.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,s.Z)("h4",{className:"modal-title"},void 0,pgettext("markup editor","Image"))),(0,s.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,s.Z)("div",{className:"modal-body"},void 0,(0,s.Z)(ve.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,s.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,s.Z)(ve.Z,{for:"markup_image_url",label:pgettext("markup editor","Image URL"),validation:this.state.error?[this.state.error]:void 0},void 0,(0,s.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,s.Z)("div",{className:"modal-footer"},void 0,(0,s.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,pgettext("markup editor","Cancel")),(0,s.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(),s=t.state.url.trim();return 0===s.length?(t.setState({error:gettext("This field is required.")}),!1):(o.length>0?ie(a,i,"["+o+"]("+s+")"):ie(a,i,"<"+s+">"),Q.Z.hide(),!1)}));var n=e.selection.text.trim(),o=vt(n);return t.state={error:null,text:o?"":n,url:o?n:""},t}return(0,r.Z)(i,[{key:"render",value:function(){var e=this;return(0,s.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,s.Z)("div",{className:"modal-content"},void 0,(0,s.Z)("div",{className:"modal-header"},void 0,(0,s.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,ft||(ft=(0,s.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,s.Z)("h4",{className:"modal-title"},void 0,pgettext("markup editor","Link"))),(0,s.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,s.Z)("div",{className:"modal-body"},void 0,(0,s.Z)(ve.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,s.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,s.Z)(ve.Z,{for:"markup_link_url",label:pgettext("markup editor","Link address"),validation:this.state.error?[this.state.error]:void 0},void 0,(0,s.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,s.Z)("div",{className:"modal-footer"},void 0,(0,s.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,pgettext("markup editor","Cancel")),(0,s.Z)("button",{className:"btn btn-primary"},void 0,pgettext("markup editor","Insert link"))))))}}]),i}(o().Component);var gt;const bt=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(),s=t.state.text.trim();if(0===s.length)return t.setState({error:gettext("This field is required.")}),!1;var r=a.prefix.trim().length?"\n\n":"";return ie(a,i,o?r+'[quote="'+o+'"]\n'+s+"\n[/quote]\n\n":r+"[quote]\n"+s+"\n[/quote]\n\n"),Q.Z.hide(),!1})),t.state={error:null,author:"",text:e.selection.text},t}return(0,r.Z)(i,[{key:"render",value:function(){var e=this;return(0,s.Z)("div",{className:"modal-dialog modal-lg",role:"document"},void 0,(0,s.Z)("div",{className:"modal-content"},void 0,(0,s.Z)("div",{className:"modal-header"},void 0,(0,s.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,gt||(gt=(0,s.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,s.Z)("h4",{className:"modal-title"},void 0,pgettext("markup editor","Quote"))),(0,s.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,s.Z)("div",{className:"modal-body"},void 0,(0,s.Z)(ve.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,s.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,s.Z)(ve.Z,{for:"markup_quote_text",label:pgettext("markup editor","Quoted text"),validation:this.state.error?[this.state.error]:void 0},void 0,(0,s.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,s.Z)("div",{className:"modal-footer"},void 0,(0,s.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,pgettext("markup editor","Cancel")),(0,s.Z)("button",{className:"btn btn-primary"},void 0,pgettext("markup editor","Insert quote"))))))}}]),i}(o().Component),yt=function(e){var t=e.disabled,n=e.icon,a=e.title,i=e.onClick;return(0,s.Z)("button",{className:"btn btn-markup-editor",title:a,type:"button",disabled:t,onClick:i},void 0,(0,s.Z)("span",{className:"material-icon"},void 0,n))};var _t=n(54031);const kt=function(e,t){var n=1024*$.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,_t.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($.Z.get("ATTACHMENTS_API"),o,(function(e){a.progress=e,i()})).then((function(e){Object.assign(a,e,{uploaded_on:U()(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 Nt,xt;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,s.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,s.Z)(mt,{selection:e,element:n,update:a}))}},{name:pgettext("markup editor","Quote"),icon:"format_quote",onClick:function(){var e=oe(n);Q.Z.show((0,s.Z)(bt,{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,s.Z)(Ze,{selection:e,element:n,update:a}))}}];return $.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${username}',insertTpl:"@${username}",searchKey:"username",callbacks:{remoteFilter:function(e,t){Ct.getJSON($.Z.get("MENTION_API"),{q:e},t)}}}),Ct(t).on("inserted.atwho",(function(t,n,a,i){var o=i.query,s=a.target.innerText.trim(),r=t.target.value.substr(0,o.headPos),l=t.target.value.substr(o.endPos);t.target.value=r+s+l,e.onChange(t);var c=o.headPos+s.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,s.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,s.Z)(pe,{preview:t.state.preview,canProtect:t.props.canProtect,isProtected:t.props.isProtected,disabled:t.props.disabled,empty:t.props.value.trim().length<$.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,r.Z)(i)}(o().Component);var Et=n(92490);var St="posting-active",Ot="posting-default",Lt="posting-minimized",Pt="posting-fullscreen";const Tt=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,r.Z)(i,[{key:"componentDidMount",value:function(){document.body.classList.add(St,Ot)}},{key:"componentWillUnmount",value:function(){document.body.classList.remove(St,Ot,Lt,Pt)}},{key:"componentWillReceiveProps",value:function(e){var t=e.fullscreen;e.minimized?(document.body.classList.remove(Ot,Pt),document.body.classList.add(Lt)):t?(document.body.classList.remove(Ot,Lt),document.body.classList.add(Pt)):(document.body.classList.remove(Pt,Lt),document.body.classList.add(Ot))}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.fullscreen,a=e.minimized;return(0,s.Z)("div",{className:G()("posting-dialog",{"posting-dialog-minimized":a,"posting-dialog-fullscreen":n&&!a})},void 0,(0,s.Z)("div",{className:"posting-dialog-container"},void 0,t))}}]),i}(o().Component),At=function(e){var t=e.children;return(0,s.Z)("div",{className:"posting-dialog-body"},void 0,t)};var Bt;const It=function(e){var t=e.close,n=e.message;return(0,s.Z)("div",{className:"posting-dialog-error"},void 0,Bt||(Bt=(0,s.Z)("div",{className:"posting-dialog-error-icon"},void 0,(0,s.Z)("span",{className:"material-icon"},void 0,"error_outlined"))),(0,s.Z)("div",{className:"posting-dialog-error-detail"},void 0,(0,s.Z)("p",{},void 0,n),(0,s.Z)("button",{type:"button",className:"btn btn-default",onClick:t},void 0,pgettext("modal","Close"))))};var jt,Dt,zt,Ut,qt;const Mt=function(e){var t=e.children,n=e.close,a=e.fullscreen,i=e.minimize,o=e.minimized,r=e.fullscreenEnter,l=e.fullscreenExit,c=e.open;return(0,s.Z)("div",{className:"posting-dialog-header"},void 0,(0,s.Z)("div",{className:"posting-dialog-caption"},void 0,t),o?(0,s.Z)("button",{className:"btn btn-posting-dialog",title:pgettext("dialog","Open"),type:"button",onClick:c},void 0,jt||(jt=(0,s.Z)("span",{className:"material-icon"},void 0,"expand_less"))):(0,s.Z)("button",{className:"btn btn-posting-dialog",title:pgettext("dialog","Minimize"),type:"button",onClick:i},void 0,Dt||(Dt=(0,s.Z)("span",{className:"material-icon"},void 0,"expand_more"))),a?(0,s.Z)("button",{className:"btn btn-posting-dialog hidden-xs",title:pgettext("dialog","Exit the fullscreen mode"),type:"button",onClick:l},void 0,zt||(zt=(0,s.Z)("span",{className:"material-icon"},void 0,"fullscreen_exit"))):(0,s.Z)("button",{className:"btn btn-posting-dialog hidden-xs",title:pgettext("dialog","Enter the fullscreen mode"),type:"button",onClick:r},void 0,Ut||(Ut=(0,s.Z)("span",{className:"material-icon"},void 0,"fullscreen"))),(0,s.Z)("button",{className:"btn btn-posting-dialog",title:pgettext("dialog","Cancel"),type:"button",onClick:n},void 0,qt||(qt=(0,s.Z)("span",{className:"material-icon"},void 0,"close"))))};var Ft,Ht,Vt,Yt,Gt,$t,Wt,Qt,Kt;function Xt(e){var t=e.isClosed,n=e.isHidden,a=e.isPinned,i=e.disabled,o=e.options,r=e.close,l=e.open,c=e.hide,u=e.unhide,d=e.pinGlobally,p=e.pinLocally,h=e.unpin,v=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,s.Z)("div",{className:"dropdown"},void 0,(0,s.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,v.length>0?(0,s.Z)("span",{className:"btn-icons-family"},void 0,v.map((function(e){return(0,s.Z)("span",{className:"material-icon"},e,e)}))):Ft||(Ft=(0,s.Z)("span",{className:"material-icon"},void 0,"more_horiz"))),(0,s.Z)("ul",{className:"dropdown-menu dropdown-menu-right stick-to-bottom"},void 0,2===o.pin&&2!==a&&(0,s.Z)("li",{},void 0,(0,s.Z)("button",{className:"btn btn-link",onClick:d,type:"button",disabled:i},void 0,Ht||(Ht=(0,s.Z)("span",{className:"material-icon"},void 0,"bookmark")),pgettext("post thread","Pinned globally"))),o.pin>=a&&1!==a&&(0,s.Z)("li",{},void 0,(0,s.Z)("button",{className:"btn btn-link",onClick:p,type:"button",disabled:i},void 0,Vt||(Vt=(0,s.Z)("span",{className:"material-icon"},void 0,"bookmark_outline")),pgettext("post thread","Pinned in category"))),o.pin>=a&&0!==a&&(0,s.Z)("li",{},void 0,(0,s.Z)("button",{className:"btn btn-link",onClick:h,type:"button",disabled:i},void 0,Yt||(Yt=(0,s.Z)("span",{className:"material-icon"},void 0,"radio_button_unchecked")),pgettext("post thread","Not pinned"))),o.close&&!!t&&(0,s.Z)("li",{},void 0,(0,s.Z)("button",{className:"btn btn-link",onClick:l,type:"button",disabled:i},void 0,Gt||(Gt=(0,s.Z)("span",{className:"material-icon"},void 0,"lock_outline")),pgettext("post thread","Open"))),o.close&&!t&&(0,s.Z)("li",{},void 0,(0,s.Z)("button",{className:"btn btn-link",onClick:r,type:"button",disabled:i},void 0,$t||($t=(0,s.Z)("span",{className:"material-icon"},void 0,"lock")),pgettext("post thread","Closed"))),o.hide&&!!n&&(0,s.Z)("li",{},void 0,(0,s.Z)("button",{className:"btn btn-link",onClick:u,type:"button",disabled:i},void 0,Wt||(Wt=(0,s.Z)("span",{className:"material-icon"},void 0,"visibility")),pgettext("post thread","Visible"))),o.hide&&!n&&(0,s.Z)("li",{},void 0,(0,s.Z)("button",{className:"btn btn-link",onClick:c,type:"button",disabled:i},void 0,Qt||(Qt=(0,s.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(),v.Z.close();window.confirm(pgettext("post thread","Are you sure you want to discard thread?"))&&(t.minimize(),v.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.pin0}));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(),v.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,r.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,s.Z)("form",{className:"posting-dialog-form",onSubmit:this.handleSubmit},void 0,(0,s.Z)(Et.o8,{className:"posting-dialog-toolbar"},void 0,(0,s.Z)(Et.Z2,{className:"posting-dialog-thread-recipients",auto:!0},void 0,(0,s.Z)(Et.Eg,{auto:!0},void 0,(0,s.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,s.Z)(Et.Z2,{className:"posting-dialog-thread-title",auto:!0},void 0,(0,s.Z)(Et.Eg,{auto:!0},void 0,(0,s.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,s.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,r=e.fullscreen,l=e.fullscreenEnter,c=e.fullscreenExit;return(0,s.Z)(Tt,{fullscreen:r,minimized:a},void 0,(0,s.Z)(Mt,{fullscreen:r,fullscreenEnter:l,fullscreenExit:c,minimized:a,minimize:i,open:o,close:n},void 0,pgettext("post thread","Start private thread")),(0,s.Z)(At,{},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(),v.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,r.Z)(i,[{key:"componentDidMount",value:function(){H.Z.get(this.props.config,this.props.context||null).then(this.loadSuccess,this.loadError),B(!1,this.onQuote)}},{key:"componentWillUnmount",value:function(){I()}},{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 B(!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(),B(!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);B(!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(sn,e,(0,s.Z)(It,{message:this.state.error,close:this.close})):this.state.isReady?o().createElement(sn,e,(0,s.Z)("form",{className:"posting-dialog-form",method:"POST",onSubmit:this.handleSubmit},void 0,(0,s.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(sn,e,(0,s.Z)("div",{className:"posting-loading ui-preview"},void 0,(0,s.Z)(Rt,{attachments:[],value:"",submitText:pgettext("post reply submit","Post reply"),disabled:!0,onAttachmentsChange:function(){},onChange:function(){}})))}}]),i}(D.Z),sn=function(e){var t=e.children,n=e.close,a=e.minimized,i=e.minimize,o=e.open,r=e.fullscreen,l=e.fullscreenEnter,c=e.fullscreenExit,u=e.thread;return(0,s.Z)(Tt,{fullscreen:r,minimized:a},void 0,(0,s.Z)(Mt,{fullscreen:r,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,s.Z)(At,{},void 0,t))};var 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,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:U()(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(),v.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,r.Z)(i,[{key:"componentDidMount",value:function(){H.Z.get(this.props.config).then(this.loadSuccess,this.loadError),B(!1,this.onQuote)}},{key:"componentWillUnmount",value:function(){I()}},{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 B(!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(),B(!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);B(!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,s.Z)(It,{message:this.state.error,close:this.close})):this.state.isReady?o().createElement(ln,t,(0,s.Z)("form",{className:"posting-dialog-form",method:"POST",onSubmit:this.handleSubmit},void 0,(0,s.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,s.Z)("div",{className:"posting-loading ui-preview"},void 0,(0,s.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,r=e.fullscreen,l=e.fullscreenEnter,c=e.fullscreenExit,u=e.post;return(0,s.Z)(Tt,{fullscreen:r,minimized:a},void 0,(0,s.Z)(Mt,{fullscreen:r,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,s.Z)(At,{},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(rn,e);default:return null}}},12891:(e,t,n)=>{"use strict";n.d(t,{Jh:()=>s,jn:()=>o});var a=n(55210),i=n(99170);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 s(){return i.Z.get("SETTINGS").post_length_max?[r(),(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)}))]:[r()]}function r(){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)}))}},60471:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var a=n(22928),i=n(15671),o=n(43144),s=n(97326),r=n(79340),l=n(6215),c=n(61120),u=n(4942),d=n(57588);var p=function(e){(0,r.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{"use strict";n.d(t,{Z:()=>b});var a,i=n(22928),o=n(15671),s=n(43144),r=n(79340),l=n(6215),c=n(61120),u=(n(57588),n(99170)),d=n(82211),p=n(43345),h=n(47235),v=n(78657),m=n(59801),f=n(53904),Z=n(93051),g=n(19755);var b=function(e){(0,r.Z)(b,e);var t,n,p=(t=b,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 b(e){var t;return(0,o.Z)(this,b),(t=p.call(this,e)).state={isLoading:!1,showActivation:!1,username:"",password:"",validators:{username:[],password:[]}},t}return(0,s.Z)(b,[{key:"clean",value:function(){return!!this.isValid()||(f.Z.error(pgettext("sign in modal","Fill out both fields.")),!1)}},{key:"send",value:function(){return v.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(''),e.append(''),e.find('input[type="hidden"]').val(v.Z.getCsrfToken()),e.find('input[name="redirect_to"]').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),m.Z.hide()):f.Z.error(e.detail):403===e.status&&e.ban?((0,Z.Z)(e.ban),m.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?"))))))}}]),b}(p.Z)},24678:(e,t,n)=>{"use strict";n.d(t,{Jj:()=>h,ZP:()=>p,pg:()=>v});var a=n(22928),i=n(15671),o=n(43144),s=n(79340),r=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,r.Z)(this,n)}}var p=function(e){(0,s.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,s.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),v=function(e){(0,s.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:()=>O});var a,i=n(22928),o=n(57588),s=n.n(o),r=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)(v,{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=m("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=m("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 v(e){var t=e.user,n=m("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 m(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)(r.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)(r.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,b,y,_=n(15671),k=n(43144),N=n(79340),x=n(6215),w=n(61120),C=n(44039);var R,E=function(e){(0,N.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,x.Z)(this,e)});function o(){return(0,_.Z)(this,o),a.apply(this,arguments)}return(0,k.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)(r.ZP,{size:"50",size2x:"80"}))))),(0,i.Z)("div",{className:"col-xs-9 col-sm-12 user-card-body"},void 0,b||(b=(0,i.Z)("div",{className:"user-card-avatar"},void 0,(0,i.Z)("span",{},void 0,(0,i.Z)(r.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," ")),y||(y=(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}(s().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 O(e){var t=e.cols,n=e.isReady,a=e.showStatus,o=e.users,s="col-xs-12 col-sm-4";return 4===t&&(s+=" 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:s},e.id,(0,i.Z)(Z,{showStatus:a,user:e}))})))):(0,i.Z)(S,{colClassName:s,cols:t})}},82125:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var a=n(15671),i=n(43144),o=n(97326),s=n(79340),r=n(6215),l=n(61120),c=n(4942),u=n(57588);var d=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,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,r.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),s=n(97326),r=n(79340),l=n(6215),c=n(61120),u=n(4942),d=n(57588);var p=function(e){(0,r.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{"use strict";n.d(t,{SW:()=>k,ry:()=>f,xn:()=>x});var a=window.misago_locale||"en-us",i=pgettext("time ago","moment ago"),o=pgettext("time ago","now"),s=pgettext("day at time","%(day)s at %(time)s"),r=pgettext("day at time","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=pgettext("short month","%(day)s %(month)s"),v=pgettext("short month","%(month)s %(year)s"),m=new Intl.RelativeTimeFormat(a,{numeric:"always",style:"long"}),f=new Intl.DateTimeFormat(a,{dateStyle:"full",timeStyle:"medium"}),Z=new Intl.DateTimeFormat(a,{month:"long",day:"numeric"}),g=new Intl.DateTimeFormat(a,{year:"numeric",month:"long",day:"numeric"}),b=new Intl.DateTimeFormat(a,{year:"2-digit",month:"short",day:"numeric"}),y=new Intl.DateTimeFormat(a,{weekday:"long"}),_=new Intl.DateTimeFormat(a,{timeStyle:"short"});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.ceil(a/60)*o;return m.format(u,"minute")}if(a<10800){var d=Math.ceil(a/3600)*o;return m.format(d,"hour")}return N(t,e)?n>0?r.replace("%(time)s",_.format(e)):_.format(e):function(e){var t=new Date;return t.setDate(t.getDate()-1),N(t,e)}(e)?c.replace("%(time)s",_.format(e)):function(e){var t=new Date;return t.setDate(t.getDate()+1),N(t,e)}(e)?l.replace("%(time)s",_.format(e)):n<0&&a<518400?function(e,t){return s.replace("%(day)s",e).replace("%(time)s",_.format(t))}(y.format(e),e):t.getFullYear()==e.getFullYear()?Z.format(e):g.format(e)}function N(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.ceil(n/60);return u.replace("%(time)s",a)}if(n<86400){var i=Math.ceil(n/3600);return d.replace("%(time)s",i)}if(n<604800){var s=Math.ceil(n/86400);return p.replace("%(time)s",s)}var r={};return b.formatToParts(e).forEach((function(e){var t=e.type,n=e.value;r[t]=n})),e.getFullYear()===t.getFullYear()?h.replace("%(day)s",r.day).replace("%(month)s",r.month):v.replace("%(year)s",r.year).replace("%(month)s",r.month)}},99170:(e,t,n)=>{"use strict";n.d(t,{Z:()=>I});var a=n(15671),i=n(43144),o=(n(58294),n(95377),n(68852),n(39737),n(14316),n(43204),n(7023),n(94028)),s=n.n(o);const r=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;n0&&t.length!==a.length;)o-=1,e.forEach(i);return n}}]),e}();var l=n(4942);function c(e){var t=e.closest("[hx-silent]");return!t||"true"!==t.getAttribute("hx-silent")}const u=(0,i.Z)((function e(){var t=this;(0,a.Z)(this,e),(0,l.Z)(this,"show",(function(){t.requests+=1,t.update()})),(0,l.Z)(this,"hide",(function(){t.requests&&(t.requests-=1,t.update())})),(0,l.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 d=n(19755);const p=(0,i.Z)((function e(t){var n=this;(0,a.Z)(this,e),(0,l.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,l.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")?s().ajax("POST",document.location.href,{target:n.modal,swap:"innerHTML",values:a}).then((function(){d(n.modal).modal("show")})):s().ajax("POST",document.location.href,{target:"#misago-htmx-root",swap:"outerHTML",values:a})})),(0,l.Z)(this,"onRemoveSelection",(function(e){document.querySelectorAll(n.selection).forEach((function(e){e.checked=!1})),n.update()})),(0,l.Z)(this,"registerEvents",(function(){document.body.addEventListener("click",(function(e){var t=e.target;"INPUT"===t.tagName&&"checkbox"===t.type&&n.update()})),s().onLoad((function(){return n.update()}))})),(0,l.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()}));var h=n(15861),v=n(64687),m=n.n(v),f={};function Z(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){f[t]||(f[t]={}),e.setAttribute("misago-validate-active","true");var s=null;i.addEventListener("keyup",(function(r){var l=r.target.value;a&&(l=l.trim()),0!==l.trim().length?f[t][l]?g(e,i,f[t][l]):(s&&window.clearTimeout(s),s=window.setTimeout((0,h.Z)(m().mark((function a(){var s,r;return m().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,y(t,o,l,n);case 2:s=a.sent,r=s.errors,f[t][l]=r,g(e,i,r);case 6:case"end":return a.stop()}}),a)}))),1e3)):function(e){e.classList.remove("has-error"),e.classList.remove("has-success"),b(e)}(e)}))}}}function g(e,t,n){n.length?function(e,t,n){e.classList.remove("has-success"),e.classList.add("has-error"),b(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"),b(e)}(e)}function b(e){e.querySelectorAll("[misago-dynamic-message]").forEach((function(e){return e.remove()}))}function y(e,t,n,a){return _.apply(this,arguments)}function _(){return(_=(0,h.Z)(m().mark((function e(t,n,a,i){var o,s;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 s=e.sent,e.next=9,s.json();case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}s().onLoad((function(e){(e||document).querySelectorAll("[misago-validate]").forEach(Z)}));var k=document.getElementById("misago-snackbars"),N=null;function x(){k.replaceChildren()}function w(){N&&window.clearTimeout(N),k.querySelectorAll(".snackbar").forEach((function(e){e.classList.add("in")})),N=window.setTimeout((function(){k.querySelectorAll(".snackbar").forEach((function(e){e.classList.add("out"),N=window.setTimeout(x,1e3)}))}),6e3)}function C(e,t){x(),N&&window.clearTimeout(N);var n=document.createElement("div");n.classList.add("snackbar"),n.classList.add("snackbar-"+e),n.innerText=t,n.role="alert",k.appendChild(n),N=window.setTimeout(w,100)}function R(e){C("danger",e)}function E(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)}s().onLoad(w),document.addEventListener("htmx:responseError",(function(e){E(e)&&R(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","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){E(e)&&R(pgettext("htmx response error","Site could not be reached"))})),document.addEventListener("htmx:timeout",(function(e){E(e)&&R(pgettext("htmx response error","Site took too long to reply"))}));var S=n(75557),O={};function L(e){var t=e.getAttribute("misago-timestamp");O[t]||(O[t]=new Date(t)),e.hasAttribute("misago-timestamp-title")||(e.setAttribute("misago-timestamp-title","true"),e.setAttribute("title",S.ry.format(O[t])));var n=e.getAttribute("misago-timestamp-format");e.textContent="short"==n?(0,S.xn)(O[t]):(0,S.SW)(O[t])}function P(e){(e||document).querySelectorAll("[misago-timestamp]").forEach(L)}document.querySelectorAll("[misago-timestamp]").forEach(L),P(),window.setInterval(P,55e3),s().onLoad(P);var T=n(19755),A=new u,B=new(function(){function e(){(0,a.Z)(this,e),this._initializers=[],this._context={},this.loader=A}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 r(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){C(e,t)}},{key:"snackbarInfo",value:function(e){!function(e){C("info",e)}(e)}},{key:"snackbarSuccess",value:function(e){!function(e){C("success",e)}(e)}},{key:"snackbarWarning",value:function(e){!function(e){C("warning",e)}(e)}},{key:"snackbarError",value:function(e){R(e)}},{key:"bulkModeration",value:function(e){return new p(e)}}]),e}());window.misago=B;const I=B;document.addEventListener("htmx:beforeRequest",(function(e){c(e.target)&&A.show()})),document.addEventListener("htmx:afterRequest",(function(e){c(e.target)&&A.hide()})),document.addEventListener("misago:afterModeration",(function(){T("#threads-moderation-modal").modal("hide")}))},58339:(e,t,n)=>{"use strict";var a=n(99170),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(99170),i=n(35486),o=n(78657),s=n(53904),r=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){r.Z.dispatch((0,i.r$)(e))}),(function(e){s.Z.apiError(e)}))}),45e3)},after:"auth"})},46226:(e,t,n)=>{"use strict";var a=n(99170),i=n(98274),o=n(59801),s=n(90287),r=n(62833);a.Z.addInitializer({name:"auth",initializer:function(){i.Z.init(s.Z,r.Z,o.Z)},after:"store"})},93240:(e,t,n)=>{"use strict";var a=n(99170),i=n(78657),o=n(93825),s=n(96142),r=n(53904);a.Z.addInitializer({name:"captcha",initializer:function(e){o.ZP.init(e,i.Z,s.Z,r.Z)}})},75147:(e,t,n)=>{"use strict";var a=n(22928),i=n(57588),o=n.n(i),s=n(99170),r=n(15671),l=n(43144),c=n(97326),u=n(79340),d=n(6215),p=n(61120),h=n(4942),v=n(78657);var m=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,r.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}),v.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}),v.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);s.Z.addInitializer({name:"component:accept-agreement",initializer:function(e){document.getElementById("required-agreement-mount")&&(0,f.Z)((0,a.Z)(m,{api:e.get("REQUIRED_AGREEMENT_API")}),"required-agreement-mount",!1)},after:"store"})},4894:(e,t,n)=>{"use strict";var a=n(37424),i=n(99170),o=n(22928),s=n(15671),r=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,s.Z)(this,i),a.apply(this,arguments)}return(0,r.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 v=n(4869);i.Z.addInitializer({name:"component:auth-message",initializer:function(){(0,v.Z)((0,a.$j)(h)(p),"auth-message-mount")},after:"store"})},29223:(e,t,n)=>{"use strict";var a=n(99170),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),s=n.n(o),r=n(73935),l=n.n(r),c=n(37424),u=n(993),d=n(40689),p=n(80261),h=n(15671),v=n(43144),m=n(79340),f=n(6215),Z=n(61120),g=n(59801),b=n(14467);const y=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,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 s(){return(0,h.Z)(this,s),o.apply(this,arguments)}return(0,v.Z)(s,[{key:"componentDidMount",value:function(){"?modal=login"===window.document.location.search&&window.setTimeout((function(){return g.Z.show(a||(a=(0,i.Z)(b.Z,{})))}),300)}},{key:"render",value:function(){return null}}]),s}(s().Component);function _(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 k(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 N,x=n(49021),w=n(97326),C=n(4942),R=n(63026),E=n(66462),S=n(94184),O=n.n(S);function L(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)(x.Aw,{},void 0,pgettext("notifications title","Notifications")),(0,i.Z)(x.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)(x.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:O()("btn",{"btn-primary":t,"btn-default":!t}),type:"button",onClick:a},void 0,n)}const T=function(e){(0,m.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)(L,{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?N||(N=(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,v.Z)(o,[{key:"getApiUrl",value:function(){return misago.get("NOTIFICATIONS_API")+"?limit=20"+(this.state.unread?"&filter=unread":"")}}]),o}(s().Component);function A(e){var t=e.id,n=e.className,a=e.badge,o=e.url,s=e.active,r=e.onClick,l=a?pgettext("navbar","You have unread notifications!"):pgettext("navbar","Open notifications");return(0,i.Z)("a",{id:t,className:O()("btn btn-navbar-icon",n,{active:s}),href:o,title:l,onClick:r},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 B(e){var t=e.id,n=e.className,a=e.badge,o=e.url;return(0,i.Z)(x.Lt,{id:t,toggle:function(e){var t=e.isOpen,s=e.toggle;return(0,i.Z)(A,{className:n,active:t,badge:a,url:o,onClick:function(e){e.preventDefault(),s()}})},menuClassName:"notifications-dropdown",menuAlignRight:!0},void 0,(function(e){var t=e.isOpen;return(0,i.Z)(T,{active:t})}))}var I;function j(e){var t=e.id,n=e.className,a=e.badge,o=e.url,s=e.active,r=e.onClick,l=a?pgettext("navbar","You have unread private threads!"):pgettext("navbar","Open private threads");return(0,i.Z)("a",{id:t,className:O()("btn btn-navbar-icon",n,{active:s}),href:o,title:l,onClick:r},void 0,!!a&&(0,i.Z)("span",{className:"navbar-item-badge"},void 0,a),I||(I=(0,i.Z)("span",{className:"material-icon"},void 0,"inbox")))}var D,z,U,q=n(62989);function M(e){var t=e.id,n=e.className,a=e.url,o=e.active,s=e.onClick;return(0,i.Z)("a",{id:t,className:O()("btn btn-navbar-icon",n,{active:o}),href:a,title:pgettext("navbar","Open search"),onClick:s},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)(x.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 z||(z=(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:O()("btn btn-navbar-icon",n,{active:a}),title:pgettext("navbar","Open menu"),type:"button",onClick:o},void 0,U||(U=(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)(x.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 $(e){var t=e.id,n=e.className,a=e.user,o=e.active,s=e.onClick;return(0,i.Z)("a",{id:t,className:O()("btn-navbar-image",n,{active:o}),href:a.url,title:pgettext("navbar","Open your options"),onClick:s},void 0,(0,i.Z)(G.ZP,{user:a,size:34}))}var W,Q,K,X,J=n(28166);function ee(e){var t=e.id,n=e.className,a=e.user;return(0,i.Z)(x.Lt,{id:t,toggle:function(e){var t=e.isOpen,o=e.toggle;return(0,i.Z)($,{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,r=e.user,l=e.searchUrl,c=e.notificationsUrl,h=e.privateThreadsUrl,v=e.showSearch,m=e.showPrivateThreads;return(0,i.Z)("div",{className:"container navbar-container"},void 0,s().createElement(_,n),(0,i.Z)("div",{className:"navbar-right"},void 0,a.length>0&&(0,i.Z)(k,{items:a}),!!v&&(0,i.Z)(F,{id:"navbar-search-dropdown",url:l}),!!v&&(0,i.Z)(M,{id:"navbar-search-overlay",url:l,onClick:function(e){t(u.UL()),e.preventDefault()}}),W||(W=(0,i.Z)(Y,{id:"navbar-site-nav-dropdown"})),(0,i.Z)(H,{id:"navbar-site-nav-overlay",onClick:function(){t(u.AU())}}),!!m&&(0,i.Z)(j,{id:"navbar-private-threads",badge:r.unreadPrivateThreads,url:h}),!!r&&(0,i.Z)(B,{id:"navbar-notifications-dropdown",badge:r.unreadNotifications,url:c}),!!r&&(0,i.Z)(A,{id:"navbar-notifications-overlay",badge:r.unreadNotifications,url:c,onClick:function(e){t(u.hN()),e.preventDefault()}}),!!r&&(0,i.Z)(ee,{id:"navbar-user-nav-dropdown",user:r}),!!r&&(0,i.Z)($,{id:"navbar-user-nav-overlay",user:r,onClick:function(e){t(u.T5()),e.preventDefault()}}),!r&&(Q||(Q=(0,i.Z)(p.Z,{className:"btn-navbar-sign-in"}))),!r&&!o&&(K||(K=(0,i.Z)(d.Z,{className:"btn-navbar-register"}))),!r&&!o&&(X||(X=(0,i.Z)(y,{})))))}));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),s=n.n(o),r=n(73935),l=n.n(r),c=n(37424),u=n(15671),d=n(43144),p=n(97326),h=n(79340),v=n(6215),m=n(61120),f=n(4942),Z=n(63026),g=n(66462),b=n(94184),y=n.n(b),_=n(49021),k=n(64836);function N(e){var t=e.children,n=e.open,a=e.showAll,o=e.showUnread,s=e.unread;return(0,i.Z)(k.a,{open:n},void 0,(0,i.Z)(k.i,{},void 0,pgettext("notifications title","Notifications")),(0,i.Z)(_.KE,{},void 0,(0,i.Z)(x,{active:!s,onClick:a},void 0,pgettext("notifications dropdown","All")),(0,i.Z)(x,{active:s,onClick:o},void 0,pgettext("notifications dropdown","Unread"))),t,(0,i.Z)(_.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 x(e){var t=e.active,n=e.children,a=e.onClick;return(0,i.Z)("button",{className:y()("btn",{"btn-primary":t,"btn-default":!t}),type:"button",onClick:a},void 0,n)}var w=function(e){(0,h.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,m.Z)(t);if(n){var i=(0,m.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,v.Z)(this,e)});function s(e){var t;return(0,u.Z)(this,s),t=o.call(this,e),(0,f.Z)((0,p.Z)(t),"render",(function(){return(0,i.Z)(N,{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,s=e.error;return o?a||(a=(0,i.Z)(g.Pu,{})):s?(0,i.Z)(g.lb,{error:s}):(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)(s,[{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"))}}]),s}(s().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),s=n(73935),r=n.n(s),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),v=n(64687),m=n.n(v),f=n(35486),Z=n(53904),g=n(60642),b=n(63026);const y=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 _=n(59131),k=n(66462);function N(e){var t=e.children;return(0,a.Z)("ul",{className:"nav nav-pills"},void 0,t)}var x=n(94184),w=n.n(x);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)(N,{},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,O,L,P=n(82211);function T(e){var t=e.baseUrl,n=e.data,i=e.disabled;return(0,a.Z)("div",{className:"misago-pagination"},void 0,(0,a.Z)(A,{url:t,disabled:i||!n||!n.hasPrevious},void 0,pgettext("notifications pagination","Latest")),(0,a.Z)(A,{url:t+"?before="+(n?n.firstCursor:""),disabled:i||!n||!n.hasPrevious},void 0,pgettext("notifications pagination","Newer")),(0,a.Z)(A,{url:t+"?after="+(n?n.lastCursor:""),disabled:i||!n||!n.hasNext},void 0,pgettext("notifications pagination","Older")))}function A(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 B(e){var t=e.baseUrl,n=e.data,i=e.disabled,o=e.bottom,s=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)(T,{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:s},void 0,O||(O=(0,a.Z)("span",{className:"material-icon"},void 0,"done_all")),pgettext("notifications","Mark all as read")))))}function I(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,s=n.query,r=i.props.filter,l=function(e){var t=misago.get("NOTIFICATIONS_URL");return"all"!==e&&(t+=e+"/"),t}(r);return(0,a.Z)(_.Z,{},void 0,(0,a.Z)(y,{title:pgettext("notifications title","Notifications"),subtitle:I(r)}),(0,a.Z)(E,{filter:r}),(0,a.Z)(b.Z,{filter:r,query:s},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,v){var g,b=v.loading,y={baseUrl:l,data:i,disabled:c||b||!i||0===i.results.length,markAllAsRead:(g=(0,h.Z)(m().mark((function n(){return m().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)(m().mark((function e(){return m().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||b?(0,a.Z)("div",{},void 0,o().createElement(B,y),L||(L=(0,a.Z)(k.Pu,{})),o().createElement(B,(0,p.Z)({},y,{bottom:!0}))):u?(0,a.Z)("div",{},void 0,o().createElement(B,y),n||(n=(0,a.Z)(k.lb,{error:u})),o().createElement(B,(0,p.Z)({},y,{bottom:!0}))):i?(!i.hasPrevious&&s&&window.history.replaceState({},"",l),(0,a.Z)("div",{},void 0,o().createElement(B,y),(0,a.Z)(k.uE,{filter:r,items:i.results,hasNext:i.hasNext,hasPrevious:i.hasPrevious}),o().createElement(B,(0,p.Z)({},y,{bottom:!0})))):null}))})))}));var D;n(4517);const z=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 U,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");r().render((0,a.Z)(l.zt,{store:q.Z.getStore()},void 0,U||(U=(0,a.Z)(z,{}))),n)}},after:"store"})},46016:(e,t,n)=>{"use strict";var a,i=n(37424),o=n(22928),s=n(15671),r=n(43144),l=n(97326),c=n(79340),u=n(6215),d=n(61120),p=n(4942),h=n(57588),v=n.n(h),m=n(30381),f=n.n(m),Z=n(37848);var g,b=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,s.Z)(this,l),i.apply(this,arguments)}return(0,r.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}(v().Component),y=n(33556),_=n(99170),k=n(55547),N=n(53328);var x,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,s.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})})),_.Z.has("PROFILE_BAN")?t.initWithPreloadedData(_.Z.pop("PROFILE_BAN")):t.initWithoutPreloadedData(),t.startPolling(e.profile.api.ban),t}return(0,r.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){k.Z.start({poll:"ban-details",url:e,frequency:9e4,update:this.update,error:this.error})}},{key:"componentDidMount",value:function(){N.Z.set({title:pgettext("profile ban details title","Ban details"),parent:this.props.profile.username})}},{key:"componentWillUnmount",value:function(){k.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)(y.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)(y.Z,{icon:"error_outline",message:this.state.error})):g||(g=(0,o.Z)("div",{},void 0,(0,o.Z)(b,{})))}},{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}(v().Component);function C(e){return e.display?(0,o.Z)(y.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?x||(x=(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,s.Z)(this,i);for(var t=arguments.length,n=new Array(t),o=0;o0&&void 0!==arguments[0]?arguments[0]:0;A.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}),B.Z.apiError(t)}))}},{key:"componentDidMount",value:function(){N.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)($.o8,{},void 0,(0,o.Z)($.Z2,{auto:!0},void 0,(0,o.Z)($.Eg,{auto:!0},void 0,(0,o.Z)("h3",{},void 0,this.props.header)))),v().createElement(oe,(0,J.Z)({isLoading:this.state.isLoading,loadMore:this.loadMore},this.props)))}}]),i}(v().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)(se,{isLoading:e.isLoading,loadMore:e.loadMore,next:e.posts.next}))}function se(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 re=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,s.Z)(this,i),a.apply(this,arguments)}return(0,r.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}(v().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,s.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(),_.Z.has(t.PRELOADED_DATA_KEY)?t.initWithPreloadedData(_.Z.pop(t.PRELOADED_DATA_KEY)):t.initWithoutPreloadedData(),t}return(0,r.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];A.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){B.Z.apiError(e)}))}},{key:"componentDidMount",value:function(){N.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)($.o8,{},void 0,(0,o.Z)($.Z2,{auto:!0},void 0,(0,o.Z)($.Eg,{auto:!0},void 0,(0,o.Z)("h3",{},void 0,this.getLabel()))),(0,o.Z)($.Z2,{},void 0,(0,o.Z)($.Eg,{},void 0,(0,o.Z)(re,{value:this.state.search,onChange:this.search,placeholder:pgettext("profile followers search","Search users...")})))),this.getListBody())}}]),i}(v().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,s.Z)(this,i),a.apply(this,arguments)}return(0,r.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,ve=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,s.Z)(this,i),a.apply(this,arguments)}return(0,r.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}(v().Component),me=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,s.Z)(this,i),a.apply(this,arguments)}return(0,r.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)(me.ZP,{user:this.props.change.changed_by,size:"100"})):pe||(pe=(0,o.Z)("span",{className:"user-avatar-wrapper"},void 0,(0,o.Z)(me.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}(v().Component);var Ze,ge,be=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,s.Z)(this,i),a.apply(this,arguments)}return(0,r.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}(v().Component),ye=n(44039);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(){return(0,s.Z)(this,i),a.apply(this,arguments)}return(0,r.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)(me.ZP,{size:"100"})))),(0,o.Z)("div",{className:"change-author"},void 0,(0,o.Z)("span",{className:"ui-preview-text",style:{width:ye.e(30,100)+"px"}},void 0," ")),(0,o.Z)("div",{className:"change"},void 0,(0,o.Z)("span",{className:"ui-preview-text",style:{width:ye.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:ye.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:ye.e(80,140)+"px"}},void 0," ")))}}]),i}(v().Component);var ke,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,s.Z)(this,i),a.apply(this,arguments)}return(0,r.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)(_e,{hiddenOnMobile:e>0},e)}))))}}]),i}(v().Component);var 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,s.Z)(this,i),a.apply(this,arguments)}return(0,r.Z)(i,[{key:"render",value:function(){return this.props.isLoaded?this.props.changes.length?(0,o.Z)(be,{changes:this.props.changes}):(0,o.Z)(ve,{emptyMessage:this.props.emptyMessage}):ke||(ke=(0,o.Z)(Ne,{}))}}]),i}(v().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,s.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)})),_.Z.has("PROFILE_NAME_HISTORY")?t.initWithPreloadedData(_.Z.pop("PROFILE_NAME_HISTORY")):t.initWithoutPreloadedData(),t}return(0,r.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;A.Z.get(_.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){B.Z.apiError(e)}))}},{key:"componentDidMount",value:function(){N.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)($.o8,{},void 0,(0,o.Z)($.Z2,{auto:!0},void 0,(0,o.Z)($.Eg,{auto:!0},void 0,(0,o.Z)("h3",{},void 0,this.getLabel()))),(0,o.Z)($.Z2,{},void 0,(0,o.Z)($.Eg,{},void 0,(0,o.Z)(re,{value:this.state.search,onChange:this.search,placeholder:pgettext("profile username history search input","Search history...")})))),(0,o.Z)(xe,{isLoaded:this.state.isLoaded,emptyMessage:this.getEmptyMessage(),changes:this.props["username-history"]}),this.getMoreButton())}}]),i}(v().Component),Re=n(82125),Ee=n(27519),Se=n(59131),Oe=n(98936),Le=n(99755);var Pe,Te=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,s.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})),A.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}),B.Z.apiError(e)}))})),t.state={isLoading:!1},t}return(0,r.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}(v().Component),Ae=n(64646);var Be,Ie,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,s.Z)(this,i);for(var t=arguments.length,n=new Array(t),o=0;o1?(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,r.Z)(i,[{key:"componentDidMount",value:function(){var e=this;A.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 A.Z.post(this.props.profile.api.delete,{with_content:this.state.with_content})}},{key:"handleSuccess",value:function(){k.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)(O.Z,{label:pgettext("profile delete","User content"),for:"id_with_content"},void 0,(0,o.Z)(ze.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:_.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)(Ue.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}(T.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,s.Z)(this,h);for(var t=arguments.length,n=new Array(t),o=0;o{"use strict";var a,i=n(99170),o=n(97326),s=n(4942),r=n(22928),l=n(15671),c=n(43144),u=n(79340),d=n(6215),p=n(61120),h=n(57588),v=n.n(h),m=n(82211),f=n(43345),Z=n(78657),g=n(53904),b=n(55210),y=n(93051);function _(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 k=function(e){(0,u.Z)(n,e);var t=_(n);function n(e){var a;return(0,l.Z)(this,n),(a=t.call(this,e)).state={isLoading:!1,email:"",validators:{email:[b.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,y.Z)(e.ban):g.Z.apiError(e)}},{key:"render",value:function(){return(0,r.Z)("div",{className:"well well-form well-form-request-activation-link"},void 0,(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"form-group"},void 0,(0,r.Z)("div",{className:"control-input"},void 0,(0,r.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,r.Z)(m.Z,{className:"btn-primary btn-block",loading:this.state.isLoading},void 0,pgettext("request activation link form btn","Send link"))))}}]),n}(f.Z),N=function(e){(0,u.Z)(n,e);var t=_(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,r.Z)("div",{className:"well well-form well-form-request-activation-link well-done"},void 0,(0,r.Z)("div",{className:"done-message"},void 0,a||(a=(0,r.Z)("div",{className:"message-icon"},void 0,(0,r.Z)("span",{className:"material-icon"},void 0,"check"))),(0,r.Z)("div",{className:"message-body"},void 0,(0,r.Z)("p",{},void 0,this.getMessage())),(0,r.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}(v().Component),x=function(e){(0,u.Z)(n,e);var t=_(n);function n(e){var a;return(0,l.Z)(this,n),a=t.call(this,e),(0,s.Z)((0,o.Z)(a),"complete",(function(e){a.setState({complete:e})})),(0,s.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,r.Z)(N,{user:this.state.complete,callback:this.reset}):(0,r.Z)(k,{callback:this.complete})}}]),n}(v().Component),w=n(4869);i.Z.addInitializer({name:"component:request-activation-link",initializer:function(){document.getElementById("request-activation-link-mount")&&(0,w.Z)(x,"request-activation-link-mount",!1)},after:"store"})},11768:(e,t,n)=>{"use strict";var a,i,o=n(99170),s=n(97326),r=n(4942),l=n(22928),c=n(15671),u=n(43144),d=n(79340),p=n(6215),h=n(61120),v=n(57588),m=n.n(v),f=n(73935),Z=n.n(f),g=n(82211),b=n(43345),y=n(78657),_=n(53904),k=n(55210),N=n(93051);function x(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=x(n);function n(e){var a;return(0,c.Z)(this,n),(a=t.call(this,e)).state={isLoading:!1,email:"",validators:{email:[k.Do()]}},a}return(0,u.Z)(n,[{key:"clean",value:function(){return!!this.isValid()||(_.Z.error(pgettext("request password reset form","Enter a valid e-mail address.")),!1)}},{key:"send",value:function(){return y.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,N.Z)(e.ban):_.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}(b.Z),C=function(e){(0,d.Z)(n,e);var t=x(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}(m().Component),R=function(e){(0,d.Z)(n,e);var t=x(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}(m().Component),E=function(e){(0,d.Z)(n,e);var t=x(n);function n(e){var a;return(0,c.Z)(this,n),a=t.call(this,e),(0,r.Z)((0,s.Z)(a),"complete",(function(e){a.setState({complete:e})})),(0,r.Z)((0,s.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}(m().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(99170),o=n(97326),s=n(4942),r=n(22928),l=n(15671),c=n(43144),u=n(79340),d=n(6215),p=n(61120),h=n(57588),v=n.n(h),m=n(73935),f=n.n(m),Z=n(82211),g=n(43345),b=n(14467),y=n(78657),_=n(98274),k=n(59801),N=n(53904),x=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||(N.Z.error(pgettext("password reset form","Enter new password.")),!1)}},{key:"send",value:function(){return y.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,x.Z)(e.ban):N.Z.apiError(e)}},{key:"render",value:function(){return(0,r.Z)("div",{className:"well well-form well-form-reset-password"},void 0,(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"form-group"},void 0,(0,r.Z)("div",{className:"control-input"},void 0,(0,r.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,r.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(){k.Z.show(b.Z)}},{key:"render",value:function(){return(0,r.Z)("div",{className:"page page-message page-message-success page-forgotten-password-changed"},void 0,(0,r.Z)("div",{className:"container"},void 0,(0,r.Z)("div",{className:"message-panel"},void 0,a||(a=(0,r.Z)("div",{className:"message-icon"},void 0,(0,r.Z)("span",{className:"material-icon"},void 0,"check"))),(0,r.Z)("div",{className:"message-body"},void 0,(0,r.Z)("p",{className:"lead"},void 0,this.getMessage()),(0,r.Z)("p",{},void 0,pgettext("password reset form","Sign in using new password to continue.")),(0,r.Z)("p",{},void 0,(0,r.Z)("button",{type:"button",className:"btn btn-primary",onClick:this.showSignIn},void 0,pgettext("password reset form btn","Sign in")))))))}}]),n}(v().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{"use strict";var a,i=n(22928),o=(n(57588),n(73935)),s=n.n(o),r=n(37424),l=n(62989),c=n(90287);misago.addInitializer({name:"component:search-overlay",initializer:function(e){var t=document.getElementById("search-mount");s().render((0,i.Z)(r.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),s=n(87462),r=n(57588),l=n.n(r),c=n(59131),u=n(15671),d=n(43144),p=n(97326),h=n(79340),v=n(6215),m=n(61120),f=n(4942),Z=n(99170),g=n(43345),b=n(21981),y=n(16427),_=n(6935),k=n(78657),N=n(53904),x=n(90287),w=n(98936),C=n(99755);var R=function(e){(0,h.Z)(s,e);var t,n,i=(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,m.Z)(t);if(n){var i=(0,m.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,v.Z)(this,e)});function s(e){var t;return(0,u.Z)(this,s),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)(s,[{key:"componentDidMount",value:function(){this.state.query.length&&this.handleSubmit()}},{key:"clean",value:function(){return!!this.state.query.trim().length||(N.Z.error(pgettext("search form","You have to enter search query.")),!1)}},{key:"send",value:function(){x.Z.dispatch((0,y.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)),k.Z.get(Z.Z.get("SEARCH_API"),{q:e})}},{key:"handleSuccess",value:function(e){x.Z.dispatch((0,y.Vx)({query:this.state.query.trim(),isLoading:!1,providers:e})),e.forEach((function(e){"users"===e.id?x.Z.dispatch((0,_.ZB)(e.results.results)):"threads"===e.id&&x.Z.dispatch((0,b.zD)(e.results))}))}},{key:"handleError",value:function(e){N.Z.apiError(e),x.Z.dispatch((0,y.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"))))))))))}}]),s}(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)(O,{results:e.results}))})))}function O(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 L(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 T=n(11005),A=n(82211);function B(e){return(0,o.Z)("div",{},void 0,(0,o.Z)(T.Z,{isReady:!0,posts:e.results}),l().createElement(I,e))}n(69092);var I=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,m.Z)(t);if(n){var i=(0,m.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,v.Z)(this,e)});function i(){var e;(0,u.Z)(this,i);for(var t=arguments.length,n=new Array(t),o=0;o{"use strict";var a,i=n(22928),o=(n(57588),n(73935)),s=n.n(o),r=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");s().render((0,i.Z)(r.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(99170),o=n(22928),s=n(15671),r=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,s.Z)(this,i),a.apply(this,arguments)}return(0,r.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 v(e){return e.snackbar}var m=n(4869);i.Z.addInitializer({name:"component:snackbar",initializer:function(){(0,m.Z)((0,a.$j)(v)(h),"snackbar-mount")},after:"snackbar"})},95920:(e,t,n)=>{"use strict";var a=n(57588),i=n.n(a),o=n(22928),s=n(15671),r=n(43144),l=n(97326),c=n(79340),u=n(6215),d=n(61120),p=n(4942),h=n(99170),v=n(26106),m=n(82211),f=n(43345),Z=n(96359),g=n(78657),b=n(53904),y=n(55210),_=n(59131),k=n(99755);const N=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)(k.sP,{},void 0,(0,o.Z)(k.mr,{styleName:"social-auth"},void 0,(0,o.Z)(k.gC,{styleName:"social-auth"},void 0,(0,o.Z)("h1",{},void 0,a))))};function x(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{"use strict";var a,i,o=n(37424),s=n(22928),r=n(15671),l=n(43144),c=n(97326),u=n(79340),d=n(6215),p=n(61120),h=n(4942),v=n(57588),m=n.n(v),f=n(87462),Z=n(43345),g=n(96359),b=n(8154),y=n(7738),_=n(78657),k=n(59801),N=n(53904),x=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,r.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||(N.Z.error(pgettext("add private thread participant","You have to enter user name.")),!1)}},{key:"send",value:function(){return _.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){x.Z.dispatch((0,y.y8)(e)),x.Z.dispatch(b.gx(e.participants)),N.Z.success(pgettext("add private thread participant","New participant has been added to thread.")),k.Z.hide()}},{key:"render",value:function(){return(0,s.Z)("div",{className:"modal-dialog modal-sm",role:"document"},void 0,(0,s.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,s.Z)("div",{className:"modal-content"},void 0,a||(a=(0,s.Z)(R,{})),(0,s.Z)("div",{className:"modal-body"},void 0,(0,s.Z)(g.Z,{for:"id_username",label:pgettext("add private thread participant field","User to add")},void 0,(0,s.Z)("input",{id:"id_username",className:"form-control",disabled:this.state.isLoading,onChange:this.onUsernameChange,type:"text",value:this.state.username}))),(0,s.Z)("div",{className:"modal-footer"},void 0,(0,s.Z)("button",{className:"btn btn-block btn-primary",disabled:this.state.isLoading},void 0,pgettext("add private thread participant btn","Add participant")),(0,s.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,s.Z)("div",{className:"modal-header"},void 0,(0,s.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,i||(i=(0,s.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,s.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,r.Z)(this,i);for(var t=arguments.length,n=new Array(t),o=0;o%(relative)s';function be(e){return(0,s.Z)("ul",{className:"list-unstyled list-inline poll-details"},void 0,(0,s.Z)(we,{votes:e.poll.votes}),(0,s.Z)(Ne,{poll:e.poll}),(0,s.Z)(Ce,{poll:e.poll}),(0,s.Z)(ye,{poll:e.poll}))}function ye(e){var t=interpolate((0,Ze.Z)(pgettext("thread poll","Started by %(poster)s %(posted_on)s.")),{poster:_e(e.poll),posted_on:ke(e.poll)},!0);return(0,s.Z)("li",{className:"poll-info-creation",dangerouslySetInnerHTML:{__html:t}})}function _e(e){return e.url.poster?interpolate('%(user)s',{url:(0,Ze.Z)(e.url.poster),user:(0,Ze.Z)(e.poster_name)},!0):interpolate('%(user)s',{user:(0,Ze.Z)(e.poster_name)},!0)}function ke(e){return interpolate(ge,{absolute:(0,Ze.Z)(e.posted_on.format("LLL")),relative:(0,Ze.Z)(e.posted_on.fromNow())},!0)}function Ne(e){if(!e.poll.length)return null;var t=interpolate((0,Ze.Z)(pgettext("thread poll","Voting ends %(ends_on)s.")),{ends_on:xe(e.poll)},!0);return(0,s.Z)("li",{className:"poll-info-ends-on",dangerouslySetInnerHTML:{__html:t}})}function xe(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,s.Z)("li",{className:"poll-info-votes"},void 0,n)}function Ce(e){return e.poll.is_public?(0,s.Z)("li",{className:"poll-info-public"},void 0,pgettext("thread poll","Voting is public.")):null}function Re(e){return(0,s.Z)("div",{className:"panel panel-default panel-poll"},void 0,(0,s.Z)("div",{className:"panel-body"},void 0,(0,s.Z)("h2",{},void 0,e.poll.question),(0,s.Z)(be,{poll:e.poll}),(0,s.Z)(H,{poll:e.poll}),(0,s.Z)(de,{isPollOver:e.isPollOver,poll:e.poll,edit:e.edit,showVoting:e.showVoting,thread:e.thread})))}function Ee(e){return(0,s.Z)("ul",{className:"list-unstyled list-inline poll-help"},void 0,(0,s.Z)(Se,{choicesLeft:e.choicesLeft}),(0,s.Z)(Oe,{poll:e.poll}))}function Se(e){var t=e.choicesLeft;if(0===t)return(0,s.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,s.Z)("li",{className:"poll-help-choices-left"},void 0,a)}function Oe(e){return e.poll.allow_revotes?(0,s.Z)("li",{className:"poll-help-allow-revotes"},void 0,pgettext("thread poll","You can change your vote later.")):(0,s.Z)("li",{className:"poll-help-no-revotes"},void 0,pgettext("thread poll","Votes are final."))}function Le(e){return(0,s.Z)("ul",{className:"list-unstyled poll-select-choices"},void 0,e.choices.map((function(t){return(0,s.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,r.Z)(this,i);for(var t=arguments.length,n=new Array(t),o=0;o2,choice:t,disabled:e.props.disabled,onChange:e.onChange,onDelete:e.onDelete},t.hash)}))),(0,s.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}(m().Component),qe=function(e){(0,u.Z)(n,e);var t=ze(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o%(relative)s',{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,s.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('%(relative)s',{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,s.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='%(name)s',st='%(name)s';function rt(e){return it[e.post.event_type]?(0,s.Z)("p",{className:"event-message"},void 0,it[e.post.event_type]):"changed_title"===e.post.event_type?m().createElement(lt,e):"moved"===e.post.event_type?m().createElement(ct,e):"merged"===e.post.event_type?m().createElement(ut,e):"changed_owner"===e.post.event_type?m().createElement(dt,e):"added_participant"===e.post.event_type?m().createElement(pt,e):"removed_participant"===e.post.event_type?m().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(st,{name:(0,Ze.Z)(e.post.event_context.old_title)},!0),a=interpolate(t,{old_title:n},!0);return(0,s.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,s.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(st,{name:(0,Ze.Z)(e.post.event_context.merged_thread)},!0),a=interpolate(t,{merged_thread:n},!0);return(0,s.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,s.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,s.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,s.Z)("p",{className:"event-message",dangerouslySetInnerHTML:{__html:a}})}function vt(e){return e.post.is_read?null:(0,s.Z)("div",{className:"event-label"},void 0,(0,s.Z)("span",{className:"label label-unread"},void 0,pgettext("event unread label","New event")))}var mt=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,r.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(){_.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 m().createElement("div",{className:this.props.className,ref:function(n){n&&t&&e.initialize(n)}},this.props.children)}}]),i}(m().Component);function ft(e){var t="event";return e.post.isDeleted?t="hide":e.post.is_hidden&&(t="event post-hidden"),(0,s.Z)("li",{id:"post-"+e.post.id,className:t},void 0,(0,s.Z)(vt,{post:e.post}),(0,s.Z)("div",{className:"event-body"},void 0,(0,s.Z)("div",{className:"event-icon"},void 0,m().createElement(Ye,e)),(0,s.Z)(mt,{className:"event-content",post:e.post},void 0,m().createElement(rt,e),m().createElement(tt,e))))}var Zt=n(69130),gt=n(48772);function bt(e){return(0,s.Z)("div",{className:"col-xs-12 col-md-6"},void 0,m().createElement(yt,e),(0,s.Z)("div",{className:"post-attachment"},void 0,(0,s.Z)("a",{href:e.attachment.url.index,className:"attachment-name item-title",target:"_blank"},void 0,e.attachment.filename),m().createElement(Nt,e)))}function yt(e){return e.attachment.is_image?(0,s.Z)("div",{className:"post-attachment-preview"},void 0,m().createElement(kt,e)):(0,s.Z)("div",{className:"post-attachment-preview"},void 0,m().createElement(_t,e))}function _t(e){return(0,s.Z)("a",{href:e.attachment.url.index,className:"material-icon"},void 0,"insert_drive_file")}function kt(e){var t=e.attachment.url.thumb||e.attachment.url.index;return(0,s.Z)("a",{className:"post-thumbnail",href:e.attachment.url.index,target:"_blank",style:{backgroundImage:'url("'+(0,Ze.Z)(t)+'")'}})}function Nt(e){var t;t=e.attachment.url.uploader?interpolate('%(user)s',{url:(0,Ze.Z)(e.attachment.url.uploader),user:(0,Ze.Z)(e.attachment.uploader_name)},!0):interpolate('%(user)s',{user:(0,Ze.Z)(e.attachment.uploader_name)},!0);var n=interpolate('%(relative)s',{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,s.Z)("p",{className:"post-attachment-description",dangerouslySetInnerHTML:{__html:a}})}function xt(e){return function(e){return(!e.is_hidden||e.acl.can_see_hidden)&&e.attachments}(e.post)?(0,s.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,s.Z)(wt,{row:e},t)}))):null}function wt(e){return(0,s.Z)("div",{className:"row"},void 0,e.row.map((function(e){return(0,s.Z)(bt,{attachment:e},e?e.id:0)})))}var Ct,Rt,Et,St,Ot,Lt,Pt,Tt=n(69092);function At(e){return e.post.is_hidden&&!e.post.acl.can_see_hidden?m().createElement(It,e):e.post.content?m().createElement(Bt,e):m().createElement(jt,e)}function Bt(e){var t=e.post,n="@"+(t.poster?t.poster.username:t.poster_name);return(0,s.Z)(mt,{className:"post-body",post:t},void 0,(0,s.Z)(Tt.Z,{author:n,markup:t.content}))}function It(e){var t;t=e.post.hidden_by?interpolate('%(user)s',{url:(0,Ze.Z)(e.post.url.hidden_by),user:(0,Ze.Z)(e.post.hidden_by_name)},!0):interpolate('%(user)s',{user:(0,Ze.Z)(e.post.hidden_by_name)},!0);var n=interpolate('%(relative)s',{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,s.Z)(mt,{className:"post-body post-body-hidden",post:e.post},void 0,(0,s.Z)("p",{className:"lead"},void 0,pgettext("post body hidden","This post is hidden. You cannot see its contents.")),(0,s.Z)("p",{className:"text-muted",dangerouslySetInnerHTML:{__html:a}}))}function jt(e){return(0,s.Z)(mt,{className:"post-body post-body-invalid",post:e.post},void 0,(0,s.Z)("p",{className:"lead"},void 0,pgettext("post body invalid","This post's contents cannot be displayed.")),(0,s.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,s.Z)("div",{className:"post-status-message post-status-best-answer"},void 0,Ct||(Ct=(0,s.Z)("span",{className:"material-icon"},void 0,"check_box")),(0,s.Z)("p",{},void 0,i))}function zt(e){return Mt(e.post)&&e.post.is_hidden?(0,s.Z)("div",{className:"post-status-message post-status-hidden"},void 0,Rt||(Rt=(0,s.Z)("span",{className:"material-icon"},void 0,"visibility_off")),(0,s.Z)("p",{},void 0,pgettext("post hidden flag","This post is hidden. Only users with permission may see its contents."))):null}function Ut(e){return Mt(e.post)&&e.post.is_unapproved?(0,s.Z)("div",{className:"post-status-message post-status-unapproved"},void 0,Et||(Et=(0,s.Z)("span",{className:"material-icon"},void 0,"remove_circle_outline")),(0,s.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,s.Z)("div",{className:"post-status-message post-status-protected visible-xs-block"},void 0,St||(St=(0,s.Z)("span",{className:"material-icon"},void 0,"lock_outline")),(0,s.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){x.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){x.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){x.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){x.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){x.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 $t(e){var t=e.post.last_likes||[],n=[e.user].concat(t),a=n.length>3?n.slice(0,-1):n;x.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 Wt(e){x.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){_.Z.patch(e.post.api.index,t).then((function(t){x.Z.dispatch(Ge.r$(e.post,t))}),(function(t){400===t.status?N.Z.error(t.detail[0]):N.Z.apiError(t),x.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!"))&&(x.Z.dispatch(Ge.r$(e.post,{isDeleted:!0})),_.Z.delete(e.post.api.index).then((function(){N.Z.success(pgettext("post delete","Post has been deleted."))}),(function(t){400===t.status?N.Z.error(t.detail):N.Z.apiError(t),x.Z.dispatch(Ge.r$(e.post,{isDeleted:!1}))})))}function Xt(e){var t=e.post,n=e.user;x.Z.dispatch(y.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;x.Z.dispatch(y.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){_.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)),x.Z.dispatch(y.Vx(e))}),(function(e){400===e.status?N.Z.error(e.detail[0]):N.Z.apiError(e),x.Z.dispatch(y.Vx(n))}))}var tn,nn,an,on,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,r.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;_.Z.get(this.props.post.api.likes).then((function(t){e.setState({isReady:!0,likes:t.map(rn)})}),(function(t){e.setState({isReady:!0,error:t.detail})}))}},{key:"render",value:function(){return this.state.error?(0,s.Z)(ln,{className:"modal-message"},void 0,(0,s.Z)(X.Z,{message:this.state.error})):this.state.isReady?this.state.likes.length?(0,s.Z)(ln,{className:"modal-sm",likes:this.state.likes},void 0,(0,s.Z)(cn,{likes:this.state.likes})):(0,s.Z)(ln,{className:"modal-message"},void 0,(0,s.Z)(X.Z,{message:pgettext("post likes modal","No users have liked this post.")})):Ot||(Ot=(0,s.Z)(ln,{className:"modal-sm"},void 0,(0,s.Z)(J.Z,{})))}}]),i}(m().Component);function rn(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,r=npgettext("post likes modal","%(likes)s like","%(likes)s likes",o);i=interpolate(r,{likes:o},!0)}return(0,s.Z)("div",{className:"modal-dialog "+(t||""),role:"document"},void 0,(0,s.Z)("div",{className:"modal-content"},void 0,(0,s.Z)("div",{className:"modal-header"},void 0,(0,s.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,Lt||(Lt=(0,s.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,s.Z)("h4",{className:"modal-title"},void 0,i)),n))}function cn(e){return(0,s.Z)("div",{className:"modal-body modal-post-likers"},void 0,(0,s.Z)("ul",{className:"media-list"},void 0,e.likes.map((function(e){return m().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,s.Z)("li",{className:"media"},void 0,(0,s.Z)("div",{className:"media-left"},void 0,(0,s.Z)("a",{className:"user-avatar",href:e.url},void 0,(0,s.Z)(B.ZP,{size:"50",user:t}))),(0,s.Z)("div",{className:"media-body"},void 0,(0,s.Z)("a",{className:"item-title",href:e.url},void 0,e.username)," ",(0,s.Z)(dn,{likedOn:e.liked_on})))}return(0,s.Z)("li",{className:"media"},void 0,Pt||(Pt=(0,s.Z)("div",{className:"media-left"},void 0,(0,s.Z)("span",{className:"user-avatar"},void 0,(0,s.Z)(B.ZP,{size:"50"})))),(0,s.Z)("div",{className:"media-body"},void 0,(0,s.Z)("strong",{},void 0,e.username)," ",(0,s.Z)(dn,{likedOn:e.liked_on})))}function dn(e){return(0,s.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,s.Z)("div",{className:"post-footer"},void 0,m().createElement(vn,e),m().createElement(mn,e),m().createElement(fn,e),m().createElement(Zn,(0,f.Z)({lastLikes:e.post.last_likes,likes:e.post.likes},e)),m().createElement(gn,(0,f.Z)({likes:e.post.likes},e)),m().createElement(kn,e),m().createElement(Nn,e),m().createElement(xn,e)):null}var vn=function(e){(0,u.Z)(n,e);var t=pn(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o0;return this.props.post.acl.can_see_likes&&e?2===this.props.post.acl.can_see_likes?(0,s.Z)("button",{className:"btn btn-link btn-sm pull-left hidden-xs",onClick:this.onClick,type:"button"},void 0,bn(this.props.likes,this.props.lastLikes)):(0,s.Z)("p",{className:"pull-left hidden-xs"},void 0,bn(this.props.likes,this.props.lastLikes)):null}}]),n}(m().Component),gn=function(e){(0,u.Z)(n,e);var t=pn(n);function n(){return(0,r.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,s.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,s.Z)("span",{className:"material-icon"},void 0,"favorite")),this.props.likes):(0,s.Z)("p",{className:"likes-compact pull-left visible-xs-block"},void 0,on||(on=(0,s.Z)("span",{className:"material-icon"},void 0,"favorite")),this.props.likes):null}}]),n}(Zn);function bn(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],s=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:s},!0);var r=npgettext("post likes","%(users)s and %(likes)s other user like this.","%(users)s and %(likes)s other users like this.",a);return interpolate(r,{users:n.join(", "),likes:a},!0)}var yn,_n,kn=function(e){(0,u.Z)(n,e);var t=pn(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o%(user)s',{url:(0,Ze.Z)(e.edit.url.editor),user:(0,Ze.Z)(e.edit.editor_name)},!0):interpolate('%(user)s',{user:(0,Ze.Z)(e.edit.editor_name)},!0);var n=interpolate('%(relative)s',{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,s.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,r.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),_.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;_.Z.post(n).then((function(e){var t=Ge.ZB(e);x.Z.dispatch(Ge.r$(e,t)),N.Z.success(pgettext("post revert","Post has been reverted to previous state.")),k.Z.hide()}),(function(e){N.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,s.Z)(Fn,{className:"modal-dialog modal-message"},void 0,(0,s.Z)(X.Z,{message:this.state.error})):this.state.isReady?(0,s.Z)(Fn,{},void 0,(0,s.Z)(Bn,{canRevert:this.state.canRevert,disabled:this.state.isBusy,edit:this.state.edit,goToEdit:this.goToEdit,revertEdit:this.revertEdit}),(0,s.Z)(Rn,{diff:this.state.edit.diff}),(0,s.Z)(Pn,{canRevert:this.state.canRevert,disabled:this.state.isBusy,edit:this.state.edit,revertEdit:this.revertEdit})):Tn||(Tn=(0,s.Z)(Fn,{},void 0,(0,s.Z)(J.Z,{})))}}]),i}(m().Component);function Fn(e){return(0,s.Z)("div",{className:e.className||"modal-dialog",role:"document"},void 0,(0,s.Z)("div",{className:"modal-content"},void 0,(0,s.Z)("div",{className:"modal-header"},void 0,(0,s.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,An||(An=(0,s.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,s.Z)("h4",{className:"modal-title"},void 0,pgettext("post history modal title","Post edits history"))),e.children))}var Hn,Vn,Yn,Gn,$n,Wn,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 m().createElement(va,(0,f.Z)({},e,{Form:ma}))}var ta,na,aa,ia,oa,sa,ra,la,ca,ua,da,pa,ha,va=function(e){(0,u.Z)(n,e);var t=Jn(n);function n(e){var a;return(0,r.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;_.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,s.Z)(Za,{message:this.state.isError}):this.state.isLoaded?m().createElement(ma,(0,f.Z)({},this.props,{categories:this.state.categories})):Hn||(Hn=(0,s.Z)(fa,{}))}}]),n}(m().Component),ma=function(e){(0,u.Z)(n,e);var t=Jn(n);function n(e){var a;return(0,r.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