import{Cb as f,Cd as b,La as g,Lb as v,Mb as S,aa as r,ai as y,fa as c,ga as p,kb as d,lb as m,ni as w,rf as a,tb as h,yc as R,yd as C}from"./chunk-WSBGJRUM.js";import{i as u,l}from"./chunk-PMOLICDQ.js";var k=["root"],Q=(()=>{let i=class i{metaService=r(y);route=r(C);router=r(b);pluginService=r(w);root=R("root");urlSub;ngAfterViewInit(){this.urlSub=this.route.url.subscribe(()=>{this.loadRoute()})}ngOnDestroy(){this.urlSub&&this.urlSub.unsubscribe()}onRootClick(e){let t=e.target;if(!t)return;let o=t.closest("a");if(!o)return;let n=o.getAttribute("href")||"";!o.target&&n.startsWith("/")&&(e.preventDefault(),e.stopPropagation(),this.router.navigateByUrl(n))}loadRoute(){return l(this,null,function*(){if(yield this.pluginService.ensurePluginsAreLoaded(this.route.snapshot.data.pluginScope||"common"),!this.route.snapshot.data.parentRoute){a.error('Missing "parentRoute" URL data to load plugin route '+this.route.snapshot.url);return}let e="/"+this.route.snapshot.url.map(o=>o.path).join("/"),t=this.pluginService.getRegisteredClientRoute(e,this.route.snapshot.data.parentRoute);if(!t)return a.info(`Could not find registered route ${e}`,{routes:this.pluginService.getAllRegisteredClientRoutes()}),this.router.navigate(["/404"],{skipLocationChange:!0});t.title&&this.metaService.setTitle(t.title),t.onMount({rootEl:this.root().nativeElement})})}};u(i,"\u0275fac",function(t){return new(t||i)}),u(i,"\u0275cmp",g({type:i,selectors:[["ng-component"]],viewQuery:function(t,o){t&1&&v(o.root,k,5),t&2&&S()},decls:2,vars:0,consts:[["root",""],[3,"click"]],template:function(t,o){if(t&1){let n=h();d(0,"div",1,0),f("click",function(P){return c(n),p(o.onRootClick(P))}),m()}},encapsulation:2}));let s=i;return s})();export{Q as a};
/**i18n:3907c1bc44ea3b180445250ac6c616b106e81f719372623351dcd73c005dc65a*/
//# sourceMappingURL=chunk-LQFG6NXT.js.map
