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