import{c as f}from"./chunk-CGIEQQI7.js";import{J as u,M as c,e as a,ka as l,qa as h}from"./chunk-FLIJEKW7.js";var D=(()=>{let n=class n{constructor(e){this.renderFactory=e,this.transitionInMs=250,this.routes={},this.routeChanging=!1,this.activeRoute=new a(void 0),this.renderer=e.createRenderer(null,null)}setCssVariable(e,i,t){this.renderer.setStyle(e,i,t,l.DashCase)}viewRoute(e,i,t=!1,o=f.Forward,d=[]){let s=this.routes[e];if(s!=null){s.params.next(d),this.activeRoute.getValue()?.type!=e&&this.closeActiveRoute(o,t),this.routeChanging=!0,s.loadDirection=i,s.active=!0,this.activeRoute.next(s);let g=t?this.transitionInMs:0,m=s.initialized.subscribe({next:()=>{s.animating=t,setTimeout(()=>{this.routeChanging=!1,s.animating=!1,s.rendered=!0},g),m.unsubscribe()}})}}closeActiveRoute(e,i=!1){let t=this.activeRoute.getValue();t!=null&&(t.loadDirection=e,t.closing=!0,t.animating=i,setTimeout(()=>{t.active=!1,t.closing=!1,t.animating=!1,t.rendered=!1},this.transitionInMs))}init(e,i=null,t=250,o){this.routes=e,this.transitionInMs=t,this.setCssVariable(o,"--routeTransition",`${t}ms`),i!=null&&(this.defaultRoute=this.routes[i],this.viewRoute(i,this.defaultRoute.loadDirection))}ngOnDestroy(){}};n.\u0275fac=function(i){return new(i||n)(c(h))},n.\u0275prov=u({token:n,factory:n.\u0275fac});let r=n;return r})();export{D as a};
