"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[2731],{62731:(e,t,a)=>{a.r(t),a.d(t,{default:()=>w}),a(17046);var i=a(97023),l=a.n(i),s=a(14778),n=a(23453),o=a(92387),r=a.n(o),u=a(35631),_=a(45955),m=a(77440),c=a(7430),d=a(44553),f=a(11039),p=a(35412),g=a(19408),E=a(61436),y=a(78451),S=a(60088);const v=r().div.withConfig({displayName:"StyledDiv"})(["width:100%;padding:0 24px;margin:12px auto;"]),w=function(){var e;const[t,a]=(0,i.useState)(!0),{formatMessage:o,formatNumber:r}=(0,s.useIntl)(),w=(0,n.useDispatch)(),b=(0,p.A)(),[k]=(0,f.A)(),D=(0,g.A)(),h=(0,n.useSelector)(c.HW),M=(0,n.useSelector)(c.J1),T=(0,n.useSelector)(_.I0),A=(0,n.useSelector)(_.Pd),N=(null==A?void 0:A.sku)===y.YE.STARTER,z=(0,n.useSelector)((e=>(0,m.Jt)(e,y.pm.CLOUD_USER_EPHEMERAL_INFO,"file_limit_banner_snooze")));let I=!0;if(""!==z){const e=JSON.parse(z);I=Date.now()-e.lastSnoozeTimestamp>=864e6}if(!t)return null;if(!I)return null;if(!T||!N)return null;const L=null==k||null===(e=k.files)||void 0===e?void 0:e.total_storage,R=b.files.totalStorage;if(void 0===L||!(R>L))return null;const F=l().createElement(s.FormattedMessage,{id:"create_post.file_limit_sticky_banner.messageTitle",defaultMessage:"Your free plan is limited to {storageGB} of files.",values:{storageGB:(0,S.Lh)(L,r)}}),O=l().createElement(s.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=>l().createElement("a",{onClick:e=>{e.preventDefault(),D({trackingLocation:"file_limit_sticky_banner"})}},e)}}),C=l().createElement(s.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=>l().createElement(E.A,{ctaText:e,notifyRequestData:{required_plan:y.gS.Professional,required_feature:y.W0.UNLIMITED_FILE_STORAGE,trial_notification:!1},callerInfo:"file_limit_sticky_banner"})}});return l().createElement(v,{id:"cloud_file_limit_banner"},l().createElement(d.A,{mode:"warning",variant:"app",onDismiss:()=>{const e={lastSnoozeTimestamp:Date.now()};w((0,u.SF)(h.id,[{category:y.pm.CLOUD_USER_EPHEMERAL_INFO,name:"file_limit_banner_snooze",user_id:h.id,value:JSON.stringify(e)}])),a(!1)},closeBtnTooltip:o({id:"create_post.file_limit_sticky_banner.snooze_tooltip",defaultMessage:"Snooze for {snoozeDays} days"},{snoozeDays:10}),title:F,message:M?O:C}))}}}]);
//# sourceMappingURL=2731.a317a310f6c774cd0d7f.js.map