import{$c as y,$e as a,Da as s,Kb as C,ba as l,cb as d,cd as b,db as h,ib as f,la as p,lg as w,ma as g,qb as m,tg as P,xb as v,yb as S,zb as R}from"./chunk-X3RCWQ3R.js";import{i as o,j as c}from"./chunk-SR6RTMQI.js";var k=["root"],D=(()=>{let n=class n{constructor(e,t,i,r){o(this,"metaService");o(this,"route");o(this,"router");o(this,"pluginService");o(this,"root");o(this,"urlSub");this.metaService=e,this.route=t,this.router=i,this.pluginService=r}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 i=t.closest("a");if(!i)return;let r=i.getAttribute("href")||"";!i.target&&r.startsWith("/")&&(e.preventDefault(),e.stopPropagation(),this.router.navigateByUrl(r))}loadRoute(){return c(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(i=>i.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})})}};o(n,"\u0275fac",function(t){return new(t||n)(s(P),s(y),s(b),s(w))}),o(n,"\u0275cmp",l({type:n,selectors:[["ng-component"]],viewQuery:function(t,i){if(t&1&&v(k,5),t&2){let r;S(r=R())&&(i.root=r.first)}},standalone:!0,features:[C],decls:2,vars:0,consts:[["root",""],[3,"click"]],template:function(t,i){if(t&1){let r=f();d(0,"div",1,0),m("click",function(_){return p(r),g(i.onRootClick(_))}),h()}},encapsulation:2}));let u=n;return u})();export{D as a};
/**i18n:3d16453f213eb5db982e7e7dd90631843ac5d3f860726a614777c3e9e3f9b57e*/
//# sourceMappingURL=chunk-FOVMDOKW.js.map
