"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[388],{10388:(e,n,t)=>{t.r(n),t.d(n,{default:()=>m});var r=t(62688),a=t.n(r),l=(t(17046),t(97023)),o=t.n(l),c=t(14778),s=t(23453),u=t(78625),i=t(65952),d=t(63324),b=t(18515),h=t(87131);const f={singleline:!0,mentionHighlight:!1};function m(e){let{channelId:n}=e;const t=(0,s.useSelector)((e=>(0,i.c3)(e,n))),r=(0,s.useSelector)((e=>(0,u.j)(e,n))),a=(0,l.useRef)(null),[m,p]=o().useState(!1);(0,l.useEffect)((()=>{if(!a.current)return;const e=a.current.offsetWidth<a.current.scrollWidth,n=a.current.offsetHeight<a.current.scrollHeight;p(e||n)}),[null==t?void 0:t.text]);const _=(0,c.useIntl)().formatMessage({id:"channel_banner.aria_label",defaultMessage:"Channel banner text"}),g=o().createElement(b.A,{message:null==t?void 0:t.text,options:f}),k=(0,l.useMemo)((()=>({backgroundColor:null==t?void 0:t.background_color})),[t]),E=(0,l.useMemo)((()=>{if(!t||!t.background_color)return{};const e=(0,d.Up)(t.background_color);return{color:e,"--channel-banner-text-color":e}}),[t]);return t&&r?o().createElement(h.A,{title:g,className:"channelBannerTooltip",delayClose:!0,forcedPlacement:"bottom",disabled:!m},o().createElement("div",{className:"channel_banner","data-testid":"channel_banner_container",style:k},o().createElement("span",{"data-testid":"channel_banner_text",className:"channel_banner_text","aria-label":_,style:E,ref:a},g))):null}m.propTypes={channelId:a().string.isRequired}},78625:(e,n,t)=>{t.d(n,{j:()=>s,l:()=>c});var r=t(47958),a=t(40057),l=t(65952),o=t(26614);const c=e=>{const n=(0,o.Ay)(e);return(null==n?void 0:n.SkuShortName)===a.Bz.SKUEnterpriseAdvanced},s=(e,n)=>{if(!c(e))return!1;const t=(0,l.c3)(e,n),o=(0,l.c)(e,n);return Boolean(o&&(o.type===a.Bz.OPEN_CHANNEL||o.type===a.Bz.PRIVATE_CHANNEL))&&(0,r.z)(t)}},47958:(e,n)=>{n.z=function(e){return!!e&&(Boolean(e.enabled)&&Boolean(e.text)&&Boolean(e.background_color))}}}]);
//# sourceMappingURL=388.44dbf9651ced0708742a.js.map