import {g,er as fg,aO as jr,b2 as mt,a$ as Fi,w as wpe,aE as L,j,b as Pa,ci as lb,dt as cx,cj as db,f as fx,c as DV}from'./main-BiUBeaMj.js';var R=["root"],A=(()=>{class r{metaService=g(fg);route=g(jr);router=g(mt);pluginService=g(Fi);root=wpe("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){j.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 j.info(`Could not find registered route ${e}`,{routes:this.pluginService.getAllRegisteredClientRoutes()}),this.router.navigate(["/404"],{skipLocationChange:true});t.title&&this.metaService.setTitle(t.title),t.onMount({rootEl:this.root().nativeElement});})}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=Pa({type:r,selectors:[["ng-component"]],viewQuery:function(t,o){t&1&&fx(o.root,R,5),t&2&&DV();},decls:2,vars:0,consts:[["root",""],[3,"click"]],template:function(t,o){t&1&&(lb(0,"div",1,0),cx("click",function(C){return o.onRootClick(C)}),db());},encapsulation:2,changeDetection:1})}return r})();/**i18n:fad79908930cbb4c308e7550a5fe49bb3841dbb330066a6429aebaa006173605*/export{A};//# sourceMappingURL=chunk-CsnQT7rp.js.map
