"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[2731],{62731(e,a,t){t.r(a),t.d(a,{default:()=>w}),t(26502),t(66184);var i=t(36418),l=t(14778),s=t(37270),o=t(67166),n=t(35631),r=t(45955),d=t(77440),m=t(7430),u=t(44553),_=t(11039),c=t(47551),f=t(19408),p=t(61436),g=t(81444),y=t(60088);const E=o.default.div.withConfig({displayName:"StyledDiv"})(["width:100%;padding:0 24px;margin:12px auto;"]),w=function(){const[e,a]=(0,i.useState)(!0),{formatMessage:t,formatNumber:o}=(0,l.useIntl)(),w=(0,s.useDispatch)(),S=(0,c.A)(),[v]=(0,_.A)(),{openPricingModal:M,isAirGapped:h}=(0,f.A)(),b=(0,s.useSelector)(m.HW),T=(0,s.useSelector)(m.J1),k=(0,s.useSelector)(r.I0),D=(0,s.useSelector)(r.Pd),N=D?.sku===g.YE.STARTER,A=(0,s.useSelector)(e=>(0,d.Jt)(e,g.pm.CLOUD_USER_EPHEMERAL_INFO,"file_limit_banner_snooze"));let F=!0;if(""!==A){const e=JSON.parse(A);F=Date.now()-e.lastSnoozeTimestamp>=864e6}if(!e)return null;if(!F)return null;if(!k||!N)return null;const z=v?.files?.total_storage,R=S.files.totalStorage;if(void 0===z||!(R>z))return null;const I=i.createElement(l.FormattedMessage,{id:"create_post.file_limit_sticky_banner.messageTitle",defaultMessage:"Your free plan is limited to {storageGB} of files.",values:{storageGB:(0,y.Lh)(z,o)}}),L=h?i.createElement(l.FormattedMessage,{id:"create_post.file_limit_sticky_banner.admin_message_airgapped",defaultMessage:"New uploads will automatically archive older files. To view them again, you can delete older files."}):i.createElement(l.FormattedMessage,{id:"create_post.file_limit_sticky_banner.admin_message",defaultMessage:"New uploads will automatically archive older files. To view them again, you can delete older files or <a>upgrade to a paid plan.</a>",values:{a:e=>i.createElement("a",{onClick:e=>{e.preventDefault(),M()}},e)}}),O=h?i.createElement(l.FormattedMessage,{id:"create_post.file_limit_sticky_banner.non_admin_message_airgapped",defaultMessage:"New uploads will automatically archive older files. To view them again, contact your admin."}):i.createElement(l.FormattedMessage,{id:"create_post.file_limit_sticky_banner.non_admin_message",defaultMessage:"New uploads will automatically archive older files. To view them again, <a>notify your admin to upgrade to a paid plan.</a>",values:{a:e=>i.createElement(p.A,{ctaText:e,notifyRequestData:{required_plan:g.gS.Professional,required_feature:g.W0.UNLIMITED_FILE_STORAGE,trial_notification:!1}})}});return i.createElement(E,{id:"cloud_file_limit_banner"},i.createElement(u.A,{mode:"warning",variant:"app",onDismiss:()=>{const e={lastSnoozeTimestamp:Date.now()};w((0,n.SF)(b.id,[{category:g.pm.CLOUD_USER_EPHEMERAL_INFO,name:"file_limit_banner_snooze",user_id:b.id,value:JSON.stringify(e)}])),a(!1)},closeBtnTooltip:t({id:"create_post.file_limit_sticky_banner.snooze_tooltip",defaultMessage:"Snooze for {snoozeDays} days"},{snoozeDays:10}),title:I,message:T?L:O}))}}}]);
//# sourceMappingURL=2731.13b9bcf3dab86ad4665a.js.map