import{a as B}from"./chunk-PQGNYTS4.js";import{a as D}from"./chunk-D4RZOGGF.js";import{Lb as k,Ob as F,f as U,j as w}from"./chunk-YSQLW2JA.js";import{f as b,g as m,h as L,i as d,j as x,k as g}from"./chunk-NVJ2ZZFT.js";import{$c as a,Aa as E,Hb as G,Ia as v,Rd as N,V as S,W as T,Wb as P,Yc as c,Zc as n,a as h,ab as y,af as M,b as f,bb as _,cd as I,dd as O,rc as C,ya as R,za as A}from"./chunk-SKPDQO4E.js";var V=`<ng-container *ngIf="visible">
    <ng-container *ngIf="isOverlay; then onOverlay else onPage"></ng-container>
</ng-container>

<!-- ---------------- OVERLAY --------------- -->

<ng-template #onOverlay>
    <div class="overlay-container">
        <div class="overlay-menu">
            <ng-container *ngFor="let menuCategory of menuCategories">
                <div class="overlay-category">
                    <div class="text-sm fw-medium mb-2">
                        {{menuCategory.categoryType.title|translate:languageService.userTranslate|upper}}</div>
                    <ng-container *ngFor="let item of menuCategory.items">
                        <div class="page-navigation-item text-sm color-gray-dark cursor-pointer"
                            (click)="itemClicked(item)">
                            <!-- <cds-icon [attr.shape]="item.mainIcon" style="width: 16px; height: 16px;"></cds-icon> -->
                            <span>{{(item.i18nCodeFull ? item.i18nCodeFull : item.i18nCode) |
                                translate:languageService.userTranslate}}</span>
                        </div>
                    </ng-container>
                </div>
            </ng-container>
        </div>
        <cds-icon [attr.shape]="mainPage.icon" style="width: 144px; height: 144px;" class="overlay-back-icon">
        </cds-icon>
    </div>
</ng-template>

<!-- ---------------- PAGE NAVIGATION --------------- -->

<ng-template #onPage>
    <div class="d-block d-md-none row my-3">
        <div class="col-12 text-lg fw-medium">
            {{(mainPage.i18nCodeFull ? mainPage.i18nCodeFull : mainPage.i18nCode) | translate | upper }}
        </div>
    </div>
    <div class="row my-1 my-md-4">
        <div
            class="col-12 col-md-4 col-lg-3 d-flex flex-column featured-item-container rounded-3 row-gap-2 py-3 px-3 mb-3 mb-md-0">
            <div class="text-md fw-medium mt-1 mb-1 mt-md-2 mb-md-3 px-2">
                {{"COMMON.FEATURED"|translate:languageService.userTranslate|upper}}
            </div>
            <div [@listAnimationFast]="featuredMenuList.length">
                <div class="featured-item d-flex column-gap-3 p-2 cursor-pointer rounded-2"
                    *ngFor="let item of featuredMenuList" (click)="itemClicked(item)">
                    <div class="featured-item-icon d-flex align-items-center justify-content-center rounded-1"
                        style="min-width: 30px; min-height: 30px;">
                        <cds-icon [attr.shape]="item.icon" class="cds-icon-18"></cds-icon>
                    </div>
                    <div class="d-flex flex-column justify-content-center">
                        <span class="text-md line-height-md fw-normal color-gray-darkest">{{(item.i18nCodeFull ?
                            item.i18nCodeFull :
                            item.i18nCode) |
                            translate:languageService.userTranslate}}
                        </span>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-12 col-md-8 col-lg-9 px-3 px-md-5">
            <div class="d-none d-md-block row mt-4 mb-5">
                <div class="col-12 text-lg fw-medium">
                    {{(mainPage.i18nCodeFull ? mainPage.i18nCodeFull : mainPage.i18nCode) | translate | upper }}
                </div>
            </div>
            <div class="row" [@listAnimation]="menuCategories.length">
                <div class="col-12 col-md-6 col-lg-4 mb-2 mb-md-3 mb-lg-5" *ngFor="let menuCategory of menuCategories">
                    <div class="text-md fw-medium my-2 my-mb-4">
                        {{menuCategory.categoryType.title|translate:languageService.userTranslate|upper}}
                    </div>
                    <!-- <div class="text-xs mb-4 text-italic color-gray">
                        {{menuCategory.categoryType.description|translate:languageService.userTranslate}}
                    </div> -->
                    <div class="d-flex flex-column gap-2 pb-3">
                        <div class="py-1" *ngFor="let item of menuCategory.items">
                            <div class="page-navigation-item text-md fw-normal color-gray-dark cursor-pointer"
                                (click)="itemClicked(item)">
                                <!-- <cds-icon [attr.shape]="item.icon" class="me-2 cds-icon-14"></cds-icon> -->
                                <span>{{(item.i18nCodeFull ? item.i18nCodeFull :
                                    item.i18nCode) |
                                    translate:languageService.userTranslate}}
                                </span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</ng-template>`;var Y=`.justify-content-center{-webkit-box-pack:center;-moz-box-pack:center;-webkit-flex-pack:center;-ms-flex-pack:center;-moz-justify-content:center;-webkit-justify-content:center;justify-content:center}.justify-content-flex-end{-webkit-box-pack:end;-moz-box-pack:end;-webkit-flex-pack:end;-ms-flex-pack:end;-moz-justify-content:flex-end;-webkit-justify-content:flex-end;justify-content:flex-end}.card-footer{padding:.28rem .7rem}.alert{font-size:.756rem}@media screen and (min-width: 992px){.modal-xxl{max-width:1640px}}@media screen and (min-width: 1200px){.modal-xxxl{max-width:1860px}}.modal-fs{max-width:none;position:absolute;margin:auto;inset:16px;height:100vh;display:flex}.btn-link{text-decoration:none}.btn-link:hover{text-decoration:underline}.invalid-feedback{margin-top:0!important;font-size:.672rem!important}.page-navigation-item:hover{color:#0a2a5a!important}.featured-item-container{background-color:#fff}.featured-item-container .featured-item:hover{background-color:#f1f5f9}.featured-item-container .featured-item:hover .featured-item-icon{background-color:#e2e8f0;color:#64748b}.featured-item-container .featured-item-icon{background-color:#f1f5f9;color:#64748b}.overlay-container{width:700px;height:300px;background-color:#fff;-webkit-border-radius:.56rem;-moz-border-radius:.56rem;border-radius:.56rem;padding:12px;position:relative}.overlay-container .overlay-back-icon{color:#f9f7f7;position:absolute;right:.5rem;bottom:.5rem;z-index:1}.overlay-container .overlay-menu{height:276px;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-flex-wrap:wrap;-moz-flex-wrap:wrap;flex-wrap:wrap;position:relative;z-index:2}.overlay-container .overlay-menu .overlay-category{padding-bottom:12px;max-width:50%}
`;var J=function(p,t,e,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(p,t,e,r);else for(var u=p.length-1;u>=0;u--)(s=p[u])&&(o=(i<3?s(o):i>3?s(t,e,o):s(t,e))||o);return i>3&&o&&Object.defineProperty(t,e,o),o},l=class{_locale;translate;constructor(t,e){this._locale=t,this.translate=e}transform(t,e){var r={tr:{regexp:/[\u0069]/g,map:{i:"\u0130"}}};j(e)&&(e=j(this.translate.currentLang)?"tr":this.translate.currentLang);var i=r[e];return t=t==null?"":String(t),i&&(t=t.replace(i.regexp,function(o){return i.map[o]})),t.toUpperCase()}static ctorParameters=()=>[{type:String,decorators:[{type:S,args:[v]}]},{type:I}]};l=J([A({name:"upper",standalone:!0})],l);function j(p){return p==null||p===""||p!==p}var Q=function(p,t,e,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(p,t,e,r);else for(var u=p.length-1;u>=0;u--)(s=p[u])&&(o=(i<3?s(o):i>3?s(t,e,o):s(t,e))||o);return i>3&&o&&Object.defineProperty(t,e,o),o},z=class{authService;pacsService;userService;languageService;router;popoverRef;modalService;configuration;visible=!1;isOverlay=!1;overlayGroup;mainPage;menuCategories=[];featuredMenuList;profileNavigationMenu;activeMenuList;constructor(t,e,r,i,o,s,u){this.authService=t,this.pacsService=e,this.userService=r,this.languageService=i,this.router=o,this.popoverRef=s,this.modalService=u,s&&(this.isOverlay=!0,this.overlayGroup=this.popoverRef.data.group)}getDefaultFeaturedMenuList(t){let e=g.getEmptyModel(t);switch(t){case c.Pacs:e.menuGroupList=[{count:8,type:"page",path:a.PACS_USER_PPERMISSIONS.path},{count:7,type:"page",path:a.PACS_PPERMISSIONS_MANAGEMENT.path},{count:6,type:"page",path:a.PACS_USER_CALENDAR.path},{count:5,type:"page",path:a.PACS_USER_HR_MANAGER_CALENDAR.path},{count:4,type:"page",path:a.PACS_WORKPLANS.path},{count:3,type:"page",path:a.PACS_PPERMISSION_TYPES.path},{count:2,type:"page",path:a.PACS_VACATIONS.path},{count:1,type:"page",path:a.PACS_WORKPLAN_PLANNER.path}];break;case c.Report:e.menuGroupList=[{count:8,type:"page",path:a.REPORT_ACCESSLOGS.path},{count:7,type:"page",path:a.REPORT_ENTEREXIT.path},{count:6,type:"page",path:a.REPORT_PACS_DAILY.path},{count:5,type:"page",path:a.REPORT_PACS_EMPLOYEE.path},{count:4,type:"page",path:a.REPORT_PACS_MOMENT.path},{count:3,type:"page",path:a.REPORT_AUDIT_IDENTITY.path},{count:2,type:"page",path:a.REPORT_PACS_PPERMISSION_USAGE.path},{count:1,type:"page",path:a.REPORT_AUDIT_TERMINAL.path}];break;case c.Management:e.menuGroupList=[{count:8,type:"page",path:a.MANAGEMENT_IDENTITIES.path},{count:7,type:"page",path:a.FORBIDDEN_IDENTITIES.path},{count:6,type:"page",path:a.MANAGEMENT_CREDENTIAL.path},{count:5,type:"page",path:a.MANAGEMENT_ORGANIZATIONUNITS_WIDE.path},{count:4,type:"page",path:a.MANAGEMENT_SCHEDULED_JOBS.path},{count:3,type:"page",path:a.MANAGEMENT_ACCESSCONTROLPOINTS.path},{count:2,type:"page",path:a.MANAGEMENT_CAMERAS.path},{count:1,type:"page",path:a.MANAGEMENT_REGIONS.path}];break;case c.MyAccount:e.menuGroupList=[{count:4,type:"page",path:a.MY_ACCOUNT_PERSONAL.path},{count:3,type:"page",path:a.MY_ACCOUNT_SETTINGS.path},{count:2,type:"page",path:a.MY_ACCOUNT_SECURITY.path},{count:1,type:"page",path:a.MY_ACCOUNT_NOTIFICATION.path}];break;case c.SocialArea:e.menuGroupList=[{count:4,type:"page",path:a.SOCA_BALANCE_MANAGEMENT.path},{count:3,type:"page",path:a.SOCA_TICKET_TYPES.path},{count:2,type:"page",path:a.SOCA_REPORT_USAGES.path},{count:1,type:"page",path:a.SOCA_REPORT_TRANSACTIONS.path}];break;case c.Visitor:e.menuGroupList=[{count:3,type:"page",path:a.VISITOR_REGISTRATION.path},{count:3,type:"page",path:a.VISITOR_LIST.path},{count:2,type:"page",path:a.VISITOR_REPORT.path}];break;case c.Analysis:e.menuGroupList=[{count:4,type:"page",path:a.ANALYSIS_VISITORS.path},{count:3,type:"page",path:a.ANALYSIS_VISITOR_COUNTS.path},{count:2,type:"page",path:a.ANALYSIS_ACCESSCONTROLPOINTACTIVITY.path},{count:1,type:"page",path:a.ANALYSIS_VISITOR_PRE_REGISTRATION.path}];break;default:e.menuGroupList=[];break}return e}setFeaturedMenuList(t=void 0){let e;t&&(this.profileNavigationMenu=t,e=this.profileNavigationMenu.find(o=>o.menuGroup==this.mainPage.menuGroup)),P(e)&&(e=g.getEmptyModel(this.mainPage.menuGroup)),this.getDefaultFeaturedMenuList(this.mainPage.menuGroup).menuGroupList.forEach(o=>{e.menuGroupList.some(s=>s.path==o.path)||e.menuGroupList.push(o)}),this.activeMenuList=e;let i=[];this.menuCategories.forEach(o=>{o.items.forEach(s=>{let u=e.menuGroupList.find(W=>W.path==s.path);u&&i.push(f(h({},s),{count:u.count}))})}),this.featuredMenuList=i.sort((o,s)=>o.count<s.count?1:o.count>s.count?-1:0).slice(0,m),setTimeout(()=>{this.visible=!0},300)}setMenuCategories(t){this.menuCategories=t,this.userService.getOrganizationClientProfile().subscribe({next:e=>{e&&e.navigationMenuVersion&&e.navigationMenuVersion==b?this.setFeaturedMenuList(e.navigationMenuFeaturedList):this.setFeaturedMenuList()},error:e=>{this.setFeaturedMenuList()}})}ngOnInit(){this.isOverlay?this.mainPage=this.authService.getAvailablePageRoutes().find(e=>e.menuGroup==this.overlayGroup):this.mainPage=this.authService.getAvailablePageRoutes().find(e=>e.fullPath==C(this.router.url));let t=[];if(this.mainPage.subPages.forEach(e=>{if(e.navVisibility!=!1){let r=t.find(i=>i.categoryType.subGroup==e.subGroup);if(r){let i=e;if(i.itemGroup){let o=r.items.find(s=>s.itemGroup==i.itemGroup);o?o.items.push(i):r.items.push({itemGroup:i.itemGroup,itemGroupTitle:i.itemGroupTitle,itemGroupIcon:i.itemGroupIcon,items:[i]})}else r.items.push(i)}else{r={categoryType:H.find(o=>o.subGroup==e.subGroup),items:[]};let i=e;i.itemGroup?r.items.push({itemGroup:i.itemGroup,itemGroupTitle:i.itemGroupTitle,itemGroupIcon:i.itemGroupIcon,items:[i]}):r.items.push(i),t.push(r)}}}),this.mainPage&&this.mainPage.fullPath)if(this.isOverlay)this.setMenuCategories(t);else switch(this.mainPage.fullPath){case a.REPORTS.fullPath:this.pacsService.getCustomReportList().subscribe({next:e=>{if(e&&e.length>0){let r={categoryType:H.find(i=>i.subGroup==n.ReportCustom),items:[]};e.forEach(i=>{r.items.push({path:i.id,i18nCode:i.name,icon:"report",group:c.Report,subGroup:n.ReportCustom,customReport:i})}),t.push(r)}this.setMenuCategories(t)},error:e=>{this.setMenuCategories(t)}});break;default:this.setMenuCategories(t);break}}itemClicked(t){this.activeMenuList.menuGroupList.map(r=>(r.count--,r));let e=this.activeMenuList.menuGroupList.find(r=>r.path==t.path);e?e.count<x&&(e.count=e.count+L):t.customReport?this.activeMenuList.menuGroupList.push({count:d,type:"customreport",path:t.path}):this.activeMenuList.menuGroupList.push({count:d,type:"page",path:t.path}),this.activeMenuList.menuGroupList=this.activeMenuList.menuGroupList.filter(r=>r.count>0).slice(0,m),this.userService.saveNavigationMenuList(this.mainPage.menuGroup,this.activeMenuList),t.customReport?this.modalService.open(k,{settings:{size:"lg"},props:{reportDefinition:t.customReport}}).result.then(r=>{}).catch(r=>{}):(this.router.navigate([t.fullPath]),this.isOverlay&&this.popoverRef.close())}static ctorParameters=()=>[{type:F},{type:w},{type:B},{type:M},{type:G},{type:U,decorators:[{type:T}]},{type:N}];static propDecorators={configuration:[{type:E}]}};z=Q([R({selector:"armon-submenu-cards",template:V,animations:D,standalone:!0,imports:[_,y,l,O],styles:[Y]})],z);var H=[{subGroup:n.ManagementUser,title:"SUBGROUP.MANAGEMENT_USER_TITLE"},{subGroup:n.ManagementCredential,title:"SUBGROUP.MANAGEMENT_CREDENTIAL_TITLE"},{subGroup:n.ManagementHardware,title:"SUBGROUP.MANAGEMENT_HARDWARE_TITLE"},{subGroup:n.ManagementOrganization,title:"SUBGROUP.MANAGEMENT_ORGANIZATION_TITLE"},{subGroup:n.ManagementAccess,title:"SUBGROUP.MANAGEMENT_ACCESS_TITLE"},{subGroup:n.ManagementStructure,title:"SUBGROUP.MANAGEMENT_STRUCTURE_TITLE"},{subGroup:n.ReportAccess,title:"SUBGROUP.REPORT_ACCESS_TITLE"},{subGroup:n.ReportVisitor,title:"SUBGROUP.REPORT_VISITOR_TITLE"},{subGroup:n.ReportPACS,title:"SUBGROUP.REPORT_PACS_TITLE"},{subGroup:n.ReportCustom,title:"SUBGROUP.REPORT_CUSTOM_TITLE"},{subGroup:n.ReportHardware,title:"SUBGROUP.REPORT_HARDWARE_TITLE"},{subGroup:n.ReportAudit,title:"SUBGROUP.REPORT_AUDIT_TITLE"},{subGroup:n.AnalysisVisitor,title:"SUBGROUP.ANALYSIS_VISITOR_TITLE"},{subGroup:n.AnalysisPACS,title:"SUBGROUP.ANALYSIS_PACS_TITLE"},{subGroup:n.AnalysisAccess,title:"SUBGROUP.ANALYSIS_ACCESS_TITLE"},{subGroup:n.PacsPermissions,title:"SUBGROUP.PACS_PERMISSION_TITLE"},{subGroup:n.PacsPlanning,title:"SUBGROUP.PACS_PLANNING_TITLE"},{subGroup:n.PacsManagement,title:"SUBGROUP.PACS_MANAGEMENT_TITLE"},{subGroup:n.VisitorRegistration,title:"SUBGROUP.VISITOR_REGISTRATION_TITLE"},{subGroup:n.VisitorReport,title:"SUBGROUP.VISITOR_REPORT_TITLE"},{subGroup:n.SocaBalanceManagement,title:"SUBGROUP.SOCA_BALANCE_MANAGEMENT_TITLE"},{subGroup:n.SocaReport,title:"SUBGROUP.SOCA_REPORT_TITLE"},{subGroup:n.MyAccount,title:"SUBGROUP.MY_ACCOUNT_TITLE"},{subGroup:n.MyAccountNotifications,title:"SUBGROUP.MY_ACCOUNT_NOTIFICATIONS_TITLE"}];export{z as a};
