"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[2376],{62376:(e,t,a)=>{a.r(t),a.d(t,{default:()=>w}),a(14078);var i=a(84390),l=a.n(i),s=a(72060),n=a(70314),o=a(85939),r=a.n(o),u=a(32394),_=a(80947),c=a(83905),m=a(23894),d=a(22171),f=a(32397),p=a(34250),g=a(92287),y=a(66815),E=a(23712),v=a(17389);const S=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.Z)(),[k]=(0,f.Z)(),D=(0,g.Z)(),h=(0,n.useSelector)(m.ts),M=(0,n.useSelector)(m.BW),T=(0,n.useSelector)(_.VF),N=(0,n.useSelector)(_.Bf),z=(null==N?void 0:N.sku)===E.D_.STARTER,R=(0,n.useSelector)((e=>(0,c.U2)(e,E.uP.CLOUD_USER_EPHEMERAL_INFO,"file_limit_banner_snooze")));let F=!0;if(""!==R){const e=JSON.parse(R);F=Date.now()-e.lastSnoozeTimestamp>=864e6}if(!t)return null;if(!F)return null;if(!T||!z)return null;const I=null==k||null===(e=k.files)||void 0===e?void 0:e.total_storage,L=b.files.totalStorage;if(void 0===I||!(L>I))return null;const O=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,v.qh)(I,r)}}),C=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)}}),P=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(y.Z,{ctaText:e,notifyRequestData:{required_plan:E.lP.Professional,required_feature:E.xk.UNLIMITED_FILE_STORAGE,trial_notification:!1},callerInfo:"file_limit_sticky_banner"})}});return l().createElement(S,{id:"cloud_file_limit_banner"},l().createElement(d.Z,{mode:"warning",variant:"app",onDismiss:()=>{const e={lastSnoozeTimestamp:Date.now()};w((0,u.$A)(h.id,[{category:E.uP.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:O,message:M?C:P}))}}}]);
//# sourceMappingURL=2376.ac8feee829b807064921.js.map