import{B as m,L as f,ea as g}from"./chunk-XKASPZDQ.js";import{W as u,aa as c,fa as a,v as n}from"./chunk-ABTD7CBT.js";var p=(()=>{class t{constructor(e,o,r){this.configService=e,this.router=o,this.contextService=r}resolve(e){let o=e.data?.originalUrl;if(!o)if(e.url&&e.url.length>0){if(o="/"+e.url.map(r=>r.path).join("/"),e.queryParams&&Object.keys(e.queryParams).length>0){let r=new URLSearchParams(e.queryParams).toString();o+="?"+r}}else o=this.router.url;if(console.log("\u{1F50D} CustomViewDataResolver: Resolving for URL:",o),console.log("\u{1F50D} CustomViewDataResolver: Route segments (may be empty due to **):",e.url),console.log("\u{1F50D} CustomViewDataResolver: Route data:",e.data),console.log("\u{1F50D} CustomViewDataResolver: Original URL from route data:",e.data?.originalUrl),console.log("\u{1F50D} CustomViewDataResolver: Router URL:",this.router.url),console.log("\u{1F50D} CustomViewDataResolver: Query params:",e.queryParams),o==="/"||o==="")throw console.error("CustomViewDataResolver: ROOT PATH ISSUE - This resolver should not handle root path"),console.error("CustomViewDataResolver: Current router URL:",this.router.url),console.error("CustomViewDataResolver: Target URL:",o),console.error("CustomViewDataResolver: Route data:",e.data),new Error("Root path should not be handled by CustomViewsModule");return this.configService.getRouteConfig(o).pipe(u(r=>{if(console.log("CustomViewDataResolver: Route config result:",r),r)return[r];let l=e.url,i="";for(let s=0;s<l.length-1;s++)if(l[s].path==="custom-view"){i=l[s+1].path;break}if(!i)throw console.error("CustomViewDataResolver: No viewId found and no route config found for:",o),new Error(`No custom view configuration found for URL: ${o}`);return console.log("CustomViewDataResolver: Trying viewId lookup:",i),this.configService.getViewConfig(i)}),n(r=>{if(!r)throw console.error("CustomViewDataResolver: Final config is null for:",o),new Error(`No custom view configuration found for URL: ${o}`);return console.log("CustomViewDataResolver: Successfully resolved config:",r),r}))}static{this.\u0275fac=function(o){return new(o||t)(a(f),a(m),a(g))}}static{this.\u0275prov=c({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();export{p as a};
