import{s as e,t as m,w as f,x as R}from"./chunk-V67SIXYX.js";import{a as h,b as I}from"./chunk-YADAVUVK.js";import{F as o,k as r,la as E,od as d,qa as c,v as s,va as a}from"./chunk-HEIW4SFT.js";m();E();I();m();var u=[e.tasks.runTaskAction,e.documents.runDocumentWorkflow,e.humanResources.closeWorkflowTaskInstance];d();R();var y=(()=>{class n{constructor(t){this.api=t,this.MAX_TAKE=100,this.REFRESH_TIME=5*60,this.announcementsS=new s(1),this.announcements$=this.announcementsS.asObservable()}init(){return r(this,null,function*(){yield this.fetch(),this.startPeriodicalRefresh()})}startPeriodicalRefresh(){this.timer||(this.timer=setInterval(()=>{this.fetch()},this.REFRESH_TIME*1e3))}stopPeriodicalRefresh(){clearInterval(this.timer),this.timer=void 0}refresh(){return this.fetch()}intercept(t){let i=t.url.indexOf("?"),l=i>-1?t.url.substring(0,i):t.url;h.exists(u,p=>l.endsWith(p))&&this.fetch()}fetch(){return r(this,null,function*(){try{let t=yield o(this.api.get(e.announcements.fetchAnnouncements(this.MAX_TAKE)));this.announcementsS.next(t)}catch(t){console.error("Exception while init. announcements",t)}})}static{this.\u0275fac=function(i){return new(i||n)(a(f))}}static{this.\u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();export{y as a};
