import{a as z,d as G,e as K,f as Q,g as W,h as X}from"./chunk-3C2MW2QY.js";import{b as J,g as Y,l as q}from"./chunk-QZHSUPXF.js";import{b as Z}from"./chunk-3K7UGDSO.js";import{d as P}from"./chunk-WQGDHA2L.js";import{f as H}from"./chunk-2QUP3RQX.js";import{$b as c,Tc as N,Uc as $,pd as B}from"./chunk-ATD4AEXQ.js";import{Bb as m,Cb as j,Db as w,H as C,Ka as r,Kc as F,Nb as D,Oa as l,Qb as b,Rb as S,Ta as x,Ua as T,Z as M,da as v,dd as k,ed as A,fd as U,gd as L,hb as p,ib as d,id as V,ja as _,k as h,ka as O,kb as R,lb as g,mb as I,nb as u,ob as o,pb as a,qb as f,xb as y,zb as E}from"./chunk-BXH3QC5E.js";var it=[[["","prefixContent",""]]],ot=["[prefixContent]"];function nt(e,s){if(e&1&&(o(0,"mat-icon"),b(1),a()),e&2){let t=m().$implicit;r(),S(t.customIcon)}}function rt(e,s){if(e&1&&f(0,"mat-icon",8),e&2){let t=m().$implicit;u("svgIcon",t.customSvg)}}function at(e,s){if(e&1){let t=y();o(0,"button",7),E("click",function(){let n=_(t).$implicit,tt=m();return O(tt.navigateTo(n))}),p(1,nt,2,1,"mat-icon")(2,rt,1,1,"mat-icon",8),o(3,"span"),b(4),a()()}if(e&2){let t=s.$implicit,i=m();D("selected",i.optionSelected(t)),u("disabled",t.disabled),r(),d(t.customIcon?1:t.customSvg?2:-1),r(3),S(t.label)}}function mt(e,s){e&1&&(o(0,"div",5),w(1),a())}var st=(()=>{class e{router;route;showExtraContent;firstOptionDefaultSelected;menuOptions=[];selectedOption;destroySubject=new h;constructor(t,i){this.router=t,this.route=i}ngOnInit(){this.router.events.pipe(M(this.destroySubject),C(t=>t instanceof k)).subscribe(t=>{this.setSelectedOption(t.url)}),this.setSelectedOption(this.router.url)}setSelectedOption(t){let i=this.menuOptions.find(n=>t.match(new RegExp(`(^|/)${n.path}(/|$)`)));c.isNullOrUndefined(i)?this.firstOptionDefaultSelected&&this.menuOptions.length>0?this.selectedOption=this.menuOptions[0]:this.selectedOption=null:this.selectedOption=i}ngOnDestroy(){this.destroySubject.next(),this.destroySubject.complete()}navigateTo(t){this.router.navigate([t.path],{relativeTo:this.route.parent}).then(i=>{i&&(this.selectedOption=t)}).catch(c.EMPTY_REJECTION_HANDLER)}optionSelected(t){return this.firstOptionDefaultSelected&&c.isNullOrUndefined(this.selectedOption)&&(this.selectedOption=this.menuOptions[0]),this.selectedOption?.path===t.path}static \u0275fac=function(i){return new(i||e)(l(L),l(A))};static \u0275cmp=x({type:e,selectors:[["abs-side-ribbon-template"]],inputs:{showExtraContent:"showExtraContent",firstOptionDefaultSelected:"firstOptionDefaultSelected",menuOptions:"menuOptions"},standalone:!1,ngContentSelectors:ot,decls:9,vars:1,consts:[[1,"abs-ribbon-container"],["mode","side","opened","","disableClose","true",1,"ribbon-sidenav"],[1,"ribbon-action-list"],["mat-menu-item","",1,"ribbon-menu-item",3,"selected","disabled"],[1,"ribbon-content"],[1,"ribbon-main-card"],[1,"ribbon-dynamic-content-container"],["mat-menu-item","",1,"ribbon-menu-item",3,"click","disabled"],[3,"svgIcon"]],template:function(i,n){i&1&&(j(it),o(0,"mat-sidenav-container",0)(1,"mat-sidenav",1)(2,"mat-action-list",2),g(3,at,5,5,"button",3,R),a()(),o(5,"mat-sidenav-content",4),p(6,mt,2,0,"div",5),o(7,"div",6),f(8,"router-outlet"),a()()()),i&2&&(r(3),I(n.menuOptions),r(3),d(n.showExtraContent?6:-1))},dependencies:[z,N,Q,W,K,Y,U],encapsulation:2})}return e})();var ct=(()=>{class e{static \u0275fac=function(i){return new(i||e)};static \u0275mod=T({type:e});static \u0275inj=v({imports:[F,Z,B,G,J,$,X,q,P,H,V]})}return e})();export{st as a,ct as b};
