pleroma/priv/static/packs/flavours/glitch/async/notifications.js

2 lines
23 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[77],{807:function(t,e,n){"use strict";n.r(e);var i=n(0),o=n(2),a=n(7),s=n(1),c=n(62),l=n.n(c),r=n(3),d=n.n(r),u=n(13),f=n(734),h=n(732),b=n(40),g=n(249),p=n(103),O=n(5),j=n.n(O),v=n(14),m=n.n(v),M=n(18),_=n(1058),w=n(6),C=n(295),y=n(210),P=n(466),k=n(745),x=n(23),I=function(t){function e(){for(var e,n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=t.call.apply(t,[this].concat(i))||this,Object(s.a)(Object(o.a)(e),"handleMoveUp",(function(){var t=e.props,n=t.notification;(0,t.onMoveUp)(n.get("id"))})),Object(s.a)(Object(o.a)(e),"handleMoveDown",(function(){var t=e.props,n=t.notification;(0,t.onMoveDown)(n.get("id"))})),Object(s.a)(Object(o.a)(e),"handleOpen",(function(){e.handleOpenProfile()})),Object(s.a)(Object(o.a)(e),"handleOpenProfile",(function(){var t=e.props.notification;e.context.router.history.push("/accounts/"+t.getIn(["account","id"]))})),Object(s.a)(Object(o.a)(e),"handleMention",(function(t){t.preventDefault();var n=e.props,i=n.notification;(0,n.onMention)(i.get("account"),e.context.router.history)})),e}Object(a.a)(e,t);var n=e.prototype;return n.getHandlers=function(){return{moveUp:this.handleMoveUp,moveDown:this.handleMoveDown,open:this.handleOpen,openProfile:this.handleOpenProfile,mention:this.handleMention,reply:this.handleMention}},n.render=function(){var t=this.props,e=t.account,n=t.notification,o=t.hidden,a=e.get("display_name_html")||e.get("username"),s=Object(i.a)("bdi",{},void 0,Object(i.a)(y.a,{className:"notification__display-name",href:e.get("url"),title:e.get("acct"),to:"/accounts/"+e.get("id"),dangerouslySetInnerHTML:{__html:a}}));return Object(i.a)(C.HotKeys,{handlers:this.getHandlers()},void 0,Object(i.a)("div",{className:"notification notification-follow focusable",tabIndex:"0"},void 0,Object(i.a)("div",{className:"notification__message"},void 0,Object(i.a)("div",{className:"notification__favourite-icon-wrapper"},void 0,Object(i.a)(x.a,{fixedWidth:!0,id:"user-plus"})),Object(i.a)(w.b,{id:"notification.follow",defaultMessage:"{name} followed you",values:{name:s}})),Object(i.a)(P.a,{hidden:o,id:e.get("id"),withNote:!1}),Object(i.a)(k.a,{notification:n})))},e}(M.a);Object(s.a)(I,"propTypes",{hidden:j.a.bool,id:j.a.string.isRequired,account:m.a.map.isRequired,notification:m.a.map.isRequired});var N,q,S,U=n(91),D=n(93),W=n(39),T=Object(w.f)({authorize:{id:"follow_request.authorize",defaultMessage:"Authorize"},reject:{id:"follow_request.reject",defaultMessage:"Reject"}}),F=Object(w.g)((S=q=function(t){function e(){for(var e,n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=t.call.apply(t,[this].concat(i))||this,Object(s.a)(Object(o.a)(e),"handleMoveUp",(function(){var t=e.props,n=t.notification;(0,t.onMoveUp)(n.get("id"))})),Object(s.a)(Object(o.a)(e),"handleMoveDown",(function(){var t=e.props,n=t.notification;(0,t.onMoveDown)(n.get("id"))})),Object(s.a)(Object(o.a)(e),"handleOpen",(function(){e.handleOpenProfile()})),Object(s.a)(Object(o.a)(e),"handleOpenProfile",(function(){var t=e.props.notification;e.context.router.history.push("/accounts/"+t.getIn(["account","id"]))})),Object(s.a)(Object(o.a)(e),"handleMention",(function(t){t.preventDefault();var n=e.props,i=n.notification;(0,n.onMention)(i.get("account"),e.context.router.history)})),e}Object(a.a)(e,t);var n=e.prototype;return n.getHandlers=function(){return{moveUp:this.handleMoveUp,moveDown:this.handleMoveDown,open:this.handleOpen,openProfile:this.handleOpenProfile,mention:this.handleMention,reply:this.handleMention}},n.render=function(){var t=this.props,e=t.intl,n=t.hidden,o=t.account,a=t.onAuthorize,s=t.onReject,c=t.notification;if(!o)return Object(i.a)("div",{});if(n)return Object(i.a)(r.Fragment,{},void 0,o.get("display_name"),o.get("username"));var l=o.get("display_name_html")||o.get("username"),d=Object(i.a)("bdi",{},void 0,Object(i.a)(y.a,{className:"notification__display-name",href:o.get("url"),title:o.get("acct"),to:"/accounts/"+o.get("id"),dangerouslySetInnerHTML:{__html:l}}));return Object(i.a)(C.HotKeys,{handlers:this.getHandlers()},void 0,Object(i.a)("div",{className:"notification notification-follow-request focusable",tabIndex:"0"},void 0,Object(i.a)("div",{className:"notification__message"},void 0,Object(i.a)("div",{className:"notification__favourite-icon-wrapper"},void 0,Object(i.a)(x.a,{id:"user",fixedWidth:!0})),Object(i.a)(w.b,{id:"notification.follow_request",defaultMessage:"{name} has requested to follow you",values:{name:d}})),Object(i.a)("div",{className:"account"},void 0,Object(i.a)("div",{className:"account__wrapper"},void 0,Object(i.a)(y.a,{className:"account__display-name",title:o.get("acct"),href:o.get("url"),to:"/accounts/"+o.get("id")},o.get("id"),Object(i.a)("div",{className:"account__avatar-wrapper"},void 0,Object(i.a)(U.a,{account:o,size:36})),Object(i.a)(D.a,{account:o})),Object(i.a)("div",{className:"account__relationship"},void 0,Object(i.a)(W.a,{title:e.formatMessage(T.authorize),icon:"check",onClick:a}),Object(i.a)(W.a,{title:e.formatMessage(T.reject),icon:"times",onClick:s})))),Object(i.a)(k.a,{notification:c})))},e}(M.a),Object(s.a)(q,"propTypes",{account:m.a.map.isRequired,onAuthorize:j.a.func.isRequired,onReject:j.a.func.isRequired,intl:j.a.object.isRequired,notification:m.a.map.isRequired}),N=S))||N,R=n(22),A=Object(u.connect)(null,(function(t,e){var n=e.account;return{onAuthorize:function(){t(Object(R.y)(n.get("id")))},onReject:function(){t(Object(R.P)(n.get("id")))}}}))(F),L=function(t){function e(){return t.apply(this,arguments)||this}return Object(a.a)(e,t),e.prototype.render=function(){var t=this.props,e=t.hidden,n=t.notification,o=t.onMoveDown,a=t.onMoveUp,s=t.onMention,c=t.getScrollPosition,l=t.updateScrollBottom;switch(n.get("type")){case"follow":return Object(i.a)(I,{hidden:e,id:n.get("id"),account:n.get("account"),notification:n,onMoveDown:o,onMoveUp:a,onMention:s});case"follow_request":return Object(i.a)(A,{hidden:e,id:n.get("id"),account:n.get("account"),notification:n,onMoveDown:o,onMoveUp:a,onMention:s});case"mention":return Object(i.a)(_.a,{containerId:n.get("id"),hidden:e,id:n.get("status"),notification:n,onMoveDown:o,onMoveUp:a,onMention:s,contextType:"notifications",getScrollPosition:c,updateScrollBottom:l,cachedMediaWidth:this.props.cachedMediaWidth,cacheMediaWidth:this.props.cacheMediaWidth,onUnmount:this.props.onUnmount,withDismiss:!0});case"favourite":return Object(i.a)(_.a,{containerId:n.get("id"),hidden:e,id:n.get("status"),account:n.get("account"),prepend:"favourite",muted:!0,notification:n,onMoveDown:o,onMoveUp:a,onMention:s,getScrollPosition:c,updateScrollBottom:l,cachedMediaWidth:this.props.cachedMediaWidth,cacheMediaWidth:this.props.cacheMediaWidth,onUnmount:this.props.onUnmount,withDismiss:!0});case"reblog":return Object(i.a)(_.a,{containerId:n.get("id"),hidden:e,id:n.get("status"),account:n.get("account"),prepend:"reblog",muted:!0,notification:n,onMoveDown:o,onMoveUp:a,onMention:s,getScrollPosition:c,updateScrollBottom:l,cachedMediaWidth:this.props.cachedMediaWidth,cacheMediaWidth:this.props.cacheMediaWidth,onUnmount:this.props.onUnmount,withDismiss:!0});case"poll":return Object(i.a)(_.a,{containerId:n.get("id"),hidden:e,id:n.get("status"),account:n.get("account"),prepend:"poll",muted:!0,notification:n,onMoveDown:o,onMoveUp:a,onMention:s,getScrollPosition:c,updateScrollBottom:l,cachedMediaWidth:this.props.cachedMediaWidth,cacheMediaWidth:this.props.cacheMediaWidth,onUnmount:this.props.onUnmount,withDismiss:!0});default:return null}},e}(M.a);Object(s.a)(L,"propTypes",{notification:m.a.map.isRequired,hidden:j.a.bool,onMoveUp:j.a.func.isRequired,onMoveDown:j.a.func.isRequired,onMention:j.a.func.isRequired,getScrollPosition:j.a.func,updateScrollBottom:j.a.func,cacheMediaWidth:j.a.func,cachedMediaWidth:j.a.number,onUnmount:j.a.func});var z,B,H,E,K=n(19),G=Object(u.connect)((function(){var t=Object(p.e)();return function(e,n){return{notification:t(e,n.notification,n.accountId),notifCleaning:e.getIn(["notifications","cleaningMode"])}}}),(function(t){return{onMention:function(e,n){t(Object(K.hb)(e,n))}}}))(L),J=function(t){function e(){return t.apply(this,arguments)||this}return Object(a.a)(e,t),e.prototype.render=function(){return Object(i.a)("button",{className:"text-btn column-header__setting-btn",tabIndex:"0",onClick:this.props.onClick},void 0,Object(i.a)(x.a,{id:"eraser"})," ",Object(i.a)(w.b,{id:"notifications.clear",defaultMessage:"Clear notifications"}))},e}(d.a.Component),V=n(1073),Q=function(t){function e(){for(var e,n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=t.call.apply(t,[this].concat(i))||this,Object(s.a)(Object(o.a)(e),"onPushChange",(function(t,n){e.props.onChange(["push"].concat(t),n)})),e}return Object(a.a)(e,t),e.prototype.render=function(){var t=this.props,e=t.settings,n=t.pushSettings,o=t.onChange,a=t.onClear,s=Object(i.a)(w.b,{id:"notifications.column_settings.filter_bar.show",defaultMessage:"Show"}),c=Object(i.a)(w.b,{id:"notifications.column_settings.filter_bar.advanced",defaultMessage:"Display all categories"}),l=Object(i.a)(w.b,{id:"notifications.column_settings.alert",defaultMessage:"Desktop notifications"}),r=Object(i.a)(w.b,{id:"notifications.column_settings.show",defaultMessage:"Show in column"}),d=Object(i.a)(w.b,{id:"notifications.column_settings.sound",defaultMessage:"Play sound"}),u=n.get("browserSupport")&&n.get("isSubscribed"),f=u&&Object(i.a)(w.b,{id:"notifications.column_settings.push",defaultMessage:"Push notifications"}),h=u&&Object(i.a)(w.b,{id:"notifications.column_settings.push_meta",defaultMessage:"This device"});return Object(i.a)("div",{},void 0,Object(i.a)("div",{className:"column-settings__row"},void 0,Object(i.a)(J,{onClick:a})),Object(i.a)("div",{role:"group","aria-labelledby":"notifications-filter-bar"},void 0,Object(i.a)("span",{id:"notifications-filter-bar",className:"column-settings__section"},void 0,Object(i.a)(w.b,{id:"notifications.column_settings.filter_bar.category",defaultMessage:"Quick filter bar"})),Object(i.a)("div",{className:"column-settings__row"},void 0,Object(i.a)(V.a,{id:"show-filter-bar",prefix:"notifications",settings:e,settingPath:["quickFilter","show"],onChange:o,label:s}),Object(i.a)(V.a,{id:"show-filter-bar",prefix:"notifications",settings:e,settingPath:["quickFilter","advanced"],onChange:o,label:c}))),Object(i.a)("div",{role:"group","aria-labelledby":"notifications-follow"},void 0,Object(i.a)("span",{id:"notifications-follow",className:"column-settings__section"},void 0,Object(i.a)(w.b,{id:"notifications.column_settings.follow",defaultMessage:"New followers:"})),Object(i.a)("div",{className:"column-settings__row"},void 0,Object(i.a)(V.a,{prefix:"notifications_desktop",settings:e,settingPath:["alerts","follow"],onChange:o,label:l}),u&&Object(i.a)(V.a,{prefix:"notifications_push",settings:n,settingPath:["alerts","follow"],meta:h,onChange:this.onPushChange,label:f}),Object(i.a)(V.a,{prefix:"notifications",settings:e,settingPath:["shows","follow"],onChange:o,label:r}),Object(i.a)(V.a,{prefix:"notifications",settings:e,settingPath:["sounds","follow"],onChange:o,label:d}))),Object(i.a)("div",{role:"group","aria-labelledby":"notifications-follow-request"},void 0,Object(i.a)("span",{id:"notifications-follow-request",className:"column-settings__section"},void 0,Object(i.a)(w.b,{id:"notifications.column_settings.follow_request",defaultMessage:"New follow requests:"})),Object(i.a)("div",{className:"column-settings__row"},void 0,Object(i.a)(V.a,{prefix:"notifications_desktop",settings:e,settingPath:["alerts","follow_request"],onChange:o,label:l}),u&&Object(i.a)(V.a,{prefix:"notifications_push",settings:n,settingPath:["alerts","follow_request"],onChange:this.onPushChange,label:f}),Object(i.a)(V.a,{prefix:"notifications",settings:e,settingPath:["shows","follow_request"],onChange:o,label:r}),Object(i.a)(V.a,{prefix:"notifications",settings:e,settingPath:["sounds","follow_request"],onChange:o,label:d}))),Object(i.a)("div",{role:"group","aria-labelledby":"notifications-favourite"},void 0,Object(i.a)("span",{id:"notifications-favourite",className:"column-settings__section"},void 0,Object(i.a)(w.b,{id:"notifications.column_settings.favourite",defaultMessage:"Favourites:"})),Object(i.a)("div",{className:"column-settings__row"},void 0,Object(i.a)(V.a,{prefix:"notifications_desktop",settings:e,settingPath:["alerts","favourite"],onChange:o,label:l}),u&&Object(i.a)(V.a,{prefix:"notifications_push",settings:n,settingPath:["alerts","favourite"],meta:h,onChange:this.onPushChange,label:f}),Object(i.a)(V.a,{prefix:"notifications",settings:e,settingPath:["shows","favourite"],onChange:o,label:r}),Object(i.a)(V.a,{prefix:"notifications",settings:e,settingPath:["sounds","favourite"],onChange:o,label:d}))),Object(i.a)("div",{role:"group","aria-labelledby":"notifications-mention"},void 0,Object(i.a)("span",{id:"notifications-mention",className:"column-settings__section"},void 0,Object(i.a)(w.b,{id:"notifications.column_settings.mention",defaultMessage:"Mentions:"})),Object(i.a)("div",{className:"column-settings__row"},void 0,Object(i.a)(V.a,{prefix:"notifications_desktop",settings:e,settingPath:["alerts","mention"],onChange:o,label:l}),u&&Object(i.a)(V.a,{prefix:"notifications_push",settings:n,settingPath:["alerts","mention"],meta:h,onChange:this.onPushChange,label:f}),Object(i.a)(V.a,{prefix:"notifications",settings:e,settingPath:["shows","mention"],onChange:o,label:r}),Object(i.a)(V.a,{prefix:"notifications",settings:e,settingPath:["sounds","mention"],onChange:o,label:d}))),Object(i.a)("div",{role:"group","aria-labelledby":"notifications-reblog"},void 0,Object(i.a)("span",{id:"notifications-reblog",className:"column-settings__section"},void 0,Object(i.a)(w.b,{id:"notifications.column_settings.reblog",defaultMessage:"Boosts:"})),Object(i.a)("div",{className:"column-settings__row"},void 0,Object(i.a)(V.a,{prefix:"notifications_desktop",settings:e,settingPath:["alerts","reblog"],onChange:o,label:l}),u&&Object(i.a)(V.a,{prefix:"notifications_push",settings:n,settingPath:["alerts","reblog"],meta:h,onChange:this.onPushChange,label:f}),Object(i.a)(V.a,{prefix:"notifications",settings:e,settingPath:["shows","reblog"],onChange:o,label:r}),Object(i.a)(V.a,{prefix:"notifications",settings:e,settingPath:["sounds","reblog"],onChange:o,label:d}))),Object(i.a)("div",{role:"group","aria-labelledby":"notifications-poll"},void 0,Object(i.a)("span",{id:"notifications-poll",className:"column-settings__section"},void 0,Object(i.a)(w.b,{id:"notifications.column_settings.poll",defaultMessage:"Poll results:"})),Object(i.a)("div",{className:"column-settings__row"},void 0,Object(i.a)(V.a,{prefix:"notifications_desktop",settings:e,settingPath:["alerts","poll"],onChange:o,label:l}),u&&Object(i.a)(V.a,{prefix:"notifications_push",settings:n,settingPath:["alerts","poll"],meta:h,onChange:this.onPushChange,label:f}),Object(i.a)(V.a,{prefix:"notifications",settings:e,settingPath:["shows","poll"],onChange:o,label:r}),Object(i.a)(V.a,{prefix:"notifications",settings:e,settingPath:["sounds","poll"],onChange:o,label:d}))))},e}(d.a.PureComponent),Y=n(69),X=n(227),Z=n(42),$=Object(w.f)({clearMessage:{id:"notifications.clear_confirmation",defaultMessage:"Are you sure you want to permanently clear all your notifications?"},clearConfirm:{id:"notifications.clear",defaultMessage:"Clear notifications"}}),tt=Object(w.g)(Object(u.connect)((function(t){return{settings:t.getIn(["settings","notifications"]),pushSettings:t.get("push_notifications")}}),(function(t,e){var n=e.intl;return{onChange:function(e,n){"push"===e[0]?t(Object(X.e)(e.slice(1),n)):"quickFilter"===e[0]?(t(Object(Y.c)(["notifications"].concat(e),n)),t(Object(b.B)("all"))):t(Object(Y.c)(["notifications"].concat(e),n))},onClear:function(){t(Object(Z.d)("CONFIRM",{message:n.formatMessage($.clearMessage),confirm:n.formatMessage($.clearConfirm),onConfirm:function(){return t(Object(b.r)())}}))}}}))(Q)),et=Object(w.f)({mentions:{id:"notifications.filter.mentions",defaultMessage:"Mentions"},favourites:{id:"notifications.filter.favourites",defaultMessage:"Favourites"},boosts:{id:"notifications.filter.boosts",defaultMessage:"Boosts"},polls:{id:"notifications.filter.polls",defaultMessage:"Poll results"},follows:{id:"notifications.filter.follows",defaultMessage:"Follows"}}),nt=Object(w.g)(z=function(t){function e(){return t.apply(this,arguments)||this}Object(a.a)(e,t);var n=e.prototype;return n.onClick=function(t){var e=this;return function(){return e.props.selectFilter(t)}},n.render=function(){var t=this.props,e=t.selectedFilter,n=t.advancedMode,o=t.intl;return n?Object(i.a)("div",{className:"notification__filter-bar"},void 0,Object(i.a)("button",{className:"all"===e?"active":"",onClick:this.onClick("all")},void 0,Object(i.a)(w.b,{id:"notifications.filter.all",defaultMessage:"All"})),Object(i.a)("button",{className:"mention"===e?"active":"",onClick:this.onClick("mention"),title:o.formatMessage(et.mentions)},void 0,Object(i.a)(x.a,{id:"reply-all",fixedWidth:!0})),Object(i.a)("button",{className:"favourite"===e?"active":"",onClick:this.onClick("favourite"),title:o.formatMessage(et.favourites)},void 0,Object(i.a)(x.a,{id:"star",fixedWidth:!0})),Object(i.a)("button",{className:"reblog"===e?"active":"",onClick:this.onClick("reblog"),title:o.formatMessage(et.boosts)},void 0,Object(i.a)(x.a,{id:"retweet",fixedWidth:!0})),Object(i.a)("button",{className:"poll"===e?"active":"",onClick:this.onClick("poll"),title:o.formatMessage(et.polls)},void 0,Object(i.a)(x.a,{id:"tasks",fixedWidth:!0})),Object(i.a)("button",{className:"follow"===e?"active":"",onClick:this.onClick("follow"),title:o.formatMessage(et.follows)},void 0,Object(i.a)(x.a,{id:"user-plus",fixedWidth:!0}))):Object(i.a)("div",{className:"notification__filter-bar"},void 0,Object(i.a)("button",{className:"all"===e?"active":"",onClick:this.onClick("all")},void 0,Object(i.a)(w.b,{id:"notifications.filter.all",defaultMessage:"All"})),Object(i.a)("button",{className:"mention"===e?"active":"",onClick:this.onClick("mention")},void 0,Object(i.a)(w.b,{id:"notifications.filter.mentions",defaultMessage:"Mentions"})))},e}(d.a.PureComponent))||z,it=Object(u.connect)((function(t){return{selectedFilter:t.getIn(["settings","notifications","quickFilter","active"]),advancedMode:t.getIn(["settings","notifications","quickFilter","advanced"])}}),(function(t){return{selectFilter:function(e){t(Object(b.B)(e))}}}))(nt),ot=n(54),at=n(4),st=n(1022),ct=n(1114);n.d(e,"default",(function(){return dt}));var lt=Object(w.f)({title:{id:"column.notifications",defaultMessage:"Notifications"}}),rt=Object(ot.a)([function(t){return t.getIn(["settings","notifications","quickFilter","show"])},function(t){return t.getIn(["settings","notifications","quickFilter","active"])},function(t){return Object(at.List)(t.getIn(["settings","notifications","shows"]).filter((function(t){return!t})).keys())},function(t){return t.getIn(["notifications","items"])}],(function(t,e,n,i){return t&&"all"!==e?i.filter((function(t){return null!==t&&e===t.get("type")})):i.filterNot((function(t){return null!==t&&n.includes(t.get("type"))}))})),dt=Object(u.connect)((function(t){return{showFilterBar:t.getIn(["settings","notifications","quickFilter","show"]),notifications:rt(t),localSettings:t.get("local_settings"),isLoading:t.getIn(["notifications","isLoading"],!0),isUnread:t.getIn(["notifications","unread"])>0||t.getIn(["notifications","pendingItems"]).size>0,hasMore:t.getIn(["notifications","hasMore"]),numPending:t.getIn(["notifications","pendingItems"],Object(at.List)()).size,notifCleaningActive:t.getIn(["notifications","cleaningMode"])}}),(function(t){return{onEnterCleaningMode:function(e){t(Object(b.t)(e))},onMount:function(){t(Object(b.y)())},onUnmount:function(){t(Object(b.C)())},dispatch:t}}))(B=Object(w.g)((E=H=function(t){function e(){for(var e,n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=t.call.apply(t,[this].concat(i))||this,Object(s.a)(Object(o.a)(e),"handleLoadGap",(function(t){e.props.dispatch(Object(b.u)({maxId:t}))})),Object(s.a)(Object(o.a)(e),"handleLoadOlder",l()((function(){var t=e.props.notifications.last();e.props.dispatch(Object(b.u)({maxId:t&&t.get("id")}))}),300,{leading:!0})),Object(s.a)(Object(o.a)(e),"handleLoadPending",(function(){e.props.dispatch(Object(b.v)())})),Object(s.a)(Object(o.a)(e),"handleScrollToTop",l()((function(){e.props.dispatch(Object(b.A)(!0))}),100)),Object(s.a)(Object(o.a)(e),"handleScroll",l()((function(){e.props.dispatch(Object(b.A)(!1))}),100)),Object(s.a)(Object(o.a)(e),"handlePin",(function(){var t=e.props,n=t.columnId,i=t.dispatch;i(n?Object(g.h)(n):Object(g.e)("NOTIFICATIONS",{}))})),Object(s.a)(Object(o.a)(e),"handleMove",(function(t){var n=e.props,i=n.columnId;(0,n.dispatch)(Object(g.g)(i,t))})),Object(s.a)(Object(o.a)(e),"handleHeaderClick",(function(){e.column.scrollTop()})),Object(s.a)(Object(o.a)(e),"setColumnRef",(function(t){e.column=t})),Object(s.a)(Object(o.a)(e),"handleMoveUp",(function(t){var n=e.props.notifications.findIndex((function(e){return null!==e&&e.get("id")===t}))-1;e._selectChild(n,!0)})),Object(s.a)(Object(o.a)(e),"handleMoveDown",(function(t){var n=e.props.notifications.findIndex((function(e){return null!==e&&e.get("id")===t}))+1;e._selectChild(n,!1)})),e}Object(a.a)(e,t);var n=e.prototype;return n._selectChild=function(t,e){var n=this.column.node,i=n.querySelector("article:nth-of-type("+(t+1)+") .focusable");i&&(e&&n.scrollTop>i.offsetTop?i.scrollIntoView(!0):!e&&n.scrollTop+n.clientHeight<i.offsetTop+i.offsetHeight&&i.scrollIntoView(!1),i.focus())},n.componentDidMount=function(){var t=this.props.onMount;t&&t()},n.componentWillUnmount=function(){var t=this.props.onUnmount;t&&t()},n.render=function(){var t=this,e=this.props,n=e.intl,o=e.notifications,a=e.shouldUpdateScroll,s=e.isLoading,c=e.isUnread,l=e.columnId,r=e.multiColumn,u=e.hasMore,b=e.numPending,g=e.showFilterBar,p=!!l,O=Object(i.a)(w.b,{id:"empty_column.notifications",defaultMessage:"You don't have any notifications yet. Interact with others to start the conversation."}),j=null,v=g?Object(i.a)(it,{}):null;j=s&&this.scrollableContent?this.scrollableContent:o.size>0||u?o.map((function(e,n){return null===e?Object(i.a)(ct.a,{disabled:s,maxId:n>0?o.getIn([n-1,"id"]):null,onClick:t.handleLoadGap},"gap:"+o.getIn([n+1,"id"])):Object(i.a)(G,{notification:e,accountId:e.get("account"),onMoveUp:t.handleMoveUp,onMoveDown:t.handleMoveDown},e.get("id"))})):null,this.scrollableContent=j;var m=Object(i.a)(st.a,{scrollKey:"notifications-"+l,trackScroll:!p,isLoading:s,showLoading:s&&0===o.size,hasMore:u,numPending:b,emptyMessage:O,onLoadMore:this.handleLoadOlder,onLoadPending:this.handleLoadPending,onScrollToTop:this.handleScrollToTop,onScroll:this.handleScroll,shouldUpdateScroll:a,bindToDocument:!r},void 0,j);return d.a.createElement(f.a,{bindToDocument:!r,ref:this.setColumnRef,name:"notifications",extraClasses:this.props.notifCleaningActive?"notif-cleaning":null,label:n.formatMessage(lt.title)},Object(i.a)(h.a,{icon:"bell",active:c,title:n.formatMessage(lt.title),onPin:this.handlePin,onMove:this.handleMove,onClick:this.handleHeaderClick,pinned:p,multiColumn:r,localSettings:this.props.localSettings,notifCleaning:!0,notifCleaningActive:this.props.notifCleaningActive,onEnterCleaningMode:this.props.onEnterCleaningMode},void 0,Object(i.a)(tt,{})),v,m)},e}(d.a.PureComponent),Object(s.a)(H,"defaultProps",{trackScroll:!0}),B=E))||B)||B}}]);
//# sourceMappingURL=notifications.js.map