import{a as P}from"./chunk-2ZNS6QTD.js";import"./chunk-PQGNYTS4.js";import"./chunk-P3WQM3KW.js";import"./chunk-FSCI3FDB.js";import{a as L}from"./chunk-D4RZOGGF.js";import"./chunk-WFZJP5WR.js";import"./chunk-F6KLNSUK.js";import{b as R,c as F,d as j}from"./chunk-YOJ4KGSB.js";import"./chunk-CO3X7TQN.js";import{a as w}from"./chunk-VSFNMVXJ.js";import"./chunk-WQ6DP4JQ.js";import{Eb as M,Gb as _,Ob as E,S as m,W as D,X as J,c as n,h as C,i as d,l as k,o as z,rb as A}from"./chunk-YSQLW2JA.js";import"./chunk-NVJ2ZZFT.js";import{Fb as u,Ng as y,Te as I,Vc as h,ab as p,af as O,bb as v,bh as x,dd as b,eh as q,gg as r,hd as S,hg as T,jg as N,ya as f,zc as g}from"./chunk-SKPDQO4E.js";var B=`<div class="h-100" *ngIf="visibleComponent">
  <side-navigation>
    <ng-template side-navigation-nav>
      <div class="row">
        <div class="col-12">
          <label class="report-form-label">{{'NOTIFICATIONJOBS.TYPES'|translate}}</label>
          <nz-select class="w-100" nzSize="small" nzPlaceHolder="{{'COMMON.ALL'|translate}}"
            [(ngModel)]="request.filter.types" nzMode="'multiple'">
            <nz-option *ngFor="let notificationJobsType of notificationJobTypes" [nzValue]="notificationJobsType.type"
              [nzLabel]="(notificationJobsType.title | translate)"></nz-option>
          </nz-select>
        </div>
        <div class="col-12 pos-relative">
          <label class="report-form-label">{{'NOTIFICATIONJOBS.USER_FILTER' | translate :
            languageService.userTranslate}}</label>
          <armon-user-filter-control [(ngModel)]="request.filter.receiverFilter"></armon-user-filter-control>
        </div>
        <div class="col-12">
          <label class="report-form-label">{{'NOTIFICATIONJOBS.STATES'|translate}}</label>
          <nz-select class="w-100" nzSize="small" nzPlaceHolder="{{'COMMON.ALL'|translate}}"
            [(ngModel)]="request.filter.states" nzMode="'multiple'">
            <nz-option *ngFor="let notificationJobsState of notificationJobService.notificationJobsStates"
              [nzValue]="notificationJobsState.state" [nzLabel]="(notificationJobsState.title | translate)"></nz-option>
          </nz-select>
        </div>
        <div class="col-12">
          <label class="report-form-label">{{'NOTIFICATIONJOBS.MEDIUMS'|translate}}</label>
          <armon-notification-medium-input [(ngModel)]="request.filter.mediums" [narrow]="true">
          </armon-notification-medium-input>
        </div>
        <div class="col-12">
          <label class="report-form-label">{{'NOTIFICATIONJOBS.WHEN'|translate}}</label>
          <nz-select class="w-100" nzSize="small" nzPlaceHolder="{{'COMMON.ALL'|translate}}"
            [(ngModel)]="request.filter.when" [nzAllowClear]="true">
            <nz-option *ngFor="let notificationJobsWhen of notificationJobService.notificationJobsWhens"
              [nzValue]="notificationJobsWhen.trigger" [nzLabel]="(notificationJobsWhen.title | translate)"></nz-option>
          </nz-select>
        </div>
        <div class="col-12 mt-2">
          <label class="report-checkbox-label" nz-checkbox
            [(ngModel)]="request.filter.archived">{{'NOTIFICATIONJOBS.ONLY_ARCHIVED' |
            translate}}</label>
        </div>
        <div class="col-12 mt-4 d-flex justify-content-center">
          <button class="btn btn-primary btn-sm" (click)="onListClicked($event)">{{'BUTTON.SHOW' |translate}}</button>
        </div>
      </div>
    </ng-template>
    <ng-template side-navigation-content>
      <div class="report-data-container">
        <div class="row report-filter-container">
          <div class="col-12"
            *ngIf="request.filter && request.filter.notificationIds && request.filter.notificationIds.length>0">
            <div class="alert alert-warning alert-sm passive-alert">
              <div class="alert-items">
                <div class="alert-item static">
                  <div class="alert-text">
                    {{"NOTIFICATIONJOBS.HISTORY_NOTIFICATION_LIMITED"|translate}}<button
                      class="ms-3 btn btn-sm btn-link"
                      (click)="onExitLimitedModeClicked($event)">{{'BUTTON.SHOW_ALL'|translate}}</button>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="col-12" *ngIf="request.filter && request.filter.eventIds && request.filter.eventIds.length>0">
            <div class="alert alert-warning alert-sm passive-alert">
              <div class="alert-items">
                <div class="alert-item static">
                  <div class="alert-text">
                    {{"NOTIFICATIONJOBS.HISTORY_EVENT_LIMITED"|translate}}<button class="ms-3 btn btn-sm btn-link"
                      (click)="onExitLimitedModeClicked($event)">{{'BUTTON.SHOW_ALL'|translate}}</button>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="col-12">
            <armon-date-picker [options]="datePickerOptions" (selectionChanged)="onDateSelectionChanged($event)">
            </armon-date-picker>
          </div>
          <div class="col-12">
            <armon-sorting-picker [data]="sortingPickerData" (selectionChanged)="onSortingSelectionChanged($event)">
            </armon-sorting-picker>
          </div>
        </div>
        <div class="row report-data-table-container" id="report-data-table-container">
          <div class="col-12">
            <ng-container *ngIf="items && items.length>0">
              <div class="row my-2" [@listAnimation]="items.length">
                <div class="col-12" *ngFor="let item of items">
                  <armon-notificationjobs-instance [notificationJobInstance]="item" [selfView]="false">
                  </armon-notificationjobs-instance>
                </div>
              </div>
            </ng-container>
          </div>
          <div class="col-12 pt-5" *ngIf="items && items.length==0">
            <nz-empty [nzNotFoundContent]="contentTpl" [nzNotFoundImage]="'./assets/images/empty/empty_list.png'">
              <ng-template #contentTpl>
                <span>{{'COMMON.NO_DATA'|translate}}</span>
              </ng-template>
            </nz-empty>
          </div>
          <div class="col-12 my-2">
            <armon-pagination [paginationResponse]="paginationResponse" (pageChanged)="pageChanged($event)"
              [scrollDomId]="'report-data-table-container'">
            </armon-pagination>
          </div>
        </div>
      </div>
    </ng-template>
  </side-navigation>
</div>`;var H=`.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 Y=function(l,t,e,o){var a=arguments.length,i=a<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(l,t,e,o);else for(var c=l.length-1;c>=0;c--)(s=l[c])&&(i=(a<3?s(i):a>3?s(t,e,i):s(t,e))||i);return a>3&&i&&Object.defineProperty(t,e,i),i},U=class{notificationJobService;scheduledJobService;languageService;settingsService;authService;route;visibleComponent=!1;permissionReportDetailed;request;items;notificationJobTypes;paginationResponse=new y;datePickerOptions=new T;sortingPickerData;constructor(t,e,o,a,i,s){this.notificationJobService=t,this.scheduledJobService=e,this.languageService=o,this.settingsService=a,this.authService=i,this.route=s}ngOnInit(){this.permissionReportDetailed=this.authService.checkPermission(S.ACCESSLOG.getReportDetailed()),this.request=m.getEmptyModel(),this.request.pagination.take=g.REQUEST_ITEM_LIMIT,this.datePickerOptions.items=[{type:r.Today,selected:!0,currentTimeForEnd:!0},{type:r.Yesterday},{type:r.SelectDay},{type:r.CustomWithTimer}];let t=N.getDateSelection(this.datePickerOptions.items[0]);this.setDateSelection(t),this.sortingPickerData={items:[{value:"type",label:"NOTIFICATIONJOBS.SORTING_TYPE",showDirection:!0,selected:!0,isAlpha:!0,directionDefault:d.ASC},{value:"createdT",label:"NOTIFICATIONJOBS.SORTING_CREATED_AT",showDirection:!0,isAlpha:!0,directionDefault:d.ASC}]},this.setSortingSelection(this.sortingPickerData.items[0].value,h.ASC),this.route.queryParams.subscribe(e=>{e&&e[n.NotificationId]&&e[n.NotificationId]!==""&&(this.request.filter.notificationIds=[e[n.NotificationId]]),e&&e[n.NotificationEventId]&&e[n.NotificationEventId]!==""&&(this.request.filter.eventIds=[e[n.NotificationEventId]]),e&&e[n.Archived]&&(this.request.filter.archived=e[n.Archived]=="true"),setTimeout(()=>{this.getOrganizationSettings()},300)})}setDateSelection(t){this.request.filter.eventTime.start=t.startDate,this.request.filter.eventTime.end=t.endDate}setSortingSelection(t,e){this.request.sorting.field=t,this.request.sorting.order=e}getOrganizationSettings(){this.settingsService.getOrganizationSettings().subscribe(t=>{this.notificationJobTypes=t.notification.enabledTypeDefs.filter(e=>e.filterable==!0),this.getData(),this.visibleComponent=!0})}getData(){let t=m.getRequestModel(this.request,this.request.filter.eventIds&&this.request.filter.eventIds.length>0||this.request.filter.notificationIds&&this.request.filter.notificationIds.length>0);this.notificationJobService.listNotificationJobInstances(t).subscribe(e=>{this.items=e.items,this.paginationResponse=e.pagination})}pageChanged(t){this.request.pagination=t,this.getData()}onSortingSelectionChanged(t){this.setSortingSelection(t.value,t.direction),this.getData()}onListClicked(t){this.request.pagination.skip=0,this.getData()}onDateSelectionChanged(t){this.setDateSelection(t),this.getData()}onExitLimitedModeClicked(){this.request.filter.notificationIds=null,this.request.filter.eventIds=null,this.request.filter.archived=!1,this.getData()}static ctorParameters=()=>[{type:J},{type:D},{type:O},{type:A},{type:E},{type:u}]};U=Y([f({selector:"armon-notificationjobs-instances",template:B,animations:L,standalone:!0,imports:[v,j,R,q,I,p,M,_,z,F,k,C,P,x,w,b],styles:[H]})],U);export{U as NotificationJobsInstancesComponent};
