import{a as X,b as v,c as ee}from"./chunk-V5QQQH6M.js";import{a as Z}from"./chunk-FFR3SHS6.js";import"./chunk-I2YJPM55.js";import{b as K,c as w}from"./chunk-SDHD5Z3H.js";import"./chunk-ZDEKLPKE.js";import"./chunk-VQU52MNH.js";import"./chunk-MXSLISEG.js";import"./chunk-FH4KR5HL.js";import"./chunk-PQGNYTS4.js";import"./chunk-P3WQM3KW.js";import"./chunk-3GSDFESG.js";import"./chunk-7QEXVS2A.js";import{b as $}from"./chunk-FSCI3FDB.js";import{a as B,b as G,c as J}from"./chunk-UZB7YFT6.js";import"./chunk-HXEFMD5A.js";import"./chunk-KCLQIV7M.js";import"./chunk-5KCUTXXV.js";import"./chunk-JUDWAYYT.js";import{a as W}from"./chunk-5OT2MLHH.js";import"./chunk-WFZJP5WR.js";import"./chunk-F6KLNSUK.js";import{a as V}from"./chunk-4MZCYQX4.js";import{b as Y,c as H,d as Q}from"./chunk-YOJ4KGSB.js";import"./chunk-I6FSQTEP.js";import"./chunk-CO3X7TQN.js";import{a as j}from"./chunk-VSFNMVXJ.js";import"./chunk-WQ6DP4JQ.js";import{Mb as F,c as n,j as y}from"./chunk-YSQLW2JA.js";import{Hb as q,L as A,Nb as U,ca as M,da as N}from"./chunk-NVJ2ZZFT.js";import{Aa as f,Ba as b,Be as P,Ce as _,Dc as p,Fb as R,Mg as S,Ng as L,Qf as O,Rd as h,bb as x,dc as I,dd as u,ha as d,jb as g,te as T,ue as C,ve as m,xe as E,ya as c,ye as D,zc as z}from"./chunk-SKPDQO4E.js";var te=`<div class="h-100">
    <side-navigation *ngIf="visibleComponent">
        <ng-template side-navigation-nav>
            <armon-pacs-filter-select [title]="'PACS.PPERMISSION_TYPE_LABEL'" [options]="typeFilterOptions"
                [selectedIndex]="selectedTypeIndex"
                (filterChanged)="typeFilterChanged($event)"></armon-pacs-filter-select>
            <armon-pacs-filter-select [title]="'PACS.PPERMISSION_STATUS'" [options]="statusFilterOptions"
                (filterChanged)="statusFilterChanged($event)"></armon-pacs-filter-select>
            <armon-pacs-filter-date-range [title]="'PACS.USER_PPERMISSION_FILTER_DATE'" [dateRange]="filterDateRange"
                (filterChanged)="dateRangeFilterChanged($event)"></armon-pacs-filter-date-range>
        </ng-template>
        <ng-template side-navigation-content>
            <div class="row my-3">
                <div class="col-12">
                    <button class="btn btn-sm btn-primary"
                        (click)="addPPermission($event)">{{'PACS.USER_PPERMISSION_ADD'|translate}}</button>
                </div>
            </div>
            <div class="row py-2" *ngIf="limitedMode">
                <div class="col-12">
                    <div class="alert alert-warning" role="alert">
                        {{"PACS.DIRECTION_PPERMISSION_LIST_LIMITED"|translate}} <a class="alert-link"
                            (click)="exitLimitedMode($event)">{{'BUTTON.SHOW_ALL'|translate}}</a>
                    </div>
                </div>
            </div>
            <div class="row py-3">
                <div class="col-12">
                    <p-table [value]="ppermissions" dataKey="id" [responsive]="true" rowExpandMode="single">
                        <ng-template pTemplate="header">
                            <tr>
                                <th class="width-20p">{{'PACS.PPERMISSION_TYPE_LABEL' | translate}}</th>
                                <th>{{'PACS.USER_PPERMISSION_DATES' | translate}}</th>
                                <th>{{'PACS.PPERMISSION_STATUS' | translate}}</th>
                            </tr>
                        </ng-template>
                        <ng-template pTemplate="body" let-ppermission let-rowData let-expanded="expanded">
                            <tr [pRowToggler]="rowData" [attr.expanded]="expanded" class="data-row">
                                <td>
                                    <span>{{ppermission.ppermissionType.name}}</span>
                                </td>
                                <td>
                                    <div class="report-multi-data-cell">
                                        <div class="d-flex align-items-center">
                                            <span class="main-text">{{ppermission.dateRange.startDateText}}</span>
                                            <div class="ms-2">
                                                <armon-icon-label
                                                    [colorCode]="ppermission.ppermissionType.isDailyScheduled?1:2">
                                                    <ng-template icon-label-icon>
                                                        <cds-icon
                                                            shape="{{ppermission.ppermissionType.isDailyScheduled?'calendar':'clock'}}"
                                                            solid></cds-icon>
                                                    </ng-template>
                                                    <ng-template icon-label-content>
                                                        <armon-pacs-ppermission-duration
                                                            [isDailyScheduled]="ppermission.ppermissionType.isDailyScheduled"
                                                            [duration]="ppermission.permissionUsageCount"></armon-pacs-ppermission-duration>
                                                    </ng-template>
                                                </armon-icon-label>

                                            </div>
                                        </div>
                                        <span class="sub-text mt-2">{{ppermission.dateRange.startDateTime |
                                            date:'medium'}} ~ {{ppermission.dateRange.endDateTime |
                                            date:'medium'}}</span>

                                    </div>
                                </td>
                                <td>
                                    <armon-pacs-ppermission-approve [ppermissionResponse]="ppermission"
                                        [widgetMode]="true" [userFilters]="{userIds:request.userIds}"
                                        [useAsHumanResources]="useAsHumanResources"></armon-pacs-ppermission-approve>
                                </td>
                            </tr>
                        </ng-template>
                        <ng-template pTemplate="rowexpansion" let-ppermission>
                            <tr class="expanded-row">
                                <td [attr.colspan]="3">
                                    <armon-pacs-user-ppermission-list-item [ppermissionResponse]="ppermission"
                                        [ppermissionTypeList]="availableTypes"
                                        (ppermissionEditStarted)="editStarted($event)"
                                        (ppermissionEditCompleted)="editCompleted($event)"
                                        (ppermissionEditCancelled)="editCancelled($event)"></armon-pacs-user-ppermission-list-item>
                                </td>
                            </tr>
                        </ng-template>
                    </p-table>
                </div>
            </div>
            <div class="row pb-3">
                <div class="col-12">
                    <armon-pagination [paginationResponse]="paginationResponse"
                        (pageChanged)="pageChanged($event)"></armon-pagination>
                </div>
            </div>
        </ng-template>
    </side-navigation>
</div>`;var ie="";var oe=`<div class="ppermission-type-item">
    <div class="card-header">
        <span>{{ppermissionResponse.ppermissionType.name}}</span>
    </div>
    <div class="card-block">
        <div class="section-tag-container">
            <div class="section-tag" type="1">
                <div class="icon-container">
                    <cds-icon shape="calendar" size="sm"></cds-icon>
                </div>
                <div class="title-container">
                    <div class="dateinfo-container">
                        <span>
                            <strong>{{'PACS.USER_PPERMISSION_DATES' | translate}}</strong>
                        </span>
                        <span>{{ppermissionResponse.dateRange.startDateTime | date:'medium'}} -
                            {{ppermissionResponse.dateRange.endDateTime
                            | date:'medium'}}</span>
                    </div>
                    <div class="button-container">
                        <button class="btn btn-primary btn-sm" (click)="calendarClicked($event)">
                            <cds-icon shape="search" class="me-2"></cds-icon>{{'PACS.CALENDAR' | translate}}
                        </button>
                    </div>
                </div>
            </div>
            <div class="section-tag" type="2" *ngIf="ppermissionResponse.note && ppermissionResponse.note.length>0">
                <div class="icon-container">
                    <cds-icon shape="note" size="sm"></cds-icon>
                </div>
                <div class="title-container">
                    <span>
                        <strong>{{'PACS.USER_PPERMISSION_NOTE' | translate}}&nbsp;:&nbsp;</strong>
                    </span>
                    <span>{{ppermissionResponse.note}}</span>
                </div>
            </div>
            <div class="section-tag" type="3"
                *ngIf="ppermissionResponse.attachmentInfoList && ppermissionResponse.attachmentInfoList.length>0">
                <div class="icon-container">
                    <cds-icon shape="download-cloud" size="sm"></cds-icon>
                </div>
                <div class="title-container">
                    <armon-pacs-attachment-list [uploadEnabled]="false"
                        [(attachmentList)]="ppermissionResponse.attachmentInfoList"
                        *ngIf="ppermissionResponse.attachmentInfoList && ppermissionResponse.attachmentInfoList.length>0">
                    </armon-pacs-attachment-list>
                </div>
            </div>
            <div class="section-tag" type="1"
                *ngIf="ppermissionResponse.dynamicFormData && ppermissionResponse.ppermissionType.dynamicForm">
                <div class="icon-container">
                    <cds-icon shape="form" size="sm"></cds-icon>
                </div>
                <div class="title-container d-flex flex-column">
                    <span>
                        <strong>{{'PACS.USER_PPERMISSION_ORGANIZATION_FORM' | translate}}</strong>
                    </span>
                    <df-form-user-content [dynamicFormData]="ppermissionResponse.dynamicFormData"
                        [userDynamicContent]="ppermissionResponse.ppermissionType.dynamicForm"></df-form-user-content>
                </div>
            </div>
        </div>
        <armon-pacs-ppermission-approve [ppermissionResponse]="ppermissionResponse" [disabledApprove]="true"
            [useAsSelf]="true"></armon-pacs-ppermission-approve>
    </div>
    <div class="card-footer px-1 py-3">
        <ng-container *ngIf="ppermissionResponse.isEditable == true">
            <button class="btn btn-sm btn-outline-primary me-2" (click)="editClicked($event)"
                [disabled]="disabled">{{'BUTTON.EDIT'|translate}}</button>
            <button class="btn btn-sm btn-outline-danger" (click)="deleteClicked($event)"
                [disabled]="disabled">{{'BUTTON.DELETE'|translate}}</button>
        </ng-container>
        <ng-container *ngIf="ppermissionResponse.isEditable == false">
            <span class="text-sm text-italic text-black-50"><cds-icon shape="help" class="me-2"></cds-icon>{{ppermissionResponse.editableStatusText|translate}}</span>
        </ng-container>
    </div>
</div>`;var se=`.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}:host .card{border-top:2px solid rgba(10,42,90,.6)}:host .card-header{padding:12px}:host .card-header .main-title{padding:6px 0;font-size:.924rem;text-align:left}:host .card-header .title{font-size:.84rem;text-align:left}:host .card-header .sub-title{font-weight:500;font-size:.672rem;text-align:left}:host .section-tag-container{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}:host .section-tag-container .section-tag[type="1"]{font-size:.714rem;margin:3px;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;-webkit-flex-direction:row;-moz-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-grow:1;-webkit-box-flex:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-box-align:stretch;-ms-flex-align:stretch;-webkit-align-items:stretch;-moz-align-items:stretch;align-items:stretch}:host .section-tag-container .section-tag[type="1"] .icon-container{padding:12px;min-height:36px;background-color:#0a2a5a33;color:#0a2a5a;-webkit-border-top-left-radius:.375rem;-moz-border-radius-topleft:.375rem;border-top-left-radius:.375rem;-webkit-border-v-left-radius:.375rem;-moz-border-radius-bottomleft:.375rem;border-bottom-left-radius:.375rem;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:start;-ms-flex-align:start;-webkit-align-items:flex-start;-moz-align-items:flex-start;align-items:flex-start}:host .section-tag-container .section-tag[type="1"] .title-container{padding:6px 12px;min-height:36px;color:#0a2a5a;background-color:#0a2a5a08;-webkit-border-top-right-radius:.375rem;-moz-border-radius-topv:.375rem;border-top-right-radius:.375rem;-webkit-border-v-right-radius:.375rem;-moz-border-radius-bottomright:.375rem;border-bottom-right-radius:.375rem;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-grow:1;-webkit-box-flex:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1}:host .section-tag-container .section-tag[type="1"] .title-container .dateinfo-container{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-grow:1;-webkit-box-flex:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1}:host .section-tag-container .section-tag[type="1"] .title-container .dateinfo-container span{font-size:.714rem;text-align:left;font-weight:400!important}:host .section-tag-container .section-tag[type="1"] .title-container .button-container{display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-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;-webkit-box-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column}:host .section-tag-container .section-tag[type="1"] .title-container .button-container .btn:last-child{margin-right:0}:host .section-tag-container .section-tag[type="2"]{font-size:.714rem;margin:3px;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;-webkit-flex-direction:row;-moz-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-grow:1;-webkit-box-flex:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-box-align:stretch;-ms-flex-align:stretch;-webkit-align-items:stretch;-moz-align-items:stretch;align-items:stretch}:host .section-tag-container .section-tag[type="2"] .icon-container{padding:12px;min-height:36px;background-color:#00435833;color:#004358;-webkit-border-top-left-radius:.375rem;-moz-border-radius-topleft:.375rem;border-top-left-radius:.375rem;-webkit-border-v-left-radius:.375rem;-moz-border-radius-bottomleft:.375rem;border-bottom-left-radius:.375rem;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:start;-ms-flex-align:start;-webkit-align-items:flex-start;-moz-align-items:flex-start;align-items:flex-start}:host .section-tag-container .section-tag[type="2"] .title-container{padding:6px 12px;min-height:36px;color:#004358;background-color:#00435808;-webkit-border-top-right-radius:.375rem;-moz-border-radius-topv:.375rem;border-top-right-radius:.375rem;-webkit-border-v-right-radius:.375rem;-moz-border-radius-bottomright:.375rem;border-bottom-right-radius:.375rem;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-grow:1;-webkit-box-flex:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1}:host .section-tag-container .section-tag[type="2"] .title-container .dateinfo-container{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-grow:1;-webkit-box-flex:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1}:host .section-tag-container .section-tag[type="2"] .title-container .dateinfo-container span{font-size:.714rem;text-align:left;font-weight:400!important}:host .section-tag-container .section-tag[type="2"] .title-container .button-container{display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-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;-webkit-box-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column}:host .section-tag-container .section-tag[type="2"] .title-container .button-container .btn:last-child{margin-right:0}:host .section-tag-container .section-tag[type="3"]{font-size:.714rem;margin:3px;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;-webkit-flex-direction:row;-moz-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-grow:1;-webkit-box-flex:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-box-align:stretch;-ms-flex-align:stretch;-webkit-align-items:stretch;-moz-align-items:stretch;align-items:stretch}:host .section-tag-container .section-tag[type="3"] .icon-container{padding:12px;min-height:36px;background-color:#0369a133;color:#0369a1;-webkit-border-top-left-radius:.375rem;-moz-border-radius-topleft:.375rem;border-top-left-radius:.375rem;-webkit-border-v-left-radius:.375rem;-moz-border-radius-bottomleft:.375rem;border-bottom-left-radius:.375rem;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:start;-ms-flex-align:start;-webkit-align-items:flex-start;-moz-align-items:flex-start;align-items:flex-start}:host .section-tag-container .section-tag[type="3"] .title-container{padding:6px 12px;min-height:36px;color:#0369a1;background-color:#0369a108;-webkit-border-top-right-radius:.375rem;-moz-border-radius-topv:.375rem;border-top-right-radius:.375rem;-webkit-border-v-right-radius:.375rem;-moz-border-radius-bottomright:.375rem;border-bottom-right-radius:.375rem;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-grow:1;-webkit-box-flex:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1}:host .section-tag-container .section-tag[type="3"] .title-container .dateinfo-container{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-grow:1;-webkit-box-flex:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1}:host .section-tag-container .section-tag[type="3"] .title-container .dateinfo-container span{font-size:.714rem;text-align:left;font-weight:400!important}:host .section-tag-container .section-tag[type="3"] .title-container .button-container{display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-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;-webkit-box-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column}:host .section-tag-container .section-tag[type="3"] .title-container .button-container .btn:last-child{margin-right:0}
`;var me=function(r,e,t,s){var i=arguments.length,o=i<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,s);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},k=class{pacsService;interactionService;routingService;modalService;ppermissionTypeList;ppermissionResponse;disabled=!1;ppermissionEditStarted=new d;ppermissionEditCompleted=new d;ppermissionEditCancelled=new d;editPPermission;constructor(e,t,s,i){this.pacsService=e,this.interactionService=t,this.routingService=s,this.modalService=i}ngOnInit(){}ngOnDestroy(){}showEditModal(){this.ppermissionEditStarted.emit(),this.modalService.open(w,{settings:{size:"xl",scrollable:!0,centered:!1,escape:!1,click:!1},props:{ppermissionId:this.ppermissionResponse.id,editModeOnlyDateSelection:!0}}).result.then(e=>{this.ppermissionEditCompleted.emit()}).catch(e=>{})}editClicked(e){this.ppermissionResponse.ppermissionType.requireApprovement&&this.ppermissionResponse.userPPermissionInfo&&this.ppermissionResponse.userPPermissionInfo[0].hasApprovedAction?this.interactionService.showDialog("PACS.EDIT_USER_PPERMISSION","PACS.DIALOG_EDIT_APPROVES_PPERMISSION",null,null,!0,"BUTTON.EDIT","",!1,()=>{this.showEditModal()}):this.showEditModal()}deleteClicked(e){this.interactionService.showDialog(this.ppermissionResponse.ppermissionType.name,"PACS.DIALOG_DELETE_PPERMISSION",null,null,!0,"BUTTON.DELETE","",!0,()=>{this.pacsService.deletePPermission(this.ppermissionResponse.id).subscribe(()=>{this.ppermissionEditCompleted.emit()})})}editCompleted(e){this.ppermissionEditCompleted.emit()}editCancelled(e){this.ppermissionEditCancelled.emit()}calendarClicked(e){this.ppermissionResponse&&this.routingService.goToMyCalendar(p.fromJSDate(this.ppermissionResponse.dateRange.startDateTime).toFormat("yyyy-MM"))}static ctorParameters=()=>[{type:y},{type:O},{type:F},{type:h}];static propDecorators={ppermissionTypeList:[{type:f}],ppermissionResponse:[{type:f}],disabled:[{type:f}],ppermissionEditStarted:[{type:b}],ppermissionEditCompleted:[{type:b}],ppermissionEditCancelled:[{type:b}]}};k=me([c({selector:"armon-pacs-user-ppermission-list-item",template:oe,standalone:!0,imports:[x,$,ee,v,g,u],styles:[se]})],k);var de=function(r,e,t,s){var i=arguments.length,o=i<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,s);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},ne=class{route;pacsService;modalService;visibleComponent=!1;newPPermission;limitedMode=!1;typeFilterOptions=[];statusFilterOptions;availableTypes=[];selectedTypeIndex=0;ppermissions=[];filterDateRange;request=new U;paginationResponse=new L;paginationRequest=new S;constructor(e,t,s){this.route=e,this.pacsService=t,this.modalService=s}ngOnInit(){this.statusFilterOptions=I(M),this.statusFilterOptions.unshift(new N(null,"PACS.ALL")),this.setRequest(),this.filterDateRange=this.request.dateRange,this.route.queryParams.subscribe(e=>{e&&(e&&e.id&&e.id!=""&&(this.request.ppermissionIds=[e.id],this.limitedMode=!0),e[n.PPermissionTypeId]&&e[n.PPermissionTypeId]!==""&&(this.request.ppermissionTypeId=e[n.PPermissionTypeId]),e[n.StartDate]&&e[n.EndDate]&&e[n.StartDate]!==""&&e[n.EndDate]!==""&&(this.filterDateRange={startDateTime:p.fromISO(e[n.StartDate]).toJSDate(),endDateTime:p.fromISO(e[n.EndDate]).toJSDate()},this.request.dateRange.startDateTime=this.filterDateRange.startDateTime,this.request.dateRange.endDateTime=this.filterDateRange.endDateTime)),this.getPPermissionTypes()})}ngOnDestroy(){}setRequest(){this.request.pagination=this.paginationRequest,this.request.pagination.take=z.REQUEST_ITEM_LIMIT,this.request.pagination.skip=0,this.request.dateRange=new A,this.request.dateRange.startDateTime=p.local().minus({months:3}).startOf("day").toJSDate(),this.request.dateRange.endDateTime=p.local().plus({months:1}).toJSDate()}getPPermissionTypes(){let e=new q,t=new S;t.take=0,e.pagination=t,this.pacsService.getPPermissionTypeList(e).subscribe(s=>{this.availableTypes=s.items.filter(i=>i.personnelCanInit===!0&&i.isPassive===!1),this.typeFilterOptions.push({value:null,i18nName:"PACS.ALL"}),s.items.forEach(i=>{this.typeFilterOptions.push({value:i.id,i18nName:i.name})}),this.request.ppermissionTypeId&&(this.selectedTypeIndex=this.typeFilterOptions.findIndex(i=>i.value==this.request.ppermissionTypeId)),this.visibleComponent=!0,this.getPPermissions()})}getPPermissions(){this.pacsService.getPPermissionSelfList(this.request).subscribe(e=>{this.ppermissions=e.items,this.paginationResponse=e.pagination})}refreshList(e=!1){this.request.ppermissionIds&&(delete this.request.ppermissionIds,this.limitedMode=!1),e&&(this.request.pagination.skip=0),this.getPPermissions()}addPPermission(e){this.modalService.open(w,{settings:{size:"xl",scrollable:!0,centered:!1,escape:!1,click:!1}}).result.then(t=>{this.refreshList()}).catch(t=>{})}addCompleted(e){this.refreshList()}addCancelled(e){}editStarted(e){}editCompleted(e){this.refreshList()}editCancelled(e){}exitLimitedMode(e){this.refreshList()}pageChanged(e){this.request.pagination=e,this.refreshList(!1)}typeFilterChanged(e){this.request.ppermissionTypeId=e.value,this.refreshList()}statusFilterChanged(e){this.request.status=e.value,this.refreshList()}dateRangeFilterChanged(e){this.request.dateRange.startDateTime=e.startDateTime,this.request.dateRange.endDateTime=e.endDateTime,this.refreshList()}static ctorParameters=()=>[{type:R},{type:y},{type:h}]};ne=de([c({selector:"armon-pacs-user-ppermission-list",template:te,animations:[T("listAnimation",[D("* => *",[P(":enter",m({opacity:0}),{optional:!0}),P(":enter",_("100ms",[C("0.2s ease-in",E([m({opacity:0,transform:"translateY(10%)",offset:0}),m({opacity:.5,transform:"translateY(-3%)",offset:.3}),m({opacity:1,transform:"translateY(0)",offset:1})]))]),{optional:!0,delay:200})])])],standalone:!0,imports:[x,Q,Y,Z,X,H,W,V,J,B,G,K,v,k,j,g,u],styles:[ie]})],ne);export{ne as PacsUserPPermissionListComponent};
