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