import{a as me}from"./chunk-T7RLVMCF.js";import{a as le}from"./chunk-FH4KR5HL.js";import{a as de,b as ce}from"./chunk-ZBRKSVZT.js";import{a as ge}from"./chunk-AYO4TCFG.js";import{a as pe}from"./chunk-25WJNSQA.js";import{a as re}from"./chunk-5DQKN4SL.js";import{a as xe}from"./chunk-PWALQELY.js";import{a as Ie}from"./chunk-H6QPU4XN.js";import{a as fe}from"./chunk-IMWNGRKR.js";import{a as ue,b as he,c as ve}from"./chunk-UZB7YFT6.js";import{a as Te}from"./chunk-4IRXRL4C.js";import{Db as ne,H as J,Ib as se,J as X,Mb as oe,Ob as ae,P as Q,T as K,nb as h,rb as ie,s as W,v as $,y as q}from"./chunk-YSQLW2JA.js";import{J as Z,Va as ee,ma as P,pa as A,ud as te}from"./chunk-NVJ2ZZFT.js";import{$f as H,Aa as d,Ba as T,Dc as R,He as g,Me as U,Nc as F,Ne as w,Pd as k,Qf as j,Rd as M,Sd as y,Te as G,Ue as B,W as _,Yg as b,_a as f,ab as u,af as Y,bb as m,bc as z,bh as C,dd as p,fb as x,gb as O,ha as I,hd as l,jb as D,mc as L,mg as V,ya as c,zc as v}from"./chunk-SKPDQO4E.js";var ye=`<ng-container *ngIf="!visibleComponent">
    <div class="spinner-grow text-primary" role="status">
        <span class="sr-only"></span>
    </div>
</ng-container>
<div *ngIf="visibleComponent">
    <div class="row">
        <ng-container *ngFor="let item of items">
            <div class="col-12 py-2">
                <div class="w-100 d-flex flex-column p-3 shadow-box-1 rnd-1 bg-color-white position-relative item-container"
                    [ngStyle]="{'border-color': item.statusColor}">
                    <div class="d-flex align-items-center mb-3">
                        <div class="d-flex flex-column">
                            <span class="text-lg fw-medium mb-2">{{item.utcHourText}}<armon-local-date
                                    [dateUtc]="item.utc">
                                </armon-local-date></span>
                            <span class="text-xs text-align-right">{{item.utcText}}</span>
                        </div>
                        <div class="ms-auto d-flex flex-column align-items-end">
                            <armon-credential-tags *ngIf="item.credentials && item.credentials.length>0"
                                [credentials]="item.credentials"></armon-credential-tags>
                        </div>
                    </div>
                    <div>
                        <cds-icon nz-tooltip
                            nzTooltipTitle="{{item.statusDescription | translate:item.statusDescriptionData}}"
                            [attr.shape]="item.directionIcon" size="sm"></cds-icon><span
                            class="ms-2 text-sm">{{item.statusInfo | translate}}</span>
                        <span class="text-sm text-italic"
                            *ngIf="item.accessControlPoint">,&nbsp;{{(item.accessControlPoint ?
                            item.accessControlPoint.name : '')}}</span>
                    </div>
                    <span class="text-xs text-italic my-1">
                        {{item.statusDescription | translate:item.statusDescriptionData}}
                    </span>
                    <span class="text-xs text-italic my-1" *ngIf="item.isRemoteAccess">
                        <cds-icon shape="open-remotely" class="me-1"></cds-icon>
                        {{'REPORT.ACCESS_LOGS_REMOTE_ACCESS' | translate}}
                    </span>
                    <span class="text-xs text-italic my-1" *ngIf="item.mobileAuthenticated">
                        <cds-icon shape="mobile_authenticated" class="me-1"></cds-icon>
                        {{'REPORT.ACCESS_LOGS_MOBILE_AUTHENTICATED' | translate}}
                    </span>

                    <div>
                        <ng-container *ngIf="item.snapshots && item.snapshots.length>0">
                            <armon-camera-snapshot-gallery [snapshots]="item.snapshots" class="me-2">
                            </armon-camera-snapshot-gallery>
                        </ng-container>
                        <!-- <ng-container *ngIf="item.location && item.location.isValid">
                            <div class="p-2 me-2">
                                <armon-map-open-layers [location]="item.location"></armon-map-open-layers>
                            </div>
                        </ng-container> -->
                    </div>
                </div>
            </div>
        </ng-container>
    </div>
    <div class="row p-5 mt-5" *ngIf="items && items.length==0">
        <div class="col-12">
            <nz-empty [nzNotFoundContent]="contentTpl" [nzNotFoundImage]="'./assets/images/empty/empty_list.png'">
                <ng-template #contentTpl>
                    <span>{{'IDENTITY.TITLE_NO_LAST_ACCESS_LOGS'|translate}}</span>
                </ng-template>
            </nz-empty>
        </div>
    </div>
</div>`;var be=`.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}.item-container{border-left:3px solid #FFF}
`;var ze=function(a,e,t,i){var s=arguments.length,n=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(a,e,t,i);else for(var r=a.length-1;r>=0;r--)(o=a[r])&&(n=(s<3?o(n):s>3?o(e,t,n):o(e,t))||n);return s>3&&n&&Object.defineProperty(e,t,n),n},S=class{reportService;identityId=null;take=10;items;visibleComponent=!1;logsLoaded=new I;constructor(e){this.reportService=e}ngOnInit(){this.getAccessLogs()}ngOnDestroy(){}getAccessLogs(){let e=Z.getEmptyModel();e.take=this.take,e.userIds=[this.identityId],e.startUtc=R.local().minus({month:1}).toJSDate(),e.endUtc=R.local().toJSDate(),this.reportService.getAccessLogs(e,!1).subscribe(t=>{this.items=t.items,this.logsLoaded.emit(this.items),this.visibleComponent=!0})}ngOnChanges(e){}static ctorParameters=()=>[{type:X}];static propDecorators={identityId:[{type:d}],take:[{type:d}],logsLoaded:[{type:T}]}};S=ze([c({selector:"armon-identity-access-logs",template:ye,standalone:!0,imports:[m,u,x,Te,Ie,b,fe,C,p],styles:[be]})],S);var Ce=`<ng-container *ngIf="!loading">
  <div class="row">
    <div class="col-12">
      <div class="d-flex flex-column">
        <div class="d-flex flex-column mb-2">
          <div class="d-flex align-items-center">
            <armon-identity-photo [identityId]="identityId" [removeWhenEmpty]="true" [size]="'lg'">
            </armon-identity-photo>
            <span class="text-xl">
              <span class="text-bold me-2">{{detail.organizationProfile.fullName}}</span>
              <armon-icon-label [colorCode]="7" *ngIf="detail.organizationProfile.isDisabled">
                <ng-template icon-label-icon>
                  <cds-icon shape="user" solid size="sm"></cds-icon>
                </ng-template>
                <ng-template icon-label-content>
                  <span>{{'IDENTITYSTATUS.PASSIVE'|translate}}</span>
                </ng-template>
              </armon-icon-label>
            </span>
          </div>
        </div>
      </div>
    </div>
  </div>

  <!-- Detail Drawer View -->
  <ng-container *ngIf="drawerRef">
    <nz-tabset [(nzSelectedIndex)]="selectedTab" [nzAnimated]="false">
      <nz-tab nzTitle="{{'IDENTITY.TITLE'|translate:languageService.userTranslate}}">
        <ng-template *ngTemplateOutlet="userDetailTemplate">
        </ng-template>
      </nz-tab>
      <nz-tab nzTitle="{{'IDENTITY.TITLE_LAST_ACCESS_LOGS'|translate}}" *ngIf="permissionReportAccessLogs">
        <ng-container *ngIf="selectedTab==1">
          <div class="row me-0">
            <div class="col-12" style="max-height: 70vh; overflow-y: auto;">
              <armon-identity-access-logs [identityId]="identityId"></armon-identity-access-logs>
            </div>
          </div>
          <div class="row">
            <div class="col-12 d-flex justify-content-center my-1">
              <button class="btn btn-link bms-auto"
                (click)="onShowReportButtonClicked()">{{'IDENTITY.TITLE_ALL_ACCESS_LOGS'|translate}}</button>
            </div>
          </div>
        </ng-container>
      </nz-tab>
    </nz-tabset>
  </ng-container>

  <!-- Page Component View, Just Identity Detail -->
  <ng-container *ngIf="!drawerRef">
    <ng-template *ngTemplateOutlet="userDetailTemplate">
    </ng-template>
  </ng-container>

  <div class="row b-t-1 mt-3" *ngIf="drawerRef || !detail.organizationProfile.isAnonymized">
    <div class="col-12 pt-3 d-flex">
      <button class="btn btn-sm btn-outline-secondary me-auto" *ngIf="drawerRef"
        (click)="onCloseButtonClicked($event)">{{'BUTTON.CLOSE'|translate}}</button>
      <ng-container *ngIf="!detail.organizationProfile.isAnonymized">
        <button nz-dropdown [nzDropdownMenu]="menuActions" class="btn btn-sm btn-outline-primary me-2"
          *ngIf="actions && actions.length > 0" [nzClickHide]="true" nzPlacement="topRight">
          {{'BUTTON.ACTIONS'|translate}}<cds-icon shape="angle" direction="up" class="ms-1"></cds-icon>
        </button>
        <nz-dropdown-menu #menuActions="nzDropdownMenu">
          <ul nz-menu>
            <li nz-menu-item *ngFor="let action of actions" (click)="onActionClicked(action)">
              {{action.label | translate}}</li>
          </ul>
        </nz-dropdown-menu>
        <button class="btn btn-sm btn-outline-primary" *ngIf="permissionEdit"
          (click)="onEditButtonClicked($event)">{{'BUTTON.EDIT'|translate}}</button>
      </ng-container>
    </div>
  </div>
</ng-container>
<ng-container *ngIf="loading">
  <div class="row">
    <div class="col-12">
      <div class="spinner-grow text-primary" role="status">
        <span class="sr-only"></span>
      </div>
    </div>
  </div>
</ng-container>

<!-- TEMPLATES -->

<ng-template #userDetailTemplate>
  <div class="row" [ngClass]="{'mt-3': !drawerRef}">
    <div class="col-12">
      <ng-template
        *ngTemplateOutlet="profileTemplate;context: {$implicit: detail.organizationProfile, username:detail.username}">
      </ng-template>
    </div>
  </div>
  <div class="row" *ngIf="detail.organizationUnits && detail.organizationUnits.length > 0">
    <div class="col-12">
      <ng-template *ngTemplateOutlet="organizationUnitsTemplate;context: {$implicit: detail.organizationUnits}">
      </ng-template>
    </div>
  </div>
  <div class="row" *ngIf="detail.userGroups && detail.userGroups.length > 0">
    <div class="col-12">
      <ng-template *ngTemplateOutlet="userGroupsTemplate;context: {$implicit: detail.userGroups}">
      </ng-template>
    </div>
  </div>
  <div class="row" *ngIf="detail.credentials && detail.credentials.length > 0">
    <div class="col-12">
      <ng-template *ngTemplateOutlet="credentialsTemplate;context: {$implicit: detail.credentials}">
      </ng-template>
    </div>
  </div>
  <div class="row" *ngIf="detail.accessRights && detail.accessRights.length > 0">
    <div class="col-12">
      <ng-template *ngTemplateOutlet="accessRightsTemplate;context: {$implicit: detail.accessRights}">
      </ng-template>
    </div>
  </div>
</ng-template>

<!-- ORGANIZATION PROFILE -->
<ng-template #profileTemplate let-organizationProfile let-username="username">
  <div class="d-flex flex-column">
    <div class="d-flex flex-column mb-4">
      <span class="text-sm text-bold" *ngIf="organizationProfile.uniqueId">
        <span>
          {{organizationProfile.uniqueId}}
        </span>
      </span>
      <span class="text-sm text-black-50" *ngIf="roleName">
        <span>
          {{roleName|translate}}
        </span>
      </span>
    </div>
    <span class="text-md mb-2" *ngIf="organizationProfile.email || organizationProfile.phoneNumber">
      <span *ngIf="organizationProfile.email" class="me-2" nz-tooltip nzTooltipTitle="{{'BUTTON.EMAIL'|translate}}">
        <a href="mailto:{{organizationProfile.email}}">
          <cds-icon shape="envelope" class="text-black-50 me-1"></cds-icon>{{organizationProfile.email}}
        </a>
      </span>
      <span *ngIf="organizationProfile.phoneNumber" class="me-2" nz-tooltip
        nzTooltipTitle="{{'BUTTON.CALL'|translate}}">
        <a href="tel:{{organizationProfile.phoneNumber}}">
          <cds-icon shape="phone-handset" class="text-black-50 me-1"></cds-icon>{{organizationProfile.phoneNumber}}
        </a>
      </span>
    </span>
    <span class="text-sm mb-3" *ngIf="organizationProfile.address">
      <span>
        <cds-icon shape="home" class="text-black-50 me-1"></cds-icon>{{organizationProfile.address}}
      </span>
    </span>
    <div class="row mb-3" *ngIf="username">
      <div class="col-12">
        <div class="text-sm d-flex">
          <span>{{'USER.USERNAME'|translate}} :</span><span class="fw-medium ms-1 cursor-pointer"
            [cdkCopyToClipboard]="username" nz-tooltip
            nzTooltipTitle="{{'BUTTON.COPY' | translate}}">{{username}}</span>
        </div>
      </div>
    </div>
    <div class="row">
      <div class="col-6 d-flex flex-column mb-2" *ngIf="organizationProfile.birthDateUtcText">
        <span class="text-xs text-black-50">{{'IDENTITY.BIRTH_DATE'|translate}}</span>
        <span class="text-sm">{{organizationProfile.birthDateUtcText}}</span>
      </div>
      <div class="col-6 d-flex flex-column mb-2" *ngIf="organizationProfile.exployeeStartUtcText">
        <span class="text-xs text-black-50">{{'IDENTITY.EMPLOYEE_START'|translate}}</span>
        <span class="text-sm">{{organizationProfile.exployeeStartUtcText}}</span>
      </div>
      <div class="col-6 d-flex flex-column mb-2" *ngIf="organizationProfile.previousServiceDuration">
        <span class="text-xs text-black-50">{{'IDENTITY.PREVIOUS_SERVICE'|translate}}</span>
        <span class="text-sm">{{organizationProfile.previousServiceDuration}}
          {{'REPORT.PACS_UNIT_DAY'|translate}}</span>
      </div>
      <div class="col-6 d-flex flex-column mb-2" *ngIf="organizationProfile.pacsEnabledRemainedAnnualPPermission">
        <span class="text-xs text-black-50">{{'IDENTITY.REMAINED_ANNUAL_PPERMISSION_DAYS'|translate}}</span>
        <span class="text-sm">{{organizationProfile.pacsEnabledRemainedAnnualPPermission}}
          {{'REPORT.PACS_UNIT_DAY'|translate}}</span>
      </div>
    </div>
  </div>
</ng-template>

<!-- ORGANIZATION PROFILE END -->

<!-- ORGANIZATION UNITS -->
<ng-template #organizationUnitsTemplate let-organizationUnits>
  <div class="d-flex flex-column my-3">
    <div class="d-flex mb-1 b-b-1 py-1">
      <span class="text-sm">{{'IDENTITY.TITLE_ORGANIZATION_UNITS'|translate}} ({{organizationUnits.length}})</span>
      <span class="text-xs text-bold text-secondary ms-auto cursor-pointer" *ngIf="permissionEdit"
        (click)="onEditButtonClicked($event, 'organizationunits')">{{'BUTTON.EDIT'|translate}}</span>
    </div>
    <div class="d-flex flex-wrap">
      <ng-container *ngFor="let organizationUnit of organizationUnits">
        <div class="d-flex align-items-center py-2 pe-2 mt-1 mb-2 me-3">
          <cds-icon shape="organization" class="text-black-50 me-1"></cds-icon>
          <div class="d-flex flex-column">
            <span class="text-sm line-height-sm">{{organizationUnit.name}}</span>
            <span class="text-xs color-gray">{{organizationUnit.roleName|translate}}</span>
          </div>
        </div>
      </ng-container>
    </div>
  </div>
</ng-template>
<!-- ORGANIZATION UNITS END -->

<!-- GROUPS -->
<ng-template #userGroupsTemplate let-userGroups>
  <div class="d-flex flex-column my-3">
    <div class="d-flex mb-1 b-b-1 py-1">
      <span class="text-sm">{{'IDENTITY.TITLE_USER_GROUP'|translate}} ({{userGroups.length}})</span>
      <span class="text-xs text-bold text-secondary ms-auto cursor-pointer" *ngIf="permissionEdit"
        (click)="onEditButtonClicked($event, 'usergroups')">{{'BUTTON.EDIT'|translate}}</span>
    </div>
    <div class="d-flex flex-wrap">
      <ng-container *ngFor="let userGroup of userGroups">
        <div class="d-flex align-items-start py-2 pe-2 my-1 me-2">
          <cds-icon shape="users" solid class="me-1" [ngStyle]="{'color': userGroup.hexCode}"></cds-icon>
          <div class="d-flex flex-column">
            <span class="text-sm">{{userGroup.name}}</span>
          </div>
        </div>
      </ng-container>
    </div>
  </div>
</ng-template>
<!-- GROUPS END -->

<!-- CREDENTIALS -->
<ng-template #credentialsTemplate let-credentials>
  <div class="d-flex flex-column my-3">
    <div class="d-flex mb-1 b-b-1 py-1">
      <span class="text-sm">{{'IDENTITY.TITLE_CREDENTIALS'|translate}} ({{credentials.length}})</span>
      <span class="text-xs text-bold text-secondary ms-auto cursor-pointer" *ngIf="permissionEdit"
        (click)="onEditButtonClicked($event, 'credentials')">{{'BUTTON.EDIT'|translate}}</span>
    </div>
    <div class="d-flex flex-wrap">
      <ng-container *ngFor="let credential of credentials">
        <div class="d-flex align-items-start py-2 pe-2 my-1 me-2">
          <cds-icon [attr.shape]="credential.credentialType.icon" class="text-black-50 me-2" size="md"></cds-icon>
          <div class="d-flex flex-column">
            <span class="text-sm">{{credential.credentialType.description|translate}}<span
                class="badge rounded-pill text-bg-info ms-1"
                *ngIf="credential.groupNumber">{{credential.groupNumber}}</span></span>
            <span class="text-xs text-black-50"
              *ngIf="credential.dataVisibility && credential.dataText">{{credential.dataText|translate}}</span>
            <span class="text-xxs font-italic" *ngIf="credential.expirationUtcText"
              [ngClass]="{'text-danger': credential.isExpired, 'text-black-50': !credential.isExpired}" nz-tooltip
              nzTooltipTitle="{{'CREDENTIAL.TITLE_EXPIRATION' | translate}}">{{credential.expirationUtcText}}</span>
          </div>
        </div>
      </ng-container>
    </div>
  </div>
</ng-template>
<!-- CREDENTIALS END -->

<!-- ACCESS RIGHTS -->
<ng-template #accessRightsTemplate let-accessRights>
  <div class="d-flex flex-column my-3">
    <div class="d-flex mb-1 b-b-1 py-1">
      <span class="text-sm">{{'IDENTITY.TITLE_ACCESS_RIGHTS'|translate}} ({{accessRights.length}})</span>
      <span class="text-xs text-bold text-secondary ms-auto cursor-pointer" *ngIf="permissionEdit"
        (click)="onEditButtonClicked($event, 'accessrights')">{{'BUTTON.EDIT'|translate}}</span>
    </div>
    <div class="d-flex flex-wrap">
      <ng-container *ngFor="let accessRight of accessRights">
        <div class="d-flex align-items-start py-2 pe-2 my-1 me-2">
          <cds-icon shape="login" class="text-black-50 me-2"></cds-icon>
          <div class="d-flex flex-column">
            <span class="text-sm">{{accessRight.accessControlPointName}}</span>
            <span class="text-xs text-black-50"
              *ngIf="accessRight.remoteAccess && accessRight.accessControlPointRemoteAvailable">{{'REPORT.ACP_SUMMARY_REMOTE_ACCESS'|translate}}</span>
          </div>
        </div>
      </ng-container>
    </div>
  </div>
</ng-template>
<!-- ACCESS RIGHTS END -->`;var Se="";var Ee=`<div class="modal-header">
  <span class="text-lg">{{'IDENTITY.CHANGE_PASSWORD' | translate}}</span>
</div>

<div class="modal-body">
  <div class="row">
    <div class="col-12 mb-3">
      <span class="text-md text-bold" *ngIf="fullname">{{fullname}}</span>
    </div>
    <div class="col-12">
      <form class="form" [formGroup]="identityChangePasswordForm">
        <div class="form-group">
          <label for="identityAccountConfirmPassword" class="required">{{'IDENTITY.NEW_PASSWORD' | translate}}</label>
          <div class="input-group">
            <input id="identityAccountNewPassword" type="password" formControlName="newPassword"
              class="form-control form-control-sm"
              [ngClass]="{'is-invalid': isUserAccountFormFieldInvalid('newPassword')}">
            <div class="invalid-feedback"
              *ngIf="identityChangePasswordForm.get('newPassword').errors && identityChangePasswordForm.get('newPassword').errors.required">
              {{'VALIDATION.REQUIRED' | translate}}
            </div>
            <div class="invalid-feedback"
              *ngIf="identityChangePasswordForm.get('newPassword').errors && identityChangePasswordForm.get('newPassword').errors.minlength">
              <span [translate]="'VALIDATION.MIN_LENGTH'"
                [translateParams]="{min: identityChangePasswordForm.get('newPassword').errors.minlength.requiredLength}"></span>
            </div>
            <div class="invalid-feedback"
              *ngIf="identityChangePasswordForm.get('newPassword').errors && identityChangePasswordForm.get('newPassword').errors.maxlength">
              <span [translate]="'VALIDATION.MAX_LENGTH'"
                [translateParams]="{max: identityChangePasswordForm.get('newPassword').errors.maxlength.requiredLength}"></span>
            </div>
          </div>
        </div>

        <div class="form-group">
          <label for="identityAccountConfirmPassword" class="required">{{'IDENTITY.CONFIRM_PASSWORD' |
            translate}}</label>
          <div class="input-group">
            <input id="identityAccountConfirmPassword" type="password" formControlName="confirmPassword"
              class="form-control form-control-sm"
              [ngClass]="{'is-invalid': isUserAccountFormFieldInvalid('confirmPassword') || isPasswordsNotMatched}">
            <div class="invalid-feedback"
              *ngIf="identityChangePasswordForm.get('confirmPassword').errors && identityChangePasswordForm.get('confirmPassword').errors.required">
              {{'VALIDATION.REQUIRED' | translate}}
            </div>
            <div class="invalid-feedback"
              *ngIf="identityChangePasswordForm.get('confirmPassword').errors && identityChangePasswordForm.get('confirmPassword').errors.minlength">
              <span [translate]="'VALIDATION.MIN_LENGTH'"
                [translateParams]="{min: identityChangePasswordForm.get('confirmPassword').errors.minlength.requiredLength}"></span>
            </div>
            <div class="invalid-feedback"
              *ngIf="identityChangePasswordForm.get('confirmPassword').errors && identityChangePasswordForm.get('confirmPassword').errors.maxlength">
              <span [translate]="'VALIDATION.MAX_LENGTH'"
                [translateParams]="{max: identityChangePasswordForm.get('confirmPassword').errors.maxlength.requiredLength}"></span>
            </div>
            <div class="invalid-feedback" *ngIf="isPasswordsNotMatched">
              {{'VALIDATION.PASSWORD_NOT_MATCH' | translate}}
            </div>
          </div>
        </div>
      </form>
    </div>
  </div>
</div>

<div class="modal-footer">
  <button class="btn btn-outline-primary me-2" (click)="onCancelClicked($event)">{{'BUTTON.CLOSE' | translate}}</button>
  <button class="btn btn-primary" (click)="onChangePasswordClicked($event)"
    [disabled]="identityChangePasswordForm.invalid || isPasswordsNotMatched">{{'BUTTON.SAVE' | translate}}</button>
</div>`;var Ne=`.identityName{margin-top:4px}
`;var Ue=function(a,e,t,i){var s=arguments.length,n=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(a,e,t,i);else for(var r=a.length-1;r>=0;r--)(o=a[r])&&(n=(s<3?o(n):s>3?o(e,t,n):o(e,t))||n);return s>3&&n&&Object.defineProperty(e,t,n),n},E=class extends y{identityService;interactionService;userId;fullname;identityChangePasswordForm=new U({newPassword:new w("",[g.required,g.minLength(v.PASSWORD_MIN_LENGTH),g.maxLength(v.PASSWORD_MAX_LENGTH)]),confirmPassword:new w("",[g.required,g.minLength(v.PASSWORD_MIN_LENGTH),g.maxLength(v.PASSWORD_MAX_LENGTH)])});FORM_FIELD_NEWPASSWORD="newPassword";FORM_FIELD_CONFIRMPASSWORD="confirmPassword";constructor(e,t){super(),this.identityService=e,this.interactionService=t}get isPasswordsNotMatched(){return this.identityChangePasswordForm&&this.identityChangePasswordForm.get(this.FORM_FIELD_NEWPASSWORD)&&this.identityChangePasswordForm.get(this.FORM_FIELD_NEWPASSWORD).value&&this.identityChangePasswordForm.get(this.FORM_FIELD_CONFIRMPASSWORD)&&this.identityChangePasswordForm.get(this.FORM_FIELD_CONFIRMPASSWORD).value&&this.identityChangePasswordForm.get(this.FORM_FIELD_NEWPASSWORD).value!==this.identityChangePasswordForm.get(this.FORM_FIELD_CONFIRMPASSWORD).value}onModalInitialized(){super.onModalInitialized()}isUserAccountFormFieldInvalid(e){return z(this.identityChangePasswordForm,e)}onChangePasswordClicked(e){let t=new ee;t.id=this.userId,t.password=this.identityChangePasswordForm.get(this.FORM_FIELD_NEWPASSWORD).value,this.identityService.changePasswordOfIdentity(t).subscribe(()=>{this.interactionService.showMessage("IDENTITY.CHANGE_PASSWORD_SUCCEED",null,F.Success,{fullname:this.fullname}),this.closeModal()})}static ctorParameters=()=>[{type:h},{type:j}];static propDecorators={userId:[{type:d}],fullname:[{type:d}]}};E=Ue([c({selector:"armon-identity-change-password-modal",template:Ee,standalone:!0,imports:[m,G,B,V,f,p],styles:[Ne]})],E);var Re=`<div class="modal-header">\r
    <span class="text-lg">{{'BUTTON.ACTION_HISTORY_EDIT' | translate}}</span>\r
</div>\r
\r
<div class="modal-body mhs-25 mxh-vh-60">\r
    <ng-container *ngIf="records">\r
        <div *ngIf="records?.length > 0; else noData">\r
            <div class="row py-2">\r
                <ng-container *ngFor="let record of records">\r
                    <div\r
                        class="col-12 d-flex flex-column bg-color-gray-tint rnd-1 mb-3 p-3 border border-1 border-light-subtle">\r
                        <div class="d-flex align-items-baseline"\r
                            [ngClass]="{'b-b-1 mb-2 pb-2': (record.changes && record.changes.length>0)}">\r
                            <span class="text-sm">{{record.message}}</span>\r
                            <span class="text-xs text-italic text-right ms-auto">{{record.actionUtc |\r
                                date:'medium'}}</span>\r
                        </div>\r
                        <div class="d-flex flex-column">\r
                            <ng-container *ngFor="let change of record.changes">\r
                                <span>\r
                                    <span class="text-sm text-bold">{{change.field}}</span>&nbsp;:&nbsp;\r
                                    <ng-container *ngIf="change.oldValue && change.newValue">\r
                                        <span class="text-sm">{{change.oldValue}}</span>\r
                                        <cds-icon shape="circle-arrow" direction="right" size="sm" solid\r
                                            class="mx-2 color-secondary"></cds-icon>\r
                                        <span class="text-sm">{{change.newValue}}</span>\r
                                    </ng-container>\r
                                    <ng-container *ngIf="change.oldValue && !change.newValue">\r
                                        <cds-icon shape="minus-circle" size="sm" solid class="me-2 color-secondary">\r
                                        </cds-icon>\r
                                        <span class="text-sm">{{change.oldValue}}</span>\r
                                    </ng-container>\r
                                    <ng-container *ngIf="!change.oldValue && change.newValue">\r
                                        <cds-icon shape="plus-circle" size="sm" solid class="me-2 color-secondary">\r
                                        </cds-icon>\r
                                        <span class="text-sm">{{change.newValue}}</span>\r
                                    </ng-container>\r
                                </span>\r
                            </ng-container>\r
                        </div>\r
                    </div>\r
                </ng-container>\r
            </div>\r
        </div>\r
    </ng-container>\r
    <ng-template #noData>\r
        <nz-empty [nzNotFoundContent]="contentTpl" [nzNotFoundImage]="'./assets/images/empty/empty_list.png'">\r
            <ng-template #contentTpl>\r
                <span>{{'ACTION_HISTORY_NO_DATA' | translate}}</span>\r
            </ng-template>\r
        </nz-empty>\r
    </ng-template>\r
</div>\r
<div class="modal-footer">\r
    <button class="btn btn-primary" (click)="onCancelClicked($event)">{{'BUTTON.CLOSE' | translate}}</button>\r
</div>`;var we=`.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 Ye=function(a,e,t,i){var s=arguments.length,n=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(a,e,t,i);else for(var r=a.length-1;r>=0;r--)(o=a[r])&&(n=(s<3?o(n):s>3?o(e,t,n):o(e,t))||n);return s>3&&n&&Object.defineProperty(e,t,n),n},N=class extends y{identityService;userId;records;constructor(e){super(),this.identityService=e}onModalInitialized(){super.onModalInitialized(),this.fetchData()}fetchData(){this.identityService.getIdentityActionHistory(this.userId).subscribe(e=>{this.records=e.items})}static ctorParameters=()=>[{type:h}];static propDecorators={userId:[{type:d}]}};N=Ye([c({selector:"armon-identity-action-history-modal",template:Re,standalone:!0,imports:[m,u,f,C,D,p],styles:[we]})],N);var je=function(a,e,t,i){var s=arguments.length,n=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(a,e,t,i);else for(var r=a.length-1;r>=0;r--)(o=a[r])&&(n=(s<3?o(n):s>3?o(e,t,n):o(e,t))||n);return s>3&&n&&Object.defineProperty(e,t,n),n},Pe=class{identityService;roleService;authService;sessionService;modalService;routingService;languageService;settingsService;drawerRef;identityId;selectedTab=0;detailLoaded=new I;detail;loading=!0;permissionEdit;permissionReportAccessLogs;actions=[];enabledNotificationJobTypes;roleName;constructor(e,t,i,s,n,o,r,Ae,_e){this.identityService=e,this.roleService=t,this.authService=i,this.sessionService=s,this.modalService=n,this.routingService=o,this.languageService=r,this.settingsService=Ae,this.drawerRef=_e}ngOnInit(){setTimeout(()=>{this.getIdentityDetails(this.identityId)},200)}getIdentityDetails(e){this.identityService.getIdentityDetailedById(e,!1).subscribe(t=>{t?(L(t.credentials,"-groupNumber"),t.organizationUnits&&t.organizationUnits.length>0&&t.organizationUnits.forEach(i=>{this.roleService.allRoles.find(s=>s.id==i.roleId)&&(i.roleName=this.roleService.allRoles.find(s=>s.id==i.roleId).name)}),this.detail=t,this.detailLoaded.emit(this.detail),this.roleService.allRoles.find(i=>i.id==this.detail.organizationProfile.roleId)&&(this.roleName=this.roleService.allRoles.find(i=>i.id==this.detail.organizationProfile.roleId).name),this.settingsService.getOrganizationSettings().subscribe(i=>{this.enabledNotificationJobTypes=i.notification.enabledTypeDefs,this.initializeActions()})):this.drawerRef&&this.drawerRef.close()})}initializeActions(){let e=this.identityService.getOrganizationUnitIds(this.detail);this.permissionEdit=this.authService.checkPermission(l.IDENTITY.getEdit(),e),this.permissionReportAccessLogs=this.authService.checkPermission(l.ACCESSLOG.getReportDetailed(),e),this.addAction("BUTTON.SHOW_ACCESS_LOGS",this.onShowReportButtonClicked,l.ACCESSLOG.getReportDetailed(),e),this.permissionEdit&&this.addAction("IDENTITY.EDIT_PHOTOS",this.onEditPhotosClicked),this.permissionEdit&&(this.addAction("FORBIDDEN_IDENTITY.ADD_RECORD",this.onAddForbiddenRecordClicked,l.IDENTITY.getForbiddenView()),this.addAction("FORBIDDEN_IDENTITY.USER_LIST",this.onListUserForbiddenRecordsClicked,l.IDENTITY.getForbiddenView())),(this.permissionEdit||this.authService.checkPermission([l.IDENTITY.getReadDetailed(),l.IDENTITY.getCredentialWrite()],e))&&this.addAction("BUTTON.ACTION_HISTORY_EDIT",this.onActionHistoryButtonClicked),this.permissionEdit&&this.authService.checkPermission(l.ACCESSLOG.getInsertManualLog())&&this.addAction("ACCESSCONTROLPOINT.ADD_MANUAL_RECORD",this.onAddManualLogButtonClicked),this.authService.checkPermission([l.IDENTITY.getAccessNotifications(),l.ACCESSLOG.getReportSummary(),l.IDENTITY.getReadBasic()],e)&&this.enabledNotificationJobTypes.findIndex(t=>t.type==P.IdentityAccess)>-1&&this.addAction("MYACCOUNT.NOTIFICATION_ADD_TRIGGER_ACCESS",this.onAddAccessNotificationClicked),this.sessionService.hasModule(H.PACS)&&this.authService.checkPermission([l.PPERMISSION.getWrite(),l.IDENTITY.getReadBasic()])&&this.enabledNotificationJobTypes.findIndex(t=>t.userPacsNotification==!0)>-1&&this.addAction("MYACCOUNT.NOTIFICATION_ADD_TRIGGER_PACS",this.onAddPACSNotificationClicked),this.loading=!1}addAction(e,t,i,s){i?this.authService.checkPermission(i,s)&&this.actions.push({label:e,action:t}):this.actions.push({label:e,action:t})}onActionClicked(e){e.action&&e.action.apply(this)}onEditButtonClicked(e,t=null){let i=this.modalService.open(ce,{settings:{size:"xl",scrollable:!0,centered:!1},props:{identityId:this.detail.id,page:t}});i.result.then(s=>{}).catch(s=>{}),setTimeout(()=>{this.drawerRef&&this.drawerRef.close(i)},500)}onShowReportButtonClicked(){this.routingService.gotoUserAccessLogs(this.detail.id),this.drawerRef&&this.drawerRef.close()}onChangePasswordButtonClicked(){this.modalService.open(E,{settings:{size:"md"},props:{userId:this.detail.id,fullname:this.detail.organizationProfile.fullName}}).result.then(e=>{}).catch(e=>{})}onEditPhotosClicked(e){let t=this.modalService.open(me,{settings:{size:"lg"},props:{identityId:this.detail.id,title:this.detail.organizationProfile.fullName}}).result.then(i=>{}).catch(i=>{});setTimeout(()=>{this.drawerRef&&this.drawerRef.close(t)},500)}onActionHistoryButtonClicked(){this.modalService.open(N,{settings:{size:"lg",scrollable:!0},props:{userId:this.detail.id}}).result.then(e=>{}).catch(e=>{}),this.drawerRef&&this.drawerRef.close()}onAddManualLogButtonClicked(){this.modalService.open(xe,{settings:{size:"md",centered:!0},props:{userId:this.detail.id}}).result.then(e=>{}).catch(e=>{}),this.drawerRef&&this.drawerRef.close()}onAddAccessNotificationClicked(){setTimeout(()=>{let e=Q.getEmptyModel(P.IdentityAccess);e.receiverFilter||(e.receiverFilter=A.getEmptyModel()),e.receiverFilter.userIds=[this.sessionService.currentUserId],e.settings.targetUserId=this.detail.id,this.modalService.open(ge,{settings:{size:"lg",scrollable:!0},props:{notificationJob:e}}).result.then(t=>{}).catch(t=>{})},300)}onAddPACSNotificationClicked(){setTimeout(()=>{this.modalService.open(se,{settings:{size:"lg",scrollable:!0},props:{availableTypes:K.filter(e=>e.userPacsNotification==!0&&this.enabledNotificationJobTypes.findIndex(t=>t.type==+e.type)>-1),typeSelectionText:"SCHEDULEDJOBS.TYPE_SELECTION_PACS_DIRECTION",typeSelectedFunction:e=>(e.settings.notification.receiverFilter||(e.settings.notification.receiverFilter=A.getEmptyModel()),e.settings.notification.receiverFilter.userIds=[this.sessionService.currentUserId],e.settings.subjectedEmployees.userIds=[this.detail.id],e)}}).result.then(e=>{}).catch(e=>{})},300)}onCloseButtonClicked(e){this.drawerRef&&this.drawerRef.close()}onAddForbiddenRecordClicked(){let e=te.getEmptyModel();e.userId=this.detail.id;let t=this.modalService.open(pe,{settings:{size:"md"},props:{record:e}}).result.then(i=>{}).catch(i=>{});this.drawerRef&&this.drawerRef.close(t)}onListUserForbiddenRecordsClicked(){this.routingService.gotoManageForbiddenIdentities(this.detail.id)}static ctorParameters=()=>[{type:h},{type:J},{type:ae},{type:k},{type:M},{type:oe},{type:Y},{type:ie},{type:re,decorators:[{type:_}]}];static propDecorators={identityId:[{type:d}],selectedTab:[{type:d}],detailLoaded:[{type:T}]}};Pe=je([c({selector:"armon-identity-detail",template:Ce,standalone:!0,imports:[m,le,ve,ue,he,ne,O,S,q,$,u,W,f,b,de,x,p],styles:[Se]})],Pe);export{E as a,N as b,S as c,Pe as d};
