import{a as A}from"./chunk-ZTHC5SJ5.js";import"./chunk-LMQQ766H.js";import"./chunk-SLQSOQUB.js";import"./chunk-SYO4PMIS.js";import"./chunk-IOLBSI3Y.js";import{e as L}from"./chunk-RBSSJWML.js";import"./chunk-MFZ3EXVF.js";import"./chunk-R6MVWAVG.js";import"./chunk-SDHD5Z3H.js";import"./chunk-ZDEKLPKE.js";import"./chunk-VQU52MNH.js";import"./chunk-MXSLISEG.js";import"./chunk-JNXLVPIF.js";import{c as T,d as E}from"./chunk-O2WVXTHR.js";import"./chunk-T7RLVMCF.js";import"./chunk-FH4KR5HL.js";import"./chunk-ZBRKSVZT.js";import"./chunk-PLS4K4KY.js";import"./chunk-JN2ZUHXX.js";import"./chunk-NLCRYDJ4.js";import"./chunk-RB5TOXJE.js";import"./chunk-7GYHTWED.js";import"./chunk-AYO4TCFG.js";import"./chunk-XOY5UTVP.js";import"./chunk-25WJNSQA.js";import{b as S}from"./chunk-5DQKN4SL.js";import"./chunk-G7OJYPNY.js";import"./chunk-PWALQELY.js";import"./chunk-3GSDFESG.js";import"./chunk-7QEXVS2A.js";import"./chunk-FSCI3FDB.js";import{a as w}from"./chunk-D4RZOGGF.js";import"./chunk-PMJFQIXL.js";import"./chunk-MNVOJIXC.js";import"./chunk-H6QPU4XN.js";import"./chunk-IMWNGRKR.js";import"./chunk-5WJM4RWS.js";import"./chunk-UZB7YFT6.js";import"./chunk-HXEFMD5A.js";import"./chunk-KCLQIV7M.js";import"./chunk-5KCUTXXV.js";import"./chunk-C7NDY7PV.js";import"./chunk-JUDWAYYT.js";import"./chunk-4IRXRL4C.js";import"./chunk-LAJI7RPC.js";import"./chunk-WFZJP5WR.js";import"./chunk-F6KLNSUK.js";import"./chunk-I6FSQTEP.js";import"./chunk-CO3X7TQN.js";import"./chunk-VSFNMVXJ.js";import"./chunk-WQ6DP4JQ.js";import{Mb as I,Ob as C,c as r,wb as b}from"./chunk-YSQLW2JA.js";import"./chunk-NVJ2ZZFT.js";import{$f as g,Fb as u,Pd as y,Te as h,af as x,bb as p,dd as v,hd as d,wa as c,wc as f,ya as m}from"./chunk-SKPDQO4E.js";var R=`<div class="row justify-content-center">
  <div class="col-xl-8 col-lg-12 col-md-12 my-2" *ngIf="identityId">
    <div class="row mb-2">
      <div class="col-12 d-flex justify-content-end">
        <button class="btn btn-sm btn-success" (click)="onChangeIdentityButtonClicked()">
          <cds-icon shape="search" solid class="me-1"></cds-icon>
          {{'COMMON.SELECT_USER'|translate:languageService.userTranslate}}
        </button>
      </div>
    </div>
    <div class="row">
      <div class="col-3 bg-white rndl-1 shadow-box-1 d-none d-md-flex flex-column justify-content-between">
        <div class="my-4 mx-2">
          <span class="text-md text-secondary">{{'IDENTITY.SUMMARY'|translate:languageService.userTranslate}}</span>
        </div>
        <div *ngIf="identityDetail" class="my-4 mx-2 d-flex flex-column">
          <span
            class="text-x4l line-height-xxxl color-gray">{{identityDetail.credentials?identityDetail.credentials.length:'-'}}</span>
          <span class="text-sm color-gray mb-4">{{'CREDENTIAL.TITLE_CARD'|translate}}</span>
          <span
            class="text-x4l line-height-xxxl color-gray">{{identityDetail.accessRights?identityDetail.accessRights.length:'-'}}</span>
          <span class="text-sm color-gray">{{'REPORT.ACCESS_LOGS_HEADER_ACCESS_POINT'|translate}}</span>
        </div>
      </div>
      <div class="col-12 col-md-9 bg-white rndr-1 shadow-box-1">
        <div class="d-flex my-4 mx-2">
          <armon-identity-detail [identityId]="identityId" (detailLoaded)="onIdentityDetailLoaded($event)">
          </armon-identity-detail>
        </div>
      </div>
    </div>
    <div class="row mt-4">
      <div class="col-3 bg-white rndl-1 shadow-box-1 d-none d-md-flex flex-column justify-content-between">
        <div class="my-4 mx-2">
          <span class="text-md text-secondary">{{'IDENTITY.TITLE_LAST_ACCESS_LOGS'|translate}}</span>
        </div>
        <div *ngIf="accessLogs && accessLogs.length>0" class="my-4 mx-2 d-flex flex-column">
          <span class="text-xxl line-height-xxl color-gray">{{accessLogs[0].utcHourText}}</span>
          <span class="text-xs line-height-md text-italic color-gray">{{accessLogs[0].utcText}}</span>
          <span class="text-sm color-gray">{{'REPORT.ENTEREXIT_LAST_EXIT'|translate}}</span>
        </div>
      </div>
      <div class="col-12 col-md-9 bg-white rndr-1 shadow-box-1">
        <div class="d-flex flex-column my-4 mx-2">
          <armon-identity-access-logs [identityId]="identityId" [take]="3" (logsLoaded)="onAccessLogsLoaded($event)">
          </armon-identity-access-logs>
          <button class="btn btn-sm btn-outline-primary ms-auto mt-3"
            (click)="onShowReportButtonClicked()">{{'IDENTITY.TITLE_ALL_ACCESS_LOGS'|translate}}</button>
        </div>
      </div>
    </div>
    <div class="row mt-5" *ngIf="hasPacsModule">
      <div class="col-12">
        <div class="d-flex flex-column my-2">
          <span class="text-md color-primary">{{'PAGES.PACS_FULL'|translate}}</span>
        </div>
      </div>
    </div>
    <div class="row mt-4" *ngIf="permissionPacsAttendanceControl && hasPacsModule">
      <div class="col-12 bg-white rnd-1 shadow-box-1">
        <div class="d-flex flex-column my-2 mx-1">
          <armon-report-pacs-daily-user [showDetail]="true" [disabled]="true" [userId]="identityId" viewMode="2">
          </armon-report-pacs-daily-user>
        </div>
      </div>
    </div>
    <div class="row mt-4" *ngIf="permissionPacsAttendanceControl && hasPacsModule">
      <div class="col-12 bg-white rnd-1 shadow-box-1">
        <div class="d-flex flex-column my-2 mx-1 py-3">
          <armon-pacs-calendar-grid-employee [userId]="identityId" view="day">
          </armon-pacs-calendar-grid-employee>
          <button class="btn btn-sm btn-outline-primary ms-auto mt-3"
            (click)="onShowCalendarButtonClicked()">{{'PAGES.PACS_HR_MANAGER_CALENDAR'|translate}}</button>
        </div>
      </div>
    </div>
  </div>
</div>

<ng-template #drawerTemplate let-data let-drawerRef="drawerRef">
  <div class="row">
    <div class="col-12 d-flex flex-column">
      <span class="text-lg mb-2">
        {{'COMMON.SELECT_USER'|translate: languageService.userTranslate}}
      </span>
      <div class="row">
        <div class="col-12 mt-3">
          <label class="report-form-label">{{'IDENTITY.TITLE' | translate: languageService.userTranslate}}</label>
          <armon-select-search query="identity" [allowMulti]="false" [(ngModel)]="selectedIdentityId">
          </armon-select-search>
        </div>
      </div>
    </div>
    <div class="col-12 d-flex justify-content-end mt-3">
      <button class="btn btn-sm btn-outline-primary me-1" [disabled]="!selectedIdentityId"
        (click)="onCancelClicked($event)">{{'BUTTON.CANCEL'|translate}}</button>
      <button class="btn btn-sm btn-primary" (click)="onSaveClicked($event)">{{'BUTTON.SELECT'|translate}}</button>
    </div>
  </div>
</ng-template>`;var _=`.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}
`;var N=function(o,e,i,s){var n=arguments.length,t=n<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,i):s,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(o,e,i,s);else for(var l=o.length-1;l>=0;l--)(a=o[l])&&(t=(n<3?a(t):n>3?a(e,i,t):a(e,i))||t);return n>3&&t&&Object.defineProperty(e,i,t),t},k=class{route;authService;sessionService;routingService;drawerService;languageService;identityId;drawerTemplate;drawerRef;selectedIdentityId;permissionReportAccessLogs;permissionPacsAttendanceControl;hasPacsModule;identityDetail;accessLogs;constructor(e,i,s,n,t,a){this.route=e,this.authService=i,this.sessionService=s,this.routingService=n,this.drawerService=t,this.languageService=a}ngOnInit(){this.permissionReportAccessLogs=this.authService.checkPermission(d.ACCESSLOG.getReportDetailed()),this.permissionPacsAttendanceControl=this.authService.checkPermission(d.ATTENDANCECONTROL.getReport()),this.hasPacsModule=this.sessionService.hasModule(g.PACS)}ngAfterViewInit(){this.route.queryParams.subscribe(e=>{e&&e[r.UserId]&&e[r.UserId]!=""&&(this.identityId=e[r.UserId])})}onChangeIdentityButtonClicked(){this.selectedIdentityId=this.identityId,this.drawerRef=this.drawerService.create({nzContent:this.drawerTemplate,nzClosable:!1,nzWidth:f(!0),nzContentParams:{value:""}})}onCancelClicked(){this.drawerRef.close()}onSaveClicked(){this.selectedIdentityId&&(this.drawerRef.close(),this.identityId=null,setTimeout(()=>{this.identityId=this.selectedIdentityId},600))}onIdentityDetailLoaded(e){this.identityDetail=e}onAccessLogsLoaded(e){this.accessLogs=e}onShowReportButtonClicked(){this.routingService.gotoUserAccessLogs(this.identityId)}onShowCalendarButtonClicked(){this.routingService.goToUserCalendar(this.identityId)}static ctorParameters=()=>[{type:u},{type:C},{type:y},{type:I},{type:S},{type:x}];static propDecorators={drawerTemplate:[{type:c,args:["drawerTemplate"]}]}};k=N([m({selector:"armon-manage-identity-page",template:R,animations:w,standalone:!0,imports:[p,E,T,L,A,b,h,v],styles:[_]})],k);export{k as ManageIdentityPageComponent};
