"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[6676],{26676:(e,s,t)=>{t.r(s),t.d(s,{default:()=>C}),t(43617),t(99930);var i=t(37270),n=t(32446),r=t(97282),o=t(35631),a=t(26366),c=t(8361),m=t(65952),d=t(26614),l=t(77440),p=t(80635),h=t(63647);const u=[];var y=t(36418),f=t.n(y),g=t(14778),_=t(14891),A=t(37266),E=t(78451);class S extends f().PureComponent{componentDidMount(){this.props.isSystemAdmin&&this.props.actions.getStandardAnalytics()}componentDidUpdate(e){e.isSystemAdmin!==this.props.isSystemAdmin&&this.props.isSystemAdmin&&this.props.actions.getStandardAnalytics()}getCurrentNotice=()=>{for(const e of this.props.notices)if(!this.props.dismissedNotices[e.name]&&!this.props.preferences[e.name]&&(!e.adminOnly||this.props.isSystemAdmin)&&e.show?.(this.props.serverVersion,this.props.config,this.props.license,this.props.analytics,this.props.currentChannel))return e;return null};hide=(()=>{var e=this;return function(){let s=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=e.getCurrentNotice();t&&(s||e.props.actions.savePreferences(e.props.currentUserId,[{user_id:e.props.currentUserId,category:E.pm.CATEGORY_SYSTEM_NOTICE,name:t.name,value:"dismissed"}]),e.props.actions.dismissNotice(t.name))}})();hideAndRemind=()=>{this.hide(!0)};hideAndForget=()=>{this.hide(!1)};render(){const e=this.getCurrentNotice();if(null==e)return null;let s;e.adminOnly&&(s=f().createElement("div",{className:"system-notice__info"},f().createElement("i",{className:"fa fa-eye",title:this.props.intl.formatMessage({id:"system_notice.adminVisible.icon",defaultMessage:"Only visible to System Admins Icon"})}),f().createElement(g.FormattedMessage,{id:"system_notice.adminVisible",defaultMessage:"Only visible to System Admins"})));const t=e.icon||f().createElement(A.A,null);return f().createElement("div",{className:"system-notice bg--white"},f().createElement("div",{className:"system-notice__logo"},t),f().createElement("div",{className:"system-notice__body"},f().createElement("div",{className:"system-notice__title"},e.title),e.body,s,f().createElement("div",{className:"system-notice__footer"},f().createElement(_.Button,{id:"systemnotice_remindme",emphasis:"primary",size:"sm",onClick:this.hideAndRemind},f().createElement(g.FormattedMessage,{id:"system_notice.remind_me",defaultMessage:"Remind Me Later"})),e.allowForget&&f().createElement(_.Button,{id:"systemnotice_dontshow",emphasis:"tertiary",size:"sm",onClick:this.hideAndForget},f().createElement(g.FormattedMessage,{id:"system_notice.dont_show",defaultMessage:"Don't Show Again"})))))}}const v=(0,g.injectIntl)(S),N=(0,l.dI)("getSystemNoticePreferences",E.pm.CATEGORY_SYSTEM_NOTICE),M=(0,c.Mz)("getPreferenceNameMap",N,(e=>{const s={};return e.forEach((e=>{s[e.name]=e})),s})),C=(0,i.connect)((function(e){const s=(0,d.Ay)(e),t=(0,d.zj)(e),i=e.entities.general.serverVersion,n=e.entities.admin.analytics;return{currentUserId:e.entities.users.currentUserId,preferences:M(e),dismissedNotices:e.views.notice.hasBeenDismissed,isSystemAdmin:(0,p.y4)(e,{permission:a.xB.MANAGE_SYSTEM}),notices:u,config:t,license:s,serverVersion:i,analytics:n,currentChannel:(0,m.Lw)(e)}}),(function(e){return{actions:(0,n.zH)({savePreferences:o.SF,dismissNotice:h.L,getStandardAnalytics:r.ur},e)}}))(v)}}]);
//# sourceMappingURL=6676.364647ec7a8542292d2c.js.map