import{a as h}from"./chunk-YPJQ2LAG.js";import{a}from"./chunk-TBWZV3FG.js";import{c as o,x as r,z as s}from"./chunk-OS6UA6LL.js";var l=(()=>{let i=class i{constructor(t,e){this.deviceRouteService=t,this.uiService=e,this.openAppointments=[],this.watchForAppointmentDispostionChange=!1,this.initializing=new o(!1),this.active=new o(!1),this.init()}storeAppointment(t,e=!1){this.openAppointments.find(c=>c.id==t.id)==null&&this.openAppointments.push(t),e&&(this.activeAppointment=t)}removeAppointment(t){for(var e=0,p=this.openAppointments.length;e<p;e++)if(this.openAppointments[e].id==t){this.openAppointments.splice(e,1);break}}goToAppointment(t){this.deviceRouteService.viewRouteByType("Appointment",[t],!0)}goToRoute(t,e=[]){this.activeAppointment=void 0,this.deviceRouteService.viewRouteByType(t,e,!0)}watchRoutes(){this.routeSubscription=this.deviceRouteService.activeRoute.subscribe({next:t=>{this.activeRoute=t}})}open(){this.active.next(!0)}close(){this.active.next(!1)}toggleActive(){this.active.getValue()?this.close():this.open()}init(){this.watchRoutes()}ngOnDestroy(){this.routeSubscription?.unsubscribe(),this.stateSubscription?.unsubscribe()}};i.\u0275fac=function(e){return new(e||i)(s(h),s(a))},i.\u0275prov=r({token:i,factory:i.\u0275fac});let n=i;return n})();export{l as a};
