import{a as E}from"./chunk-ZTHC5SJ5.js";import"./chunk-LMQQ766H.js";import"./chunk-SLQSOQUB.js";import"./chunk-SYO4PMIS.js";import"./chunk-IOLBSI3Y.js";import"./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"./chunk-PWALQELY.js";import"./chunk-3GSDFESG.js";import"./chunk-7QEXVS2A.js";import"./chunk-FSCI3FDB.js";import"./chunk-D4RZOGGF.js";import"./chunk-PMJFQIXL.js";import"./chunk-MNVOJIXC.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{a as N}from"./chunk-WFZJP5WR.js";import"./chunk-F6KLNSUK.js";import{b as O,c as k,d as R}from"./chunk-YOJ4KGSB.js";import"./chunk-I6FSQTEP.js";import"./chunk-CO3X7TQN.js";import"./chunk-VSFNMVXJ.js";import"./chunk-WQ6DP4JQ.js";import{c as o,l as U,wb as D}from"./chunk-YSQLW2JA.js";import"./chunk-NVJ2ZZFT.js";import{$c as u,Dc as c,Fb as h,Hb as f,Pd as S,Qf as y,Te as I,bb as v,bh as _,dd as C,gg as s,hg as P,jg as M,rc as g,wa as p,ya as m}from"./chunk-SKPDQO4E.js";var w=`<ng-container *ngIf="selfMode">\r
  <div class="row justify-content-center">\r
    <div class="col-xl-9 col-lg-12">\r
      <div class="row">\r
        <div class="col-12">\r
          <armon-date-picker #datePicker [options]="datePickerOptions"\r
            (selectionChanged)="onDateSelectionChanged($event)">\r
          </armon-date-picker>\r
        </div>\r
      </div>\r
      <div class="row" *ngIf="selectedUserId && selectedMonth">\r
        <div class="col-12">\r
          <armon-pacs-calendar-grid-employee [userId]="selectedUserId" [selectedMonth]="selectedMonth"\r
            (onUserCaptionUpdated)="onUserCaptionUpdated($event)"></armon-pacs-calendar-grid-employee>\r
        </div>\r
      </div>\r
    </div>\r
  </div>\r
</ng-container>\r
<ng-container *ngIf="!selfMode">\r
  <div class="h-100">\r
    <side-navigation #sideNavigation>\r
      <ng-template side-navigation-nav>\r
        <div class="row">\r
          <div class="col-12">\r
            <label class="report-form-label">{{'REPORT.PACS_COL_USER' | translate}}</label>\r
            <armon-select-search query="identity" [allowMulti]="false" [(ngModel)]="selectedUserId"\r
              (ngModelChange)="onIdentityChanged($event)">\r
            </armon-select-search>\r
          </div>\r
        </div>\r
        <div class="row mt-3" *ngIf="userCaption && selectedUserId">\r
          <div class="col-12">\r
            <div class="p-2 bg-white rounded-1">\r
              <armon-captionlines [captionlines]="userCaption" [showBorder]="false">\r
              </armon-captionlines>\r
            </div>\r
          </div>\r
        </div>\r
      </ng-template>\r
      <ng-template side-navigation-content>\r
        <div class="row">\r
          <div class="col-12">\r
            <armon-date-picker #datePicker [options]="datePickerOptions"\r
              (selectionChanged)="onDateSelectionChanged($event)">\r
            </armon-date-picker>\r
          </div>\r
        </div>\r
        <div class="row" *ngIf="selectedUserId && selectedMonth">\r
          <div class="col-12">\r
            <armon-pacs-calendar-grid-employee [userId]="selectedUserId" [selectedMonth]="selectedMonth"\r
              (onUserCaptionUpdated)="onUserCaptionUpdated($event)"></armon-pacs-calendar-grid-employee>\r
          </div>\r
        </div>\r
        <div class="row mt-5" *ngIf="!selectedUserId">\r
          <div class="col-12">\r
            <nz-empty [nzNotFoundContent]="contentTpl" [nzNotFoundImage]="'./assets/images/empty/search_user.png'">\r
              <ng-template #contentTpl>\r
                <span> {{'PACS.CALENDAR_SELECT_EMPLOYEE_INFO'|translate}}</span>\r
              </ng-template>\r
            </nz-empty>\r
          </div>\r
        </div>\r
      </ng-template>\r
    </side-navigation>\r
  </div>\r
</ng-container>`;var b="";var z=function(a,e,i,n){var r=arguments.length,t=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,i):n,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(a,e,i,n);else for(var l=a.length-1;l>=0;l--)(d=a[l])&&(t=(r<3?d(t):r>3?d(e,i,t):d(e,i))||t);return r>3&&t&&Object.defineProperty(e,i,t),t},A=class{router;interactionService;sessionService;route;selfMode=!1;selectedUserId;userCaption;datePickerOptions=new P;selectedMonth;datePicker;sideNavigation;constructor(e,i,n,r){this.router=e,this.interactionService=i,this.sessionService=n,this.route=r}ngOnInit(){this.selfMode=u.PACS_USER_CALENDAR.fullPath==g(this.router.url),this.selfMode&&(this.selectedUserId=this.sessionService.currentUserId),this.datePickerOptions.items=[{type:s.PreviousMonth},{type:s.CurrentMonth,selected:!0},{type:s.NextMonth},{type:s.SelectMonth}],this.route.queryParams.subscribe(e=>{e&&e[o.UserId]&&e[o.UserId]!=""&&(this.selectedUserId=e[o.UserId])})}ngAfterViewInit(){this.route.queryParams.subscribe(e=>{e&&e[o.Month]&&e[o.Month]!=""?this.setDateSelection(this.datePicker.setPickerItemAndDate(2,[c.fromISO(e[o.Month]).startOf("month").toJSDate(),c.fromISO(e[o.Month]).endOf("month").toJSDate()])):this.setDateSelection(M.getDateSelection(this.datePickerOptions.items[1]))})}setDateSelection(e){this.selectedMonth=c.fromJSDate(e.startDate).toFormat("yyyy-MM")}onDateSelectionChanged(e){this.setDateSelection(e)}onIdentityChanged(e){this.userCaption=null,this.sideNavigation&&e&&this.sideNavigation.hideLeftClicked()}onUserCaptionUpdated(e){console.log("onUserCaptionUpdated",e),this.userCaption=e}static ctorParameters=()=>[{type:f},{type:y},{type:S},{type:h}];static propDecorators={datePicker:[{type:p,args:["datePicker"]}],sideNavigation:[{type:p,args:["sideNavigation"]}]}};A=z([m({selector:"armon-pacs-calendar-grid",template:w,standalone:!0,imports:[v,U,E,R,O,D,I,N,k,_,C],styles:[b]})],A);export{A as PacsCalendarGridComponent};
