1import{G as u,j as k,N,ag as p,ab as B,O as m,ah as d,_ as f,r as b,o as g,l as h,w as v,h as _,ai as L}from"./index-D-iuxWOd.js";var y=Object.defineProperty,C=Object.getOwnPropertyDescriptor,c=(n,e,s,a)=>{for(var r=a>1?void 0:a?C(e,s):e,o=n.length-1,i;o>=0;o--)(i=n[o])&&(r=(a?i(e,s,r):i(r))||r);return a&&r&&y(e,s,r),r};const w=u("breakingNews"),P=u("contentPage"),O=60;let t=class extends k(N){constructor(){super(...arguments),this.timerRefreshBreakingNews=null}get shouldFetchLatestBreakingNews(){var e,s;return!((s=(e=this.$route)==null?void 0:e.meta)!=null&&s.isLibUserServices)&&![p.CompanyOverviewPage,p.SpecialTopicsPage,p.CompanyLastLevelPage].includes(this.currentPageType)&&this.outputMedium!==B.Embedded}get firstBreakingNews(){var e;return this.shouldFetchLatestBreakingNews&&this.breakingNews.length>0?(e=this.breakingNews)==null?void 0:e[0]:null}handleBannerClick({url:e}){this.navigate(e)}async fetchLatestBreakingNews(){this.shouldFetchLatestBreakingNews&&(this.timerRefreshBreakingNews||(await this.fetchLatestBreakingNewsAction(),this.removeTimer(),this.timerRefreshBreakingNews=window.setInterval(this.fetchLatestBreakingNews,O*1e3)))}removeTimer(){this.timerRefreshBreakingNews&&(window.clearInterval(this.timerRefreshBreakingNews),this.timerRefreshBreakingNews=null)}async mounted(){this.cookContentLoadedSubscription=this.EventBus.subscribe("cookContent.loaded",()=>this.fetchLatestBreakingNews(),!0)}async beforeUnmount(){this.removeTimer(),this.cookContentLoadedSubscription&&this.EventBus.unsubscribe(this.cookContentLoadedSubscription)}};c([w.Getter("getBreakingNews")],t.prototype,"breakingNews",2);c([w.Action("fetchLatestBreakingNews")],t.prototype,"fetchLatestBreakingNewsAction",2);c([P.Getter("currentPageType")],t.prototype,"currentPageType",2);t=c([m({name:"BreakingNewsBannerWrapper",components:{DnmBreakingNewsHeader:d}})],t);function T(n,e,s,a,r,o){const i=b("DnmBreakingNewsHeader");return g(),h(L,{name:"slide"},{default:v(()=>[n.firstBreakingNews?(g(),h(i,{key:0,onOnClick:n.handleBannerClick,"banner-link":n.firstBreakingNews.href,headline:n.firstBreakingNews.title,class:"breakingNewsBanner","data-testid":"breakingNewsBannerWrapper-container"},null,8,["onOnClick","banner-link","headline"])):_("",!0)]),_:1})}const R=f(t,[["render",T],["__scopeId","data-v-f08be4eb"]]);var l;try{"__c"in t&&((l=t.__c).componentFileName??(l.componentFileName=Object.create(null)),Object.defineProperty(t.__c,"componentFileName",{value:"app/components/breakingNewsBannerWrapper/BreakingNewsBannerWrapper.vue"}))}catch(n){console.error("injectFileNamePlugin",n)}export{R as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.