import{a as Ls}from"./chunk-KPAQQQE2.js";import{a as As}from"./chunk-TOMSDEUO.js";import{a as Ks}from"./chunk-236ISZ7F.js";import"./chunk-SSSZHUIR.js";import{a as Bs}from"./chunk-IOLBSI3Y.js";import{a as ie}from"./chunk-A5D23SNU.js";import{a as qs}from"./chunk-OAYF7FNF.js";import{a as Xs}from"./chunk-HYAJENKW.js";import{a as zt,b as Gs,c as _t,d as Fs,e as Hs}from"./chunk-RBSSJWML.js";import"./chunk-MFZ3EXVF.js";import{a as Vs}from"./chunk-R6MVWAVG.js";import{a as js}from"./chunk-SDHD5Z3H.js";import"./chunk-ZDEKLPKE.js";import"./chunk-VQU52MNH.js";import"./chunk-MXSLISEG.js";import{a as j,h as Oe,k as Ws,l as Ms,r as $s,v as Us}from"./chunk-JNXLVPIF.js";import{a as Os,b as pe,d as Ns}from"./chunk-5HOZEP3O.js";import"./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 G}from"./chunk-5DQKN4SL.js";import"./chunk-G7OJYPNY.js";import{a as Ds}from"./chunk-PQGNYTS4.js";import"./chunk-P3WQM3KW.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-H6QPU4XN.js";import"./chunk-IMWNGRKR.js";import"./chunk-5WJM4RWS.js";import{a as Ps,b as zs,c as _s}from"./chunk-UZB7YFT6.js";import"./chunk-HXEFMD5A.js";import"./chunk-KCLQIV7M.js";import"./chunk-5KCUTXXV.js";import{a as Ys}from"./chunk-FGMGXMBG.js";import{a as Nt}from"./chunk-C7NDY7PV.js";import"./chunk-JUDWAYYT.js";import"./chunk-4IRXRL4C.js";import"./chunk-LAJI7RPC.js";import{a as K}from"./chunk-WFZJP5WR.js";import"./chunk-F6KLNSUK.js";import"./chunk-I6FSQTEP.js";import{b as xi}from"./chunk-CO3X7TQN.js";import{a as He}from"./chunk-VSFNMVXJ.js";import"./chunk-WQ6DP4JQ.js";import{Ab as Ot,Bb as Pt,Ca as fi,Da as Ts,J as Rt,Mb as R,Ob as E,Qb as Ve,Rb as Ce,h as es,j as N,k as It,l as kt,nb as Rs,o as St,pb as Es,s as $e,ta as Et,ua as Ss,v as Ue,vb as te,wb as X,xb as Dt,y as Ge,ya as Cs}from"./chunk-YSQLW2JA.js";import{Ba as ms,Cc as T,Dc as re,Ec as ks,H as Ee,Hb as gs,L as De,T as os,Tb as us,Z as rs,_ as as,a as O,ac as fs,b as gi,bc as k,c as Ki,cc as xs,d as Zi,dc as bs,e as Ji,ec as ws,fc as ui,gc as ys,ic as vs,ja as I,jc as Is,ka as ls,l as Qi,ra as ds,rb as ps,w as c,y as z}from"./chunk-NVJ2ZZFT.js";import{$ as ye,$c as Re,$f as et,A as Ni,Aa as h,Ag as ts,Ba as v,Ca as Mi,Da as $i,Dc as d,Ea as Ui,G as Ai,Gg as Ct,Hb as me,Hg as je,Ig as is,Ka as Te,Mc as ci,Mg as Tt,Na as Ze,Nc as Me,Ng as Fe,Oa as ut,P as Li,Pa as Je,Pd as B,Q as di,Qd as qi,Qf as Q,Ra as Gi,Rd as U,Rg as ss,Sa as ji,Sd as ke,Sg as ns,Tb as Ae,Te as _,V as we,Va as Y,Vc as hi,Ve as bt,Wb as Fi,Xb as Vi,Yb as Hi,Ye as wt,Yg as q,_a as Ne,a as Xe,ab as S,af as Se,b as li,bb as u,bh as cs,ca as Ke,cb as ce,cd as D,db as he,dc as Le,dd as f,ec as We,eh as hs,fb as V,g as zi,ga as le,gb as Ie,gg as ee,ha as w,hc as Yi,hd as b,hg as yt,jb as ft,jg as tt,l as gt,mg as vt,nd as Qe,pa as de,qa as ve,s as ze,tc as Bi,te as Xi,u as _e,ue as mi,va as Wi,ve as xt,wa as P,wc as $,ya as p,ye as pi,z as _i}from"./chunk-SKPDQO4E.js";var Zs=`<div class="header-container d-flex flex-column px-3" [ngClass]="{'header-container-edit py-2':isEditMode}">
  <div class="d-flex align-items-center" *ngIf="!isEditMode">
    <span class="text-md me-2" *ngIf="!isEditMode && socketConnected">{{'PAGES.DASHBOARD'|translate}}</span>
    <cds-icon shape="cog" class="color-gray-darkest cursor-pointer me-2" (click)="onEditClicked($event)" nz-tooltip
      nzTooltipTitle="{{'BUTTON.EDIT'|translate}}" style="width: 18px; height: 18px;"></cds-icon>
    <ng-container *ngIf="widgetScreens && widgetScreens.length>1">
      <ng-container *ngFor="let widgetScreeen of widgetScreens; let index = index;">
        <div class="widget-screen-sm d-flex align-items-center justify-content-center me-2"
          [attr.active]="widgetScreeen.isActive" (click)="onWidgetScreenClicked($event, widgetScreeen)">
          <span class="text-sm line-height-sm mt-1">{{index+1}}</span>
        </div>
      </ng-container>
    </ng-container>
  </div>
  <div class="d-flex flex-grow-1 mb-2 pb-2 b-b-1" *ngIf="selectedScreenId && isEditMode">
    <div class="d-flex flex-column justify-content-between align-items-center pe-3 me-3 b-r-1">
      <span class="text-xs">{{'WIDGET.WIDGETS'|translate}}</span>
      <cds-icon nz-dropdown [nzDropdownMenu]="menuAdd" solid class="color-primary cursor-pointer" shape="plus-circle"
        size="lg">
      </cds-icon>
      <nz-dropdown-menu #menuAdd="nzDropdownMenu">
        <ul nz-menu>
          <li nz-menu-item *ngFor="let addableItem of addableItems" (click)="onAddClicked(addableItem)">
            {{addableItem.name|translate}}</li>
        </ul>
      </nz-dropdown-menu>
    </div>
    <div class="d-none d-sm-flex flex-column justify-content-between">
      <span class="text-xs">{{'WIDGET.WIDGET_SCREENS'|translate}}</span>
      <div class="d-flex">
        <ng-container *ngFor="let widgetScreeen of widgetScreens; let index = index;">
          <div class="widget-screen d-flex align-items-center justify-content-center me-2"
            [attr.active]="widgetScreeen.isActive" (click)="onWidgetScreenClicked($event, widgetScreeen)">
            <span class="text-lg">{{index+1}}</span>
            <div class="delete-button d-flex align-items-center justify-content-center cursor-pointer"
              click-stop-propagation (click)="onDeleteWidgetScreenClicked($event, widgetScreeen)">
              <cds-icon shape="times-circle" solid class="color-error cds-icon-18" nz-tooltip
                nzTooltipTitle="{{'BUTTON.DELETE'|translate}}" size="sm"></cds-icon>
            </div>
          </div>
        </ng-container>
        <div class="widget-screen-add d-flex align-items-center justify-content-center cursor-pointer"
          (click)="onAddWidgetScreenClicked($event)" *ngIf="widgetScreens.length < 5">
          <cds-icon shape="plus" style="width: 18px; height: 18px;"></cds-icon>
        </div>
      </div>
    </div>
    <div class="d-flex ms-auto align-items-end">
      <button class="btn btn-outline-primary btn-sm me-2" (click)="onCancelClicked($event)"
        *ngIf="isEditMode">{{'BUTTON.CANCEL'|translate}}</button>
      <button class="btn btn-primary btn-sm" (click)="onSaveClicked($event)"
        *ngIf="isEditMode">{{'BUTTON.SAVE'|translate}}</button>
    </div>
  </div>
  <!-- <button class="btn btn-outline-danger btn-sm" (click)="onResetClicked($event)" *ngIf="isEditMode">{{'BUTTON.RESET'|translate}}</button> -->
</div>
<ng-container *ngIf="selectedScreenId">
  <div class="gridster-container" *ngIf="!isMobileView" [ngClass]="{'gridster-container-edit': isEditMode}">
    <gridster [options]="options" style="background: transparent;">
      <gridster-item [item]="item"
        *ngFor="let item of screens[selectedScreenId].widgets; let first = first; let last = last;"
        style="border: 1px solid lightgray;">
        <ng-template *ngTemplateOutlet="widgetList; context: {$implicit: item, first:first, last:last}"></ng-template>
      </gridster-item>
    </gridster>
  </div>
  <div *ngIf="isMobileView">
    <ng-container *ngFor="let item of screens[selectedScreenId].widgets; let first = first; let last = last;">
      <div class="mobile-widget-container" [ngStyle]="{height: (item.rows * 55)+'px'}">
        <ng-template *ngTemplateOutlet="widgetList; context: {$implicit: item, first:first, last:last}"></ng-template>
      </div>
    </ng-container>
  </div>
</ng-container>

<ng-template #widgetList let-item let-first="first" let-last="last">
  <ng-container [ngSwitch]="item.type">
    <div *ngSwitchCase="3" class="dashboard-item">
      <armon-remote-control-item-list class="dashboard-content widget-item" [widgetData]="item.data"
        [widgetId]="item.id" (dataUpdated)="onRemoteControlsDataUpdated($event)" (hideClicked)="onHideClicked(item)">
      </armon-remote-control-item-list>
      <armon-gridster-overlay #overlay *ngIf="isEditMode" [item]="item" (hideClicked)="onHideClicked(item)"
        (upClicked)="onUpClicked(item)" (downClicked)="onDownClicked(item)" [first]="first" [last]="last"
        [@enterLeaveFade]>
      </armon-gridster-overlay>
    </div>
    <div *ngSwitchCase="1" class="dashboard-item">
      <armon-activity-timeline class="dashboard-content widget-item" [widgetData]="item.data" [widgetId]="item.id"
        (dataUpdated)="onActivityTimelineDataUpdated($event)"></armon-activity-timeline>
      <armon-gridster-overlay #overlay *ngIf="isEditMode" [item]="item" (hideClicked)="onHideClicked(item)"
        (upClicked)="onUpClicked(item)" (downClicked)="onDownClicked(item)" [first]="first" [last]="last"
        [@enterLeaveFade]>
      </armon-gridster-overlay>
    </div>
    <div *ngSwitchCase="5" class="dashboard-item">
      <armon-widget-pacs-ppermission class="dashboard-content widget-item"></armon-widget-pacs-ppermission>
      <armon-gridster-overlay #overlay *ngIf="isEditMode" [item]="item" (hideClicked)="onHideClicked(item)"
        (upClicked)="onUpClicked(item)" (downClicked)="onDownClicked(item)" [first]="first" [last]="last"
        [@enterLeaveFade]>
      </armon-gridster-overlay>
    </div>
    <div *ngSwitchCase="10" class="dashboard-item">
      <armon-widget-pacs-personnel-count class="widget-item" [widgetData]="item.data" [widgetId]="item.id"
        (dataUpdated)="onPersonnelCountDataUpdated($event)"></armon-widget-pacs-personnel-count>
      <armon-gridster-overlay #overlay *ngIf="isEditMode" [item]="item" (hideClicked)="onHideClicked(item)"
        (upClicked)="onUpClicked(item)" (downClicked)="onDownClicked(item)" [first]="first" [last]="last"
        [@enterLeaveFade]>
      </armon-gridster-overlay>
    </div>
    <div *ngSwitchCase="7" class="dashboard-item">
      <armon-widget-pacs-ppermission-organization class="widget-item"></armon-widget-pacs-ppermission-organization>
      <armon-gridster-overlay #overlay *ngIf="isEditMode" [item]="item" (hideClicked)="onHideClicked(item)"
        (upClicked)="onUpClicked(item)" (downClicked)="onDownClicked(item)" [first]="first" [last]="last"
        [@enterLeaveFade]>
      </armon-gridster-overlay>
    </div>
    <div *ngSwitchCase="8" class="dashboard-item">
      <armon-widget-pacs-personnel class="widget-item" [widgetData]="item.data" [widgetId]="item.id"
        (dataUpdated)="onPacsPersonnelDataUpdated($event)"></armon-widget-pacs-personnel>
      <armon-gridster-overlay #overlay *ngIf="isEditMode" [item]="item" (hideClicked)="onHideClicked(item)"
        (upClicked)="onUpClicked(item)" (downClicked)="onDownClicked(item)" [first]="first" [last]="last"
        [@enterLeaveFade]>
      </armon-gridster-overlay>
    </div>
    <div *ngSwitchCase="9" class="dashboard-item">
      <armon-widget-pacs-performance class="widget-item" [showPersonal]="false" [widgetData]="item.data"
        [widgetId]="item.id" (dataUpdated)="onPacsPerformanceDataUpdated($event)"></armon-widget-pacs-performance>
      <armon-gridster-overlay #overlay *ngIf="isEditMode" [item]="item" (hideClicked)="onHideClicked(item)"
        (upClicked)="onUpClicked(item)" (downClicked)="onDownClicked(item)" [first]="first" [last]="last"
        [@enterLeaveFade]>
      </armon-gridster-overlay>
    </div>
    <div *ngSwitchCase="6" class="dashboard-item">
      <armon-widget-pacs-personnel-count-daily class="widget-item" [widgetData]="item.data" [widgetId]="item.id"
        (dataUpdated)="onPersonnelCountDailyDataUpdated($event)"></armon-widget-pacs-personnel-count-daily>
      <armon-gridster-overlay #overlay *ngIf="isEditMode" [item]="item" (hideClicked)="onHideClicked(item)"
        (upClicked)="onUpClicked(item)" (downClicked)="onDownClicked(item)" [first]="first" [last]="last"
        [@enterLeaveFade]>
      </armon-gridster-overlay>
    </div>
    <div *ngSwitchCase="11" class="dashboard-item">
      <armon-widget-visit-counts class="widget-item" [widgetData]="item.data" [widgetId]="item.id"
        (dataUpdated)="onVisitCountsDataUpdated($event)"></armon-widget-visit-counts>
      <armon-gridster-overlay #overlay *ngIf="isEditMode" [item]="item" (hideClicked)="onHideClicked(item)"
        (upClicked)="onUpClicked(item)" (downClicked)="onDownClicked(item)" [first]="first" [last]="last"
        [@enterLeaveFade]>
      </armon-gridster-overlay>
    </div>
    <div *ngSwitchCase="12" class="dashboard-item">
      <armon-widget-visitor-detail class="widget-item"></armon-widget-visitor-detail>
      <armon-gridster-overlay #overlay *ngIf="isEditMode" [item]="item" (hideClicked)="onHideClicked(item)"
        (upClicked)="onUpClicked(item)" (downClicked)="onDownClicked(item)" [first]="first" [last]="last"
        [@enterLeaveFade]>
      </armon-gridster-overlay>
    </div>
    <div *ngSwitchCase="13" class="dashboard-item">
      <armon-widget-visitor-reason class="widget-item"></armon-widget-visitor-reason>
      <armon-gridster-overlay #overlay *ngIf="isEditMode" [item]="item" (hideClicked)="onHideClicked(item)"
        (upClicked)="onUpClicked(item)" (downClicked)="onDownClicked(item)" [first]="first" [last]="last"
        [@enterLeaveFade]>
      </armon-gridster-overlay>
    </div>
    <div *ngSwitchCase="14" class="dashboard-item">
      <armon-widget-visitor-point class="widget-item"></armon-widget-visitor-point>
      <armon-gridster-overlay #overlay *ngIf="isEditMode" [item]="item" (hideClicked)="onHideClicked(item)"
        (upClicked)="onUpClicked(item)" (downClicked)="onDownClicked(item)" [first]="first" [last]="last"
        [@enterLeaveFade]>
      </armon-gridster-overlay>
    </div>
    <div *ngSwitchCase="15" class="dashboard-item">
      <armon-widget-visitor-preregistration class="widget-item"></armon-widget-visitor-preregistration>
      <armon-gridster-overlay #overlay *ngIf="isEditMode" [item]="item" (hideClicked)="onHideClicked(item)"
        (upClicked)="onUpClicked(item)" (downClicked)="onDownClicked(item)" [first]="first" [last]="last"
        [@enterLeaveFade]>
      </armon-gridster-overlay>
    </div>
    <div *ngSwitchCase="16" class="dashboard-item">
      <armon-widget-pacs-work-durations class="dashboard-content widget-item" [widgetData]="item.data"
        [widgetId]="item.id" [type]="3" (dataUpdated)="onPacsMissingWorkDataUpdated($event)">
      </armon-widget-pacs-work-durations>
      <armon-gridster-overlay #overlay *ngIf="isEditMode" [item]="item" (hideClicked)="onHideClicked(item)"
        (upClicked)="onUpClicked(item)" (downClicked)="onDownClicked(item)" [first]="first" [last]="last"
        [@enterLeaveFade]>
      </armon-gridster-overlay>
    </div>
    <div *ngSwitchCase="17" class="dashboard-item">
      <armon-widget-region class="dashboard-content widget-item" [widgetData]="item.data" [widgetId]="item.id"
        (dataUpdated)="onRegionDataUpdated($event)"></armon-widget-region>
      <armon-gridster-overlay #overlay *ngIf="isEditMode" [item]="item" (hideClicked)="onHideClicked(item)"
        (upClicked)="onUpClicked(item)" (downClicked)="onDownClicked(item)" [first]="first" [last]="last"
        [@enterLeaveFade]>
      </armon-gridster-overlay>
    </div>
    <div *ngSwitchCase="18" class="dashboard-item">
      <armon-widget-pacs-work-durations class="dashboard-content widget-item" [widgetData]="item.data"
        [widgetId]="item.id" [type]="2" (dataUpdated)="onPacsMissingWorkDataUpdated($event)">
      </armon-widget-pacs-work-durations>
      <armon-gridster-overlay #overlay *ngIf="isEditMode" [item]="item" (hideClicked)="onHideClicked(item)"
        (upClicked)="onUpClicked(item)" (downClicked)="onDownClicked(item)" [first]="first" [last]="last"
        [@enterLeaveFade]>
      </armon-gridster-overlay>
    </div>
  </ng-container>
</ng-template>`;var Js=`.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 .header-container{overflow:hidden;height:30px}:host .header-container-edit{height:80px!important}:host .widget-screen,:host .widget-screen-add{width:48px;height:36px;border:1px solid #aaa;background-color:#ebebeb;-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem;cursor:pointer;position:relative}:host .widget-screen .delete-button,:host .widget-screen-add .delete-button{position:absolute;width:18px;height:18px;top:-5px;right:-5px;-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;border:none;background-color:#fff;visibility:hidden!important}:host .widget-screen:hover,:host .widget-screen-add:hover{background-color:#cde1ec}:host .widget-screen:hover .delete-button,:host .widget-screen-add:hover .delete-button{visibility:initial!important}:host .widget-screen[active=true],:host [active=true].widget-screen-add{border:1px solid #62a325;background-color:#e0edd3;pointer-events:none}:host .widget-screen-sm{width:24px;height:18px;border:1px solid #aaa;background-color:#fff;-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem;cursor:pointer}:host .widget-screen-sm:hover{border:1px solid #0369a1;background-color:#cde1ec}:host .widget-screen-sm[active=true]{border:1px solid #62a325;background-color:#eff6e9;pointer-events:none}:host .widget-screen-add{border:none}:host .gridster-container{height:-webkit-calc(100% - 30px);height:-moz-calc(100% - 30px);height:calc(100% - 30px)}:host .gridster-container gridster-item{-webkit-border-radius:1.2rem;-moz-border-radius:1.2rem;border-radius:1.2rem;border:1px solid #e5e7eb!important}:host .gridster-container .dashboard-item{height:100%!important;position:relative;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-box-align:stretch;-ms-flex-align:stretch;-webkit-align-items:stretch;-moz-align-items:stretch;align-items:stretch;-webkit-flex-grow:1;-webkit-box-flex:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1}:host .gridster-container .dashboard-item .dashboard-title{margin:6px 12px 0;border-bottom:1px solid rgba(10,42,90,.2);color:#0a2a5a;font-size:.714rem;line-height:1.1rem;font-weight:200;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center}:host .gridster-container .dashboard-item .dashboard-title .btn{margin:0 0 0 auto;padding-right:0}:host .gridster-container .dashboard-item .dashboard-content{-webkit-flex-basis:100%;-moz-flex-basis:100%;-ms-flex-preferred-size:100%;flex-basis:100%;height:0;min-height:0}:host .gridster-container .dashboard-item .edit-mode-filter{-webkit-filter:blur(1px);-moz-filter:blur(1px);-ms-filter:blur(1px);-o-filter:blur(1px);filter:blur(1px)}:host .gridster-container-edit{height:-webkit-calc(100% - 80px)!important;height:-moz-calc(100% - 80px)!important;height:calc(100% - 80px)!important}:host .mobile-widget-container{position:relative;border:1px solid lightgray;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem;box-shadow:0 0 4px #ccc;margin-top:6px;margin-bottom:6px}:host .mobile-widget-container .dashboard-item{-webkit-flex-grow:1;-webkit-box-flex:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1;background-color:#fff}:host .mobile-widget-container .edit-mode-filter{-webkit-filter:blur(1px);-moz-filter:blur(1px);-ms-filter:blur(1px);-o-filter:blur(1px);filter:blur(1px)}
`;var y;(function(r){r.Fit="fit",r.ScrollVertical="scrollVertical",r.ScrollHorizontal="scrollHorizontal",r.Fixed="fixed",r.VerticalFixed="verticalFixed",r.HorizontalFixed="horizontalFixed"})(y||(y={}));var bi;(function(r){r.Always="always",r.OnDragAndResize="onDrag&Resize",r.None="none"})(bi||(bi={}));var C;(function(r){r.None="none",r.CompactUp="compactUp",r.CompactLeft="compactLeft",r.CompactUpAndLeft="compactUp&Left",r.CompactLeftAndUp="compactLeft&Up",r.CompactRight="compactRight",r.CompactUpAndRight="compactUp&Right",r.CompactRightAndUp="compactRight&Up",r.CompactDown="compactDown",r.CompactDownAndLeft="compactDown&Left",r.CompactLeftAndDown="compactLeft&Down",r.CompactDownAndRight="compactDown&Right",r.CompactRightAndDown="compactRight&Down"})(C||(C={}));var A;(function(r){r.LTR="ltr",r.RTL="rtl"})(A||(A={}));var wi=class{constructor(e){this.gridster=e}destroy(){this.gridster=null}checkCompact(){this.gridster.$options.compactType!==C.None&&(this.gridster.$options.compactType===C.CompactUp?this.checkCompactMovement("y",-1):this.gridster.$options.compactType===C.CompactLeft?this.checkCompactMovement("x",-1):this.gridster.$options.compactType===C.CompactUpAndLeft?(this.checkCompactMovement("y",-1),this.checkCompactMovement("x",-1)):this.gridster.$options.compactType===C.CompactLeftAndUp?(this.checkCompactMovement("x",-1),this.checkCompactMovement("y",-1)):this.gridster.$options.compactType===C.CompactRight?this.checkCompactMovement("x",1):this.gridster.$options.compactType===C.CompactUpAndRight?(this.checkCompactMovement("y",-1),this.checkCompactMovement("x",1)):this.gridster.$options.compactType===C.CompactRightAndUp?(this.checkCompactMovement("x",1),this.checkCompactMovement("y",-1)):this.gridster.$options.compactType===C.CompactDown?this.checkCompactMovement("y",1):this.gridster.$options.compactType===C.CompactDownAndLeft?(this.checkCompactMovement("y",1),this.checkCompactMovement("x",-1)):this.gridster.$options.compactType===C.CompactDownAndRight?(this.checkCompactMovement("y",1),this.checkCompactMovement("x",1)):this.gridster.$options.compactType===C.CompactLeftAndDown?(this.checkCompactMovement("x",-1),this.checkCompactMovement("y",1)):this.gridster.$options.compactType===C.CompactRightAndDown&&(this.checkCompactMovement("x",1),this.checkCompactMovement("y",1)))}checkCompactItem(e){this.gridster.$options.compactType!==C.None&&(this.gridster.$options.compactType===C.CompactUp?this.moveTillCollision(e,"y",-1):this.gridster.$options.compactType===C.CompactLeft?this.moveTillCollision(e,"x",-1):this.gridster.$options.compactType===C.CompactUpAndLeft?(this.moveTillCollision(e,"y",-1),this.moveTillCollision(e,"x",-1)):this.gridster.$options.compactType===C.CompactLeftAndUp?(this.moveTillCollision(e,"x",-1),this.moveTillCollision(e,"y",-1)):this.gridster.$options.compactType===C.CompactUpAndRight?(this.moveTillCollision(e,"y",-1),this.moveTillCollision(e,"x",1)):this.gridster.$options.compactType===C.CompactDown?this.moveTillCollision(e,"y",1):this.gridster.$options.compactType===C.CompactDownAndLeft?(this.moveTillCollision(e,"y",1),this.moveTillCollision(e,"x",-1)):this.gridster.$options.compactType===C.CompactLeftAndDown?(this.moveTillCollision(e,"x",-1),this.moveTillCollision(e,"y",1)):this.gridster.$options.compactType===C.CompactDownAndRight?(this.moveTillCollision(e,"y",1),this.moveTillCollision(e,"x",1)):this.gridster.$options.compactType===C.CompactRightAndDown&&(this.moveTillCollision(e,"x",1),this.moveTillCollision(e,"y",1)))}checkCompactMovement(e,t){let i=!1;this.gridster.grid.forEach(s=>{s.$item.compactEnabled!==!1&&this.moveTillCollision(s.$item,e,t)&&(i=!0,s.item[e]=s.$item[e],s.itemChanged())}),i&&this.checkCompact()}moveTillCollision(e,t,i){return e[t]+=i,this.gridster.checkCollision(e)?(e[t]-=i,!1):(this.moveTillCollision(e,t,i),!0)}},wo={gridType:y.Fit,scale:1,fixedColWidth:250,fixedRowHeight:250,keepFixedHeightInMobile:!1,keepFixedWidthInMobile:!1,setGridSize:!1,compactType:C.None,mobileBreakpoint:640,useBodyForBreakpoint:!1,allowMultiLayer:!1,defaultLayerIndex:0,maxLayerIndex:2,baseLayerIndex:1,minCols:1,maxCols:100,minRows:1,maxRows:100,defaultItemCols:1,defaultItemRows:1,maxItemCols:50,maxItemRows:50,minItemCols:1,minItemRows:1,minItemArea:1,maxItemArea:2500,addEmptyRowsCount:0,rowHeightRatio:1,margin:10,outerMargin:!0,outerMarginTop:null,outerMarginRight:null,outerMarginBottom:null,outerMarginLeft:null,useTransformPositioning:!0,scrollSensitivity:10,scrollSpeed:20,initCallback:void 0,destroyCallback:void 0,gridSizeChangedCallback:void 0,itemChangeCallback:void 0,itemResizeCallback:void 0,itemInitCallback:void 0,itemRemovedCallback:void 0,itemValidateCallback:void 0,enableEmptyCellClick:!1,enableEmptyCellContextMenu:!1,enableEmptyCellDrop:!1,enableEmptyCellDrag:!1,enableOccupiedCellDrop:!1,emptyCellClickCallback:void 0,emptyCellContextMenuCallback:void 0,emptyCellDropCallback:void 0,emptyCellDragCallback:void 0,emptyCellDragMaxCols:50,emptyCellDragMaxRows:50,ignoreMarginInRow:!1,draggable:{delayStart:0,enabled:!1,ignoreContentClass:"gridster-item-content",ignoreContent:!1,dragHandleClass:"drag-handler",stop:void 0,start:void 0,dropOverItems:!1,dropOverItemsCallback:void 0},resizable:{delayStart:0,enabled:!1,handles:{s:!0,e:!0,n:!0,w:!0,se:!0,ne:!0,sw:!0,nw:!0},stop:void 0,start:void 0},swap:!0,swapWhileDragging:!1,pushItems:!1,disablePushOnDrag:!1,disablePushOnResize:!1,pushDirections:{north:!0,east:!0,south:!0,west:!0},pushResizeItems:!1,displayGrid:bi.OnDragAndResize,disableWindowResize:!1,disableWarnings:!1,scrollToNewItems:!1,disableScrollHorizontal:!1,disableScrollVertical:!1,enableBoundaryControl:!1,disableAutoPositionOnConflict:!1,dirType:A.LTR},F=class r{static merge(e,t,i){for(let s in t)t[s]!==void 0&&i.hasOwnProperty(s)&&(typeof t[s]=="object"?(s in e||(e[s]={}),e[s]=r.merge(e[s],t[s],i[s])):e[s]=t[s]);return e}static checkTouchEvent(e){e.clientX===void 0&&e.touches&&(e.touches&&e.touches.length?(e.clientX=e.touches[0].clientX,e.clientY=e.touches[0].clientY):e.changedTouches&&e.changedTouches.length&&(e.clientX=e.changedTouches[0].clientX,e.clientY=e.changedTouches[0].clientY))}static checkContentClassForEvent(e,t){if(e.$options.draggable.ignoreContent){if(!r.checkDragHandleClass(t.target,t.currentTarget,e.$options.draggable.dragHandleClass,e.$options.draggable.ignoreContentClass))return!0}else if(r.checkContentClass(t.target,t.currentTarget,e.$options.draggable.ignoreContentClass))return!0;return!1}static checkContentClassForEmptyCellClickEvent(e,t){return r.checkContentClass(t.target,t.currentTarget,e.$options.draggable.ignoreContentClass)||r.checkContentClass(t.target,t.currentTarget,e.$options.draggable.dragHandleClass)}static checkDragHandleClass(e,t,i,s){if(!e||e===t)return!1;if(e.hasAttribute("class")){let n=e.getAttribute("class").split(" ");if(n.indexOf(i)>-1)return!0;if(n.indexOf(s)>-1)return!1}return r.checkDragHandleClass(e.parentNode,t,i,s)}static checkContentClass(e,t,i){return!e||e===t?!1:e.hasAttribute("class")&&e.getAttribute("class").split(" ").indexOf(i)>-1?!0:r.checkContentClass(e.parentNode,t,i)}static compareItems(e,t){return e.y>t.y?-1:e.y<t.y?1:e.x>t.x?-1:1}},yi=class{constructor(e){this.gridster=e,this.emptyCellClickCb=t=>{if(!this.gridster||this.gridster.movingItem||F.checkContentClassForEmptyCellClickEvent(this.gridster,t))return;let i=this.getValidItemFromEvent(t);i&&(this.gridster.options.emptyCellClickCallback&&this.gridster.options.emptyCellClickCallback(t,i),this.gridster.cdRef.markForCheck())},this.emptyCellContextMenuCb=t=>{if(this.gridster.movingItem||F.checkContentClassForEmptyCellClickEvent(this.gridster,t))return;t.preventDefault(),t.stopPropagation();let i=this.getValidItemFromEvent(t);i&&(this.gridster.options.emptyCellContextMenuCallback&&this.gridster.options.emptyCellContextMenuCallback(t,i),this.gridster.cdRef.markForCheck())},this.emptyCellDragDrop=t=>{let i=this.getValidItemFromEvent(t);i&&(this.gridster.options.emptyCellDropCallback&&this.gridster.options.emptyCellDropCallback(t,i),this.gridster.cdRef.markForCheck())},this.emptyCellDragOver=t=>{t.preventDefault(),t.stopPropagation();let i=this.getValidItemFromEvent(t);i?(t.dataTransfer&&(t.dataTransfer.dropEffect="move"),this.gridster.movingItem=i):(t.dataTransfer&&(t.dataTransfer.dropEffect="none"),this.gridster.movingItem=null),this.gridster.previewStyle()},this.emptyCellMouseDown=t=>{if(F.checkContentClassForEmptyCellClickEvent(this.gridster,t))return;t.preventDefault(),t.stopPropagation();let i=this.getValidItemFromEvent(t);!i||t.buttons!==1&&!(t instanceof TouchEvent)||(this.initialItem=i,this.gridster.movingItem=i,this.gridster.previewStyle(),this.gridster.zone.runOutsideAngular(()=>{this.removeWindowMousemoveListenerFn=this.gridster.renderer.listen("window","mousemove",this.emptyCellMouseMove),this.removeWindowTouchmoveListenerFn=this.gridster.renderer.listen("window","touchmove",this.emptyCellMouseMove)}),this.removeWindowMouseupListenerFn=this.gridster.renderer.listen("window","mouseup",this.emptyCellMouseUp),this.removeWindowTouchendListenerFn=this.gridster.renderer.listen("window","touchend",this.emptyCellMouseUp))},this.emptyCellMouseMove=t=>{t.preventDefault(),t.stopPropagation();let i=this.getValidItemFromEvent(t,this.initialItem);i&&(this.gridster.movingItem=i,this.gridster.previewStyle())},this.emptyCellMouseUp=t=>{this.removeWindowMousemoveListenerFn(),this.removeWindowTouchmoveListenerFn(),this.removeWindowMouseupListenerFn(),this.removeWindowTouchendListenerFn();let i=this.getValidItemFromEvent(t,this.initialItem);i&&(this.gridster.movingItem=i),this.gridster.options.emptyCellDragCallback&&this.gridster.movingItem&&this.gridster.options.emptyCellDragCallback(t,this.gridster.movingItem),setTimeout(()=>{this.initialItem=null,this.gridster&&(this.gridster.movingItem=null,this.gridster.previewStyle())}),this.gridster.cdRef.markForCheck()}}destroy(){this.gridster.previewStyle&&this.gridster.previewStyle(),this.gridster.movingItem=null,this.initialItem=this.gridster=null,this.removeDocumentDragendListenerFn&&(this.removeDocumentDragendListenerFn(),this.removeDocumentDragendListenerFn=null)}updateOptions(){this.gridster.$options.enableEmptyCellClick&&!this.removeEmptyCellClickListenerFn&&this.gridster.options.emptyCellClickCallback?(this.removeEmptyCellClickListenerFn=this.gridster.renderer.listen(this.gridster.el,"click",this.emptyCellClickCb),this.removeEmptyCellTouchendListenerFn=this.gridster.renderer.listen(this.gridster.el,"touchend",this.emptyCellClickCb)):!this.gridster.$options.enableEmptyCellClick&&this.removeEmptyCellClickListenerFn&&this.removeEmptyCellTouchendListenerFn&&(this.removeEmptyCellClickListenerFn(),this.removeEmptyCellTouchendListenerFn(),this.removeEmptyCellClickListenerFn=null,this.removeEmptyCellTouchendListenerFn=null),this.gridster.$options.enableEmptyCellContextMenu&&!this.removeEmptyCellContextMenuListenerFn&&this.gridster.options.emptyCellContextMenuCallback?this.removeEmptyCellContextMenuListenerFn=this.gridster.renderer.listen(this.gridster.el,"contextmenu",this.emptyCellContextMenuCb):!this.gridster.$options.enableEmptyCellContextMenu&&this.removeEmptyCellContextMenuListenerFn&&(this.removeEmptyCellContextMenuListenerFn(),this.removeEmptyCellContextMenuListenerFn=null),this.gridster.$options.enableEmptyCellDrop&&!this.removeEmptyCellDropListenerFn&&this.gridster.options.emptyCellDropCallback?(this.removeEmptyCellDropListenerFn=this.gridster.renderer.listen(this.gridster.el,"drop",this.emptyCellDragDrop),this.gridster.zone.runOutsideAngular(()=>{this.removeEmptyCellDragoverListenerFn=this.gridster.renderer.listen(this.gridster.el,"dragover",this.emptyCellDragOver)}),this.removeDocumentDragendListenerFn=this.gridster.renderer.listen("document","dragend",()=>{this.gridster.movingItem=null,this.gridster.previewStyle()})):!this.gridster.$options.enableEmptyCellDrop&&this.removeEmptyCellDropListenerFn&&this.removeEmptyCellDragoverListenerFn&&this.removeDocumentDragendListenerFn&&(this.removeEmptyCellDropListenerFn(),this.removeEmptyCellDragoverListenerFn(),this.removeDocumentDragendListenerFn(),this.removeEmptyCellDragoverListenerFn=null,this.removeEmptyCellDropListenerFn=null,this.removeDocumentDragendListenerFn=null),this.gridster.$options.enableEmptyCellDrag&&!this.removeEmptyCellMousedownListenerFn&&this.gridster.options.emptyCellDragCallback?(this.removeEmptyCellMousedownListenerFn=this.gridster.renderer.listen(this.gridster.el,"mousedown",this.emptyCellMouseDown),this.removeEmptyCellTouchstartListenerFn=this.gridster.renderer.listen(this.gridster.el,"touchstart",this.emptyCellMouseDown)):!this.gridster.$options.enableEmptyCellDrag&&this.removeEmptyCellMousedownListenerFn&&this.removeEmptyCellTouchstartListenerFn&&(this.removeEmptyCellMousedownListenerFn(),this.removeEmptyCellTouchstartListenerFn(),this.removeEmptyCellMousedownListenerFn=null,this.removeEmptyCellTouchstartListenerFn=null)}getPixelsX(e,t){let i=this.gridster.options.scale;return i?(e.clientX-t.left)/i+this.gridster.el.scrollLeft-this.gridster.gridRenderer.getLeftMargin():e.clientX+this.gridster.el.scrollLeft-t.left-this.gridster.gridRenderer.getLeftMargin()}getPixelsY(e,t){let i=this.gridster.options.scale;return i?(e.clientY-t.top)/i+this.gridster.el.scrollTop-this.gridster.gridRenderer.getTopMargin():e.clientY+this.gridster.el.scrollTop-t.top-this.gridster.gridRenderer.getTopMargin()}getValidItemFromEvent(e,t){e.preventDefault(),e.stopPropagation(),F.checkTouchEvent(e);let i=this.gridster.el.getBoundingClientRect(),s=this.getPixelsX(e,i),n=this.getPixelsY(e,i),o={x:this.gridster.pixelsToPositionX(s,Math.floor,!0),y:this.gridster.pixelsToPositionY(n,Math.floor,!0),cols:this.gridster.$options.defaultItemCols,rows:this.gridster.$options.defaultItemRows};if(t&&(o.cols=Math.min(Math.abs(t.x-o.x)+1,this.gridster.$options.emptyCellDragMaxCols),o.rows=Math.min(Math.abs(t.y-o.y)+1,this.gridster.$options.emptyCellDragMaxRows),t.x<o.x?o.x=t.x:t.x-o.x>this.gridster.$options.emptyCellDragMaxCols-1&&(o.x=this.gridster.movingItem?this.gridster.movingItem.x:0),t.y<o.y?o.y=t.y:t.y-o.y>this.gridster.$options.emptyCellDragMaxRows-1&&(o.y=this.gridster.movingItem?this.gridster.movingItem.y:0)),!(!this.gridster.$options.enableOccupiedCellDrop&&this.gridster.checkCollision(o)))return o}},vi=class{constructor(e){this.gridster=e,this.lastGridColumnStyles={},this.lastGridRowStyles={}}destroy(){this.gridster=null}updateItem(e,t,i){if(this.gridster.mobile)this.clearCellPosition(i,e),this.gridster.$options.keepFixedHeightInMobile?i.setStyle(e,"height",(t.rows-1)*this.gridster.$options.margin+t.rows*this.gridster.$options.fixedRowHeight+"px"):i.setStyle(e,"height",t.rows*this.gridster.curWidth/t.cols+"px"),this.gridster.$options.keepFixedWidthInMobile?i.setStyle(e,"width",this.gridster.$options.fixedColWidth+"px"):i.setStyle(e,"width",""),i.setStyle(e,"margin-bottom",this.gridster.$options.margin+"px"),i.setStyle(e,A.LTR?"margin-right":"margin-left","");else{let s=Math.round(this.gridster.curColWidth*t.x),n=Math.round(this.gridster.curRowHeight*t.y),o=this.gridster.curColWidth*t.cols-this.gridster.$options.margin,a=this.gridster.curRowHeight*t.rows-this.gridster.$options.margin;this.setCellPosition(i,e,s,n),i.setStyle(e,"width",o+"px"),i.setStyle(e,"height",a+"px");let l=null,g=null;this.gridster.$options.outerMargin&&(this.gridster.rows===t.rows+t.y&&(this.gridster.$options.outerMarginBottom!==null?l=this.gridster.$options.outerMarginBottom+"px":l=this.gridster.$options.margin+"px"),this.gridster.columns===t.cols+t.x&&(this.gridster.$options.outerMarginBottom!==null?g=this.gridster.$options.outerMarginRight+"px":g=this.gridster.$options.margin+"px")),i.setStyle(e,"margin-bottom",l),i.setStyle(e,A.LTR?"margin-right":"margin-left",g)}}updateGridster(){let e="",t="",i="",s="";if(this.gridster.$options.gridType===y.Fit)e=y.Fit,t=y.ScrollVertical,i=y.ScrollHorizontal,s=y.Fixed;else if(this.gridster.$options.gridType===y.ScrollVertical)this.gridster.curRowHeight=this.gridster.curColWidth*this.gridster.$options.rowHeightRatio,e=y.ScrollVertical,t=y.Fit,i=y.ScrollHorizontal,s=y.Fixed;else if(this.gridster.$options.gridType===y.ScrollHorizontal){let n=this.gridster.$options.rowHeightRatio,o=n>=1?n:n+1;this.gridster.curColWidth=this.gridster.curRowHeight*o,e=y.ScrollHorizontal,t=y.Fit,i=y.ScrollVertical,s=y.Fixed}else this.gridster.$options.gridType===y.Fixed?(this.gridster.curColWidth=this.gridster.$options.fixedColWidth+(this.gridster.$options.ignoreMarginInRow?0:this.gridster.$options.margin),this.gridster.curRowHeight=this.gridster.$options.fixedRowHeight+(this.gridster.$options.ignoreMarginInRow?0:this.gridster.$options.margin),e=y.Fixed,t=y.Fit,i=y.ScrollVertical,s=y.ScrollHorizontal):this.gridster.$options.gridType===y.VerticalFixed?(this.gridster.curRowHeight=this.gridster.$options.fixedRowHeight+(this.gridster.$options.ignoreMarginInRow?0:this.gridster.$options.margin),e=y.ScrollVertical,t=y.Fit,i=y.ScrollHorizontal,s=y.Fixed):this.gridster.$options.gridType===y.HorizontalFixed&&(this.gridster.curColWidth=this.gridster.$options.fixedColWidth+(this.gridster.$options.ignoreMarginInRow?0:this.gridster.$options.margin),e=y.ScrollHorizontal,t=y.Fit,i=y.ScrollVertical,s=y.Fixed);this.gridster.mobile||this.gridster.$options.setGridSize&&this.gridster.$options.gridType!==y.Fit?this.gridster.renderer.removeClass(this.gridster.el,e):this.gridster.renderer.addClass(this.gridster.el,e),this.gridster.renderer.removeClass(this.gridster.el,t),this.gridster.renderer.removeClass(this.gridster.el,i),this.gridster.renderer.removeClass(this.gridster.el,s)}getGridColumnStyle(e){let t={left:this.gridster.curColWidth*e,width:this.gridster.curColWidth-this.gridster.$options.margin,height:this.gridster.gridRows.length*this.gridster.curRowHeight-this.gridster.$options.margin,style:{}};t.style=li(Xe({},this.getLeftPosition(t.left)),{width:t.width+"px",height:t.height+"px"});let i=this.lastGridColumnStyles[e];return i&&i.left===t.left&&i.width===t.width&&i.height===t.height?i.style:(this.lastGridColumnStyles[e]=t,t.style)}getGridRowStyle(e){let t={top:this.gridster.curRowHeight*e,width:this.gridster.gridColumns.length*this.gridster.curColWidth+this.gridster.$options.margin,height:this.gridster.curRowHeight-this.gridster.$options.margin,style:{}};t.style=li(Xe({},this.getTopPosition(t.top)),{width:t.width+"px",height:t.height+"px"});let i=this.lastGridRowStyles[e];return i&&i.top===t.top&&i.width===t.width&&i.height===t.height?i.style:(this.lastGridRowStyles[e]=t,t.style)}getLeftPosition(e){let t=this.gridster.$options.dirType===A.RTL?-e:e;return this.gridster.$options.useTransformPositioning?{transform:"translateX("+t+"px)"}:{left:this.getLeftMargin()+t+"px"}}getTopPosition(e){return this.gridster.$options.useTransformPositioning?{transform:"translateY("+e+"px)"}:{top:this.getTopMargin()+e+"px"}}clearCellPosition(e,t){this.gridster.$options.useTransformPositioning?e.setStyle(t,"transform",""):(e.setStyle(t,"top",""),e.setStyle(t,"left",""))}setCellPosition(e,t,i,s){let n=this.gridster.$options.dirType===A.RTL?-i:i;if(this.gridster.$options.useTransformPositioning){let o="translate3d("+n+"px, "+s+"px, 0)";e.setStyle(t,"transform",o)}else e.setStyle(t,"left",this.getLeftMargin()+n+"px"),e.setStyle(t,"top",this.getTopMargin()+s+"px")}getLeftMargin(){return this.gridster.$options.outerMargin?this.gridster.$options.outerMarginLeft!==null?this.gridster.$options.outerMarginLeft:this.gridster.$options.margin:0}getTopMargin(){return this.gridster.$options.outerMargin?this.gridster.$options.outerMarginTop!==null?this.gridster.$options.outerMarginTop:this.gridster.$options.margin:0}},lt=class r{constructor(e,t){this.renderer=t,this.el=e.nativeElement}ngOnInit(){this.sub=this.previewStyle$.subscribe(e=>this.previewStyle(e))}ngOnDestroy(){this.sub&&this.sub.unsubscribe()}previewStyle(e){e?(this.renderer.setStyle(this.el,"display","block"),this.gridRenderer.updateItem(this.el,e,this.renderer)):this.renderer.setStyle(this.el,"display","")}static{this.\u0275fac=Je({minVersion:"12.0.0",version:"17.0.3",ngImport:Y,type:r,deps:[{token:le},{token:de}],target:Ke.Component})}static{this.\u0275cmp=ut({minVersion:"14.0.0",version:"17.0.3",type:r,isStandalone:!0,selector:"gridster-preview",inputs:{previewStyle$:"previewStyle$",gridRenderer:"gridRenderer"},ngImport:Y,template:"",isInline:!0,styles:[`gridster-preview{position:absolute;display:none;background:rgba(0,0,0,.15)}
`],encapsulation:ye.None})}};Ze({minVersion:"12.0.0",version:"17.0.3",ngImport:Y,type:lt,decorators:[{type:p,args:[{selector:"gridster-preview",template:"",encapsulation:ye.None,standalone:!0,styles:[`gridster-preview{position:absolute;display:none;background:rgba(0,0,0,.15)}
`]}]}],ctorParameters:()=>[{type:le},{type:de}],propDecorators:{previewStyle$:[{type:h}],gridRenderer:[{type:h}]}});var ae=class r{constructor(e,t,i,s){this.renderer=t,this.cdRef=i,this.zone=s,this.columns=0,this.rows=0,this.gridColumns=[],this.gridRows=[],this.previewStyle$=new w,this.calculateLayout$=new gt,this.resize$=new gt,this.destroy$=new gt,this.optionsChanged=()=>{this.setOptions();let n=this.grid.length-1,o;for(;n>=0;n--)o=this.grid[n],o.updateOptions();this.calculateLayout()},this.onResize=()=>{this.el.clientWidth&&(this.options.setGridSize&&(this.renderer.setStyle(this.el,"width",""),this.renderer.setStyle(this.el,"height","")),this.setGridSize(),this.calculateLayout())},this.getNextPossiblePosition=(n,o={})=>{n.cols===-1&&(n.cols=this.$options.defaultItemCols),n.rows===-1&&(n.rows=this.$options.defaultItemRows),this.setGridDimensions();let a=o.y||0,l;for(;a<this.rows;a++)for(n.y=a,l=o.x||0;l<this.columns;l++)if(n.x=l,!this.checkCollision(n))return!0;let g=this.$options.maxRows>=this.rows+n.rows,x=this.$options.maxCols>=this.columns+n.cols;return!(this.rows<=this.columns&&g)&&x?(n.x=this.columns,n.y=0,!0):g?(n.y=this.rows,n.x=0,!0):!1},this.getFirstPossiblePosition=n=>{let o=Object.assign({},n);return this.getNextPossiblePosition(o),o},this.getLastPossiblePosition=n=>{let o={y:0,x:0};o=this.grid.reduce((l,g)=>{let x={y:g.$item.y+g.$item.rows-1,x:g.$item.x+g.$item.cols-1};return F.compareItems(l,x)===1?x:l},o);let a=Object.assign({},n);return this.getNextPossiblePosition(a,o),a},this.el=e.nativeElement,this.$options=JSON.parse(JSON.stringify(wo)),this.mobile=!1,this.curWidth=0,this.curHeight=0,this.grid=[],this.curColWidth=0,this.curRowHeight=0,this.dragInProgress=!1,this.emptyCell=new yi(this),this.compact=new wi(this),this.gridRenderer=new vi(this)}static checkCollisionTwoItemsForSwaping(e,t){let i=e.cols===1?0:1,s=t.cols===1?0:1,n=e.rows===1?0:1,o=t.rows===1?0:1;return e.x+i<t.x+t.cols&&e.x+e.cols>t.x+s&&e.y+n<t.y+t.rows&&e.y+e.rows>t.y+o}checkCollisionTwoItems(e,t){if(!(e.x<t.x+t.cols&&e.x+e.cols>t.x&&e.y<t.y+t.rows&&e.y+e.rows>t.y))return!1;if(!this.$options.allowMultiLayer)return!0;let s=this.$options.defaultLayerIndex,n=e.layerIndex===void 0?s:e.layerIndex,o=t.layerIndex===void 0?s:t.layerIndex;return n===o}ngOnInit(){this.options.initCallback&&this.options.initCallback(this),this.calculateLayout$.pipe(Ai(0),di(this.destroy$)).subscribe(()=>this.calculateLayout()),this.resize$.pipe(Li(()=>_i(100)),di(this.destroy$)).subscribe(()=>this.resize())}ngOnChanges(e){e.options&&(this.setOptions(),this.options.api={optionsChanged:this.optionsChanged,resize:this.onResize,getNextPossiblePosition:this.getNextPossiblePosition,getFirstPossiblePosition:this.getFirstPossiblePosition,getLastPossiblePosition:this.getLastPossiblePosition,getItemComponent:t=>this.getItemComponent(t)},this.columns=this.$options.minCols,this.rows=this.$options.minRows+this.$options.addEmptyRowsCount,this.setGridSize(),this.calculateLayout())}resize(){let e,t;this.$options.gridType==="fit"&&!this.mobile?(t=this.el.offsetWidth,e=this.el.offsetHeight):(t=this.el.clientWidth,e=this.el.clientHeight),(t!==this.curWidth||e!==this.curHeight)&&this.checkIfToResize()&&this.onResize()}setOptions(){this.$options=F.merge(this.$options,this.options,this.$options),!this.$options.disableWindowResize&&!this.windowResize?this.windowResize=this.renderer.listen("window","resize",this.onResize):this.$options.disableWindowResize&&this.windowResize&&(this.windowResize(),this.windowResize=null),this.emptyCell.updateOptions()}ngOnDestroy(){this.destroy$.next(),this.previewStyle$.complete(),this.windowResize&&this.windowResize(),this.options&&this.options.destroyCallback&&this.options.destroyCallback(this),this.options&&this.options.api&&(this.options.api.resize=void 0,this.options.api.optionsChanged=void 0,this.options.api.getNextPossiblePosition=void 0,this.options.api=void 0),this.emptyCell.destroy(),this.emptyCell=null,this.compact.destroy(),this.compact=null}checkIfToResize(){let e=this.el.clientWidth,t=this.el.offsetWidth,i=this.el.scrollWidth,s=this.el.clientHeight,n=this.el.offsetHeight,o=this.el.scrollHeight,a=e<t&&o>n&&o-n<t-e,l=s<n&&i>t&&i-t<n-s;return a?!1:!l}checkIfMobile(){return this.$options.useBodyForBreakpoint?this.$options.mobileBreakpoint>document.body.clientWidth:this.$options.mobileBreakpoint>this.curWidth}setGridSize(){let e=this.el,t,i;this.$options.setGridSize||this.$options.gridType===y.Fit&&!this.mobile?(t=e.offsetWidth,i=e.offsetHeight):(t=e.clientWidth,i=e.clientHeight),this.curWidth=t,this.curHeight=i}setGridDimensions(){this.setGridSize(),!this.mobile&&this.checkIfMobile()?(this.mobile=!this.mobile,this.renderer.addClass(this.el,"mobile")):this.mobile&&!this.checkIfMobile()&&(this.mobile=!this.mobile,this.renderer.removeClass(this.el,"mobile"));let e=this.$options.minRows,t=this.$options.minCols,i=this.grid.length-1,s;for(;i>=0;i--)s=this.grid[i],s.notPlaced||(e=Math.max(e,s.$item.y+s.$item.rows),t=Math.max(t,s.$item.x+s.$item.cols));e+=this.$options.addEmptyRowsCount,(this.columns!==t||this.rows!==e)&&(this.columns=t,this.rows=e,this.options.gridSizeChangedCallback&&this.options.gridSizeChangedCallback(this))}calculateLayout(){if(this.compact&&this.compact.checkCompact(),this.setGridDimensions(),this.$options.outerMargin){let i=-this.$options.margin;this.$options.outerMarginLeft!==null?(i+=this.$options.outerMarginLeft,this.renderer.setStyle(this.el,"padding-left",this.$options.outerMarginLeft+"px")):(i+=this.$options.margin,this.renderer.setStyle(this.el,"padding-left",this.$options.margin+"px")),this.$options.outerMarginRight!==null?(i+=this.$options.outerMarginRight,this.renderer.setStyle(this.el,"padding-right",this.$options.outerMarginRight+"px")):(i+=this.$options.margin,this.renderer.setStyle(this.el,"padding-right",this.$options.margin+"px")),this.curColWidth=(this.curWidth-i)/this.columns;let s=-this.$options.margin;this.$options.outerMarginTop!==null?(s+=this.$options.outerMarginTop,this.renderer.setStyle(this.el,"padding-top",this.$options.outerMarginTop+"px")):(s+=this.$options.margin,this.renderer.setStyle(this.el,"padding-top",this.$options.margin+"px")),this.$options.outerMarginBottom!==null?(s+=this.$options.outerMarginBottom,this.renderer.setStyle(this.el,"padding-bottom",this.$options.outerMarginBottom+"px")):(s+=this.$options.margin,this.renderer.setStyle(this.el,"padding-bottom",this.$options.margin+"px")),this.curRowHeight=(this.curHeight-s)/this.rows*this.$options.rowHeightRatio}else this.curColWidth=(this.curWidth+this.$options.margin)/this.columns,this.curRowHeight=(this.curHeight+this.$options.margin)/this.rows*this.$options.rowHeightRatio,this.renderer.setStyle(this.el,"padding-left","0px"),this.renderer.setStyle(this.el,"padding-right","0px"),this.renderer.setStyle(this.el,"padding-top","0px"),this.renderer.setStyle(this.el,"padding-bottom","0px");this.gridRenderer.updateGridster(),this.$options.setGridSize?(this.renderer.addClass(this.el,"gridSize"),this.mobile||(this.renderer.setStyle(this.el,"width",this.columns*this.curColWidth+this.$options.margin+"px"),this.renderer.setStyle(this.el,"height",this.rows*this.curRowHeight+this.$options.margin+"px"))):(this.renderer.removeClass(this.el,"gridSize"),this.renderer.setStyle(this.el,"width",""),this.renderer.setStyle(this.el,"height","")),this.updateGrid();let e=this.grid.length-1,t;for(;e>=0;e--)t=this.grid[e],t.setSize(),t.drag.toggle(),t.resize.toggle();this.resize$.next()}updateGrid(){this.$options.displayGrid==="always"&&!this.mobile?this.renderer.addClass(this.el,"display-grid"):this.$options.displayGrid==="onDrag&Resize"&&this.dragInProgress?this.renderer.addClass(this.el,"display-grid"):(this.$options.displayGrid==="none"||!this.dragInProgress||this.mobile)&&this.renderer.removeClass(this.el,"display-grid"),this.setGridDimensions(),this.gridColumns.length=r.getNewArrayLength(this.columns,this.curWidth,this.curColWidth),this.gridRows.length=r.getNewArrayLength(this.rows,this.curHeight,this.curRowHeight),this.cdRef.markForCheck()}addItem(e){e.$item.cols===void 0&&(e.$item.cols=this.$options.defaultItemCols,e.item.cols=e.$item.cols,e.itemChanged()),e.$item.rows===void 0&&(e.$item.rows=this.$options.defaultItemRows,e.item.rows=e.$item.rows,e.itemChanged()),e.$item.x===-1||e.$item.y===-1?this.autoPositionItem(e):this.checkCollision(e.$item)&&(this.$options.disableWarnings||(e.notPlaced=!0,console.warn("Can't be placed in the bounds of the dashboard, trying to auto position!/n"+JSON.stringify(e.item,["cols","rows","x","y"]))),this.$options.disableAutoPositionOnConflict?e.notPlaced=!0:this.autoPositionItem(e)),this.grid.push(e),this.calculateLayout$.next()}removeItem(e){this.grid.splice(this.grid.indexOf(e),1),this.calculateLayout$.next(),this.options.itemRemovedCallback&&this.options.itemRemovedCallback(e.item,e)}checkCollision(e){let t=!1;if(this.options.itemValidateCallback&&(t=!this.options.itemValidateCallback(e)),!t&&this.checkGridCollision(e)&&(t=!0),!t){let i=this.findItemWithItem(e);i&&(t=i)}return t}checkGridCollision(e){let t=e.y>-1&&e.x>-1,i=e.cols+e.x<=this.$options.maxCols,s=e.rows+e.y<=this.$options.maxRows,n=e.maxItemCols===void 0?this.$options.maxItemCols:e.maxItemCols,o=e.minItemCols===void 0?this.$options.minItemCols:e.minItemCols,a=e.maxItemRows===void 0?this.$options.maxItemRows:e.maxItemRows,l=e.minItemRows===void 0?this.$options.minItemRows:e.minItemRows,g=e.cols<=n&&e.cols>=o,x=e.rows<=a&&e.rows>=l,L=e.minItemArea===void 0?this.$options.minItemArea:e.minItemArea,H=e.maxItemArea===void 0?this.$options.maxItemArea:e.maxItemArea,ne=e.cols*e.rows,M=L<=ne,W=H>=ne;return!(t&&i&&s&&g&&x&&M&&W)}findItemWithItem(e){let t=0,i;for(;t<this.grid.length;t++)if(i=this.grid[t],i.$item!==e&&this.checkCollisionTwoItems(i.$item,e))return i;return!1}findItemsWithItem(e){let t=[],i=0,s;for(;i<this.grid.length;i++)s=this.grid[i],s.$item!==e&&this.checkCollisionTwoItems(s.$item,e)&&t.push(s);return t}autoPositionItem(e){this.getNextPossiblePosition(e.$item)?(e.notPlaced=!1,e.item.x=e.$item.x,e.item.y=e.$item.y,e.itemChanged()):(e.notPlaced=!0,this.$options.disableWarnings||console.warn("Can't be placed in the bounds of the dashboard!/n"+JSON.stringify(e.item,["cols","rows","x","y"])))}pixelsToPositionX(e,t,i){let s=t(e/this.curColWidth);return i?s:Math.max(s,0)}pixelsToPositionY(e,t,i){let s=t(e/this.curRowHeight);return i?s:Math.max(s,0)}positionXToPixels(e){return e*this.curColWidth}positionYToPixels(e){return e*this.curRowHeight}getItemComponent(e){return this.grid.find(t=>t.item===e)}checkCollisionForSwaping(e){let t=!1;if(this.options.itemValidateCallback&&(t=!this.options.itemValidateCallback(e)),!t&&this.checkGridCollision(e)&&(t=!0),!t){let i=this.findItemWithItemForSwapping(e);i&&(t=i)}return t}findItemWithItemForSwapping(e){let t=this.grid.length-1,i;for(;t>-1;t--)if(i=this.grid[t],i.$item!==e&&r.checkCollisionTwoItemsForSwaping(i.$item,e))return i;return!1}previewStyle(e=!1){this.movingItem?(this.compact&&e&&this.compact.checkCompactItem(this.movingItem),this.previewStyle$.next(this.movingItem)):this.previewStyle$.next(null)}static getNewArrayLength(e,t,i){let s=Math.max(e,Math.floor(t/i));return s<0?0:Number.isFinite(s)?Math.floor(s):0}static{this.\u0275fac=Je({minVersion:"12.0.0",version:"17.0.3",ngImport:Y,type:r,deps:[{token:le},{token:de},{token:Te},{token:ve}],target:Ke.Component})}static{this.\u0275cmp=ut({minVersion:"14.0.0",version:"17.0.3",type:r,isStandalone:!0,selector:"gridster",inputs:{options:"options"},usesOnChanges:!0,ngImport:Y,template:`<div
  class="gridster-column"
  *ngFor="let column of gridColumns; let i = index;"
  [ngStyle]="gridRenderer.getGridColumnStyle(i)"
></div>
<div
  class="gridster-row"
  *ngFor="let row of gridRows; let i = index;"
  [ngStyle]="gridRenderer.getGridRowStyle(i)"
></div>
<ng-content></ng-content>
<gridster-preview
  [gridRenderer]="gridRenderer"
  [previewStyle$]="previewStyle$"
  class="gridster-preview"
></gridster-preview>
`,styles:[`gridster{position:relative;box-sizing:border-box;background:grey;width:100%;height:100%;-webkit-user-select:none;user-select:none;display:block}gridster.fit{overflow-x:hidden;overflow-y:hidden}gridster.scrollVertical{overflow-x:hidden;overflow-y:auto}gridster.scrollHorizontal{overflow-x:auto;overflow-y:hidden}gridster.fixed{overflow:auto}gridster.mobile{overflow-x:hidden;overflow-y:auto}gridster.mobile gridster-item{position:relative}gridster.gridSize{height:initial;width:initial}gridster.gridSize.fit{height:100%;width:100%}gridster .gridster-column,gridster .gridster-row{position:absolute;display:none;transition:.3s;box-sizing:border-box}gridster.display-grid .gridster-column,gridster.display-grid .gridster-row{display:block}gridster .gridster-column{border-left:1px solid white;border-right:1px solid white}gridster .gridster-row{border-top:1px solid white;border-bottom:1px solid white}
`],dependencies:[{kind:"directive",type:S,selector:"[ngFor][ngForOf]",inputs:["ngForOf","ngForTrackBy","ngForTemplate"]},{kind:"directive",type:V,selector:"[ngStyle]",inputs:["ngStyle"]},{kind:"component",type:lt,selector:"gridster-preview",inputs:["previewStyle$","gridRenderer"]}],encapsulation:ye.None})}};Ze({minVersion:"12.0.0",version:"17.0.3",ngImport:Y,type:ae,decorators:[{type:p,args:[{selector:"gridster",encapsulation:ye.None,standalone:!0,imports:[S,V,lt],template:`<div
  class="gridster-column"
  *ngFor="let column of gridColumns; let i = index;"
  [ngStyle]="gridRenderer.getGridColumnStyle(i)"
></div>
<div
  class="gridster-row"
  *ngFor="let row of gridRows; let i = index;"
  [ngStyle]="gridRenderer.getGridRowStyle(i)"
></div>
<ng-content></ng-content>
<gridster-preview
  [gridRenderer]="gridRenderer"
  [previewStyle$]="previewStyle$"
  class="gridster-preview"
></gridster-preview>
`,styles:[`gridster{position:relative;box-sizing:border-box;background:grey;width:100%;height:100%;-webkit-user-select:none;user-select:none;display:block}gridster.fit{overflow-x:hidden;overflow-y:hidden}gridster.scrollVertical{overflow-x:hidden;overflow-y:auto}gridster.scrollHorizontal{overflow-x:auto;overflow-y:hidden}gridster.fixed{overflow:auto}gridster.mobile{overflow-x:hidden;overflow-y:auto}gridster.mobile gridster-item{position:relative}gridster.gridSize{height:initial;width:initial}gridster.gridSize.fit{height:100%;width:100%}gridster .gridster-column,gridster .gridster-row{position:absolute;display:none;transition:.3s;box-sizing:border-box}gridster.display-grid .gridster-column,gridster.display-grid .gridster-row{display:block}gridster .gridster-column{border-left:1px solid white;border-right:1px solid white}gridster .gridster-row{border-top:1px solid white;border-bottom:1px solid white}
`]}]}],ctorParameters:()=>[{type:le,decorators:[{type:we,args:[le]}]},{type:de,decorators:[{type:we,args:[de]}]},{type:Te,decorators:[{type:we,args:[Te]}]},{type:ve,decorators:[{type:we,args:[ve]}]}],propDecorators:{options:[{type:h}]}});var At=class{constructor(e){this.iteration=0,this.pushedItems=[],this.pushedItemsTemp=[],this.pushedItemsTempPath=[],this.pushedItemsPath=[],this.gridsterItem=e,this.gridster=e.gridster,this.tryPattern={fromEast:[this.tryWest,this.trySouth,this.tryNorth,this.tryEast],fromWest:[this.tryEast,this.trySouth,this.tryNorth,this.tryWest],fromNorth:[this.trySouth,this.tryEast,this.tryWest,this.tryNorth],fromSouth:[this.tryNorth,this.tryEast,this.tryWest,this.trySouth]},this.fromSouth="fromSouth",this.fromNorth="fromNorth",this.fromEast="fromEast",this.fromWest="fromWest"}destroy(){this.gridster=this.gridsterItem=null}pushItems(e,t){if(this.gridster.$options.pushItems&&!t){this.pushedItemsOrder=[],this.iteration=0;let i=this.push(this.gridsterItem,e);return i||this.restoreTempItems(),this.pushedItemsOrder=[],this.pushedItemsTemp=[],this.pushedItemsTempPath=[],i}else return!1}restoreTempItems(){let e=this.pushedItemsTemp.length-1;for(;e>-1;e--)this.removeFromTempPushed(this.pushedItemsTemp[e])}restoreItems(){let e=0,t=this.pushedItems.length,i;for(;e<t;e++)i=this.pushedItems[e],i.$item.x=i.item.x||0,i.$item.y=i.item.y||0,i.setSize();this.pushedItems=[],this.pushedItemsPath=[]}setPushedItems(){let e=0,t=this.pushedItems.length,i;for(;e<t;e++)i=this.pushedItems[e],i.checkItemChanges(i.$item,i.item);this.pushedItems=[],this.pushedItemsPath=[]}checkPushBack(){let e=this.pushedItems.length-1,t=!1;for(;e>-1;e--)this.checkPushedItem(this.pushedItems[e],e)&&(t=!0);t&&this.checkPushBack()}push(e,t){if(this.iteration>100)return console.warn("max iteration reached"),!1;if(this.gridster.checkGridCollision(e.$item)||t==="")return!1;let i=this.gridster.findItemsWithItem(e.$item),s=t===this.fromNorth||t===this.fromWest;i.sort((g,x)=>s?x.$item.y-g.$item.y||x.$item.x-g.$item.x:g.$item.y-x.$item.y||g.$item.x-x.$item.x);let n=0,o,a=!0,l=[];for(;n<i.length;n++){if(o=i[n],o===this.gridsterItem)continue;if(!o.canBeDragged()){a=!1;break}let g=this.pushedItemsTemp.indexOf(o);if(g>-1&&this.pushedItemsTempPath[g].length>10){a=!1;break}if(this.tryPattern[t][0].call(this,o,e))this.pushedItemsOrder.push(o),l.push(o);else if(this.tryPattern[t][1].call(this,o,e))this.pushedItemsOrder.push(o),l.push(o);else if(this.tryPattern[t][2].call(this,o,e))this.pushedItemsOrder.push(o),l.push(o);else if(this.tryPattern[t][3].call(this,o,e))this.pushedItemsOrder.push(o),l.push(o);else{a=!1;break}}if(!a&&(n=this.pushedItemsOrder.lastIndexOf(l[0]),n>-1)){let g=this.pushedItemsOrder.length-1;for(;g>=n;g--)o=this.pushedItemsOrder[g],this.pushedItemsOrder.pop(),this.removeFromTempPushed(o),this.removeFromPushedItem(o)}return this.iteration++,a}trySouth(e,t){return this.gridster.$options.pushDirections.south?(this.addToTempPushed(e),e.$item.y=t.$item.y+t.$item.rows,this.push(e,this.fromNorth)?(e.setSize(),this.addToPushed(e),!0):(this.removeFromTempPushed(e),!1)):!1}tryNorth(e,t){return this.gridster.$options.pushDirections.north?(this.addToTempPushed(e),e.$item.y=t.$item.y-e.$item.rows,this.push(e,this.fromSouth)?(e.setSize(),this.addToPushed(e),!0):(this.removeFromTempPushed(e),!1)):!1}tryEast(e,t){return this.gridster.$options.pushDirections.east?(this.addToTempPushed(e),e.$item.x=t.$item.x+t.$item.cols,this.push(e,this.fromWest)?(e.setSize(),this.addToPushed(e),!0):(this.removeFromTempPushed(e),!1)):!1}tryWest(e,t){return this.gridster.$options.pushDirections.west?(this.addToTempPushed(e),e.$item.x=t.$item.x-e.$item.cols,this.push(e,this.fromEast)?(e.setSize(),this.addToPushed(e),!0):(this.removeFromTempPushed(e),!1)):!1}addToTempPushed(e){let t=this.pushedItemsTemp.indexOf(e);t===-1&&(t=this.pushedItemsTemp.push(e)-1,this.pushedItemsTempPath[t]=[]),this.pushedItemsTempPath[t].push({x:e.$item.x,y:e.$item.y})}removeFromTempPushed(e){let t=this.pushedItemsTemp.indexOf(e),i=this.pushedItemsTempPath[t].pop();i&&(e.$item.x=i.x,e.$item.y=i.y,e.setSize(),this.pushedItemsTempPath[t].length||(this.pushedItemsTemp.splice(t,1),this.pushedItemsTempPath.splice(t,1)))}addToPushed(e){if(this.pushedItems.indexOf(e)<0)this.pushedItems.push(e),this.pushedItemsPath.push([{x:e.item.x||0,y:e.item.y||0},{x:e.$item.x,y:e.$item.y}]);else{let t=this.pushedItems.indexOf(e);this.pushedItemsPath[t].push({x:e.$item.x,y:e.$item.y})}}removeFromPushed(e){e>-1&&(this.pushedItems.splice(e,1),this.pushedItemsPath.splice(e,1))}removeFromPushedItem(e){let t=this.pushedItems.indexOf(e);t>-1&&(this.pushedItemsPath[t].pop(),this.pushedItemsPath.length||(this.pushedItems.splice(t,1),this.pushedItemsPath.splice(t,1)))}checkPushedItem(e,t){let i=this.pushedItemsPath[t],s=i.length-2,n,o,a,l=!1;for(;s>-1;s--)n=i[s],o=e.$item.x,a=e.$item.y,e.$item.x=n.x,e.$item.y=n.y,this.gridster.findItemWithItem(e.$item)?(e.$item.x=o,e.$item.y=a):(e.setSize(),i.splice(s+1,i.length-s-1),l=!0);return i.length<2&&this.removeFromPushed(t),l}},it,Pe,tn=50,se,st,fe,nt,ot,rt,at;function sn(r,e,t,i,s,n,o,a,l,g){it=r.$options.scrollSensitivity,Pe=r.$options.scrollSpeed,se=r.el,st=l,fe=g;let x=se.offsetWidth,L=se.offsetHeight,H=se.scrollLeft,ne=se.scrollTop,M=t-ne,W=L+ne-t-s,{clientX:be,clientY:oe}=n;if(!r.$options.disableScrollVertical)if(o.clientY<oe&&W<it){if(ln(),st&&fe&&!fe.south||at)return;at=Qs(1,a,o)}else if(o.clientY>oe&&ne>0&&M<it){if(an(),st&&fe&&!fe.north||rt)return;rt=Qs(-1,a,o)}else o.clientY!==oe&&Ei();let ht=H+x-e-i,Di=e-H;if(!r.$options.disableScrollHorizontal)if(o.clientX<be&&ht<=it){if(rn(),st&&fe&&!fe.east||nt)return;nt=en(1,a,o)}else if(o.clientX>be&&H>0&&Di<it){if(on(),st&&fe&&!fe.west||ot)return;ot=en(-1,a,o)}else o.clientX!==be&&Ri()}function Qs(r,e,t){let i=t.clientY;return window.setInterval(()=>{(!se||r===-1&&se.scrollTop-Pe<0)&&Ei(),se.scrollTop+=r*Pe,i+=r*Pe,e({clientX:t.clientX,clientY:i})},tn)}function en(r,e,t){let i=t.clientX;return window.setInterval(()=>{(!se||r===-1&&se.scrollLeft-Pe<0)&&Ri(),se.scrollLeft+=r*Pe,i+=r*Pe,e({clientX:i,clientY:t.clientY})},tn)}function nn(){Ri(),Ei(),se=null}function Ri(){on(),rn()}function Ei(){ln(),an()}function on(){nt&&(clearInterval(nt),nt=0)}function rn(){ot&&(clearInterval(ot),ot=0)}function an(){at&&(clearInterval(at),at=0)}function ln(){rt&&(clearInterval(rt),rt=0)}var Ii=class{constructor(e){this.gridsterItem=e,this.gridster=e.gridster}destroy(){this.gridster=this.gridsterItem=this.swapedItem=null}swapItems(){this.gridster.$options.swap&&(this.checkSwapBack(),this.checkSwap(this.gridsterItem))}checkSwapBack(){if(this.swapedItem){let e=this.swapedItem.$item.x,t=this.swapedItem.$item.y;this.swapedItem.$item.x=this.swapedItem.item.x||0,this.swapedItem.$item.y=this.swapedItem.item.y||0,this.gridster.checkCollision(this.swapedItem.$item)?(this.swapedItem.$item.x=e,this.swapedItem.$item.y=t):(this.swapedItem.setSize(),this.gridsterItem.$item.x=this.gridsterItem.item.x||0,this.gridsterItem.$item.y=this.gridsterItem.item.y||0,this.swapedItem=void 0)}}restoreSwapItem(){this.swapedItem&&(this.swapedItem.$item.x=this.swapedItem.item.x||0,this.swapedItem.$item.y=this.swapedItem.item.y||0,this.swapedItem.setSize(),this.swapedItem=void 0)}setSwapItem(){this.swapedItem&&(this.swapedItem.checkItemChanges(this.swapedItem.$item,this.swapedItem.item),this.swapedItem=void 0)}checkSwap(e){let t;if(this.gridster.$options.swapWhileDragging?t=this.gridster.checkCollisionForSwaping(e.$item):t=this.gridster.checkCollision(e.$item),t&&t!==!0&&t.canBeDragged()){let i=t,s=i.$item.x,n=i.$item.y,o=e.$item.x,a=e.$item.y,l=o-s,g=a-n;i.$item.x=e.item.x-l,i.$item.y=e.item.y-g,e.$item.x=i.item.x+l,e.$item.y=i.item.y+g,this.gridster.checkCollision(i.$item)||this.gridster.checkCollision(e.$item)?(e.$item.x=o,e.$item.y=a,i.$item.x=s,i.$item.y=n):(i.setSize(),this.swapedItem=i,this.gridster.$options.swapWhileDragging&&(this.gridsterItem.checkItemChanges(this.gridsterItem.$item,this.gridsterItem.item),this.setSwapItem()))}}},yo="gridster-item-resizable-handler",Z;(function(r){r.UP="UP",r.DOWN="DOWN",r.LEFT="LEFT",r.RIGHT="RIGHT"})(Z||(Z={}));var ki=class{constructor(e,t,i){this.zone=i,this.collision=!1,this.dragMove=s=>{s.stopPropagation(),s.preventDefault(),F.checkTouchEvent(s);let n=this.getDirections(s);this.gridster.options.enableBoundaryControl&&(n.includes(Z.UP)&&this.gridsterItem.el.getBoundingClientRect().top<this.gridster.el.getBoundingClientRect().top+(this.outerMarginTop??this.margin)&&(n=n.filter(o=>o!=Z.UP),s=new MouseEvent(s.type,{clientX:s.clientX,clientY:this.lastMouse.clientY})),n.includes(Z.LEFT)&&this.gridsterItem.el.getBoundingClientRect().left<this.gridster.el.getBoundingClientRect().left+(this.outerMarginLeft??this.margin)&&(n=n.filter(o=>o!=Z.LEFT),s=new MouseEvent(s.type,{clientX:this.lastMouse.clientX,clientY:s.clientY})),n.includes(Z.RIGHT)&&this.gridsterItem.el.getBoundingClientRect().right>this.gridster.el.getBoundingClientRect().right-(this.outerMarginRight??this.margin)&&(n=n.filter(o=>o!=Z.RIGHT),s=new MouseEvent(s.type,{clientX:this.lastMouse.clientX,clientY:s.clientY})),n.includes(Z.DOWN)&&this.gridsterItem.el.getBoundingClientRect().bottom>this.gridster.el.getBoundingClientRect().bottom-(this.outerMarginBottom??this.margin)&&(n=n.filter(o=>o!=Z.DOWN),s=new MouseEvent(s.type,{clientX:s.clientX,clientY:this.lastMouse.clientY}))),n.length&&(this.offsetLeft=this.gridster.el.scrollLeft-this.gridster.el.offsetLeft,this.offsetTop=this.gridster.el.scrollTop-this.gridster.el.offsetTop,sn(this.gridster,this.left,this.top,this.width,this.height,s,this.lastMouse,this.calculateItemPositionFromMousePosition),this.calculateItemPositionFromMousePosition(s))},this.calculateItemPositionFromMousePosition=s=>{this.gridster.options.scale?this.calculateItemPositionWithScale(s,this.gridster.options.scale):this.calculateItemPositionWithoutScale(s),this.calculateItemPosition(),this.lastMouse.clientX=s.clientX,this.lastMouse.clientY=s.clientY,this.zone.run(()=>{this.gridster.updateGrid()})},this.dragStop=s=>{s.stopPropagation(),s.preventDefault(),nn(),this.cancelOnBlur(),this.mousemove(),this.mouseup(),this.mouseleave(),this.touchmove(),this.touchend(),this.touchcancel(),this.gridsterItem.renderer.removeClass(this.gridsterItem.el,"gridster-item-moving"),this.gridster.dragInProgress=!1,this.gridster.updateGrid(),this.path=[],this.gridster.options.draggable&&this.gridster.options.draggable.stop?Promise.resolve(this.gridster.options.draggable.stop(this.gridsterItem.item,this.gridsterItem,s)).then(this.makeDrag,this.cancelDrag):this.makeDrag(),setTimeout(()=>{this.gridster&&(this.gridster.movingItem=null,this.gridster.previewStyle(!0))})},this.cancelDrag=()=>{this.gridsterItem.$item.x=this.gridsterItem.item.x||0,this.gridsterItem.$item.y=this.gridsterItem.item.y||0,this.gridsterItem.setSize(),this.push&&this.push.restoreItems(),this.swap&&this.swap.restoreSwapItem(),this.push&&(this.push.destroy(),this.push=null),this.swap&&(this.swap.destroy(),this.swap=null)},this.makeDrag=()=>{this.gridster.$options.draggable.dropOverItems&&this.gridster.options.draggable&&this.gridster.options.draggable.dropOverItemsCallback&&this.collision&&this.collision!==!0&&this.collision.$item&&this.gridster.options.draggable.dropOverItemsCallback(this.gridsterItem.item,this.collision.item,this.gridster),this.collision=!1,this.gridsterItem.setSize(),this.gridsterItem.checkItemChanges(this.gridsterItem.$item,this.gridsterItem.item),this.push&&this.push.setPushedItems(),this.swap&&this.swap.setSwapItem(),this.push&&(this.push.destroy(),this.push=null),this.swap&&(this.swap.destroy(),this.swap=null)},this.dragStartDelay=s=>{if(s.target.classList.contains(yo)||F.checkContentClassForEvent(this.gridster,s))return;if(F.checkTouchEvent(s),!this.gridster.$options.draggable.delayStart){this.dragStart(s);return}let o=setTimeout(()=>{this.dragStart(s),M()},this.gridster.$options.draggable.delayStart),a=this.gridsterItem.renderer.listen("document","mouseup",M),l=this.gridsterItem.renderer.listen("document","mouseleave",M),g=this.gridsterItem.renderer.listen("window","blur",M),x=this.gridsterItem.renderer.listen("document","touchmove",ne),L=this.gridsterItem.renderer.listen("document","touchend",M),H=this.gridsterItem.renderer.listen("document","touchcancel",M);function ne(W){F.checkTouchEvent(W),(Math.abs(W.clientX-s.clientX)>9||Math.abs(W.clientY-s.clientY)>9)&&M()}function M(){clearTimeout(o),g(),a(),l(),x(),L(),H()}},this.gridsterItem=e,this.gridster=t,this.lastMouse={clientX:0,clientY:0},this.path=[]}destroy(){this.gridster.previewStyle&&this.gridster.previewStyle(!0),this.gridsterItem=this.gridster=this.collision=null,this.mousedown&&(this.mousedown(),this.touchstart())}dragStart(e){e.which&&e.which!==1||(this.gridster.options.draggable&&this.gridster.options.draggable.start&&this.gridster.options.draggable.start(this.gridsterItem.item,this.gridsterItem,e),e.stopPropagation(),e.preventDefault(),this.zone.runOutsideAngular(()=>{this.mousemove=this.gridsterItem.renderer.listen("document","mousemove",this.dragMove),this.touchmove=this.gridster.renderer.listen(this.gridster.el,"touchmove",this.dragMove)}),this.mouseup=this.gridsterItem.renderer.listen("document","mouseup",this.dragStop),this.mouseleave=this.gridsterItem.renderer.listen("document","mouseleave",this.dragStop),this.cancelOnBlur=this.gridsterItem.renderer.listen("window","blur",this.dragStop),this.touchend=this.gridsterItem.renderer.listen("document","touchend",this.dragStop),this.touchcancel=this.gridsterItem.renderer.listen("document","touchcancel",this.dragStop),this.gridsterItem.renderer.addClass(this.gridsterItem.el,"gridster-item-moving"),this.margin=this.gridster.$options.margin,this.outerMarginTop=this.gridster.$options.outerMarginTop,this.outerMarginRight=this.gridster.$options.outerMarginRight,this.outerMarginBottom=this.gridster.$options.outerMarginBottom,this.outerMarginLeft=this.gridster.$options.outerMarginLeft,this.offsetLeft=this.gridster.el.scrollLeft-this.gridster.el.offsetLeft,this.offsetTop=this.gridster.el.scrollTop-this.gridster.el.offsetTop,this.left=this.gridsterItem.left-this.margin,this.top=this.gridsterItem.top-this.margin,this.originalClientX=e.clientX,this.originalClientY=e.clientY,this.width=this.gridsterItem.width,this.height=this.gridsterItem.height,this.gridster.$options.dirType===A.RTL?this.diffLeft=e.clientX-this.gridster.el.scrollWidth+this.gridsterItem.left:this.diffLeft=e.clientX+this.offsetLeft-this.margin-this.left,this.diffTop=e.clientY+this.offsetTop-this.margin-this.top,this.gridster.movingItem=this.gridsterItem.$item,this.gridster.previewStyle(!0),this.push=new At(this.gridsterItem),this.swap=new Ii(this.gridsterItem),this.gridster.dragInProgress=!0,this.gridster.updateGrid(),this.path.push({x:this.gridsterItem.item.x||0,y:this.gridsterItem.item.y||0}))}calculateItemPositionWithScale(e,t){this.gridster.$options.dirType===A.RTL?this.left=this.gridster.el.scrollWidth-this.originalClientX+(e.clientX-this.originalClientX)/t+this.diffLeft:this.left=this.originalClientX+(e.clientX-this.originalClientX)/t+this.offsetLeft-this.diffLeft,this.top=this.originalClientY+(e.clientY-this.originalClientY)/t+this.offsetTop-this.diffTop}calculateItemPositionWithoutScale(e){this.gridster.$options.dirType===A.RTL?this.left=this.gridster.el.scrollWidth-e.clientX+this.diffLeft:this.left=e.clientX+this.offsetLeft-this.diffLeft,this.top=e.clientY+this.offsetTop-this.diffTop}calculateItemPosition(){if(this.gridster.movingItem=this.gridsterItem.$item,this.positionX=this.gridster.pixelsToPositionX(this.left,Math.round),this.positionY=this.gridster.pixelsToPositionY(this.top,Math.round),this.positionXBackup=this.gridsterItem.$item.x,this.positionYBackup=this.gridsterItem.$item.y,this.gridsterItem.$item.x=this.positionX,this.gridster.checkGridCollision(this.gridsterItem.$item)&&(this.gridsterItem.$item.x=this.positionXBackup),this.gridsterItem.$item.y=this.positionY,this.gridster.checkGridCollision(this.gridsterItem.$item)&&(this.gridsterItem.$item.y=this.positionYBackup),this.gridster.gridRenderer.setCellPosition(this.gridsterItem.renderer,this.gridsterItem.el,this.left,this.top),this.positionXBackup!==this.gridsterItem.$item.x||this.positionYBackup!==this.gridsterItem.$item.y){let e=this.path[this.path.length-1],t="";e.x<this.gridsterItem.$item.x?t=this.push.fromWest:e.x>this.gridsterItem.$item.x?t=this.push.fromEast:e.y<this.gridsterItem.$item.y?t=this.push.fromNorth:e.y>this.gridsterItem.$item.y&&(t=this.push.fromSouth),this.push.pushItems(t,this.gridster.$options.disablePushOnDrag),this.swap.swapItems(),this.collision=this.gridster.checkCollision(this.gridsterItem.$item),this.collision?(this.gridsterItem.$item.x=this.positionXBackup,this.gridsterItem.$item.y=this.positionYBackup,this.gridster.$options.draggable.dropOverItems&&this.collision!==!0&&this.collision.$item&&(this.gridster.movingItem=null)):this.path.push({x:this.gridsterItem.$item.x,y:this.gridsterItem.$item.y}),this.push.checkPushBack()}else this.collision=!1;this.gridster.previewStyle(!0)}toggle(){let e=this.gridsterItem.canBeDragged();!this.enabled&&e?(this.enabled=!this.enabled,this.mousedown=this.gridsterItem.renderer.listen(this.gridsterItem.el,"mousedown",this.dragStartDelay),this.touchstart=this.gridsterItem.renderer.listen(this.gridsterItem.el,"touchstart",this.dragStartDelay)):this.enabled&&!e&&(this.enabled=!this.enabled,this.mousedown(),this.touchstart())}getDirections(e){let t=[];return this.lastMouse.clientX===0&&this.lastMouse.clientY===0&&(this.lastMouse.clientY=e.clientY,this.lastMouse.clientX=e.clientX),this.lastMouse.clientY>e.clientY&&t.push(Z.UP),this.lastMouse.clientY<e.clientY&&t.push(Z.DOWN),this.lastMouse.clientX<e.clientX&&t.push(Z.RIGHT),this.lastMouse.clientX>e.clientX&&t.push(Z.LEFT),t}},Si=class{constructor(e){this.pushedItems=[],this.pushedItemsPath=[],this.gridsterItem=e,this.gridster=e.gridster,this.tryPattern={fromEast:this.tryWest,fromWest:this.tryEast,fromNorth:this.trySouth,fromSouth:this.tryNorth},this.fromSouth="fromSouth",this.fromNorth="fromNorth",this.fromEast="fromEast",this.fromWest="fromWest"}destroy(){this.gridster=this.gridsterItem=null}pushItems(e){return this.gridster.$options.pushResizeItems?this.push(this.gridsterItem,e):!1}restoreItems(){let e=0,t=this.pushedItems.length,i;for(;e<t;e++)i=this.pushedItems[e],i.$item.x=i.item.x||0,i.$item.y=i.item.y||0,i.$item.cols=i.item.cols||1,i.$item.row=i.item.row||1,i.setSize();this.pushedItems=[],this.pushedItemsPath=[]}setPushedItems(){let e=0,t=this.pushedItems.length,i;for(;e<t;e++)i=this.pushedItems[e],i.checkItemChanges(i.$item,i.item);this.pushedItems=[],this.pushedItemsPath=[]}checkPushBack(){let e=this.pushedItems.length-1,t=!1;for(;e>-1;e--)this.checkPushedItem(this.pushedItems[e],e)&&(t=!0);t&&this.checkPushBack()}push(e,t){let i=this.gridster.checkCollision(e.$item);if(i&&i!==!0&&i!==this.gridsterItem&&i.canBeResized()){if(this.tryPattern[t].call(this,i,e,t))return!0}else if(i===!1)return!0;return!1}trySouth(e,t,i){let s=e.$item.y,n=e.$item.rows;return e.$item.y=t.$item.y+t.$item.rows,e.$item.rows=n+s-e.$item.y,!this.gridster.checkCollisionTwoItems(e.$item,t.$item)&&!this.gridster.checkGridCollision(e.$item)?(e.setSize(),this.addToPushed(e),this.push(t,i),!0):(e.$item.y=s,e.$item.rows=n,!1)}tryNorth(e,t,i){let s=e.$item.rows;return e.$item.rows=t.$item.y-e.$item.y,!this.gridster.checkCollisionTwoItems(e.$item,t.$item)&&!this.gridster.checkGridCollision(e.$item)?(e.setSize(),this.addToPushed(e),this.push(t,i),!0):(e.$item.rows=s,!1)}tryEast(e,t,i){let s=e.$item.x,n=e.$item.cols;return e.$item.x=t.$item.x+t.$item.cols,e.$item.cols=n+s-e.$item.x,!this.gridster.checkCollisionTwoItems(e.$item,t.$item)&&!this.gridster.checkGridCollision(e.$item)?(e.setSize(),this.addToPushed(e),this.push(t,i),!0):(e.$item.x=s,e.$item.cols=n,!1)}tryWest(e,t,i){let s=e.$item.cols;return e.$item.cols=t.$item.x-e.$item.x,!this.gridster.checkCollisionTwoItems(e.$item,t.$item)&&!this.gridster.checkGridCollision(e.$item)?(e.setSize(),this.addToPushed(e),this.push(t,i),!0):(e.$item.cols=s,!1)}addToPushed(e){if(this.pushedItems.indexOf(e)<0)this.pushedItems.push(e),this.pushedItemsPath.push([{x:e.item.x||0,y:e.item.y||0,cols:e.item.cols||0,rows:e.item.rows||0},{x:e.$item.x,y:e.$item.y,cols:e.$item.cols,rows:e.$item.rows}]);else{let t=this.pushedItems.indexOf(e);this.pushedItemsPath[t].push({x:e.$item.x,y:e.$item.y,cols:e.$item.cols,rows:e.$item.rows})}}removeFromPushed(e){e>-1&&(this.pushedItems.splice(e,1),this.pushedItemsPath.splice(e,1))}checkPushedItem(e,t){let i=this.pushedItemsPath[t],s=i.length-2,n,o,a,l,g;for(;s>-1;s--)n=i[s],o=e.$item.x,a=e.$item.y,l=e.$item.cols,g=e.$item.rows,e.$item.x=n.x,e.$item.y=n.y,e.$item.cols=n.cols,e.$item.rows=n.rows,this.gridster.findItemWithItem(e.$item)?(e.$item.x=o,e.$item.y=a,e.$item.cols=l,e.$item.rows=g):(e.setSize(),i.splice(s+1,i.length-1-s));return i.length<2?(this.removeFromPushed(t),!0):!1}},Ci=class{constructor(e,t,i){this.zone=i,this.directionFunction=null,this.dragMove=s=>{if(this.directionFunction===null)throw new Error("The `directionFunction` has not been set before calling `dragMove`.");s.stopPropagation(),s.preventDefault(),F.checkTouchEvent(s),this.offsetTop=this.gridster.el.scrollTop-this.gridster.el.offsetTop,this.offsetLeft=this.gridster.el.scrollLeft-this.gridster.el.offsetLeft,sn(this.gridster,this.left,this.top,this.width,this.height,s,this.lastMouse,this.directionFunction,!0,this.resizeEventScrollType);let n=this.gridster.options.scale||1;this.directionFunction({clientX:this.originalClientX+(s.clientX-this.originalClientX)/n,clientY:this.originalClientY+(s.clientY-this.originalClientY)/n}),this.lastMouse.clientX=s.clientX,this.lastMouse.clientY=s.clientY,this.zone.run(()=>{this.gridster.updateGrid()})},this.dragStop=s=>{s.stopPropagation(),s.preventDefault(),nn(),this.mousemove(),this.mouseup(),this.mouseleave(),this.cancelOnBlur(),this.touchmove(),this.touchend(),this.touchcancel(),this.gridster.dragInProgress=!1,this.gridster.updateGrid(),this.gridster.options.resizable&&this.gridster.options.resizable.stop?Promise.resolve(this.gridster.options.resizable.stop(this.gridsterItem.item,this.gridsterItem,s)).then(this.makeResize,this.cancelResize):this.makeResize(),setTimeout(()=>{this.gridsterItem.renderer.removeClass(this.gridsterItem.el,"gridster-item-resizing"),this.gridster&&(this.gridster.movingItem=null,this.gridster.previewStyle())})},this.cancelResize=()=>{this.gridsterItem.$item.cols=this.gridsterItem.item.cols||1,this.gridsterItem.$item.rows=this.gridsterItem.item.rows||1,this.gridsterItem.$item.x=this.gridsterItem.item.x||0,this.gridsterItem.$item.y=this.gridsterItem.item.y||0,this.gridsterItem.setSize(),this.push.restoreItems(),this.pushResize.restoreItems(),this.push.destroy(),this.push=null,this.pushResize.destroy(),this.pushResize=null},this.makeResize=()=>{this.gridsterItem.setSize(),this.gridsterItem.checkItemChanges(this.gridsterItem.$item,this.gridsterItem.item),this.push.setPushedItems(),this.pushResize.setPushedItems(),this.push.destroy(),this.push=null,this.pushResize.destroy(),this.pushResize=null},this.handleNorth=s=>{this.top=s.clientY+this.offsetTop-this.diffTop,this.height=this.bottom-this.top,this.minHeight>this.height?(this.height=this.minHeight,this.top=this.bottom-this.minHeight):this.gridster.options.enableBoundaryControl&&(this.top=Math.max(0,this.top),this.height=this.bottom-this.top);let n=this.gridster.options.pushItems?this.margin:0;if(this.newPosition=this.gridster.pixelsToPositionY(this.top+n,Math.floor),this.gridsterItem.$item.y!==this.newPosition){if(this.itemBackup[1]=this.gridsterItem.$item.y,this.itemBackup[3]=this.gridsterItem.$item.rows,this.gridsterItem.$item.rows+=this.gridsterItem.$item.y-this.newPosition,this.gridsterItem.$item.y=this.newPosition,this.pushResize.pushItems(this.pushResize.fromSouth),this.push.pushItems(this.push.fromSouth,this.gridster.$options.disablePushOnResize),this.gridster.checkCollision(this.gridsterItem.$item)){this.gridsterItem.$item.y=this.itemBackup[1],this.gridsterItem.$item.rows=this.itemBackup[3],this.top=this.gridster.positionYToPixels(this.gridsterItem.$item.y),this.setItemTop(this.gridster.positionYToPixels(this.gridsterItem.$item.y)),this.setItemHeight(this.gridster.positionYToPixels(this.gridsterItem.$item.rows)-this.margin);return}else this.gridster.previewStyle();this.pushResize.checkPushBack(),this.push.checkPushBack()}this.setItemTop(this.top),this.setItemHeight(this.height)},this.handleWest=s=>{let n=this.gridster.$options.dirType===A.RTL?this.originalClientX+(this.originalClientX-s.clientX):s.clientX;this.left=n+this.offsetLeft-this.diffLeft,this.width=this.right-this.left,this.minWidth>this.width?(this.width=this.minWidth,this.left=this.right-this.minWidth):this.gridster.options.enableBoundaryControl&&(this.left=Math.max(0,this.left),this.width=this.right-this.left);let o=this.gridster.options.pushItems?this.margin:0;if(this.newPosition=this.gridster.pixelsToPositionX(this.left+o,Math.floor),this.gridsterItem.$item.x!==this.newPosition){if(this.itemBackup[0]=this.gridsterItem.$item.x,this.itemBackup[2]=this.gridsterItem.$item.cols,this.gridsterItem.$item.cols+=this.gridsterItem.$item.x-this.newPosition,this.gridsterItem.$item.x=this.newPosition,this.pushResize.pushItems(this.pushResize.fromEast),this.push.pushItems(this.push.fromEast,this.gridster.$options.disablePushOnResize),this.gridster.checkCollision(this.gridsterItem.$item)){this.gridsterItem.$item.x=this.itemBackup[0],this.gridsterItem.$item.cols=this.itemBackup[2],this.left=this.gridster.positionXToPixels(this.gridsterItem.$item.x),this.setItemLeft(this.gridster.positionXToPixels(this.gridsterItem.$item.x)),this.setItemWidth(this.gridster.positionXToPixels(this.gridsterItem.$item.cols)-this.margin);return}else this.gridster.previewStyle();this.pushResize.checkPushBack(),this.push.checkPushBack()}this.setItemLeft(this.left),this.setItemWidth(this.width)},this.handleSouth=s=>{if(this.height=s.clientY+this.offsetTop-this.diffBottom-this.top,this.minHeight>this.height&&(this.height=this.minHeight),this.bottom=this.top+this.height,this.gridster.options.enableBoundaryControl){let o=this.outerMarginBottom??this.margin,a=this.gridster.el.getBoundingClientRect();this.bottom=Math.min(this.bottom,a.bottom-a.top-2*o),this.height=this.bottom-this.top}let n=this.gridster.options.pushItems?0:this.margin;if(this.newPosition=this.gridster.pixelsToPositionY(this.bottom+n,Math.ceil),this.gridsterItem.$item.y+this.gridsterItem.$item.rows!==this.newPosition){if(this.itemBackup[3]=this.gridsterItem.$item.rows,this.gridsterItem.$item.rows=this.newPosition-this.gridsterItem.$item.y,this.pushResize.pushItems(this.pushResize.fromNorth),this.push.pushItems(this.push.fromNorth,this.gridster.$options.disablePushOnResize),this.gridster.checkCollision(this.gridsterItem.$item)){this.gridsterItem.$item.rows=this.itemBackup[3],this.setItemHeight(this.gridster.positionYToPixels(this.gridsterItem.$item.rows)-this.margin);return}else this.gridster.previewStyle();this.pushResize.checkPushBack(),this.push.checkPushBack()}this.setItemHeight(this.height)},this.handleEast=s=>{let n=this.gridster.$options.dirType===A.RTL?this.originalClientX+(this.originalClientX-s.clientX):s.clientX;if(this.width=n+this.offsetLeft-this.diffRight-this.left,this.minWidth>this.width&&(this.width=this.minWidth),this.right=this.left+this.width,this.gridster.options.enableBoundaryControl){let a=this.outerMarginRight??this.margin,l=this.gridster.el.getBoundingClientRect();this.right=Math.min(this.right,l.right-l.left-2*a),this.width=this.right-this.left}let o=this.gridster.options.pushItems?0:this.margin;if(this.newPosition=this.gridster.pixelsToPositionX(this.right+o,Math.ceil),this.gridsterItem.$item.x+this.gridsterItem.$item.cols!==this.newPosition){if(this.itemBackup[2]=this.gridsterItem.$item.cols,this.gridsterItem.$item.cols=this.newPosition-this.gridsterItem.$item.x,this.pushResize.pushItems(this.pushResize.fromWest),this.push.pushItems(this.push.fromWest,this.gridster.$options.disablePushOnResize),this.gridster.checkCollision(this.gridsterItem.$item)){this.gridsterItem.$item.cols=this.itemBackup[2],this.setItemWidth(this.gridster.positionXToPixels(this.gridsterItem.$item.cols)-this.margin);return}else this.gridster.previewStyle();this.pushResize.checkPushBack(),this.push.checkPushBack()}this.setItemWidth(this.width)},this.handleNorthWest=s=>{this.handleNorth(s),this.handleWest(s)},this.handleNorthEast=s=>{this.handleNorth(s),this.handleEast(s)},this.handleSouthWest=s=>{this.handleSouth(s),this.handleWest(s)},this.handleSouthEast=s=>{this.handleSouth(s),this.handleEast(s)},this.gridsterItem=e,this.gridster=t,this.lastMouse={clientX:0,clientY:0},this.itemBackup=[0,0,0,0],this.resizeEventScrollType={west:!1,east:!1,north:!1,south:!1}}destroy(){this.gridster?.previewStyle(),this.gridster=this.gridsterItem=null}dragStart(e){if(e.which&&e.which!==1)return;this.gridster.options.resizable&&this.gridster.options.resizable.start&&this.gridster.options.resizable.start(this.gridsterItem.item,this.gridsterItem,e),e.stopPropagation(),e.preventDefault(),this.zone.runOutsideAngular(()=>{this.mousemove=this.gridsterItem.renderer.listen("document","mousemove",this.dragMove),this.touchmove=this.gridster.renderer.listen(this.gridster.el,"touchmove",this.dragMove)}),this.mouseup=this.gridsterItem.renderer.listen("document","mouseup",this.dragStop),this.mouseleave=this.gridsterItem.renderer.listen("document","mouseleave",this.dragStop),this.cancelOnBlur=this.gridsterItem.renderer.listen("window","blur",this.dragStop),this.touchend=this.gridsterItem.renderer.listen("document","touchend",this.dragStop),this.touchcancel=this.gridsterItem.renderer.listen("document","touchcancel",this.dragStop),this.gridsterItem.renderer.addClass(this.gridsterItem.el,"gridster-item-resizing"),this.lastMouse.clientX=e.clientX,this.lastMouse.clientY=e.clientY,this.left=this.gridsterItem.left,this.top=this.gridsterItem.top,this.originalClientX=e.clientX,this.originalClientY=e.clientY,this.width=this.gridsterItem.width,this.height=this.gridsterItem.height,this.bottom=this.gridsterItem.top+this.gridsterItem.height,this.right=this.gridsterItem.left+this.gridsterItem.width,this.margin=this.gridster.$options.margin,this.outerMarginTop=this.gridster.$options.outerMarginTop,this.outerMarginRight=this.gridster.$options.outerMarginRight,this.outerMarginBottom=this.gridster.$options.outerMarginBottom,this.outerMarginLeft=this.gridster.$options.outerMarginLeft,this.offsetLeft=this.gridster.el.scrollLeft-this.gridster.el.offsetLeft,this.offsetTop=this.gridster.el.scrollTop-this.gridster.el.offsetTop,this.diffLeft=e.clientX+this.offsetLeft-this.left,this.diffRight=e.clientX+this.offsetLeft-this.right,this.diffTop=e.clientY+this.offsetTop-this.top,this.diffBottom=e.clientY+this.offsetTop-this.bottom,this.minHeight=this.gridster.positionYToPixels(this.gridsterItem.$item.minItemRows||this.gridster.$options.minItemRows)-this.margin,this.minWidth=this.gridster.positionXToPixels(this.gridsterItem.$item.minItemCols||this.gridster.$options.minItemCols)-this.margin,this.gridster.movingItem=this.gridsterItem.$item,this.gridster.previewStyle(),this.push=new At(this.gridsterItem),this.pushResize=new Si(this.gridsterItem),this.gridster.dragInProgress=!0,this.gridster.updateGrid();let{classList:t}=e.target;t.contains("handle-n")?(this.resizeEventScrollType.north=!0,this.directionFunction=this.handleNorth):t.contains("handle-w")?this.gridster.$options.dirType===A.RTL?(this.resizeEventScrollType.east=!0,this.directionFunction=this.handleEast):(this.resizeEventScrollType.west=!0,this.directionFunction=this.handleWest):t.contains("handle-s")?(this.resizeEventScrollType.south=!0,this.directionFunction=this.handleSouth):t.contains("handle-e")?this.gridster.$options.dirType===A.RTL?(this.resizeEventScrollType.west=!0,this.directionFunction=this.handleWest):(this.resizeEventScrollType.east=!0,this.directionFunction=this.handleEast):t.contains("handle-nw")?this.gridster.$options.dirType===A.RTL?(this.resizeEventScrollType.north=!0,this.resizeEventScrollType.east=!0,this.directionFunction=this.handleNorthEast):(this.resizeEventScrollType.north=!0,this.resizeEventScrollType.west=!0,this.directionFunction=this.handleNorthWest):t.contains("handle-ne")?this.gridster.$options.dirType===A.RTL?(this.resizeEventScrollType.north=!0,this.resizeEventScrollType.west=!0,this.directionFunction=this.handleNorthWest):(this.resizeEventScrollType.north=!0,this.resizeEventScrollType.east=!0,this.directionFunction=this.handleNorthEast):t.contains("handle-sw")?this.gridster.$options.dirType===A.RTL?(this.resizeEventScrollType.south=!0,this.resizeEventScrollType.east=!0,this.directionFunction=this.handleSouthEast):(this.resizeEventScrollType.south=!0,this.resizeEventScrollType.west=!0,this.directionFunction=this.handleSouthWest):t.contains("handle-se")&&(this.gridster.$options.dirType===A.RTL?(this.resizeEventScrollType.south=!0,this.resizeEventScrollType.west=!0,this.directionFunction=this.handleSouthWest):(this.resizeEventScrollType.south=!0,this.resizeEventScrollType.east=!0,this.directionFunction=this.handleSouthEast))}toggle(){this.resizeEnabled=this.gridsterItem.canBeResized(),this.resizableHandles=this.gridsterItem.getResizableHandles()}dragStartDelay(e){if(F.checkTouchEvent(e),!this.gridster.$options.resizable.delayStart){this.dragStart(e);return}let t=setTimeout(()=>{this.dragStart(e),x()},this.gridster.$options.resizable.delayStart),{cancelMouse:i,cancelMouseLeave:s,cancelOnBlur:n,cancelTouchMove:o,cancelTouchEnd:a,cancelTouchCancel:l}=this.zone.runOutsideAngular(()=>{let L=this.gridsterItem.renderer.listen("document","mouseup",x),H=this.gridsterItem.renderer.listen("document","mouseleave",x),ne=this.gridsterItem.renderer.listen("window","blur",x),M=this.gridsterItem.renderer.listen("document","touchmove",g),W=this.gridsterItem.renderer.listen("document","touchend",x),be=this.gridsterItem.renderer.listen("document","touchcancel",x);return{cancelMouse:L,cancelMouseLeave:H,cancelOnBlur:ne,cancelTouchMove:M,cancelTouchEnd:W,cancelTouchCancel:be}});function g(L){F.checkTouchEvent(L),(Math.abs(L.clientX-e.clientX)>9||Math.abs(L.clientY-e.clientY)>9)&&x()}function x(){clearTimeout(t),n(),i(),s(),o(),a(),l()}}setItemTop(e){this.gridster.gridRenderer.setCellPosition(this.gridsterItem.renderer,this.gridsterItem.el,this.left,e)}setItemLeft(e){this.gridster.gridRenderer.setCellPosition(this.gridsterItem.renderer,this.gridsterItem.el,e,this.top)}setItemHeight(e){this.gridsterItem.renderer.setStyle(this.gridsterItem.el,"height",e+"px")}setItemWidth(e){this.gridsterItem.renderer.setStyle(this.gridsterItem.el,"width",e+"px")}},xe=class r{get zIndex(){return this.getLayerIndex()+this.gridster.$options.baseLayerIndex}constructor(e,t,i,s){this.renderer=i,this.zone=s,this.itemInit=new w,this.itemChange=new w,this.itemResize=new w,this.el=e.nativeElement,this.$item={cols:-1,rows:-1,x:-1,y:-1},this.gridster=t,this.drag=new ki(this,t,this.zone),this.resize=new Ci(this,t,this.zone)}ngOnInit(){this.gridster.addItem(this)}ngOnChanges(e){e.item&&(this.updateOptions(),this.init||this.gridster.calculateLayout$.next()),e.item&&e.item.previousValue&&this.setSize()}updateOptions(){this.$item=F.merge(this.$item,this.item,{cols:void 0,rows:void 0,x:void 0,y:void 0,layerIndex:void 0,dragEnabled:void 0,resizeEnabled:void 0,compactEnabled:void 0,maxItemRows:void 0,minItemRows:void 0,maxItemCols:void 0,minItemCols:void 0,maxItemArea:void 0,minItemArea:void 0,resizableHandles:{s:void 0,e:void 0,n:void 0,w:void 0,se:void 0,ne:void 0,sw:void 0,nw:void 0}})}ngOnDestroy(){this.gridster.removeItem(this),this.drag.destroy(),this.resize.destroy(),this.gridster=this.drag=this.resize=null}setSize(){this.renderer.setStyle(this.el,"display",this.notPlaced?"":"block"),this.gridster.gridRenderer.updateItem(this.el,this.$item,this.renderer),this.updateItemSize()}updateItemSize(){let e=this.$item.y*this.gridster.curRowHeight,t=this.$item.x*this.gridster.curColWidth,i=this.$item.cols*this.gridster.curColWidth-this.gridster.$options.margin,s=this.$item.rows*this.gridster.curRowHeight-this.gridster.$options.margin;this.top=e,this.left=t,!this.init&&i>0&&s>0&&(this.init=!0,this.item.initCallback&&this.item.initCallback(this.item,this),this.gridster.options.itemInitCallback&&this.gridster.options.itemInitCallback(this.item,this),this.itemInit.next({item:this.item,itemComponent:this}),this.gridster.$options.scrollToNewItems&&this.el.scrollIntoView(!1)),(i!==this.width||s!==this.height)&&(this.width=i,this.height=s,this.gridster.options.itemResizeCallback&&this.gridster.options.itemResizeCallback(this.item,this),this.itemResize.next({item:this.item,itemComponent:this}))}itemChanged(){this.gridster.options.itemChangeCallback&&this.gridster.options.itemChangeCallback(this.item,this),this.itemChange.next({item:this.item,itemComponent:this})}checkItemChanges(e,t){e.rows===t.rows&&e.cols===t.cols&&e.x===t.x&&e.y===t.y||(this.gridster.checkCollision(this.$item)?(this.$item.x=t.x||0,this.$item.y=t.y||0,this.$item.cols=t.cols||1,this.$item.rows=t.rows||1,this.setSize()):(this.item.cols=this.$item.cols,this.item.rows=this.$item.rows,this.item.x=this.$item.x,this.item.y=this.$item.y,this.gridster.calculateLayout$.next(),this.itemChanged()))}canBeDragged(){let e=this.gridster.$options.draggable.enabled,t=this.$item.dragEnabled===void 0?e:this.$item.dragEnabled;return!this.gridster.mobile&&e&&t}canBeResized(){let e=this.gridster.$options.resizable.enabled,t=this.$item.resizeEnabled===void 0?e:this.$item.resizeEnabled;return!this.gridster.mobile&&e&&t}getResizableHandles(){let e=this.gridster.$options.resizable.handles,t=this.$item.resizableHandles;return t===void 0?e:Xe(Xe({},e),t)}bringToFront(e){if(e&&e<=0)return;let t=this.getLayerIndex(),i=this.gridster.$options.maxLayerIndex;if(t<i){let s=e?t+e:i;this.item.layerIndex=this.$item.layerIndex=s>i?i:s}}sendToBack(e){if(e&&e<=0)return;let t=this.getLayerIndex();if(t>0){let i=e?t-e:0;this.item.layerIndex=this.$item.layerIndex=i<0?0:i}}getLayerIndex(){return this.item.layerIndex!==void 0?this.item.layerIndex:this.gridster.$options.defaultLayerIndex!==void 0?this.gridster.$options.defaultLayerIndex:0}static{this.\u0275fac=Je({minVersion:"12.0.0",version:"17.0.3",ngImport:Y,type:r,deps:[{token:le},{token:ae},{token:de},{token:ve}],target:Ke.Component})}static{this.\u0275cmp=ut({minVersion:"14.0.0",version:"17.0.3",type:r,isStandalone:!0,selector:"gridster-item",inputs:{item:"item"},outputs:{itemInit:"itemInit",itemChange:"itemChange",itemResize:"itemResize"},host:{properties:{"style.z-index":"this.zIndex"}},usesOnChanges:!0,ngImport:Y,template:`<ng-content></ng-content>
<div
  (mousedown)="resize.dragStartDelay($event)"
  (touchstart)="resize.dragStartDelay($event)"
  *ngIf="resize.resizableHandles?.s && resize.resizeEnabled"
  class="gridster-item-resizable-handler handle-s"
></div>
<div
  (mousedown)="resize.dragStartDelay($event)"
  (touchstart)="resize.dragStartDelay($event)"
  *ngIf="resize.resizableHandles?.e && resize.resizeEnabled"
  class="gridster-item-resizable-handler handle-e"
></div>
<div
  (mousedown)="resize.dragStartDelay($event)"
  (touchstart)="resize.dragStartDelay($event)"
  *ngIf="resize.resizableHandles?.n && resize.resizeEnabled"
  class="gridster-item-resizable-handler handle-n"
></div>
<div
  (mousedown)="resize.dragStartDelay($event)"
  (touchstart)="resize.dragStartDelay($event)"
  *ngIf="resize.resizableHandles?.w && resize.resizeEnabled"
  class="gridster-item-resizable-handler handle-w"
></div>
<div
  (mousedown)="resize.dragStartDelay($event)"
  (touchstart)="resize.dragStartDelay($event)"
  *ngIf="resize.resizableHandles?.se && resize.resizeEnabled"
  class="gridster-item-resizable-handler handle-se"
></div>
<div
  (mousedown)="resize.dragStartDelay($event)"
  (touchstart)="resize.dragStartDelay($event)"
  *ngIf="resize.resizableHandles?.ne && resize.resizeEnabled"
  class="gridster-item-resizable-handler handle-ne"
></div>
<div
  (mousedown)="resize.dragStartDelay($event)"
  (touchstart)="resize.dragStartDelay($event)"
  *ngIf="resize.resizableHandles?.sw && resize.resizeEnabled"
  class="gridster-item-resizable-handler handle-sw"
></div>
<div
  (mousedown)="resize.dragStartDelay($event)"
  (touchstart)="resize.dragStartDelay($event)"
  *ngIf="resize.resizableHandles?.nw && resize.resizeEnabled"
  class="gridster-item-resizable-handler handle-nw"
></div>
`,styles:[`gridster-item{box-sizing:border-box;z-index:1;position:absolute;overflow:hidden;transition:.3s;display:none;background:white;-webkit-user-select:text;user-select:text}gridster-item.gridster-item-moving{cursor:move}gridster-item.gridster-item-resizing,gridster-item.gridster-item-moving{transition:0s;z-index:2;box-shadow:0 0 5px 5px #0003,0 6px 10px #00000024,0 1px 18px #0000001f}.gridster-item-resizable-handler{position:absolute;z-index:2}.gridster-item-resizable-handler.handle-n{cursor:ns-resize;height:10px;right:0;top:0;left:0}.gridster-item-resizable-handler.handle-e{cursor:ew-resize;width:10px;bottom:0;right:0;top:0}.gridster-item-resizable-handler.handle-s{cursor:ns-resize;height:10px;right:0;bottom:0;left:0}.gridster-item-resizable-handler.handle-w{cursor:ew-resize;width:10px;left:0;top:0;bottom:0}.gridster-item-resizable-handler.handle-ne{cursor:ne-resize;width:10px;height:10px;right:0;top:0}.gridster-item-resizable-handler.handle-nw{cursor:nw-resize;width:10px;height:10px;left:0;top:0}.gridster-item-resizable-handler.handle-se{cursor:se-resize;width:0;height:0;right:0;bottom:0;border-style:solid;border-width:0 0 10px 10px;border-color:transparent}.gridster-item-resizable-handler.handle-sw{cursor:sw-resize;width:10px;height:10px;left:0;bottom:0}gridster-item:hover .gridster-item-resizable-handler.handle-se{border-color:transparent transparent #ccc}
`],dependencies:[{kind:"directive",type:u,selector:"[ngIf]",inputs:["ngIf","ngIfThen","ngIfElse"]}],encapsulation:ye.None})}};Ze({minVersion:"12.0.0",version:"17.0.3",ngImport:Y,type:xe,decorators:[{type:p,args:[{selector:"gridster-item",encapsulation:ye.None,standalone:!0,imports:[u],template:`<ng-content></ng-content>
<div
  (mousedown)="resize.dragStartDelay($event)"
  (touchstart)="resize.dragStartDelay($event)"
  *ngIf="resize.resizableHandles?.s && resize.resizeEnabled"
  class="gridster-item-resizable-handler handle-s"
></div>
<div
  (mousedown)="resize.dragStartDelay($event)"
  (touchstart)="resize.dragStartDelay($event)"
  *ngIf="resize.resizableHandles?.e && resize.resizeEnabled"
  class="gridster-item-resizable-handler handle-e"
></div>
<div
  (mousedown)="resize.dragStartDelay($event)"
  (touchstart)="resize.dragStartDelay($event)"
  *ngIf="resize.resizableHandles?.n && resize.resizeEnabled"
  class="gridster-item-resizable-handler handle-n"
></div>
<div
  (mousedown)="resize.dragStartDelay($event)"
  (touchstart)="resize.dragStartDelay($event)"
  *ngIf="resize.resizableHandles?.w && resize.resizeEnabled"
  class="gridster-item-resizable-handler handle-w"
></div>
<div
  (mousedown)="resize.dragStartDelay($event)"
  (touchstart)="resize.dragStartDelay($event)"
  *ngIf="resize.resizableHandles?.se && resize.resizeEnabled"
  class="gridster-item-resizable-handler handle-se"
></div>
<div
  (mousedown)="resize.dragStartDelay($event)"
  (touchstart)="resize.dragStartDelay($event)"
  *ngIf="resize.resizableHandles?.ne && resize.resizeEnabled"
  class="gridster-item-resizable-handler handle-ne"
></div>
<div
  (mousedown)="resize.dragStartDelay($event)"
  (touchstart)="resize.dragStartDelay($event)"
  *ngIf="resize.resizableHandles?.sw && resize.resizeEnabled"
  class="gridster-item-resizable-handler handle-sw"
></div>
<div
  (mousedown)="resize.dragStartDelay($event)"
  (touchstart)="resize.dragStartDelay($event)"
  *ngIf="resize.resizableHandles?.nw && resize.resizeEnabled"
  class="gridster-item-resizable-handler handle-nw"
></div>
`,styles:[`gridster-item{box-sizing:border-box;z-index:1;position:absolute;overflow:hidden;transition:.3s;display:none;background:white;-webkit-user-select:text;user-select:text}gridster-item.gridster-item-moving{cursor:move}gridster-item.gridster-item-resizing,gridster-item.gridster-item-moving{transition:0s;z-index:2;box-shadow:0 0 5px 5px #0003,0 6px 10px #00000024,0 1px 18px #0000001f}.gridster-item-resizable-handler{position:absolute;z-index:2}.gridster-item-resizable-handler.handle-n{cursor:ns-resize;height:10px;right:0;top:0;left:0}.gridster-item-resizable-handler.handle-e{cursor:ew-resize;width:10px;bottom:0;right:0;top:0}.gridster-item-resizable-handler.handle-s{cursor:ns-resize;height:10px;right:0;bottom:0;left:0}.gridster-item-resizable-handler.handle-w{cursor:ew-resize;width:10px;left:0;top:0;bottom:0}.gridster-item-resizable-handler.handle-ne{cursor:ne-resize;width:10px;height:10px;right:0;top:0}.gridster-item-resizable-handler.handle-nw{cursor:nw-resize;width:10px;height:10px;left:0;top:0}.gridster-item-resizable-handler.handle-se{cursor:se-resize;width:0;height:0;right:0;bottom:0;border-style:solid;border-width:0 0 10px 10px;border-color:transparent}.gridster-item-resizable-handler.handle-sw{cursor:sw-resize;width:10px;height:10px;left:0;bottom:0}gridster-item:hover .gridster-item-resizable-handler.handle-se{border-color:transparent transparent #ccc}
`]}]}],ctorParameters:()=>[{type:le,decorators:[{type:we,args:[le]}]},{type:ae},{type:de,decorators:[{type:we,args:[de]}]},{type:ve,decorators:[{type:we,args:[ve]}]}],propDecorators:{item:[{type:h}],itemInit:[{type:v}],itemChange:[{type:v}],itemResize:[{type:v}],zIndex:[{type:Mi,args:["style.z-index"]}]}});var Ti=class r{static{this.\u0275fac=Je({minVersion:"12.0.0",version:"17.0.3",ngImport:Y,type:r,deps:[],target:Ke.NgModule})}static{this.\u0275mod=ji({minVersion:"14.0.0",version:"17.0.3",ngImport:Y,type:r,imports:[ae,xe],exports:[ae,xe]})}static{this.\u0275inj=Gi({minVersion:"12.0.0",version:"17.0.3",ngImport:Y,type:r})}};Ze({minVersion:"12.0.0",version:"17.0.3",ngImport:Y,type:Ti,decorators:[{type:Ui,args:[{imports:[ae,xe],exports:[ae,xe]}]}]});var dn=`<div class="remote-control-items">
  <ng-container [ngSwitch]="viewState">
    <ng-container *ngSwitchCase="1">
      <div class="loading-container">
        <span class="spinner-grow spinner-grow-sm text-secondary"></span>
      </div>
    </ng-container>
    <!-- NO ACP -->
    <ng-container *ngSwitchCase="2">
      <div class="info-container">
        <cds-icon shape="info-standard" size="lg" class="mb-3 color-secondary"></cds-icon>
        <span>
          {{'REMOTECONTROL.EMPTY_GRANTED' | translate}}
        </span>
        <button class="btn btn-warning btn-sm my-3"
          (click)="onHideClicked($event)">{{'BUTTON.REMOVE'|translate}}</button>
      </div>
    </ng-container>
    <!-- NO ACP -->

    <!-- SELECT ACP -->
    <ng-container *ngSwitchCase="3">
      <div class="selection-container d-flex flex-column align-items-center justify-content-center">
        <span class="text-lg fw-medium">{{'REPORT.ACCESS_CONTROL_POINT'|translate}}</span>
        <span class="text-xs my-3">{{'REMOTECONTROL.SELECT_POINT' | translate}}</span>
        <button class="btn btn-primary btn-sm my-4"
          (click)="onSettingsClicked($event)">{{'BUTTON.SELECT'|translate}}</button>
      </div>
    </ng-container>
    <!-- SELECT ACP -->

    <!-- SHOW ACP -->
    <ng-container *ngSwitchCase="4">
      <armon-remote-control-item [remoteAccessPoint]="selectedAccessControlPoint"
        (notificationStateChanged)="onNotificationChanged($event)">
      </armon-remote-control-item>
    </ng-container>
    <!-- SHOW ACP -->
  </ng-container>
</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">{{'REPORT.ACCESS_CONTROL_POINT'|translate}}</span>
      <div class="w-100 mt-3">
        <label class="report-form-label">{{'REPORT.ACCESS_CONTROL_POINT'|translate}}</label>
        <armon-access-control-point-search #accessControlPointSearch [multiselect]="false" class="w-100"
          (itemSelected)="onAccessControlPointSelect($event)" (itemRemoved)="onAccessControlPointUnselect($event)">
        </armon-access-control-point-search>
      </div>
    </div>
    <div class="col-12 d-flex justify-content-end mt-3">
      <button class="btn btn-sm btn-outline-primary me-2"
        (click)="onCancelClicked($event)">{{'BUTTON.CANCEL'|translate}}</button>
      <button class="btn btn-primary btn-sm" [disabled]="selectedItem==null"
        (click)="onConfirmClicked($event)">{{'BUTTON.OK'|translate}}</button>
    </div>
  </div>
</ng-template>`;var cn=`.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 .remote-control-items{overflow:hidden;height:100%;width:100%;padding:0;position:relative;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 .remote-control-items .loading-container{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;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items: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}:host .remote-control-items .info-container{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;-webkit-box-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items: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;padding:18px}:host .remote-control-items .info-container span{text-align:center;color:#0a2a5a;font-size:.714rem;font-weight:500;line-height:.65rem}:host .remote-control-items .selection-container{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;-webkit-box-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center;padding:12px 18px}:host .remote-control-items .selection-container span{color:#0a2a5a;font-size:.714rem;line-height:.65rem;font-weight:500}
`;var hn=`<div class="remote-control-item" [ngStyle]="{'border-left-color': remoteAccessPoint.type.color}">

  <div class="line-area" [ngStyle]="{'background-color': remoteAccessPoint.type.color}">
    &nbsp;
  </div>

  <div class="detailed-area">

    <!-- Name of access control point -->
    <div class="title-text">{{remoteAccessPoint.name}}</div>

    <!-- Access control point type -->
    <div class="tags-text">
      <div *ngIf="remoteAccessPoint.location">{{remoteAccessPoint.location}}</div>
      <div class="mt-3" [ngStyle]="{'color': remoteAccessPoint.type.color}">
        <strong>{{remoteAccessPoint.type.description | translate}}</strong>
      </div>
      <div *ngIf="credentialNames" class="mt-3">
        <ng-container *ngFor="let name of credentialNames">
          <div class="reader-credential">{{name|translate}}</div>
        </ng-container>
      </div>
      <div *ngIf="hasManualSettings" (click)="remoteStatePermission?onSettingsClicked($event):null"
        class="mt-2 manual-settings color-error" [ngClass]="{'cursor-pointer': remoteStatePermission}">
        <cds-icon shape="exclamation-triangle" solid></cds-icon>
        <span nz-tooltip
          nzTooltipTitle="{{'REMOTECONTROL.ACCESS_CONTROL_SETTINGS'|translate}}">{{'REMOTECONTROL.CONTROL_STATE_HAS_MANUAL_CONTROL'|translate}}</span>
      </div>
    </div>

    <!-- Buttons area -->
    <div class="remote-buttons" *ngIf="remotePermission">
      <armon-remote-control-item-buttons [remoteAccessPoint]="remoteAccessPoint" class="control-item-buttons">
      </armon-remote-control-item-buttons>
    </div>
    <div class="type-icon"
      *ngIf="remoteAccessPoint.type.icon && !(remoteAccessPoint.cameraInfo && remoteAccessPoint.cameraInfo.length>0)">
      <cds-icon [attr.shape]="remoteAccessPoint.type.icon" style="width: 128px; height: 128px;"
        [ngStyle]="{'color': remoteAccessPoint.type.color}">
      </cds-icon>
    </div>
  </div>
  <div class="camera-area" *ngIf="remoteAccessPoint.cameraInfo && remoteAccessPoint.cameraInfo.length>0">
    <div class="button-container" *ngIf="remoteAccessPoint.cameraInfo.length>1">
      <div class="remote-icon-button" [attr.passive]="index==0" (click)="onPrevClicked($event)">
        <cds-icon shape="angle" direction="left"></cds-icon>
      </div>
      <div class="remote-icon-button" [attr.passive]="index==(remoteAccessPoint.cameraInfo.length-1)"
        (click)="onNextClicked($event)">
        <cds-icon shape="angle" direction="right"></cds-icon>
      </div>
    </div>
    <div class="camera-preview-container">
      <ng-container *ngFor="let camera of remoteAccessPoint.cameraInfo;let nIndex=index;">
        <armon-camera-preview [camera]="camera" [remoteAccessPoint]="remoteAccessPoint" *ngIf="nIndex==index">
        </armon-camera-preview>
      </ng-container>
    </div>
  </div>
  <div class="settings-area" [ngStyle]="{'color': remoteAccessPoint.type.color}">
    <div class="settings-icon" *ngIf="unknownLogPermission">
      <cds-icon shape="bell" style="width: 18px; height: 18px;" (click)="onChangeFailedNotificationsClicked($event)"
        nz-tooltip nzTooltipTitle="{{remoteAccessPoint.showFailedNotifications ? ('REMOTECONTROL.HIDE_FAILED_NOTIFICATIONS' | translate) :
      ('REMOTECONTROL.SHOW_FAILED_NOTIFICATIONS' | translate)}}"
        [attr.solid]="remoteAccessPoint.showFailedNotifications"
        [ngClass]="{'has-badge': remoteAccessPoint.showFailedNotifications}">
      </cds-icon>
    </div>
    <div class="settings-icon" *ngIf="remoteStatePermission">
      <cds-icon shape="shield-check" style="width: 18px; height: 18px;" (click)="onSettingsClicked($event)" nz-tooltip
        nzTooltipTitle="{{'REMOTECONTROL.ACCESS_CONTROL_SETTINGS'|translate}}"
        [ngClass]="{'is-error': hasManualSettings}"></cds-icon>
    </div>
  </div>
</div>`;var mn=`.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{height:100%;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex}:host .remote-control-item{-webkit-flex-grow:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-flex-shrink:1;-webkit-box-flex:1;-moz-flex-shrink:1;-ms-flex-negative:1;flex-shrink:1;-webkit-flex-basis:auto;-moz-flex-basis:auto;-ms-flex-preferred-size:auto;flex-basis:auto;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-box-align:stretch;-ms-flex-align:stretch;-webkit-align-items:stretch;-moz-align-items:stretch;align-items:stretch;position:relative}:host .remote-control-item .line-area{margin-left:8px;width:5px}:host .remote-control-item .detailed-area{position:relative;overflow:hidden;-webkit-flex-grow:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-flex-shrink:1;-webkit-box-flex:1;-moz-flex-shrink:1;-ms-flex-negative:1;flex-shrink:1;-webkit-flex-basis:auto;-moz-flex-basis:auto;-ms-flex-preferred-size:auto;flex-basis:auto;padding:18px;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 .remote-control-item .detailed-area .title-text{font-size:.84rem;font-weight:200}:host .remote-control-item .detailed-area .tags-text{font-size:.714rem}:host .remote-control-item .detailed-area .tags-text .manual-settings{display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center}:host .remote-control-item .detailed-area .tags-text .manual-settings span{font-size:.588rem;margin-left:2px;margin-top:2px}:host .remote-control-item .detailed-area .tags-text .reader-credential{display:inline;padding:3px 4px;margin:2px 2px 2px 0;font-size:.504rem;color:#aaa;text-align:center;background-color:#f5f5f5;-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem}:host .remote-control-item .detailed-area .remote-buttons{display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;margin-top:auto}:host .remote-control-item .detailed-area .remote-buttons .control-item-buttons{width:100%;max-width:160px!important;margin-left:-6px;margin-bottom:-6px}:host .remote-control-item .detailed-area .type-icon{position:absolute;right:12px;bottom:12px;opacity:.1}:host .remote-control-item .camera-area{padding:18px;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-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;position:relative}:host .remote-control-item .camera-area .button-container{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;position:absolute;left:24px;bottom:24px}:host .remote-control-item .camera-area .button-container .remote-icon-button{color:#d1cfcf;cursor:pointer;padding:2px 3px 3px}:host .remote-control-item .camera-area .button-container .remote-icon-button:hover{color:#eb8d00}:host .remote-control-item .camera-area .button-container .remote-icon-button[passive=true]{cursor:not-allowed;color:#333}:host .remote-control-item .camera-area .button-container .remote-icon-button[passive=true]:hover{color:#333}:host .remote-control-item .settings-area{position:absolute;top:0;right:6px;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:end;-ms-flex-align:end;-webkit-align-items:flex-end;-moz-align-items:flex-end;align-items:flex-end;padding:6px}:host .remote-control-item .settings-area .settings-icon{background-color:#fff;padding:0 3px;cursor:pointer}
`;var Co=function(r,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(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(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},Lt=class{modalService;authService;socketService;interactionService;remoteAccessPoint;favoriteStateChanged=new w;notificationStateChanged=new w;index=0;subscriptionStateChanged;hasManualSettings=!1;remoteStatePermission=!1;remotePermission=!1;unknownLogPermission=!1;credentialNames;constructor(e,t,i,s){this.modalService=e,this.authService=t,this.socketService=i,this.interactionService=s}ngOnInit(){this.remoteStatePermission=this.remoteAccessPoint.userRights&&this.remoteAccessPoint.userRights.config&&(this.getCountOfRelays(Ee.Entrance)>0||this.getCountOfRelays(Ee.Exit)>0||this.getCountOfRelays(Ee.All)>0),this.remotePermission=this.remoteAccessPoint.remoteAvailable&&this.remoteAccessPoint.userRights&&this.remoteAccessPoint.userRights.remoteAccess,this.unknownLogPermission=this.authService.checkPermission(b.ACCESSLOG.getReportUnknownLog()),this.subscriptionStateChanged=this.socketService.onRemoteAccessControlStateChanged.subscribe(t=>{t.a==this.remoteAccessPoint.id&&t.sl&&t.sl.length>0&&(t.sl.forEach(i=>{let s=this.remoteAccessPoint.states.find(n=>n.direction==i.d);if(s)s.state=i.s;else{let n=os.getEmptyModel(i.d);n.state=i.s,this.remoteAccessPoint.states.push(n)}}),this.setUiData())});let e=[];this.remoteAccessPoint.readers&&this.remoteAccessPoint.readers.length>0&&(this.remoteAccessPoint.readers.forEach(t=>{t&&t.credential&&e.findIndex(i=>i==t.credential.description)==-1&&e.push(t.credential.description)}),this.credentialNames=e),this.setUiData()}ngOnDestroy(){this.subscriptionStateChanged&&this.subscriptionStateChanged.unsubscribe()}setUiData(){this.hasManualSettings=this.remoteAccessPoint.hasManualSettings}onChangeFailedNotificationsClicked(e){this.remoteAccessPoint.showFailedNotifications=!this.remoteAccessPoint.showFailedNotifications,this.notificationStateChanged.emit(this.remoteAccessPoint),this.interactionService.showMessage("REMOTECONTROL.NOTIFICATION_STATE_CHANGED",null,Me.Success)}getCountOfRelays(e){return this.remoteAccessPoint&&this.remoteAccessPoint.relays?this.remoteAccessPoint.relays.filter(t=>t.direction===e).length:0}onSettingsClicked(){this.modalService.open(As,{settings:{size:"md"},props:{remoteAccessPointId:this.remoteAccessPoint.id,remoteAccessPointName:this.remoteAccessPoint.name,accessControlPointRemoteStates:this.remoteAccessPoint.states,showEntrance:this.getCountOfRelays(Ee.Entrance)>0,showExit:this.getCountOfRelays(Ee.Exit)>0,showAll:this.getCountOfRelays(Ee.All)>0}}).result.then(e=>{e&&(this.remoteAccessPoint.states=e,this.setUiData())}).catch(e=>{})}onPrevClicked(e){this.index>0&&this.index--}onNextClicked(e){this.index<this.remoteAccessPoint.cameraInfo.length-1&&this.index++}static ctorParameters=()=>[{type:U},{type:E},{type:Ve},{type:Q}];static propDecorators={remoteAccessPoint:[{type:h}],favoriteStateChanged:[{type:v}],notificationStateChanged:[{type:v}]}};Lt=Co([p({selector:"armon-remote-control-item",template:hn,standalone:!0,imports:[V,u,S,Ne,q,Ns,Ls,f],styles:[mn]})],Lt);var To=function(r,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(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(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},Wt=class{accessControlPointService;drawerService;sessionService;drawerTemplate;drawerRef;widgetData;widgetId;dataUpdated=new w;hideClicked=new w;viewState=1;selectedAccessControlPoint=null;selectedItem=null;subscriptionRemoteAccessGrantsChanged;subscriptionOrganizationChanged;constructor(e,t,i){this.accessControlPointService=e,this.drawerService=t,this.sessionService=i}ngOnInit(){this.widgetData&&this.widgetData.notificationACPIds&&delete this.widgetData.notificationACPIds,this.widgetData&&this.widgetData.accessControlPointId?this.widgetData.widgetId=this.widgetId:this.widgetData={widgetId:this.widgetId,accessControlPointId:null,notificationEnabled:!1},this.initializeSubscriptions()}ngOnDestroy(){this.subscriptionRemoteAccessGrantsChanged&&this.subscriptionRemoteAccessGrantsChanged.unsubscribe(),this.subscriptionOrganizationChanged&&this.subscriptionOrganizationChanged.unsubscribe()}ngAfterViewInit(){this.controlRemoteAccessPoints()}controlRemoteAccessPoints(){this.widgetData.accessControlPointId&&this.widgetData.accessControlPointId!=""?this.accessControlPointService.getDetailsofAccessControlPoint(this.widgetData.accessControlPointId,!1).subscribe(e=>{this.selectedAccessControlPoint=e,this.selectedAccessControlPoint.showFailedNotifications=this.widgetData.notificationEnabled,this.viewState=4}):this.viewState=3}onAccessControlPointSelect(e){this.selectedItem=e}onAccessControlPointUnselect(e){this.selectedItem=null}onConfirmClicked(e){this.selectedItem&&(this.drawerRef.close(),this.widgetData.widgetId=this.widgetId,this.widgetData.accessControlPointId=this.selectedItem.id,this.dataUpdated.emit(this.widgetData),this.controlRemoteAccessPoints())}onHideClicked(e){this.hideClicked.emit()}onSettingsClicked(){this.drawerRef=this.drawerService.create({nzContent:this.drawerTemplate,nzClosable:!1,nzWidth:$(!0),nzContentParams:{value:""}})}onCancelClicked(){this.drawerRef.close()}onNotificationChanged(e){this.widgetData.notificationEnabled=e.showFailedNotifications,this.widgetData.widgetId=this.widgetId,this.dataUpdated.emit(this.widgetData)}initializeSubscriptions(){this.subscriptionRemoteAccessGrantsChanged=this.accessControlPointService.onRemoteAccessGrantsChanged.subscribe(()=>{this.controlRemoteAccessPoints()}),this.subscriptionOrganizationChanged=this.sessionService.onOrganizationChanged.subscribe(()=>{this.controlRemoteAccessPoints()})}static ctorParameters=()=>[{type:Ce},{type:G},{type:B}];static propDecorators={drawerTemplate:[{type:P,args:["drawerTemplate"]}],widgetData:[{type:h}],widgetId:[{type:h}],dataUpdated:[{type:v}],hideClicked:[{type:v}]}};Wt=To([p({selector:"armon-remote-control-item-list",template:dn,standalone:!0,imports:[ce,he,Lt,Pt,f],styles:[cn]})],Wt);var pn=`<div>
  <div class="comp-container">
    <div class="icon-container d-none d-md-block">
      <cds-icon shape="draggable" style="width: 30px; height: 30px;"></cds-icon>
    </div>
    <div class="move-container d-sm-none">
      <cds-icon *ngIf="!first" shape="circle-arrow" direction="up" size="lg" solid
        (click)="onUpClicked($event)">
      </cds-icon>
      <cds-icon *ngIf="!last" shape="circle-arrow" direction="down" size="lg" solid
        (click)="onDownClicked($event)">
      </cds-icon>
    </div>
    <button class="btn btn-sm btn-warning" (click)="onHideClicked($event)">{{'BUTTON.REMOVE'|translate}}</button>
  </div>
</div>`;var gn=`.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{position:absolute;background-color:#ffffff80;inset:0;margin:auto;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-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-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center;cursor:move;z-index:20}@media screen and (max-width: 768px){:host{cursor:default}}:host .comp-container{padding:12px;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-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-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center}:host .comp-container .icon-container{padding:12px;color:#fff;background-color:#0a2a5a;-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%}:host .comp-container .move-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 .comp-container .move-container cds-icon{color:#0a2a5a;cursor:pointer}:host .comp-container button{margin:12px 0 0}
`;var Do=function(r,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(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(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},Mt=class{item;first;last;hideClicked=new w;upClicked=new w;downClicked=new w;constructor(){}ngOnInit(){}onHideClicked(e){this.hideClicked.emit(this.item)}onUpClicked(e){this.upClicked.emit(this.item)}onDownClicked(e){this.downClicked.emit(this.item)}static ctorParameters=()=>[];static propDecorators={item:[{type:h}],first:[{type:h}],last:[{type:h}],hideClicked:[{type:v}],upClicked:[{type:v}],downClicked:[{type:v}]}};Mt=Do([p({selector:"armon-gridster-overlay",template:pn,standalone:!0,imports:[u,f],styles:[gn]})],Mt);var un=`<div class="widget-data-container">
    <div class="widget-header-container">
        <span class="widget-title">{{'WIDGET.TOTAL_PERSONNEL_STATE_NOW'|translate}}<span
                class="spinner-grow spinner-grow-sm text-secondary ms-2" *ngIf="chartData==null"></span></span>
        <ng-container *ngIf="currentState">
            <span class="widget-sub-title"
                *ngIf="!currentState.organizations">{{'WIDGET.ORGANIZATION_ALL_UNITS'|translate}}</span>
            <span class="widget-sub-title text-truncate"
                *ngIf="currentState.organizations">{{currentState.organizations}}</span>
        </ng-container>
    </div>
    <ng-container *ngIf="visibleComponent && chartData">
        <div class="widget-button-container">
            <!-- PACS_ANALYSIS_HIDE -->
            <!-- <cds-icon shape="analysis_charts" style="width: 18px; height: 18px;" (click)="onDetailClicked()"
            title="{{'ANALYZE.DETAILED'|translate}} - {{'PAGES.ANALYSIS_PACS_ORG_DAILY_SUMMARY' | translate}}"></cds-icon> -->
            <cds-icon shape="calendar" style="width: 18px; height: 18px;" [owlDateTimeTrigger]="datepicker" nz-tooltip
                class="cursor-pointer me-2" nzTooltipTitle="{{'PLACEHOLDER.DATE_SELECT' | translate}}">
            </cds-icon>
            <input [(ngModel)]="selectedDate" [owlDateTime]="datepicker" class="date-select-input"
                (dateTimeChange)="onDateChanged($event)" [max]="nowDate">
            <owl-date-time [firstDayOfWeek]="1" #datepicker>
            </owl-date-time>
            <cds-icon shape="switch" style="width: 18px; height: 18px;" (click)="onSwitchViewClicked()" nz-tooltip
                class="cursor-pointer me-2" nzTooltipTitle="{{'WIDGET.SWITCH_CHART_TYPE' | translate}}">
            </cds-icon>
            <cds-icon shape="report" style="width: 18px; height: 18px;" (click)="onReportClicked()" nz-tooltip
                class="cursor-pointer me-2" nzTooltipTitle="{{'BUTTON.SHOW_REPORT' | translate}}">
            </cds-icon>
            <cds-icon shape="cog" style="width: 18px; height: 18px;" (click)="onSettingsClicked()" nz-tooltip
                class="cursor-pointer" *ngIf="permissionSearchOrganizationUnit"
                nzTooltipTitle="{{'COMMON.SETTINGS' | translate}}">
            </cds-icon>
        </div>
        <div class="data-date-container">
            <span class="text-55rem line-height-60rem text-bold">
                {{(selectedNow ? 'DATEPICKER.LABEL_NOW' : 'DATEPICKER.LABEL_HISTORY' ) | translate}}

            </span>
            <div class="d-flex align-items-center">
                <span class="text-center text-45rem line-height-50rem text-italic cursor-pointer"
                    [owlDateTimeTrigger]="datepicker">{{selectedDateText}}
                </span>
                <cds-icon shape="history" size="sm" class="cursor-pointer ms-2" *ngIf="!selectedNow"
                    (click)="onDateRemoved($event)" title="{{'WIDGET.TOTAL_PERSONNEL_STATE_SHOw_NOW'|translate}}">
                </cds-icon>
            </div>
        </div>
        <ng-container [ngSwitch]="viewState">
            <ng-container *ngSwitchCase="1">
                <div class="chart-container">
                    <d3-sunburst-chart [chartData]="chartData" [chartLabels]="chartLabels" [chartColors]="chartColors"
                        [chartOptions]="chartOptions" (valueClicked)="onValueClicked($event)"
                        (centerClicked)="onCenterClicked($event)"></d3-sunburst-chart>
                </div>
            </ng-container>
            <ng-container *ngSwitchCase="2">
                <div class="list-node-container">
                    <ng-template [ngTemplateOutlet]="nodeTemplateRef"
                        [ngTemplateOutletContext]="{ node: listData.data }">
                    </ng-template>
                </div>
            </ng-container>
        </ng-container>
    </ng-container>
</div>

<div class="no-info-container" *ngIf="visibleComponent && chartData==null">
    <p class="p2 message">
        <cds-icon shape="info-standard"></cds-icon>
        {{'WIDGET.NO_WIDGET_DATA_INFO' | translate}}
    </p>
</div>

<ng-template #nodeTemplateRef let-node="node">
    <div class="list-node" [@enterLeaveFade]>
        <div class="list-node-header" (click)="(node.value && node.value>0 && node.type) && onValueClicked(node)"
            [ngStyle]="{'border-color': node.color}" [attr.nodata]="(!node.value || node.value==0)"
            *ngIf="node.value && node.value>0" [attr.noclick]="(!node.value || node.value==0 || !node.type)">
            <span class="list-node-name">{{ node.name }}</span>
            <span class="list-node-value" *ngIf="node.value && node.value>0">{{ node.value }}</span>
        </div>
        <div *ngIf="node.children && node.children.length" class="list-node-children"
            [ngStyle]="{'border-color': node.color}">
            <ng-template ngFor let-child [ngForOf]="node.children">
                <ng-template [ngTemplateOutlet]="nodeTemplateRef" [ngTemplateOutletContext]="{ node: child }">
                </ng-template>
            </ng-template>
        </div>
    </div>
</ng-template>

<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">{{'WIDGET.TOTAL_PERSONNEL_STATE_NOW'|translate}}</span>
            <span class="text-sm">{{'WIDGET.LAST_UPDATE_DATE' | translate}} :
                {{currentState.updateDate}}</span>
            <div class="w-100 mt-3">
                <label class="report-form-label">{{'REPORT.ORGANIZATION_UNITS' | translate}}</label>
                <armon-select-search query="unit" [allowMulti]="true" [(ngModel)]="selectedOrganizationUnitIds">
                </armon-select-search>
            </div>
        </div>
        <div class="col-12 d-flex justify-content-end mt-3">
            <button class="btn btn-sm btn-outline-primary me-2"
                (click)="onCancelClicked($event)">{{'BUTTON.CANCEL'|translate}}</button>
            <button class="btn btn-sm btn-primary" (click)="onSaveClicked($event)">{{'BUTTON.SAVE'|translate}}</button>
        </div>
    </div>
</ng-template>`;var fn=`.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}.widget-host-container,:host{display:block;position:relative;padding:6px;width:100%;height:100%;color:#0a2a5a}.widget-data-container{width:100%;height:100%;padding:12px;position:relative}@media screen and (max-width: 768px){.widget-data-container{padding:6px}}.widget-data-container .widget-button-container{position:absolute;right:6px;top:6px;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex}.widget-data-container .widget-header-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;padding-right:48px}.widget-data-container .widget-header-container .widget-title{font-size:14px;line-height:14px;color:#0a2a5a;margin-bottom:6px;font-weight:500}.widget-data-container .widget-header-container .widget-sub-title{font-size:9px;line-height:10px;color:#999}.widget-data-container .widget-settings-container{position:absolute;inset:0;background-color:#fff;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;padding:12px}.widget-data-container .widget-settings-container .widget-settings-title{font-size:12px;line-height:12px;color:#0a2a5a;margin-bottom:12px}.widget-data-container .widget-settings-container .widget-settings-label{font-size:12px;line-height:12px;color:#999;margin-bottom:6px}:host .chart-container{display:block;padding:0;margin-top:15px;height:300px}:host .date-select-input{visibility:hidden;width:0;position:absolute;top:0;left:0}:host .data-date-container{padding:.3rem;-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem;margin-top:12px;background-color:#f8f9fa;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-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-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center}:host .list-node-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;padding-top:18px}:host .list-node-container .list-node .list-node-header{cursor:pointer;padding:6px;margin:5px 0;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;color:#0a2a5a;border-left-width:3px;border-left-style:solid;background-color:#fafafa;box-shadow:0 0 2px #eee}:host .list-node-container .list-node .list-node-header .list-node-name{font-size:12px;line-height:12px;-webkit-flex-grow:0;-webkit-box-flex:0;-moz-flex-grow:0;-ms-flex-positive:0;flex-grow:0}:host .list-node-container .list-node .list-node-header .list-node-value{font-size:12px;line-height:12px;font-weight:500;margin-left:auto}:host .list-node-container .list-node .list-node-header[nodata=true]{opacity:.2}:host .list-node-container .list-node .list-node-header[noclick=true]{cursor:default;pointer-events:none}:host .list-node-container .list-node .list-node-header:hover{background-color:#f5f5f5}:host .list-node-container .list-node .list-node-children{padding-left:12px;border-left-width:1px;border-left-style:dotted}
`;var xn=`<ng-container *ngIf="visibleComponent">
  <div class="modal-header">
    <div class="icon-container">
      <cds-icon shape="users" size="lg"></cds-icon>
    </div>
    <div class="title-container">
      <span class="type-title">{{title | translate}}</span>
      <span class="total-count">{{paginationResponse.total}} {{'PACS.USER' | translate}} - {{selectedDayText}}</span>
    </div>
  </div>
  <div class="modal-body bg-color-background" id="armon-pacs-user-list-item-modal-body">
    <div class="row">
      <div class="col-12">
        <armon-sorting-picker [data]="sortingPickerData" (selectionChanged)="onSortingSelectionChanged($event)">
        </armon-sorting-picker>
      </div>
    </div>
    <div class="row align-content-start mh-vh-60 mxh-vh-60 overflow-y-auto my-3"
      id="pacs-employee-list-modal-scroll-container">
      <div class="col-12">
        <armon-report-pacs-daily-user *ngFor="let item of items" [record]="item" [day]="selectedDay"
          (interactionStarted)="onInteractionStarted($event)" (interactionFinished)="onInteractionFinished($event)"
          (routingStarted)="closeClicked($event)">
        </armon-report-pacs-daily-user>
      </div>
    </div>
    <div class="row">
      <div class="col-12">
        <armon-pagination [paginationResponse]="paginationResponse" (pageChanged)="pageChanged($event)"
          [scrollDomId]="'pacs-employee-list-modal-scroll-container'"></armon-pagination>
      </div>
    </div>
  </div>
  <div class="modal-footer">
    <button nz-dropdown [nzDropdownMenu]="menuReports" class="btn btn-outline-primary me-2"
      *ngIf="visibleDetailReportButton || visibleRegionReportButton">
      {{'PAGES.REPORTS' | translate}}
      <cds-icon shape="angle" direction="down"></cds-icon>
    </button>
    <nz-dropdown-menu #menuReports="nzDropdownMenu">
      <ul nz-menu>
        <li nz-menu-item *ngIf="visibleDetailReportButton" (click)="onDetailReportClicked($event)">
          {{'PAGES.REPORT_PACS_DAILY_DETAILED'|translate}}</li>
        <li nz-menu-item *ngIf="visibleRegionReportButton" (click)="onRegionReportClicked($event)">
          {{'PAGES.REPORT_REGION'|translate}}</li>
      </ul>
    </nz-dropdown-menu>
    <button class="btn btn-primary" (click)="closeClicked($event)">
      {{'BUTTON.CLOSE' | translate}}
    </button>
  </div>
  <div class="disabled-overlay" *ngIf="visibleOverlay"></div>
</ng-container>`;var bn=`.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}.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}:host .modal-header{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}:host .modal-header .icon-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-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-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center;min-width:50px}:host .modal-header .title-container{-webkit-flex-grow:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-flex-shrink:1;-webkit-box-flex:1;-moz-flex-shrink:1;-ms-flex-negative:1;flex-shrink:1;-webkit-flex-basis:auto;-moz-flex-basis:auto;-ms-flex-preferred-size:auto;flex-basis:auto;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-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;padding-left:.35rem}:host .modal-header .title-container .type-title{font-size:1.05rem}:host .modal-header .title-container .total-count{font-size:.714rem}:host .disabled-overlay{position:absolute;margin:auto;inset:0;cursor:default;background-color:#ffffffe6;z-index:1}
`;var No=function(r,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(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(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},Ye=class extends ke{interactionService;sessionService;pacsService;authService;routingService;modalService;listType;idBasedUserFilter;title;workPlanIds;selectedDate;binaryType;existing;employeeStatusAtSegment;items;visibleComponent=!1;request;paginationResponse=new Fe;visibleDetailReportButton;visibleRegionReportButton;selectedDay;selectedDayText;visibleOverlay=!1;sortingPickerData;constructor(e,t,i,s,n,o){super(),this.interactionService=e,this.sessionService=t,this.pacsService=i,this.authService=s,this.routingService=n,this.modalService=o}onModalInitialized(){switch(super.onModalInitialized(),this.sortingPickerData=this.pacsService.getDefaultSortingPickerData(),this.visibleDetailReportButton=this.authService.checkRoutingPermission(Re.REPORT_PACS_DAILY),this.visibleRegionReportButton=this.authService.checkRoutingPermission(Re.REPORT_REGION),this.listType){case ge.Distribution:this.request=ls.getEmptyModel(),this.request.employeeStatusAtSegment=this.employeeStatusAtSegment,this.request.idBasedUserFilter=this.idBasedUserFilter,this.request.workPlanIds=this.workPlanIds,this.request.sortType=I.getDefaultSortType(this.request.employeeStatusAtSegment.working,this.request.employeeStatusAtSegment.status),this.request.dateTime=this.selectedDate,this.selectedDay=d.fromJSDate(this.request.dateTime).toFormat("yyyy-MM-dd"),this.selectedDayText=d.fromJSDate(this.request.dateTime).toLocaleString(d.DATETIME_MED);break;case ge.Cumulative:this.request=ps.getEmptyModel(),this.request.idBasedUserFilter=this.idBasedUserFilter,this.request.workPlanIds=this.workPlanIds,this.request.binaryType=this.binaryType,this.request.dateTime=this.selectedDate,this.request.existing=this.existing,this.request.sortType=xs.getDefaultSortType(this.request.binaryType),this.selectedDay=d.fromJSDate(this.request.dateTime).toFormat("yyyy-MM-dd"),this.selectedDayText=d.fromJSDate(this.request.dateTime).toLocaleString(d.DATETIME_MED);break}let e=this.sortingPickerData.items.find(t=>t.value==this.request.sortType);e.selected=!0,this.request.sortOrder=e.directionDefault?hi.ASC:hi.DESC,this.getData(),this.visibleComponent=!0}getData(){switch(this.listType){case ge.Distribution:this.getUserListDistribution();break;case ge.Cumulative:this.getUserListCumulative();break}}getUserListDistribution(){this.pacsService.getEmployeeListDistribution(this.request).subscribe(e=>{this.items=e.items,this.paginationResponse=e.paginationResponse})}getUserListCumulative(){this.pacsService.getEmployeeListCumulative(this.request).subscribe(e=>{this.items=e.items,this.paginationResponse=e.paginationResponse})}closeClicked(e){this.closeModal()}pageChanged(e){this.request.paginationRequest=e,this.getData()}userClicked(e){setTimeout(()=>{this.modalService.open(_t,{settings:{size:"lg"},props:{userId:e.userId,userCaptions:e.userCaptions}}).result.then(t=>{}).catch(t=>{})},500),this.closeModal()}onDetailReportClicked(e){this.routingService.gotoReportPacsDaily(this.selectedDay),this.closeModal()}onRegionReportClicked(e){this.routingService.gotoReportRegion(),this.closeModal()}onInteractionStarted(e){this.visibleOverlay=!0}onInteractionFinished(e){this.visibleOverlay=!1}onSortingSelectionChanged(e){this.request.sortType=e.value,this.request.sortOrder=e.direction,this.getData()}static ctorParameters=()=>[{type:Q},{type:B},{type:N},{type:E},{type:R},{type:U}];static propDecorators={listType:[{type:h}],idBasedUserFilter:[{type:h}],title:[{type:h}],workPlanIds:[{type:h}],selectedDate:[{type:h}],binaryType:[{type:h}],existing:[{type:h}],employeeStatusAtSegment:[{type:h}]}};Ye=No([p({selector:"armon-pacs-employee-list-modal",template:xn,standalone:!0,imports:[u,es,S,Hs,He,Ge,Ue,$e,f],styles:[bn]})],Ye);var ge;(function(r){r[r.Distribution=1]="Distribution",r[r.Cumulative=2]="Cumulative"})(ge||(ge={}));var wn=`<div class="w-100 h-100 pos-relative">
    <div #container class="chart-container"></div>
    <div class="d3-nodata-overlay" *ngIf="visibleNoDataOverlay">
        <div>
            <span>{{'CHART.NO_DATA'|translate}}</span>
        </div>
    </div>
</div>

`;var yn=`.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{width:100%;height:100%}:host .chart-container{width:100%;height:100%}:host::ng-deep .title{font-size:.714rem}:host::ng-deep .title-value{font-size:1.6rem}
`;var dt=zi(ds());var Wo=function(r,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(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(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},$t=class extends Us{interactionService;valueClicked=new w;centerClicked=new w;constructor(e){super(e),this.interactionService=e,this.chart=this}onInit(){}onDestroy(){}onDataUpdated(){this.drawChart()}onColorsUpdated(){this.drawChart()}onLabelsUpdated(){this.drawChart()}onOptionsUpdated(){this.drawChart()}onAfterViewInit(){this.drawChart()}onResized(){this.drawChart()}drawChart(){let e=this.chartData;if(!e||!e.data)return;this.host.html("");let t={top:5,right:5,bottom:5,left:5};this.svg=this.host.append("svg").attr("width","100%").attr("height","100%");let i=this.host.node().getBoundingClientRect(),s=i.width-t.left-t.right,n=i.height-t.top-t.bottom,o=this.svg.append("g").attr("transform","translate("+s/2+","+n/2+")"),a;Oe("body").select(".tooltip-d3-chart").empty()?a=Oe("body").append("div").attr("class","tooltip-d3-chart"):a=Oe("body").select(".tooltip-d3-chart"),a.style("opacity",0);let l=(m,J)=>{m.each(function(){for(var ue=Oe(this),ai=ue.text().split(/\s+/).reverse(),mt,qe=[],uo=0,fo=2.6,Oi=ue.attr("y"),Pi=parseFloat(ue.attr("dy")),pt=ue.text(null).append("tspan").attr("x",0).attr("y",Oi).attr("dy",Pi+"em");mt=ai.pop();)qe.push(mt),pt.text(qe.join(" ")),pt.node().getComputedTextLength()>J&&(qe.pop(),pt.text(qe.join(" ")),qe=[mt],pt=ue.append("tspan").attr("x",0).attr("y",Oi).attr("dy",`${++uo*fo+Pi}em`).text(mt))})},g=m=>{let J=Ws(m).sum(ue=>ue.value).sort((ue,ai)=>ai.value-ue.value);return Ms().size([2*Math.PI,J.height+1])(J)},x=m=>m.y1<=4&&m.y0>=1&&m.x1>m.x0,L=m=>m.y1<=4&&m.y0>=1&&(m.y1-m.y0)*(m.x1-m.x0)>.03,H=m=>(m.innerRadius=0,m.outerRadius=W,"translate("+be.centroid(m)+")"),ne=(m,J)=>"#333",M=m=>{this.centerClicked.emit()},W=Math.min(s,n)/10,be=$s().startAngle(m=>m.x0).endAngle(m=>m.x1).padAngle(m=>Math.min((m.x1-m.x0)/2,.005)).padRadius(W*1.5).innerRadius(m=>(m.y0+1)*W).outerRadius(m=>Math.max((m.y0+1)*W,(m.y1+1)*W-1)),oe=g(e.data);oe.each(m=>m.current=m);let ht=o.append("g").selectAll("path").data(oe.descendants().slice(1)).enter().append("path").attr("fill",m=>m.data.color).attr("fill-opacity",m=>x(m.current)?1:0).attr("d",m=>be(m.current)).on("mouseover",(m,J)=>{Oe(m.currentTarget).style("fill",(0,dt.default)(J.data.color).darken(.2)),a.html(J.data.tooltip).style("opacity",1).style("border-left-color",(0,dt.default)(J.data.color)).style("left",m.pageX+15+"px").style("top",m.pageY-15+"px")}).on("mouseout",(m,J)=>{a.style("opacity",0),Oe(m.currentTarget).style("fill",(0,dt.default)(J.data.color))});ht.filter(m=>m.children).style("cursor","pointer").on("click",M),ht.style("cursor","pointer").on("click",(m,J)=>{this.onValueClicked(J)});let Di=o.append("text").attr("dy","-1.5em").attr("text-anchor","middle").attr("class","title").text(oe.descendants()[0].data.name).call(l,W*2).style("opacity",0).transition().delay(500).duration(600).style("opacity",1),Yr=o.append("text").attr("dy","0.8em").attr("text-anchor","middle").attr("font-size",24+36*(1/oe.descendants()[0].value.toString().length)+"px").text(oe.descendants()[0].value).style("opacity",0).transition().delay(500).duration(600).style("opacity",1),Br=o.append("g").attr("pointer-events","none").attr("text-anchor","middle").style("user-select","none").selectAll("text").data(oe.descendants().slice(1)).enter().append("text").attr("dy","0.35em").attr("fill",m=>(0,dt.default)(m.data.color).darken(.6)).attr("font-weight","bold").attr("font-size",m=>8+6*(1/m.value.toString().length)+"px").attr("fill-opacity",m=>+L(m.current)).attr("transform",m=>H(m.current)).text(m=>m.value),qr=o.append("circle").datum(oe).attr("r",W*2).attr("fill","none").style("cursor","pointer").attr("pointer-events","all").on("click",M)}onValueClicked=e=>{this.valueClicked.emit(e.data)};onCenterClicked=e=>{this.centerClicked.emit()};static ctorParameters=()=>[{type:Q}];static propDecorators={valueClicked:[{type:v}],centerClicked:[{type:v}]}};$t=Wo([p({selector:"d3-sunburst-chart",template:wn,standalone:!0,imports:[u,f],styles:[yn]})],$t);var Mo=function(r,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(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(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},Ut=class{pacsService;translate;authService;routingService;drawerService;modalService;drawerTemplate;drawerRef;widgetData;widgetId;dataUpdated=new w;request;requestInterval;currentState;visibleComponent=!1;viewState=1;subscriptionGetData;chartData;chartColors;chartLabels;chartOptions={type:j.SunBurstChart};permissionSearchOrganizationUnit;listData;nowDate=d.local().toJSDate();selectedNow=!0;selectedDate=d.local().toJSDate();selectedDateText;selectedOrganizationUnitIds;constructor(e,t,i,s,n,o){this.pacsService=e,this.translate=t,this.authService=i,this.routingService=s,this.drawerService=n,this.modalService=o}ngOnInit(){this.request=fs.getEmptyModel(),this.request.idBasedUserFilter.organizationUnitIds=this.widgetData?this.widgetData:[],this.permissionSearchOrganizationUnit=this.authService.checkPermission(b.ORGANIZATIONUNIT.getReadBasic()),this.startSubscriptionInterval()}ngOnDestroy(){this.requestInterval&&clearInterval(this.requestInterval),this.subscriptionGetData&&this.subscriptionGetData.unsubscribe()}startSubscriptionInterval(){this.requestInterval&&clearInterval(this.requestInterval),this.subscriptionGetData&&this.subscriptionGetData.unsubscribe(),this.updateSelectedDateView(),this.requestInterval=setInterval(()=>{this.getData()},18e4),this.getData()}getData(){this.selectedNow?this.request.dateTime=d.local().toJSDate():this.request.dateTime=this.selectedDate,this.subscriptionGetData=this.pacsService.getCurrentWorkingDistribution(this.request).subscribe(e=>{this.currentState=e,this.translate.get(["WIDGET.CURRENT_PERSONNEL_TOTAL","WIDGET.CURRENT_PERSONNEL_WORKING","WIDGET.CURRENT_PERSONNEL_WORKING_NORMAL","WIDGET.CURRENT_PERSONNEL_WORKING_IN_REGION","WIDGET.CURRENT_PERSONNEL_WORKING_DUTY","WIDGET.CURRENT_PERSONNEL_WORKING_EXTRA","WIDGET.CURRENT_PERSONNEL_WORKING_OUT_WORKPLAN","WIDGET.CURRENT_PERSONNEL_WORKING_WITH_PERMISSION","WIDGET.CURRENT_PERSONNEL_NOT_WORKING","WIDGET.CURRENT_PERSONNEL_NOT_WORKING_PERMISSION","WIDGET.CURRENT_PERSONNEL_NOT_WORKING_OUT_WORKPLAN","WIDGET.CURRENT_PERSONNEL_NOT_WORKING_WORKPLAN","WIDGET.CURRENT_PERSONNEL_NOT_WORKING_HOLIDAYS","WIDGET.CURRENT_PERSONNEL_NOT_WORKING_BREAK","WIDGET.CURRENT_PERSONNEL_WORKING_OUT_REGION","WIDGET.CURRENT_PERSONNEL_WORKING_HOLIDAYS","WIDGET.CURRENT_PERSONNEL_WORKING_BREAK"]).subscribe(t=>{let i={name:t["WIDGET.CURRENT_PERSONNEL_TOTAL"],color:"#000",children:[{name:t["WIDGET.CURRENT_PERSONNEL_NOT_WORKING"],tooltip:this.getToolTipText(e.notWorking,t["WIDGET.CURRENT_PERSONNEL_NOT_WORKING"]),color:"#F83838",type:{working:!1},children:[{name:t["WIDGET.CURRENT_PERSONNEL_NOT_WORKING_OUT_WORKPLAN"],tooltip:this.getToolTipText(k.getCount(e.notWorkingDistribution,c.AtOutOfWorkingHours),t["WIDGET.CURRENT_PERSONNEL_NOT_WORKING_OUT_WORKPLAN"]),color:I.getColor(!1,c.AtOutOfWorkingHours),type:{working:!1,status:c.AtOutOfWorkingHours},value:k.getCount(e.notWorkingDistribution,c.AtOutOfWorkingHours)},{name:t["WIDGET.CURRENT_PERSONNEL_NOT_WORKING_PERMISSION"],tooltip:this.getToolTipText(k.getCount(e.notWorkingDistribution,c.AtOffTimePermission),t["WIDGET.CURRENT_PERSONNEL_NOT_WORKING_PERMISSION"]),color:I.getColor(!1,c.AtOffTimePermission),type:{working:!1,status:c.AtOffTimePermission},children:[{name:t["WIDGET.CURRENT_PERSONNEL_WORKING_IN_REGION"],tooltip:this.getToolTipText(k.getCount(e.notWorkingDistribution,c.AtOffTimePermission,!0),t["WIDGET.CURRENT_PERSONNEL_WORKING_IN_REGION"]),color:I.getColor(!1,c.AtOffTimePermission,!0),type:{working:!1,status:c.AtOffTimePermission,inRegion:!0},value:k.getCount(e.notWorkingDistribution,c.AtOffTimePermission,!0)},{name:t["WIDGET.CURRENT_PERSONNEL_WORKING_OUT_REGION"],tooltip:this.getToolTipText(k.getCount(e.notWorkingDistribution,c.AtOffTimePermission,!1),t["WIDGET.CURRENT_PERSONNEL_WORKING_OUT_REGION"]),color:I.getColor(!1,c.AtOffTimePermission,!1),type:{working:!1,status:c.AtOffTimePermission,inRegion:!1},value:k.getCount(e.notWorkingDistribution,c.AtOffTimePermission,!1)}]},{name:t["WIDGET.CURRENT_PERSONNEL_NOT_WORKING_HOLIDAYS"],tooltip:this.getToolTipText(k.getCount(e.notWorkingDistribution,c.AtHoliday),t["WIDGET.CURRENT_PERSONNEL_NOT_WORKING_HOLIDAYS"]),color:I.getColor(!1,c.AtHoliday),type:{working:!1,status:c.AtHoliday},value:k.getCount(e.notWorkingDistribution,c.AtHoliday)},{name:t["WIDGET.CURRENT_PERSONNEL_NOT_WORKING_WORKPLAN"],tooltip:this.getToolTipText(k.getCount(e.notWorkingDistribution,c.AtWorkingHours),t["WIDGET.CURRENT_PERSONNEL_NOT_WORKING_WORKPLAN"]),color:I.getColor(!1,c.AtWorkingHours),type:{working:!1,status:c.AtWorkingHours},value:k.getCount(e.notWorkingDistribution,c.AtWorkingHours)},{name:t["WIDGET.CURRENT_PERSONNEL_NOT_WORKING_BREAK"],tooltip:this.getToolTipText(k.getCount(e.notWorkingDistribution,c.AtBreak),t["WIDGET.CURRENT_PERSONNEL_NOT_WORKING_BREAK"]),color:I.getColor(!1,c.AtBreak),type:{working:!1,status:c.AtBreak},value:k.getCount(e.notWorkingDistribution,c.AtBreak)}]},{name:t["WIDGET.CURRENT_PERSONNEL_WORKING"],tooltip:this.getToolTipText(e.working,t["WIDGET.CURRENT_PERSONNEL_WORKING"]),color:"#45a84c",type:{working:!0},children:[{name:t["WIDGET.CURRENT_PERSONNEL_WORKING_OUT_WORKPLAN"],tooltip:this.getToolTipText(k.getCount(e.workingDistribution,c.AtOutOfWorkingHours),t["WIDGET.CURRENT_PERSONNEL_WORKING_OUT_WORKPLAN"]),color:I.getColor(!0,c.AtOutOfWorkingHours),type:{working:!0,status:c.AtOutOfWorkingHours},value:k.getCount(e.workingDistribution,c.AtOutOfWorkingHours)},{name:t["WIDGET.CURRENT_PERSONNEL_WORKING_WITH_PERMISSION"],tooltip:this.getToolTipText(k.getCount(e.workingDistribution,c.AtOffTimePermission),t["WIDGET.CURRENT_PERSONNEL_WORKING_WITH_PERMISSION"]),color:I.getColor(!0,c.AtOffTimePermission),type:{working:!0,status:c.AtOffTimePermission},value:k.getCount(e.workingDistribution,c.AtOffTimePermission)},{name:t["WIDGET.CURRENT_PERSONNEL_WORKING_HOLIDAYS"],tooltip:this.getToolTipText(k.getCount(e.workingDistribution,c.AtHoliday),t["WIDGET.CURRENT_PERSONNEL_WORKING_HOLIDAYS"]),color:I.getColor(!0,c.AtHoliday),type:{working:!0,status:c.AtHoliday},value:k.getCount(e.workingDistribution,c.AtHoliday)},{name:t["WIDGET.CURRENT_PERSONNEL_WORKING_NORMAL"],tooltip:this.getToolTipText(k.getCount(e.workingDistribution,c.AtWorkingHours),t["WIDGET.CURRENT_PERSONNEL_WORKING_NORMAL"]),color:I.getColor(!0,c.AtWorkingHours),type:{working:!0,status:c.AtWorkingHours},children:[{name:t["WIDGET.CURRENT_PERSONNEL_WORKING_IN_REGION"],tooltip:this.getToolTipText(k.getCount(e.workingDistribution,c.AtWorkingHours,!0),t["WIDGET.CURRENT_PERSONNEL_WORKING_IN_REGION"]),color:I.getColor(!0,c.AtWorkingHours,!0),type:{working:!0,status:c.AtWorkingHours,inRegion:!0},value:k.getCount(e.workingDistribution,c.AtWorkingHours,!0)},{name:t["WIDGET.CURRENT_PERSONNEL_WORKING_OUT_REGION"],tooltip:this.getToolTipText(k.getCount(e.workingDistribution,c.AtWorkingHours,!1),t["WIDGET.CURRENT_PERSONNEL_WORKING_OUT_REGION"]),color:I.getColor(!0,c.AtWorkingHours,!1),type:{working:!0,status:c.AtWorkingHours,inRegion:!1},value:k.getCount(e.workingDistribution,c.AtWorkingHours,!1)}]},{name:t["WIDGET.CURRENT_PERSONNEL_WORKING_BREAK"],tooltip:this.getToolTipText(k.getCount(e.workingDistribution,c.AtBreak),t["WIDGET.CURRENT_PERSONNEL_WORKING_BREAK"]),color:I.getColor(!0,c.AtBreak),type:{working:!0,status:c.AtBreak},children:[{name:t["WIDGET.CURRENT_PERSONNEL_WORKING_IN_REGION"],tooltip:this.getToolTipText(k.getCount(e.workingDistribution,c.AtBreak,!0),t["WIDGET.CURRENT_PERSONNEL_WORKING_IN_REGION"]),color:I.getColor(!0,c.AtBreak,!0),type:{working:!0,status:c.AtBreak,inRegion:!0},value:k.getCount(e.workingDistribution,c.AtBreak,!0)},{name:t["WIDGET.CURRENT_PERSONNEL_WORKING_OUT_REGION"],tooltip:this.getToolTipText(k.getCount(e.workingDistribution,c.AtBreak,!1),t["WIDGET.CURRENT_PERSONNEL_WORKING_OUT_REGION"]),color:I.getColor(!0,c.AtBreak,!1),type:{working:!0,status:c.AtBreak,inRegion:!1},value:k.getCount(e.workingDistribution,c.AtBreak,!1)}]}]}]};this.updateSelectedDateView(),this.chartData={data:i};let s=Le(i),n=this.getTotal(s);s.value=n,this.listData={data:s},this.visibleComponent=!0})})}getTotal(e){return e.value||(e.value=0),e.children&&e.children.forEach(t=>{e.value+=this.getTotal(t)}),e.value}getToolTipText(e,t){return"<span class='main'><cds-icon shape='"+(e>1?"users":"user")+"' class='cds-icon-18 me-2' solid></cds-icon>"+e+"</span><span>"+t+"</span>"}showList(e,t){this.startSubscriptionInterval(),this.modalService.open(Ye,{settings:{size:"xxl",scrollable:!0,centered:!1},props:{listType:ge.Distribution,employeeStatusAtSegment:e,idBasedUserFilter:this.request.idBasedUserFilter,title:t,workPlanIds:this.request.workPlanIds,selectedDate:this.selectedDate}}).result.then(i=>{}).catch(i=>{})}onValueClicked(e){this.showList(e.type,e.name)}onCenterClicked(e){this.showList({},"WIDGET.CURRENT_PERSONNEL_TOTAL")}onSettingsClicked(){this.selectedOrganizationUnitIds=this.request.idBasedUserFilter.organizationUnitIds,this.drawerRef=this.drawerService.create({nzContent:this.drawerTemplate,nzClosable:!1,nzWidth:$(!0),nzContentParams:{value:""}})}onCancelClicked(){this.drawerRef.close()}onSaveClicked(){this.request.idBasedUserFilter.organizationUnitIds=this.selectedOrganizationUnitIds,this.drawerRef.close(),this.dataUpdated.emit({organizationUnitIds:this.request.idBasedUserFilter.organizationUnitIds,widgetId:this.widgetId}),this.startSubscriptionInterval()}onSwitchViewClicked(e){this.viewState==1?this.viewState=2:this.viewState=1}onDetailClicked(e){this.routingService.gotoAnalysisPacsUnitMonthly()}updateSelectedDateView(){this.selectedDateText=d.fromJSDate(this.selectedDate).toLocaleString(d.DATETIME_MED)}onDateChanged(e){this.selectedNow=!1,this.startSubscriptionInterval()}onDateRemoved(e){this.selectedDate=new Date,this.selectedNow=!0,this.startSubscriptionInterval()}onReportClicked(e){this.routingService.gotoReportPacsMoment(this.selectedNow?new Date:this.selectedDate)}static ctorParameters=()=>[{type:N},{type:D},{type:E},{type:R},{type:G},{type:U}];static propDecorators={drawerTemplate:[{type:P,args:["drawerTemplate"]}],widgetData:[{type:h}],widgetId:[{type:h}],dataUpdated:[{type:v}]}};Ut=Mo([p({selector:"armon-widget-pacs-personnel-count",template:un,animations:[pe],standalone:!0,providers:[{provide:bt,useClass:It}],imports:[u,q,wt,_,ce,he,$t,Ie,V,S,X,f],styles:[fn]})],Ut);var vn=`<div class="widget-data-container" *ngIf="visibleComponent && currentState">
    <div class="widget-header-container">
        <span class="widget-title">{{'WIDGET.TOTAL_PERSONNEL_STATE'|translate}}</span>
        <span class="widget-sub-title"
            *ngIf="!currentState.organizations">{{'WIDGET.ORGANIZATION_ALL_UNITS'|translate}}</span>
        <span class="widget-sub-title text-truncate"
            *ngIf="currentState.organizations">{{currentState.organizations}}</span>
    </div>
    <div class="widget-button-container">
        <!-- PACS_ANALYSIS_HIDE -->
        <!-- <cds-icon shape="analysis_charts" style="width: 18px; height: 18px;" (click)="onDetailClicked()"
            title="{{'ANALYZE.DETAILED'|translate}} - {{'PAGES.ANALYSIS_PACS_ORG_DAILY_SUMMARY' | translate}}"></cds-icon> -->
        <cds-icon shape="calendar" style="width: 18px; height: 18px;" class="cursor-pointer me-2" [owlDateTimeTrigger]="datepicker" nz-tooltip
            nzTooltipTitle="{{'PLACEHOLDER.DATE_SELECT' | translate}}"></cds-icon>
        <input [(ngModel)]="selectedDate" [owlDateTime]="datepicker" class="date-select-input"
            (dateTimeChange)="onDateChanged($event)" [max]="nowDate">
        <owl-date-time [firstDayOfWeek]="1" [pickerType]="'calendar'" #datepicker>
        </owl-date-time>
        <cds-icon shape="bars" style="width: 18px; height: 18px;" class="cursor-pointer me-2" nz-tooltip
            nzTooltipTitle="{{'BUTTON.CATEGORIES' | translate}}" nz-dropdown [nzDropdownMenu]="menuCategory"></cds-icon>
        <nz-dropdown-menu #menuCategory="nzDropdownMenu">
            <ul nz-menu>
                <li nz-menu-item *ngFor="let category of responseData; let index=index;"
                    (click)="onMenuItemClicked(index)">
                    {{category.title}}</li>
            </ul>
        </nz-dropdown-menu>
        <cds-icon shape="cog" style="width: 18px; height: 18px;" class="cursor-pointer" *ngIf="permissionSearchOrganizationUnit"
            (click)="onSettingsClicked()" nz-tooltip nzTooltipTitle="{{'COMMON.SETTINGS' | translate}}"></cds-icon>
    </div>
    <div class="data-navigation-container">
        <div class="data-arrow-button" (click)="onPrevDataClicked($event)">
            <cds-icon shape="angle" direction="left" size="md"></cds-icon>
        </div>
        <div class="data-navigation-title">
            <span class="data-title">{{selectedCategory.title}}</span>
            <span class="text-center text-45rem text-italic cursor-pointer">
                <span [owlDateTimeTrigger]="datepicker">{{selectedDateText}}</span>
                <cds-icon shape="history" class="cursor-pointer ms-2" *ngIf="!isToday" size="sm"
                    (click)="onDateRemoved($event)" title="{{'WIDGET.TOTAL_PERSONNEL_STATE_SHOw_NOW'|translate}}">
                </cds-icon>
            </span>
        </div>
        <div class="data-arrow-button" (click)="onNextDataClicked($event)">
            <cds-icon shape="angle" direction="right" size="md"></cds-icon>
        </div>
    </div>
    <div class="chart-container">
        <d3-pie-chart [chartData]="chartData" [chartLabels]="chartLabels" [chartColors]="chartColors"
            [chartOptions]="chartOptions" (valueClicked)="onValueClicked($event)"></d3-pie-chart>
    </div>
    <div class="legend-container">
        <ng-container *ngFor="let value of selectedCategory.data.values;let index = index">
            <div class="legend-item" [ngClass]="{'legend-left': index==1}" (click)="onLegendClicked(index)">
                <div class="legend-value" [ngStyle]="{'color': selectedCategory.data.colors[index]}">{{value}}</div>
                <div class="legend-title" [ngStyle]="{'color': selectedCategory.data.colors[index]}">
                    {{selectedCategory.data.labels[index]}}</div>
            </div>
        </ng-container>
    </div>
</div>

<div class="no-data-container" *ngIf="visibleComponent && currentState==null">
    <p class="p2 message">
        <cds-icon shape="info-standard"></cds-icon>
        {{'WIDGET.NO_WIDGET_DATA_INFO' | translate}}
    </p>
</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">{{'WIDGET.TOTAL_PERSONNEL_STATE'|translate}}</span>
            <span class="text-sm">{{'WIDGET.LAST_UPDATE_DATE' | translate}} :
                {{currentState.updateDate}}</span>
            <div class="w-100 mt-3">
                <label class="report-form-label">{{'REPORT.ORGANIZATION_UNITS' | translate}}</label>
                <armon-select-search query="unit" [allowMulti]="true" [(ngModel)]="selectedOrganizationUnitIds">
                </armon-select-search>
            </div>
        </div>
        <div class="col-12 d-flex justify-content-end mt-3">
            <button class="btn btn-sm btn-outline-primary me-2"
                (click)="onCancelClicked($event)">{{'BUTTON.CANCEL'|translate}}</button>
            <button class="btn btn-sm btn-primary" (click)="onSaveClicked($event)">{{'BUTTON.SAVE'|translate}}</button>
        </div>
    </div>
</ng-template>`;var In=`.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}.widget-host-container,:host{display:block;position:relative;padding:6px;width:100%;height:100%;color:#0a2a5a}.widget-data-container{width:100%;height:100%;padding:12px;position:relative}@media screen and (max-width: 768px){.widget-data-container{padding:6px}}.widget-data-container .widget-button-container{position:absolute;right:6px;top:6px;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex}.widget-data-container .widget-header-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;padding-right:48px}.widget-data-container .widget-header-container .widget-title{font-size:14px;line-height:14px;color:#0a2a5a;margin-bottom:6px;font-weight:500}.widget-data-container .widget-header-container .widget-sub-title{font-size:9px;line-height:10px;color:#999}.widget-data-container .widget-settings-container{position:absolute;inset:0;background-color:#fff;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;padding:12px}.widget-data-container .widget-settings-container .widget-settings-title{font-size:12px;line-height:12px;color:#0a2a5a;margin-bottom:12px}.widget-data-container .widget-settings-container .widget-settings-label{font-size:12px;line-height:12px;color:#999;margin-bottom:6px}:host .category-button{padding:0;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex}:host .data-container{width:100%;height:100%;padding:.3rem}:host .blur-data-container{-webkit-filter:blur(3px);-moz-filter:blur(3px);-ms-filter:blur(3px);-o-filter:blur(3px);filter:blur(3px)}:host .title{font-size:.84rem;color:#0a2a5a}:host .date-select-input{visibility:hidden;width:0;position:absolute;top:0;left:0}:host .chart-container{display:block;margin:0;padding:0;height:260px}:host .legend-container{padding:0 12px 12px;position:absolute;bottom:0;right:0;left:0;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-box-direction:reverse;-moz-box-direction:reverse;-webkit-flex-direction:row-reverse;-moz-flex-direction:row-reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse;-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}:host .legend-container .legend-item{cursor:pointer;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-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center;transition:transform .25s;width:40%;padding:0 12px}:host .legend-container .legend-item .legend-value{color:#e2e2e2;font-size:2.016rem;font-weight:lighter;text-align:right;margin-right:9px}:host .legend-container .legend-item .legend-title{font-size:.672rem;font-weight:500;color:#999;text-align:left}:host .legend-container .legend-item:hover{transform:translateY(-4px)}:host .legend-container .legend-left{border-right:1px solid #CCC;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;-webkit-box-direction:reverse;-moz-box-direction:reverse;-webkit-flex-direction:row-reverse;-moz-flex-direction:row-reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host .legend-container .legend-left .legend-value{text-align:right;margin-right:initial;margin-left:9px}:host .legend-container .legend-left .legend-title{text-align:right}:host .data-navigation-container{padding:.3rem;-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem;margin-top:12px;background-color:#f8f9fa;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-pack:justify;-moz-box-pack:justify;-webkit-flex-pack:justify;-ms-flex-pack:justify;-moz-justify-content:space-between;-webkit-justify-content:space-between;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center}:host .data-navigation-container .data-navigation-title{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-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center}:host .data-navigation-container .data-navigation-title .data-title{text-align:center;font-size:.714rem;font-weight:500;color:#0a2a5a;-webkit-flex-grow:1;-webkit-box-flex:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1}:host .data-navigation-container .data-arrow-button{padding:4px;cursor:pointer;-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem}:host .data-navigation-container .data-arrow-button:hover{background-color:#cde1ec}:host .no-data-container{height:100%;width:100%;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-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center;font-size:.672rem;color:#999}
`;var Sn=zi(ds());var kn=[Xi("slideInOut",[pi(":enter",[xt({transform:"translateY(-20%)"}),mi("300ms",xt({transform:"translateY(0%)"}))]),pi(":leave",[mi("300ms",xt({transform:"translateY(-20%)"}))])])];var Go=function(r,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(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(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},Gt=class{router;pacsService;translate;authService;routingService;drawerService;modalService;drawerTemplate;drawerRef;widgetData;widgetId;dataUpdated=new w;request;requestInterval;currentState=null;visibleComponent=!1;subscriptionGetData;chartData;chartColors;chartLabels;chartOptions={type:j.PieChart,innerRadiusRatio:.8,customTooltip:!0,clickable:!0,centerLabelFontSize:12,centerValueFontSize:40,centerLabelRadiusRatio:1.6};responseData;selectedCategory;selectedIndex=0;translated;permissionSearchOrganizationUnit;delayTimeout=null;nowDate=new Date;selectedDate=new Date;selectedDateText;isToday=!0;selectedOrganizationUnitIds;constructor(e,t,i,s,n,o,a){this.router=e,this.pacsService=t,this.translate=i,this.authService=s,this.routingService=n,this.drawerService=o,this.modalService=a}ngOnInit(){this.request=bs.getEmptyModel(),this.request.idBasedUserFilter.organizationUnitIds=this.widgetData?this.widgetData:[],this.permissionSearchOrganizationUnit=this.authService.checkPermission(b.ORGANIZATIONUNIT.getReadBasic()),this.translate.get(["REPORT.WORKING_STATUS","WIDGET.DAILY_PERSONNEL_WORKING","WIDGET.DAILY_PERSONNEL_NOT_WORKING","WIDGET.DAILY_PERSONNEL_EXTRA_TITLE","WIDGET.DAILY_PERSONNEL_EXTRA_TIME","WIDGET.DAILY_PERSONNEL_EXTRA_NO","WIDGET.DAILY_PERSONNEL_START_TITLE","WIDGET.DAILY_PERSONNEL_START_LATE","WIDGET.DAILY_PERSONNEL_START_ON_TIME","WIDGET.DAILY_PERSONNEL_EXIT_TITLE","WIDGET.DAILY_PERSONNEL_EXIT_EARLY","WIDGET.DAILY_PERSONNEL_EXIT_ON_TIME","WIDGET.DAILY_PERSONNEL_TIME_TITLE","WIDGET.DAILY_PERSONNEL_TIME_NORMAL","WIDGET.DAILY_PERSONNEL_TIME_OUT","WIDGET.DAILY_PERSONNEL_TIME_PERMISSION","WIDGET.DAILY_PERSONNEL_MISSING_TITLE","WIDGET.DAILY_PERSONNEL_MISSING_NO","WIDGET.DAILY_PERSONNEL_MISSING_TIME","WIDGET.DAILY_PERSONNEL_NOT_WORKING_OUT","WIDGET.DAILY_PERSONNEL_NOT_WORKING_PERMISSION","WIDGET.DAILY_PERSONNEL_NOT_WORKING_NO_PERMISSION","WIDGET.DAILY_PERSONNEL_PERMISSION_NO","WIDGET.DAILY_PERSONNEL_PERMISSION_TIME","WIDGET.DAILY_PERSONNEL_PERMISSION_TITLE","WIDGET.DAILY_PERSONNEL_PERMISSION_DECLARED_TIME","WIDGET.DAILY_PERSONNEL_PERMISSION_DECLARED_TITLE","WIDGET.DAILY_PERSONNEL_PERMISSION_SOCIAL_TIME","WIDGET.DAILY_PERSONNEL_PERMISSION_SOCIAL_TITLE","WIDGET.DAILY_PERSONNEL_OTHERS","WIDGET.DAILY_PERSONNEL_START_EARLY_TITLE","WIDGET.DAILY_PERSONNEL_START_EARLY","WIDGET.DAILY_PERSONNEL_EXIT_LATE_TITLE","WIDGET.DAILY_PERSONNEL_EXIT_LATE"]).subscribe(e=>{this.translated=e,this.startSubscriptionInterval()})}ngOnDestroy(){this.requestInterval&&clearInterval(this.requestInterval),this.subscriptionGetData&&this.subscriptionGetData.unsubscribe()}startSubscriptionInterval(){this.requestInterval&&clearInterval(this.requestInterval),this.subscriptionGetData&&this.subscriptionGetData.unsubscribe(),this.nowDate=new Date,this.updateSelectedDateView(),this.requestInterval=setInterval(()=>{this.getData()},18e4),this.getData()}getData(){this.request.date=d.fromJSDate(this.selectedDate).toFormat("yyyy-MM-dd"),this.subscriptionGetData=this.pacsService.getCurrentWorkingCumulative(this.request).subscribe(e=>{this.currentState=e,this.responseData=[{title:this.translated["REPORT.WORKING_STATUS"],data:{type:z.Work,colors:[I.getColor(!0,c.AtWorkingHours),"#CCCCCC"],labels:[this.translated["WIDGET.DAILY_PERSONNEL_WORKING"],this.translated["WIDGET.DAILY_PERSONNEL_NOT_WORKING"]]}},{title:this.translated["WIDGET.DAILY_PERSONNEL_EXTRA_TITLE"],data:{type:z.ExtraWork,colors:[I.getColor(!0,c.AtOutOfWorkingHours),"#CCCCCC"],labels:[this.translated["WIDGET.DAILY_PERSONNEL_EXTRA_TIME"],this.translated["WIDGET.DAILY_PERSONNEL_OTHERS"]]}},{title:this.translated["WIDGET.DAILY_PERSONNEL_MISSING_TITLE"],data:{type:z.MissingWork,colors:[I.getColor(!1,c.AtWorkingHours),"#CCCCCC"],labels:[this.translated["WIDGET.DAILY_PERSONNEL_MISSING_TIME"],this.translated["WIDGET.DAILY_PERSONNEL_OTHERS"]]}},{title:this.translated["WIDGET.DAILY_PERSONNEL_START_TITLE"],data:{type:z.LateEntrance,colors:[I.getColor(!1,c.AtWorkingHours),"#CCCCCC"],labels:[this.translated["WIDGET.DAILY_PERSONNEL_START_LATE"],this.translated["WIDGET.DAILY_PERSONNEL_OTHERS"]]}},{title:this.translated["WIDGET.DAILY_PERSONNEL_EXIT_TITLE"],data:{type:z.EarlyLeave,colors:[I.getColor(!1,c.AtWorkingHours),"#CCCCCC"],labels:[this.translated["WIDGET.DAILY_PERSONNEL_EXIT_EARLY"],this.translated["WIDGET.DAILY_PERSONNEL_OTHERS"]]}},{title:this.translated["WIDGET.DAILY_PERSONNEL_START_EARLY_TITLE"],data:{type:z.EarlyStart,colors:[I.getColor(!0,c.AtOutOfWorkingHours),"#CCCCCC"],labels:[this.translated["WIDGET.DAILY_PERSONNEL_START_EARLY"],this.translated["WIDGET.DAILY_PERSONNEL_OTHERS"]]}},{title:this.translated["WIDGET.DAILY_PERSONNEL_EXIT_LATE_TITLE"],data:{type:z.LateLeave,colors:[I.getColor(!0,c.AtOutOfWorkingHours),"#CCCCCC"],labels:[this.translated["WIDGET.DAILY_PERSONNEL_EXIT_LATE"],this.translated["WIDGET.DAILY_PERSONNEL_OTHERS"]]}},{title:this.translated["WIDGET.DAILY_PERSONNEL_PERMISSION_TITLE"],data:{type:z.OffTimePermission,colors:[I.getColor(!1,c.AtOffTimePermission),"#CCCCCC"],labels:[this.translated["WIDGET.DAILY_PERSONNEL_PERMISSION_TIME"],this.translated["WIDGET.DAILY_PERSONNEL_OTHERS"]]}},{title:this.translated["WIDGET.DAILY_PERSONNEL_PERMISSION_DECLARED_TITLE"],data:{type:z.DeclaredWork,colors:[I.getColor(!1,c.AtOffTimePermission),"#CCCCCC"],labels:[this.translated["WIDGET.DAILY_PERSONNEL_PERMISSION_DECLARED_TIME"],this.translated["WIDGET.DAILY_PERSONNEL_OTHERS"]]}},{title:this.translated["WIDGET.DAILY_PERSONNEL_PERMISSION_SOCIAL_TITLE"],data:{type:z.ShouldBeIgnoredWork,colors:[I.getColor(!1,c.AtOffTimePermission),"#CCCCCC"],labels:[this.translated["WIDGET.DAILY_PERSONNEL_PERMISSION_SOCIAL_TIME"],this.translated["WIDGET.DAILY_PERSONNEL_OTHERS"]]}}],this.responseData=this.prepareData(this.responseData),setTimeout(()=>{this.updateSelectedDateView(),this.setSelectedCategory(this.selectedIndex)},Bi(50,300))})}prepareData(e){return e.forEach(t=>{t.data.values=this.currentState.getTypeData(t.data.type),t.data.total=t.data.values.reduce((s,n)=>s+n,0),t.data.altColors=[],t.data.colors.forEach(s=>{t.data.altColors.push((0,Sn.default)(s).fade(.95))}),t.data.tooltips=[],t.data.eventItems=[{title:t.title,type:t.data.type,exists:!0},{title:t.title,type:t.data.type,exists:!1}];let i;t.data.values.forEach((s,n)=>{i=s>1?"users":"user",t.data.tooltips.push("<span class='main'><cds-icon shape='"+i+"' class='cds-icon-18 me-2' solid></cds-icon>"+s+"</span><span>"+t.data.labels[n]+"</span>")})}),e}setChartData(e){this.chartData={values:e.values,tooltips:e.tooltips,eventItems:e.eventItems},this.chartLabels={labels:e.labels},this.chartColors={colors:e.colors},this.visibleComponent=!0}setSelectedCategory(e){this.clearAutoSwipeTimeout(),this.selectedIndex=e,this.selectedCategory=this.responseData[e],this.setChartData(this.selectedCategory.data),this.delayTimeout=setTimeout(()=>{this.onNextDataClicked()},3e4)}showUserList(e,t,i){this.startSubscriptionInterval(),this.modalService.open(Ye,{settings:{size:"xxl",scrollable:!0,centered:!1},props:{listType:ge.Cumulative,idBasedUserFilter:this.request.idBasedUserFilter,title:i?e:this.translated["WIDGET.DAILY_PERSONNEL_OTHERS"]+" ("+e+")",workPlanIds:this.request.workPlanIds,selectedDate:this.selectedDate,binaryType:t,existing:i}}).result.then(s=>{}).catch(s=>{})}onValueClicked(e){this.showUserList(e.title,e.type,e.exists)}onLegendClicked(e){this.showUserList(this.selectedCategory.title,this.selectedCategory.data.type,e==0)}onNextDataClicked(e){this.clearAutoSwipeTimeout(),this.selectedIndex==this.responseData.length-1?this.setSelectedCategory(0):this.setSelectedCategory(this.selectedIndex+1)}onPrevDataClicked(e){this.clearAutoSwipeTimeout(),this.selectedIndex==0?this.setSelectedCategory(this.responseData.length-1):this.setSelectedCategory(this.selectedIndex-1)}clearAutoSwipeTimeout(){this.delayTimeout&&clearTimeout(this.delayTimeout)}onMenuItemClicked(e){this.clearAutoSwipeTimeout(),this.setSelectedCategory(e)}onSettingsClicked(){this.selectedOrganizationUnitIds=this.request.idBasedUserFilter.organizationUnitIds,this.drawerRef=this.drawerService.create({nzContent:this.drawerTemplate,nzClosable:!1,nzWidth:$(!0),nzContentParams:{value:""}})}onCancelClicked(){this.drawerRef.close()}onSaveClicked(){this.request.idBasedUserFilter.organizationUnitIds=this.selectedOrganizationUnitIds,this.drawerRef.close(),this.dataUpdated.emit({organizationUnitIds:this.request.idBasedUserFilter.organizationUnitIds,widgetId:this.widgetId}),this.startSubscriptionInterval()}onDetailClicked(e){this.routingService.gotoAnalysisPacsUnitMonthly()}updateSelectedDateView(){d.fromJSDate(this.selectedDate).toFormat("yyyy-MM-dd")==d.fromJSDate(this.nowDate).toFormat("yyyy-MM-dd")?(this.isToday=!0,this.selectedDateText=this.translate.instant("DATEPICKER.LABEL_TODAY")):(this.isToday=!1,this.selectedDateText=d.fromJSDate(this.selectedDate).toLocaleString(d.DATETIME_MED))}onDateChanged(e){this.clearAutoSwipeTimeout(),this.startSubscriptionInterval()}onDateRemoved(e){this.selectedDate=new Date,this.clearAutoSwipeTimeout(),this.startSubscriptionInterval()}static ctorParameters=()=>[{type:me},{type:N},{type:D},{type:E},{type:R},{type:G},{type:U}];static propDecorators={drawerTemplate:[{type:P,args:["drawerTemplate"]}],widgetData:[{type:h}],widgetId:[{type:h}],dataUpdated:[{type:v}]}};Gt=Go([p({selector:"armon-widget-pacs-personnel-count-daily",template:vn,animations:[pe,kn],standalone:!0,providers:[{provide:bt,useClass:It}],imports:[u,q,wt,_,Ge,Ue,S,$e,ie,Ne,V,X,f],styles:[In]})],Gt);var Cn=`<div class="widget-data-container">
    <div class="widget-header-container" *ngIf="visibleComponent">
        <span class="widget-title">{{title|translate}}<div class="spinner-grow spinner-grow-sm text-secondary ms-2"
                role="status" *ngIf="visibleSpinner"></div></span>
        <span class="widget-sub-title" *ngIf="isOrganizationWide">{{'WIDGET.ORGANIZATION_ALL_UNITS'|translate}}</span>
        <span class="widget-sub-title text-truncate" *ngIf="!isOrganizationWide">{{organizations}}</span>
    </div>
    <ng-container *ngIf="visibleComponent && chartData">
        <div class="widget-button-container" *ngIf="!showPersonal">
            <cds-icon shape="cog" style="width: 18px; height: 18px;" *ngIf="permissionSearchOrganizationUnit"
                (click)="onSettingsClicked()" class="cursor-pointer" title="{{'COMMON.SETTINGS' | translate}}">
            </cds-icon>
        </div>
        <div class="score-container">
            <div class="yesterday-container">
                <span class="me-1 color-gray-dark">{{'WIDGET.PACS_AVERAGE_TITLE' |translate}}</span><span
                    class="value me-4 color-gray-dark">{{averageScore}}</span>
                <span class="me-1 text-bold">{{lastPeriod |translate}}</span>
                <span class="value me-1 text-bold">{{score}}</span>
                <span [ngSwitch]="scoreState">
                    <cds-icon shape="minus" class="same" *ngSwitchCase="1"></cds-icon>
                    <cds-icon shape="angle-double" direction="up" *ngSwitchCase="2"></cds-icon>
                    <cds-icon shape="angle-double" direction="down" *ngSwitchCase="3"></cds-icon>
                </span>
            </div>
        </div>
        <div class="chart-container">
            <d3-bar-chart [chartData]="chartData" [chartLabels]="chartLabels" [chartColors]="chartColors"
                [chartOptions]="chartOptions" [yAxisRange]="yAxisRange" [averageValue]="averageValue" [clickable]="true"
                [xTickFunction]="xTickFunction" (valueClicked)="onValueClicked($event)"></d3-bar-chart>
        </div>
    </ng-container>
</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">{{title|translate}}</span>
            <div class="w-100 mt-3">
                <label class="report-form-label">{{'REPORT.ORGANIZATION_UNITS' | translate}}</label>
                <armon-select-search query="unit" [allowMulti]="true" [(ngModel)]="selectedOrganizationUnitIds">
                </armon-select-search>
            </div>
        </div>
        <div class="col-12 d-flex justify-content-end mt-3">
            <button class="btn btn-sm btn-outline-primary me-2"
                (click)="onCancelClicked($event)">{{'BUTTON.CANCEL'|translate}}</button>
            <button class="btn btn-sm btn-primary" (click)="onSaveClicked($event)">{{'BUTTON.SAVE'|translate}}</button>
        </div>
    </div>
</ng-template>`;var Tn=`.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}.widget-host-container,:host{display:block;position:relative;padding:6px;width:100%;height:100%;color:#0a2a5a}.widget-data-container{width:100%;height:100%;padding:12px;position:relative}@media screen and (max-width: 768px){.widget-data-container{padding:6px}}.widget-data-container .widget-button-container{position:absolute;right:6px;top:6px;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex}.widget-data-container .widget-header-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;padding-right:48px}.widget-data-container .widget-header-container .widget-title{font-size:14px;line-height:14px;color:#0a2a5a;margin-bottom:6px;font-weight:500}.widget-data-container .widget-header-container .widget-sub-title{font-size:9px;line-height:10px;color:#999}.widget-data-container .widget-settings-container{position:absolute;inset:0;background-color:#fff;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;padding:12px}.widget-data-container .widget-settings-container .widget-settings-title{font-size:12px;line-height:12px;color:#0a2a5a;margin-bottom:12px}.widget-data-container .widget-settings-container .widget-settings-label{font-size:12px;line-height:12px;color:#999;margin-bottom:6px}:host::ng-deep .optionContainer{max-height:110px!important}:host::ng-deep .optionListContainer{max-height:100px!important}:host .chart-container{display:block;margin:0;padding:0;height:130px}:host .score-container{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-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}:host .score-container .yesterday-container{color:#0a2a5a;padding:.1rem;font-size:.588rem;line-height:.5rem}:host .score-container .yesterday-container .value{font-size:.6rem;line-height:.65rem}:host .score-container .yesterday-container .same{-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem;background-color:#0369a1;color:#fff;margin-bottom:4px;margin-right:4px}:host .score-container .yesterday-container .up{-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem;background-color:#62a325;color:#fff;margin-bottom:4px;margin-right:4px}:host .score-container .yesterday-container .down{-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem;background-color:#c82602;color:#fff;margin-bottom:4px;margin-right:4px}
`;var ct;(function(r){r[r.Daily=1]="Daily",r[r.Weekly=2]="Weekly",r[r.Monthly=3]="Monthly",r[r.Annual=4]="Annual"})(ct||(ct={}));var Vo=function(r,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(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(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},jt=class{pacsService;translate;authService;router;routingService;drawerService;drawerTemplate;drawerRef;userId;showMonthly=!1;showPersonal=!0;widgetData;widgetId;dataUpdated=new w;selectedOrganizationUnitIds=[];updateDate;organizations;isOrganizationWide;visibleComponent=!1;visibleSpinner=!0;score=null;averageScore=null;scoreState;title;lastPeriod;worksummaryScoresRequest;subscriptionGetData;permissionSearchOrganizationUnit;chartData;chartColors;chartLabels;chartOptions={type:j.BarChart};yAxisRange;averageValue;xTickFunction;constructor(e,t,i,s,n,o){this.pacsService=e,this.translate=t,this.authService=i,this.router=s,this.routingService=n,this.drawerService=o}ngOnInit(){this.permissionSearchOrganizationUnit=this.authService.checkPermission(b.ORGANIZATIONUNIT.getReadBasic()),this.getData(),this.visibleComponent=!0}ngOnDestroy(){this.subscriptionGetData&&this.subscriptionGetData.unsubscribe()}getData(){if(this.visibleSpinner=!0,this.showPersonal)if(this.showMonthly){this.title="WIDGET.PACS_PERFORMANCE_MONTHLY_USER",this.lastPeriod="WIDGET.PACS_LAST_MONTH_TITLE";let e=new ui;e.dateRange=new De,e.period=ct.Monthly,e.dateRange.startDateTime=d.local().minus({months:30}).startOf("month").toJSDate(),e.dateRange.endDateTime=d.local().minus({months:1}).endOf("month").toJSDate(),this.subscriptionGetData=this.pacsService.getUserMonthlyPacsPerformance(e,this.userId).subscribe(t=>{this.setChartData(t)})}else{this.title="WIDGET.PACS_PERFORMANCE_DAILY_USER",this.lastPeriod="WIDGET.PACS_YESTERDAY_TITLE";let e=new ui;e.dateRange=new De,e.period=ct.Daily,e.dateRange.startDateTime=d.local().minus({days:30}).startOf("day").toJSDate(),e.dateRange.endDateTime=d.local().minus({days:1}).endOf("day").toJSDate(),this.subscriptionGetData=this.pacsService.getUserDailyPacsPerformance(e,this.userId).subscribe(t=>{this.setChartData(t)})}else this.title="WIDGET.PACS_PERFORMANCE",this.lastPeriod="WIDGET.PACS_YESTERDAY_TITLE",this.worksummaryScoresRequest=ys.getEmptyModel(),this.worksummaryScoresRequest.dateRange.startDateTime=d.local().minus({days:30}).startOf("day").toFormat("yyyy-MM-dd"),this.worksummaryScoresRequest.dateRange.endDateTime=d.local().minus({days:1}).endOf("day").toFormat("yyyy-MM-dd"),this.widgetData&&this.widgetData.length>0&&(this.worksummaryScoresRequest.idBasedUserFilter.organizationUnitIds=this.widgetData),this.subscriptionGetData=this.pacsService.getOrganizationPacsPerformance(this.worksummaryScoresRequest).subscribe(e=>{this.setChartDataV2(e),this.updateDate=e.updateDate,this.organizations=e.organizations,this.isOrganizationWide=!this.organizations})}setChartData(e){let t=[],i=[],s=[],n=0;e.items.forEach(l=>{l.scoreWithoutExtraWork&&(t.push(l.scoreWithoutExtraWork),this.showMonthly?(i.push("<span class='main'>"+l.scoreWithoutExtraWork+"</span><span>"+d.fromJSDate(l.date?l.date:l.startDate).toFormat("MMMM yyyy"))+"",s.push(d.fromJSDate(l.date?l.date:l.startDate).toFormat("MMM"))):(i.push("<span class='main'>"+l.scoreWithoutExtraWork+"</span><span>"+d.fromJSDate(l.date?l.date:l.startDate).toFormat("DDD EEEE"))+"",s.push(d.fromJSDate(l.date?l.date:l.startDate).toFormat("d.MM"))),n+=l.scoreWithoutExtraWork)}),this.chartLabels={labels:s},this.chartData={values:t,tooltips:i},this.averageScore=Math.round(n/t.length),this.score=t[t.length-1];let o=t[t.length-2];this.score==o?this.scoreState=1:this.score>o?this.scoreState=2:this.scoreState=3;let a=[];t.forEach(l=>{l>=this.averageScore?a.push("#62A325"):a.push("#C82602")}),this.chartColors={colors:a},this.averageValue=this.averageScore,this.yAxisRange=100,this.xTickFunction=l=>{let g=l.split(".");if(g.length>1){let x=parseInt(g[0]);return x===1?l:x.toString()}else return l},setTimeout(()=>{this.visibleSpinner=!1},500)}setChartDataV2(e){let t=[],i=[],s=[],n=[],o=0,a=0;e.scores.forEach(x=>{t.push(x.score),i.push("<span class='main'>"+x.score+"</span><span>"+d.fromISO(x.date).toFormat("DDD EEEE"))+"",s.push(d.fromISO(x.date).toFormat("d.MM")),n.push({day:x.date}),!Hi(x.score)&&!Vi(x.score)&&(o+=x.score,a++)}),this.chartLabels={labels:s},this.chartData={values:t,tooltips:i,eventObjects:n},this.averageScore=Math.round(o/a),this.score=t[t.length-1];let l=t[t.length-2];this.score==l?this.scoreState=1:this.score>l?this.scoreState=2:this.scoreState=3;let g=[];t.forEach(x=>{g.push(zt.getColorByScore(x))}),this.chartColors={colors:g},this.averageValue=this.averageScore,this.yAxisRange=100,this.xTickFunction=x=>{let L=x.split(".");if(L.length>1){let H=parseInt(L[0]);return H===1?x:H.toString()}else return x},setTimeout(()=>{this.visibleSpinner=!1},500)}onSettingsClicked(){this.selectedOrganizationUnitIds=this.widgetData?this.widgetData:[],this.drawerRef=this.drawerService.create({nzContent:this.drawerTemplate,nzClosable:!1,nzWidth:$(!0),nzContentParams:{value:""}})}onCancelClicked(){this.drawerRef.close()}onValueClicked(e){this.routingService.gotoReportPacsDaily(e.day,{idBasedUserFilter:this.worksummaryScoresRequest.idBasedUserFilter})}onSaveClicked(){this.drawerRef.close(),this.widgetData=this.selectedOrganizationUnitIds,this.dataUpdated.emit({organizationUnitIds:this.selectedOrganizationUnitIds,widgetId:this.widgetId}),this.subscriptionGetData&&this.subscriptionGetData.unsubscribe(),this.getData()}onReportClicked(e){this.widgetData&&this.router.navigate([Re.REPORT_PACS_DAILY.fullPath],{state:{organizationUnitIds:this.widgetData,datePicker:ee.LastMonth}})}static ctorParameters=()=>[{type:N},{type:D},{type:E},{type:me},{type:R},{type:G}];static propDecorators={drawerTemplate:[{type:P,args:["drawerTemplate"]}],userId:[{type:h}],showMonthly:[{type:h}],showPersonal:[{type:h}],widgetData:[{type:h}],widgetId:[{type:h}],dataUpdated:[{type:v}]}};jt=Vo([p({selector:"armon-widget-pacs-performance",template:Cn,animations:[pe],standalone:!0,imports:[u,ce,he,Gs,X,_,f],styles:[Tn]})],jt);var Rn=`<div class="widget-data-container">
    <div class="widget-header-container">
        <span class="widget-title">{{widgetTitle|translate}}<div
                class="spinner-grow spinner-grow-sm text-secondary ms-2" role="status" *ngIf="visibleSpinner"></div>
            </span>
        <span class="widget-sub-title" *ngIf="isOrganizationWide">{{'WIDGET.ORGANIZATION_ALL_UNITS'|translate}}</span>
        <span class="widget-sub-title text-truncate" *ngIf="!isOrganizationWide">{{organizations}}</span>
    </div>
    <div class="widget-button-container">
        <cds-icon shape="cog" style="width: 18px; height: 18px;" (click)="onSettingsClicked()" class="cursor-pointer"
            title="{{'COMMON.SETTINGS' | translate}}">
        </cds-icon>
    </div>
    <div *ngIf="items && items.length>0" class="pe-1 items-container" [attr.id]="widgetId">
        <ng-container *ngFor="let item of items">
            <div class="d-flex my-2 mx-1 p-2 hover-secondary item-container cursor-pointer rnd-1"
                (click)="onIdentityClicked(item)">
                <armon-captionlines *ngIf="item.userCaptions" [showBorder]="false" [captionlines]="item.userCaptions">
                </armon-captionlines>
                <div class="d-flex flex-column" style="min-width: 140px;">
                    <armon-duration-formatter [data]="item.durationData" minimal="true"></armon-duration-formatter>
                    <span class="text-xxs text-black-50">{{item.workDays}}
                        {{'REPORT.PACS_UNIT_DAY'|translate}}</span>
                </div>
            </div>
        </ng-container>
    </div>
    <div>
        <armon-pagination [paginationResponse]="paginationResponse" [scrollDomId]="widgetId"
            (pageChanged)="pageChanged($event)"></armon-pagination>
    </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">{{widgetTitle|translate}}</span>
            <div class="row">
                <div class="col-12 mb-3">
                    <armon-date-picker #datePicker [options]="datePickerOptions"
                        (selectionChanged)="onDateSelectionChanged($event)">
                    </armon-date-picker>
                </div>
                <div class="col-12 mb-3" *ngIf="permissionSearchOrganizationUnit">
                    <label class="report-form-label">{{'REPORT.ORGANIZATION_UNITS' | translate}}</label>
                    <armon-select-search query="unit" [allowMulti]="true" [(ngModel)]="selectedOrganizationUnitIds">
                    </armon-select-search>
                    <label class="report-checkbox-label" nz-checkbox
                        *ngIf="selectedOrganizationUnitIds && selectedOrganizationUnitIds.length > 0"
                        [(ngModel)]="selectedHierarchical">{{'REPORT.SHOW_HIERARCHICALLY' | translate}}</label>
                </div>
                <div class="col-12 mb-3" *ngIf="permissionSearchIdentity">
                    <label class="report-form-label">{{'REPORT.IDENTITIES' | translate :
                        languageService.userTranslate}}</label>
                    <armon-select-search query="identity" [allowMulti]="true" [(ngModel)]="selectedIdentityIds">
                    </armon-select-search>
                </div>
                <div class="col-12 mb-3" *ngIf="permissionSearchWorkplans">
                    <label class="report-form-label">{{'REPORT.WORKPLANS' | translate}}</label>
                    <armon-select-search query="workplan" [allowMulti]="true" [(ngModel)]="selectedWorkplanIds">
                    </armon-select-search>
                </div>
                <div class="col-12 mb-3" *ngIf="permissionSearchUserGroup">
                    <label class="report-form-label">{{'REPORT.USER_GROUPS' | translate :
                        languageService.userTranslate}}</label>
                    <armon-select-search query="group" [allowMulti]="true" [(ngModel)]="selectedUserGroupIds">
                    </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-2"
                (click)="onCancelClicked($event)">{{'BUTTON.CANCEL'|translate}}</button>
            <button class="btn btn-sm btn-primary" (click)="onSaveClicked($event)">{{'BUTTON.SAVE'|translate}}</button>
        </div>
    </div>
</ng-template>`;var En=`.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}.widget-host-container,:host{display:block;position:relative;padding:6px;width:100%;height:100%;color:#0a2a5a}.widget-data-container{width:100%;height:100%;padding:12px;position:relative}@media screen and (max-width: 768px){.widget-data-container{padding:6px}}.widget-data-container .widget-button-container{position:absolute;right:6px;top:6px;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex}.widget-data-container .widget-header-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;padding-right:48px}.widget-data-container .widget-header-container .widget-title{font-size:14px;line-height:14px;color:#0a2a5a;margin-bottom:6px;font-weight:500}.widget-data-container .widget-header-container .widget-sub-title{font-size:9px;line-height:10px;color:#999}.widget-data-container .widget-settings-container{position:absolute;inset:0;background-color:#fff;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;padding:12px}.widget-data-container .widget-settings-container .widget-settings-title{font-size:12px;line-height:12px;color:#0a2a5a;margin-bottom:12px}.widget-data-container .widget-settings-container .widget-settings-label{font-size:12px;line-height:12px;color:#999;margin-bottom:6px}:host .items-container{height:-webkit-calc(100% - 2.8rem);height:-moz-calc(100% - 2.8rem);height:calc(100% - 2.8rem);overflow-y:auto}:host .item-container{-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem;box-shadow:0 0 2px #ccc}:host .item-container:hover{background-color:#f5f9fb}
`;var Dn=`<div class="modal-header">
  <div class="d-flex flex-column">
    <span class="text-lg">{{modalTitle|translate}}</span>
  </div>
</div>

<div class="modal-body d-flex flex-column">
  <div class="d-flex my-2 p-2">
    <armon-captionlines *ngIf="item.userCaptions" [showBorder]="false" [captionlines]="item.userCaptions">
    </armon-captionlines>
    <div class="d-flex align-items-center ms-auto">
      <armon-duration-formatter [data]="selectedDurationData" style="min-width: 150px;"></armon-duration-formatter>
      <armon-duration-formatter [data]="item.durationData" style="min-width: 150px;"></armon-duration-formatter>
    </div>
  </div>
  <div class="mb-3 d-flex justify-content-between">
    <div class="d-flex align-items-end">
      <!-- <span class="ms-2 fw-medium text-md text-primary">{{'COMMON.TOTAL'|translate}}&nbsp;{{days.length}}&nbsp;{{'REPORT.PACS_UNIT_DAY'|translate}}</span> -->
      <button class="btn btn-link p-0" (click)="onSelectAllClicked($event)">{{'BUTTON.SELECT_ALL'|translate}}</button>
      <button class="btn btn-link p-0 ms-2"
        (click)="onUnselectAllClicked($event)">{{'BUTTON.REMOVE_ALL'|translate}}</button>
    </div>
    <div class="d-flex align-items-center">
      <div class="form-check form-switch me-3" [hidden]="!enableDailyView">
        <input type="checkbox" class="form-check-input cursor-pointer" id="toggle_isRangeView" [(ngModel)]="isDailyView"
          (ngModelChange)="onViewChanged($event)">
        <label class="form-check-label cursor-pointer"
          for="toggle_isRangeView">{{'PACS.WORKPLAN_ASSIGN_DAYS_BUTTON'|translate}}</label>
      </div>
      <button class="btn btn-sm btn-primary me-2" [disabled]="!selectedRanges || selectedRanges.length == 0"
        *ngIf="useAsHumanResources" [hidden]="!enableAddPermission"
        (click)="onAddPermissionClicked($event)">{{'PACS.ADD_USER_PPERMISSION' | translate}}</button>
      <button class="btn btn-sm btn-primary" [disabled]="!selectedRanges || selectedRanges.length == 0 || isDailyView"
        *ngIf="permissionInsertManualLog" [hidden]="!enableAddManualRecord"
        (click)="onAddManualRecordClicked($event)">{{'ACCESSCONTROLPOINT.ADD_MANUAL_RECORD' | translate}}</button>
    </div>
  </div>
  <div class="my-2" *ngIf="isDailyView">
    <div class="alert alert-info" role="alert">
      {{"PACS.PPERMISSION_TYPE_LABEL_DAILY_INFO"|translate}}
    </div>
  </div>
  <div class="items-container px-2 mh-vh-60 mxh-vh-60 overflow-y-auto">
    <ng-container *ngFor="let day of days">
      <ng-template *ngTemplateOutlet="dayTemplate;context: {$implicit:day}">
      </ng-template>
    </ng-container>
  </div>
  <div>
    <armon-pagination [paginationResponse]="paginationResponse" [scrollDomId]="'report-data-table-container'"
      (pageChanged)="pageChanged($event)"></armon-pagination>
  </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)="onSaveClicked($event)" [disabled]="disableSaveButton">
    {{'BUTTON.SAVE' | translate}}
  </button> -->
</div>

<ng-template #dayTemplate let-day>
  <div class="row py-2 border border-1 my-2 mx-0 day-container" [attr.selected]="day.selected">
    <!-- <div class="col-2 col-md-1 b-r-1">
      <label nz-checkbox [(ngModel)]="day.selected" (ngModelChange)="onDayChecked(day)" [nzIndeterminate]="day.indeterminate"></label>
    </div> -->
    <div class="col-12 col-md-3 d-flex">
      <div class="d-flex align-items-center pe-3 ms-1 b-r-1">
        <label nz-checkbox [(ngModel)]="day.selected" (ngModelChange)="onDayChecked(day)" nzDisabled="{{day.disabled}}"
          [nzIndeterminate]="day.indeterminate"></label>
      </div>
      <div class="d-flex px-3 flex-column align-items-start">
        <span class="text-xxl text-black-50">{{day.dayText}}</span>
        <span class="text-xxs">{{day.monthText}} {{day.yearText}}</span>
      </div>
    </div>
    <div class="col-12 col-md-9 b-l-1 d-flex flex-column justify-content-center">
      <ng-container *ngIf="day.graphData">
        <armon-percentage-graph [data]="day.graphData" styleHeight="3px" class="mb-2"></armon-percentage-graph>
      </ng-container>
      <!-- SHOW SEGMENTS -->
      <ng-container *ngIf="!day.disabled">
        <div>
          <ng-container *ngIf="isDailyView">
            <span class="text-sm text-italic color-gray">{{'PACS.WORKPLAN_ASSIGN_DAYS_BUTTON'|translate}}</span>
          </ng-container>
          <ng-container *ngIf="!isDailyView">
            <ng-container *ngFor="let segment of day.segments">
              <div class="d-inline-block p-2 m-1 segment-container" [attr.selected]="segment.selected">
                <label nz-checkbox [(ngModel)]="segment.selected" nzDisabled="{{isDailyView}}"
                  (ngModelChange)="onSegmentChecked(day, segment)">{{segment.startDateTimeHourText}} -
                  {{segment.endDateTimeHourText}}</label>
              </div>
            </ng-container>
          </ng-container>
        </div>
      </ng-container>
      <!-- DISABLED -->
      <ng-container *ngIf="day.disabled">
        <!-- CALCULATION WAIT -->
        <div *ngIf="day.waitingRecalculation">
          <span>
            <span class="spinner-grow spinner-grow-sm text-secondary"></span>
            <span class="text-xs text-italic color-gray ms-1">{{'PACS.WAITING_CALCULATION_WAIT'|translate}}&nbsp;(
              <ng-container *ngFor="let recalculationReasonText of day.recalculationReasonTexts">
                <span class="comma">{{recalculationReasonText|translate}}</span>
              </ng-container>)
            </span>
          </span>
        </div>
        <!-- NO COMPLETED SEGMENT WORK -->
        <div *ngIf="!day.segments || day.segments.length == 0" class="d-flex flex-column align-items-start">
          <span class="text-xs text-italic color-gray">{{'PACS.DAY_HAS_NO_COMPLETED_SEGMENT'|translate}}</span>
        </div>
        <!-- WAITING PERMISSION -->
        <div *ngIf="day.warnings && day.warnings.hasWarning" class="d-flex flex-column align-items-start">
          <span class="text-xs text-italic color-gray">{{'PACS.DAY_HAS_WAITING_PERMISSIONS'|translate}}</span>
          <button class="btn btn-sm btn-link p-0 mt-2" *ngIf="!day.showDetail"
            (click)="day.showDetail = true">{{'BUTTON.SHOW_DETAIL'|translate}}</button>
        </div>
      </ng-container>
    </div>
    <div class="col-12 px-2 mt-2" *ngIf="day.showDetail">
      <armon-pacs-timeline-user [day]="day.day" [userId]="item.id" [multiDay]="day.isMultiDay"
        (interactionStarted)="onInteractionStarted($event)" (routingStarted)="onRoutingStarted($event)"
        (interactionFinished)="onInteractionFinished($event)">
      </armon-pacs-timeline-user>
    </div>
  </div>
</ng-template>`;var On=`.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}.items-container{overflow-y:auto;flex-grow:1;flex-shrink:1;flex-basis:auto}.day-container{background-color:#f9f9f9;-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem}.day-container[selected=true]{background-color:#f2f8ee}.segment-container{-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem;background-color:#f0f0f0}.segment-container[selected=true]{background-color:#e3eed8}
`;var Pn=`<div class="modal-header">\r
  <div class="d-flex flex-column">\r
    <span class="text-lg">{{'PACS.ADD_USER_PPERMISSION'|translate}}</span>\r
  </div>\r
</div>\r
\r
<div class="modal-body">\r
  <div class="row">\r
    <div class="col-12 my-2">\r
      <armon-captionlines *ngIf="userCaptions" [showBorder]="false" [captionlines]="userCaptions">\r
      </armon-captionlines>\r
    </div>\r
    <div class="col-12 mb-3" *ngIf="ppermissionTypes">\r
      <label>{{'PACS.PPERMISSION_TYPE_LABEL' | translate}}</label>\r
      <select [(ngModel)]="selectedType" (change)="onPermissionTypeChanged($event)" class="form-select form-select-sm">\r
        <option *ngFor="let type of ppermissionTypes" [ngValue]="type">{{type.name | translate}}</option>\r
      </select>\r
      <small>{{(isDailyView ? 'PACS.PPERMISSION_TYPE_LABEL_DAILY_INFO' : 'PACS.PPERMISSION_TYPE_LABEL_HOURLY_INFO' ) |\r
        translate}}</small>\r
    </div>\r
    <div class="col-12" *ngIf="selectedType">\r
      <label>{{'PACS.USER_PPERMISSION_NOTE' | translate}}</label>\r
      <textarea name="note" [(ngModel)]='request.note' class="form-control form-control-sm"\r
        placeholder="{{selectedType.notePlaceHolder | translate}}" rows="5" cols="20" maxlength="512"></textarea>\r
    </div>\r
  </div>\r
</div>\r
<div class="modal-footer">\r
  <button class="btn btn-outline-primary me-2" (click)="onCancelClicked($event)">{{'BUTTON.CLOSE' | translate}}</button>\r
  <button class="btn btn-primary" (click)="onAddClicked($event)">{{'BUTTON.ADD' | translate}}</button>\r
</div>`;var zn=`.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 Zo=function(r,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(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(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},Ft=class extends ke{authService;modalService;interactionService;pacsService;ranges;userId;userCaptions;isDailyView;ppermissionTypes;selectedType;useAsHumanResources;hasWritePermission;request=us.getEmptyModel();constructor(e,t,i,s){super(),this.authService=e,this.modalService=t,this.interactionService=i,this.pacsService=s}onModalInitialized(){super.onModalInitialized(),this.request.ranges=this.isDailyView?this.convertRangesToDays(this.ranges):this.ranges,this.request.userAndDeputy.userId=this.userId,this.useAsHumanResources=this.authService.checkPermission(b.PPERMISSION.getHRApprovement()),this.hasWritePermission=this.authService.checkPermission(b.PPERMISSION.getWrite()),this.getPPermissionTypeList()}convertRangesToDays(e){let t=[];return e.forEach(i=>{let s=new De;s.startDateTime=d.fromJSDate(i.startDateTime).startOf("day").toJSDate(),s.endDateTime=d.fromJSDate(i.endDateTime).plus({days:1}).startOf("day").toJSDate(),t.findIndex(o=>d.fromJSDate(s.startDateTime).equals(d.fromJSDate(o.startDateTime))&&d.fromJSDate(s.endDateTime).equals(d.fromJSDate(o.endDateTime)))==-1&&t.push(s)}),t}getPPermissionTypeList(){let e=new gs,t=new Tt;t.take=0,e.pagination=t,this.pacsService.getPPermissionTypeList(e).subscribe(i=>{let s=[];this.useAsHumanResources?s=i.items.filter(n=>n.hrCanInit==!0&&n.isPassive==!1):this.hasWritePermission?s=i.items.filter(n=>n.unitManagerCanInit==!0&&n.isPassive==!1):s=i.items.filter(n=>n.personnelCanInit==!0&&n.isPassive==!1),this.ppermissionTypes=this.isDailyView?s.filter(n=>n.isDailyScheduled==!0):s.filter(n=>n.isDailyScheduled==!1),this.selectedType=this.ppermissionTypes[0]})}onPermissionTypeChanged(e){}onAddClicked(e){this.selectedType&&(this.request.ppermissionTypeId=this.selectedType.id,this.pacsService.upsertPPermissionForRanges(this.request).subscribe(t=>{this.closeModal()},t=>{t&&t.status&&t.status===ci.RangeNotSatisfiable&&this.interactionService.showDialog("PACS.ADD_USER_PPERMISSION",t.error.units="PACS.DIALOG_ADD_LIMIT_ERROR_DAYS",null,t.error,!1,"BUTTON.OK","",!1,()=>{}),t&&t.status&&t.status===ci.Conflict&&this.modalService.open(js,{settings:{size:"lg",scrollable:!0,centered:!0},props:{conflictList:t.error.items,infoText:"PACS.DIALOG_ADD_ALREADY_VALIDATION_ERROR"}}).result.then(i=>{}).catch(i=>{})}))}static ctorParameters=()=>[{type:E},{type:U},{type:Q},{type:N}];static propDecorators={ranges:[{type:h}],userId:[{type:h}],userCaptions:[{type:h}],isDailyView:[{type:h}]}};Ft=Zo([p({selector:"armon-pacs-ppermission-ranges-upsert-modal",template:Pn,standalone:!0,imports:[u,K,_,vt,S,f],styles:[zn]})],Ft);var _n=`<div class="modal-header">\r
  <div class="d-flex flex-column">\r
    <span class="text-lg">{{'ACCESSCONTROLPOINT.ADD_MANUAL_RECORD' | translate}}</span>\r
  </div>\r
</div>\r
\r
<div class="modal-body">\r
  <div class="row">\r
    <div class="col-12 my-2">\r
      <armon-captionlines *ngIf="userCaptions" [showBorder]="false" [captionlines]="userCaptions">\r
      </armon-captionlines>\r
    </div>\r
  </div>\r
  <ng-template *ngTemplateOutlet="directionTemplate;context: {$implicit:request.entrance, isEntrance:true}">\r
  </ng-template>\r
  <ng-template *ngTemplateOutlet="directionTemplate;context: {$implicit:request.exit, isEntrance:false}">\r
  </ng-template>\r
  <div class="row">\r
    <div class="col-12">\r
      <div class="form-group">\r
        <label class="required">{{'CREDENTIAL.TITLE_DATA' | translate}}</label>\r
        <armon-credential-search #searchCredential [userId]="request.userId" [multiselect]="false"\r
          (itemSelected)="onCredentialSelected($event)" (itemRemoved)="onCredentialRemoved()">\r
        </armon-credential-search>\r
      </div>\r
    </div>\r
  </div>\r
</div>\r
\r
<div class="modal-footer">\r
  <button class="btn btn-outline-primary me-2" (click)="onCancelClicked($event)">{{'BUTTON.CLOSE' | translate}}</button>\r
  <button class="btn btn-primary" (click)="onSaveClicked($event)" [disabled]="disableSaveButton">\r
    {{'BUTTON.SAVE' | translate}}\r
  </button>\r
</div>\r
\r
<ng-template #directionTemplate let-direction let-isEntrance="isEntrance">\r
  <div class="row mb-3 b-b-1 pb-3">\r
    <div class="col-12 py-2 mb-2">\r
      <span class="text-md text-primary fw-medium">{{(isEntrance ? 'DIRECTIONTYPE.ENTRANCE_FORM' :\r
        'DIRECTIONTYPE.EXIT_FORM' ) | translate}}</span>\r
    </div>\r
    <div class="col-12">\r
      <div class="form-group">\r
        <label class="report-form-label" class="required">{{'REPORT.ACCESS_CONTROL_POINT' | translate}}</label>\r
        <armon-access-control-point-search #searchAccessControlPoints [multiselect]="false"\r
          (itemSelected)="onAccessControlPointSelected($event, isEntrance)"\r
          (itemRemoved)="onAccessControlPointRemoved(isEntrance)">\r
        </armon-access-control-point-search>\r
      </div>\r
    </div>\r
    <div class="col-12" *ngIf="direction && direction.accessControlPointId">\r
      <div class="form-group">\r
        <label class="required">{{'CONNECTIONS.TYPE_WIEGAND_READER' | translate}}</label>\r
        <armon-wiegand-reader-search #searchWiegandReaders [multiselect]="false"\r
          [accessControlPointId]="direction.accessControlPointId" (itemSelected)="onReaderSelected($event, isEntrance)"\r
          (itemRemoved)="onReaderRemoved(isEntrance)"></armon-wiegand-reader-search>\r
      </div>\r
    </div>\r
  </div>\r
</ng-template>`;var Nn=`.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 An=`<div class="w-100">
  <armon-select #select [multiselect]="multiselect" [hideChips]="hideChips" [notStoreSelection]="notStoreSelection" 
    uniqueField="id" descriptionField="description" responseField="items" [searchFunction]="searchWiegandReaders" (itemSelected)="onItemSelected($event)"
    [listFunction]="listWiegandReaders" [listIds]="listIds"
    (itemRemoved)="onItemRemoved($event)"></armon-select>
</div>`;var Ln="";var ir=function(r,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(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(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},Vt=class extends Dt{accessControlPointService;constructor(e){super(),this.accessControlPointService=e,this.searchWiegandReaders=this.searchWiegandReaders.bind(this),this.listWiegandReaders=this.listWiegandReaders.bind(this)}accessControlPointId;lastAccessControlPointId=null;lastItems;ngOnInit(){}storeReaderList(e){this.lastItems=[],this.lastAccessControlPointId=this.accessControlPointId,e.readers.forEach(t=>{this.lastItems.push(new Ct(t.id,t.name))})}getFilteredResult(e){let t=new je;return t.items=e?this.lastItems.filter(i=>i.captionLines[0].match(new RegExp(e,"i"))):this.lastItems,t}getListResult(e){let t=new je;return t.items=this.lastItems.filter(i=>e.indexOf(i.id)>-1).filter((i,s,n)=>n.findIndex(o=>o.id===i.id)===s),t}searchWiegandReaders(e){return this.lastAccessControlPointId?ze(this.getFilteredResult(e)):this.accessControlPointService.getDetailsofAccessControlPoint(this.accessControlPointId).pipe(_e(t=>(this.storeReaderList(t),this.getFilteredResult(e))))}listWiegandReaders(e){return this.lastAccessControlPointId?ze(this.getListResult(e)):this.accessControlPointService.getDetailsofAccessControlPoint(this.accessControlPointId).pipe(_e(t=>(this.storeReaderList(t),this.getListResult(e))))}static ctorParameters=()=>[{type:Ce}];static propDecorators={accessControlPointId:[{type:h}]}};Vt=ir([p({selector:"armon-wiegand-reader-search",template:An,standalone:!0,imports:[Ot],styles:[Ln]})],Vt);var Wn=`<div class="w-100">
  <armon-select #select [multiselect]="multiselect" [hideChips]="hideChips" [notStoreSelection]="notStoreSelection" 
    uniqueField="id" descriptionField="description" responseField="items" [searchFunction]="searchCredentials" (itemSelected)="onItemSelected($event)"
    [listFunction]="listCredentials" [listIds]="listIds"
    (itemRemoved)="onItemRemoved($event)"></armon-select>
</div>`;var Mn="";var or=function(r,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(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(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},Ht=class extends Dt{identityService;sessionService;translate;constructor(e,t,i){super(),this.identityService=e,this.sessionService=t,this.translate=i,this.searchCredentials=this.searchCredentials.bind(this),this.listCredentials=this.listCredentials.bind(this)}userId;lastUserId=null;lastItems;ngOnInit(){}storeReaderList(e){this.lastItems=[],this.lastUserId=this.userId,e.credentials.forEach(t=>{let i=this.translate.instant(is.find(o=>o.type===t.type).description),s=this.sessionService.getDecodedCredentialData(t.data,t.type),n=s?" ("+s+")":"";this.lastItems.push(new Ct(t.id,i+" - "+t.data+n))})}getFilteredResult(e){let t=new je;return t.items=e?this.lastItems.filter(i=>i.captionLines[0].match(new RegExp(e,"i"))):this.lastItems,t}getListResult(e){let t=new je;return t.items=this.lastItems.filter(i=>e.indexOf(i.id)>-1).filter((i,s,n)=>n.findIndex(o=>o.id===i.id)===s),t}searchCredentials(e){return this.lastUserId?ze(this.getFilteredResult(e)):this.identityService.getIdentityDetailedById(this.userId).pipe(_e(t=>(this.storeReaderList(t),this.getFilteredResult(e))))}listCredentials(e){return this.lastUserId?ze(this.getListResult(e)):this.identityService.getIdentityDetailedById(this.userId).pipe(_e(t=>(this.storeReaderList(t),this.getListResult(e))))}static ctorParameters=()=>[{type:Rs},{type:B},{type:D}];static propDecorators={userId:[{type:h}]}};Ht=or([p({selector:"armon-credential-search",template:Wn,standalone:!0,imports:[Ot],styles:[Mn]})],Ht);var rr=function(r,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(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(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},Yt=class extends ke{router;accessControlPointService;interactionService;languageService;ranges;userId;userCaptions;request=ms.getEmptyModel();accessControlPoint;disableSaveButton=!0;constructor(e,t,i,s){super(),this.router=e,this.accessControlPointService=t,this.interactionService=i,this.languageService=s}onModalInitialized(){super.onModalInitialized(),this.request.userId=this.userId,this.request.ranges=this.ranges}validateForm(){let e=!1;(this.request.entrance.accessControlPointId==null||this.request.entrance.wiegandReaderId==null||this.request.exit.accessControlPointId==null||this.request.exit.wiegandReaderId==null||this.request.credentialId==null)&&(e=!0),this.disableSaveButton=e}onSaveClicked(e){this.accessControlPointService.insertManualRecordForRanges(this.request).subscribe(t=>{this.interactionService.showMessage("ACCESSCONTROLPOINT.MANUAL_RECORD_INSERT_SUCCEED",null,Me.Success,this.languageService.userTranslate),this.closeModal()})}onDateChanged(e){this.validateForm()}onAccessControlPointSelected(e,t){t?this.request.entrance.accessControlPointId=e.id:this.request.exit.accessControlPointId=e.id,this.validateForm()}onAccessControlPointRemoved(e){e?this.request.entrance.accessControlPointId=null:this.request.exit.accessControlPointId=null,this.validateForm()}onReaderSelected(e,t){t?this.request.entrance.wiegandReaderId=e.id:this.request.exit.wiegandReaderId=e.id,this.validateForm()}onReaderRemoved(e){e?this.request.entrance.wiegandReaderId=null:this.request.exit.wiegandReaderId=null,this.validateForm()}onCredentialSelected(e){this.request.credentialId=e.id,this.validateForm()}onCredentialRemoved(){this.request.credentialId=null,this.validateForm()}static ctorParameters=()=>[{type:me},{type:Ce},{type:Q},{type:Se}];static propDecorators={ranges:[{type:h}],userId:[{type:h}],userCaptions:[{type:h}]}};Yt=rr([p({selector:"access-control-point-manual-record-ranges",template:_n,standalone:!0,imports:[u,K,Ie,Ht,Pt,Vt,f],styles:[Nn]})],Yt);var ar=function(r,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(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(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},Bt=class extends ke{authService;modalService;pacsService;item;request=Is.getEmptyModel();type;days;modalTitle;isDailyView=!1;enableDailyView=!1;enableAddManualRecord=!1;enableAddPermission=!1;selectedRanges=[];paginationResponse=new Fe;selectedDurationData;useAsHumanResources;permissionWritePPermission;permissionInsertManualLog;constructor(e,t,i){super(),this.authService=e,this.modalService=t,this.pacsService=i}onModalInitialized(){switch(super.onModalInitialized(),this.selectedDurationData={color:"#62A325",minutes:0,label:"COMMON.SELECTED_DURATION"},this.useAsHumanResources=this.authService.checkPermission(b.PPERMISSION.getHRApprovement()),this.permissionWritePPermission=this.authService.checkPermission(b.PPERMISSION.getWrite()),this.permissionInsertManualLog=this.authService.checkPermission(b.ACCESSLOG.getInsertManualLog()),this.type){case z.MissingWork:this.modalTitle="WIDGET.PACS_MISSING_WORK",this.enableDailyView=!0,this.enableAddManualRecord=!0,this.enableAddPermission=!0;break;case z.ExtraWork:this.modalTitle="WIDGET.PACS_EXTRA_WORK",this.enableDailyView=!1,this.enableAddManualRecord=!1,this.enableAddPermission=!0;break}this.request&&(this.request.range=this.request.range,this.request.type=this.type),this.getData()}getData(){this.pacsService.getWorkDurationDaysForUser(this.item.id,this.request).subscribe(e=>{this.days=e.items,this.paginationResponse=e.pagination,this.updateUIList(this.days)})}pageChanged(e){this.request.pagination=e,this.getData()}getSegmentIndex(e){return this.selectedRanges.findIndex(t=>+d.fromJSDate(t.startDateTime)==+d.fromJSDate(e.startDateTime)&&+d.fromJSDate(t.endDateTime)==+d.fromJSDate(e.endDateTime))}isSegmentSelected(e){return this.getSegmentIndex(e)>-1}selectSegment(e){if(!this.isSegmentSelected(e)){let t=new De;t.startDateTime=e.startDateTime,t.endDateTime=e.endDateTime,this.selectedRanges.push(t)}this.afterSelectionSegment(e)}unSelectSegment(e){this.isSegmentSelected(e)&&this.selectedRanges.splice(this.getSegmentIndex(e),1),this.afterSelectionSegment(e)}getSelectionRangesInMinutes(){if(this.selectedRanges||this.selectedRanges.length>0){let e=0;return this.selectedRanges.forEach(t=>{e=e+d.fromJSDate(t.endDateTime).diff(d.fromJSDate(t.startDateTime),"seconds").toObject().seconds}),Math.abs(e/60)}else return 0}afterSelectionSegment(e){this.selectedDurationData={color:"#62A325",minutes:this.getSelectionRangesInMinutes(),label:"COMMON.SELECTED_DURATION"}}detectSegmentSelection(e){e.selected?this.selectSegment(e):this.unSelectSegment(e)}onAddPermissionClicked(e){this.selectedRanges&&this.selectedRanges.length>0&&this.modalService.open(Ft,{settings:{size:"md",centered:!0},props:{ranges:this.selectedRanges,userId:this.item.id,userCaptions:this.item.userCaptions,isDailyView:this.isDailyView}}).result.then(t=>{this.request.pagination.skip=0,this.getData()}).catch(t=>{})}onAddManualRecordClicked(e){this.selectedRanges&&this.selectedRanges.length>0&&this.modalService.open(Yt,{settings:{size:"md",centered:!0},props:{ranges:this.selectedRanges,userId:this.item.id,userCaptions:this.item.userCaptions}}).result.then(t=>{this.request.pagination.skip=0,this.getData()}).catch(t=>{})}updateUIList(e){e.forEach(t=>{t.segments.forEach(i=>{i.selected=this.isSegmentSelected(i)}),this.selectUISegment(t),this.isDailyView&&t.disabled==!1&&t.indeterminate==!0&&this.onDayConvertSelected(t)})}selectUIDay(e){e.disabled==!1&&(e.indeterminate=!1,e.segments.forEach(t=>{t.selected=e.selected,e.disabled==!1&&this.detectSegmentSelection(t)}))}selectUISegment(e,t=null){e.segments.findIndex(i=>i.selected==!0)==-1?(e.selected=!1,e.indeterminate=!1):e.segments.findIndex(i=>i.selected==!1)==-1?(e.selected=!0,e.indeterminate=!1):(e.selected=!1,e.indeterminate=!0),t&&e.disabled==!1&&this.detectSegmentSelection(t)}onDayChecked(e){this.selectUIDay(e)}onSegmentChecked(e,t){this.selectUISegment(e,t)}onDayConvertSelected(e){e.selected=!0,this.selectUIDay(e)}onSelectAllClicked(e){this.days.forEach(t=>{t.disabled==!1&&(t.selected=!0,this.selectUIDay(t))})}onUnselectAllClicked(e){this.days.forEach(t=>{t.disabled==!1&&(t.selected=!1,this.selectUIDay(t))})}onRoutingStarted(e){this.closeModal()}onInteractionStarted(e){}onInteractionFinished(e){}onViewChanged(e){this.isDailyView&&this.days.forEach(t=>{t.disabled==!1&&t.indeterminate==!0&&this.onDayConvertSelected(t)})}static ctorParameters=()=>[{type:E},{type:U},{type:N}];static propDecorators={item:[{type:h}],request:[{type:h}],type:[{type:h}]}};Bt=ar([p({selector:"armon-pacs-durations-modal",template:Dn,standalone:!0,imports:[u,K,Nt,_,vt,S,Ie,He,St,Vs,Fs,f],styles:[On]})],Bt);var lr=function(r,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(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(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},qt=class{pacsService;authService;languageService;modalService;drawerService;drawerTemplate;drawerRef;widgetData;widgetId;type;dataUpdated=new w;selectedOrganizationUnitIds=[];selectedHierarchical;selectedWorkplanIds=[];selectedIdentityIds=[];selectedUserGroupIds=[];updateDate;organizations;dateSelection;isOrganizationWide;request;items;visibleComponent=!1;visibleSpinner=!0;subscriptionGetData;permissionSearchWorkplans;permissionSearchOrganizationUnit;permissionSearchIdentity;permissionSearchUserGroup;paginationResponse=new Fe;paginationRequest=new Tt;datePickerOptions=new yt;widgetTitle;datePicker;constructor(e,t,i,s,n){this.pacsService=e,this.authService=t,this.languageService=i,this.modalService=s,this.drawerService=n}ngOnInit(){switch(this.type){case z.MissingWork:this.widgetTitle="WIDGET.PACS_MISSING_WORK";break;case z.ExtraWork:this.widgetTitle="WIDGET.PACS_EXTRA_WORK";break}this.request=vs.getEmptyModel(),this.request.type=this.type,this.permissionSearchOrganizationUnit=this.authService.checkPermission(b.ORGANIZATIONUNIT.getReadBasic()),this.permissionSearchWorkplans=this.authService.checkPermission(b.ATTENDANCECONTROL.getRead()),this.permissionSearchIdentity=this.authService.checkPermission(b.IDENTITY.getReadBasic()),this.permissionSearchUserGroup=this.authService.checkPermission(b.USERGROUP.getRead()),this.datePickerOptions.items=[{type:ee.LastWeek},{type:ee.LastMonth},{type:ee.Custom,maxDays:30}];let e;this.widgetData?(this.datePickerOptions.items.find(t=>t.type==this.widgetData.datepickerSelectedType)||(this.widgetData.datepickerSelectedType=this.datePickerOptions.items[0].type),this.datePickerOptions.items.find(t=>t.type==this.widgetData.datepickerSelectedType).selected=!0,e=tt.getDateSelection(this.datePickerOptions.items.find(t=>t.type==this.widgetData.datepickerSelectedType),this.widgetData.datepickerSelectedType==ee.Custom?[d.local().minus({days:7}).toJSDate(),d.local().toJSDate()]:void 0)):(this.widgetData={widgetId:this.widgetId,organizationUnitIds:[],filterOrganizationUnitMembersHierarchically:!0,workplanIds:[],identityIds:[],userGroupIds:[],datepickerSelectedType:ee.Last3Months},this.datePickerOptions.items[0].selected=!0,e=tt.getDateSelection(this.datePickerOptions.items[0])),this.setDateSelection(e),this.visibleComponent=!0,this.getData()}ngOnDestroy(){this.subscriptionGetData&&this.subscriptionGetData.unsubscribe()}setDateSelection(e){this.dateSelection=e,this.request.range.startDateTime=e.startDate,this.request.range.endDateTime=e.endDate}getData(){this.visibleSpinner=!0,this.request.organizationUnitIds=this.widgetData.organizationUnitIds,this.request.filterOrganizationUnitMembersHierarchically=this.widgetData.filterOrganizationUnitMembersHierarchically,this.request.workPlanIds=this.widgetData.workplanIds,this.request.userIds=this.widgetData.identityIds,this.request.userGroupIds=this.widgetData.userGroupIds,this.pacsService.getWorkDurationForUsers(this.request,!1).subscribe({next:e=>{this.items=e.items,this.items.forEach(t=>{switch(this.type){case z.MissingWork:t.durationData={color:I.getColor(!1,c.AtWorkingHours),minutes:t.workDuration,label:"REPORT.PACS_COL_MISSED_WORK"};break;case z.ExtraWork:t.durationData={color:I.getColor(!0,c.AtOutOfWorkingHours),minutes:t.workDuration,label:"REPORT.PACS_COL_EXTRA_WORK"};break}}),this.paginationResponse=e.pagination,this.visibleSpinner=!1},error:e=>{this.visibleSpinner=!1}})}pageChanged(e){this.request.pagination=e,this.getData()}onSettingsClicked(){this.datePickerOptions.items.forEach(e=>{e.selected=!1}),this.datePickerOptions.items.find(e=>e.type==this.dateSelection.type).selected=!0,this.selectedOrganizationUnitIds=this.widgetData.organizationUnitIds,this.selectedHierarchical=this.widgetData.filterOrganizationUnitMembersHierarchically,this.selectedWorkplanIds=this.widgetData.workplanIds,this.selectedIdentityIds=this.widgetData.identityIds,this.selectedUserGroupIds=this.widgetData.userGroupIds,this.selectedDateSelection=this.dateSelection,this.drawerRef=this.drawerService.create({nzContent:this.drawerTemplate,nzClosable:!1,nzWidth:$(),nzContentParams:{value:""}}),setTimeout(()=>{this.datePicker.setPickerItemAndDate(this.datePickerOptions.items.findIndex(e=>e.type==this.dateSelection.type),this.dateSelection.type==ee.Custom?[this.request.range.startDateTime,this.request.range.endDateTime]:void 0)},300)}onCancelClicked(){this.drawerRef.close()}onSaveClicked(){this.widgetData.identityIds=this.selectedIdentityIds,this.widgetData.userGroupIds=this.selectedUserGroupIds,this.widgetData.organizationUnitIds=this.selectedOrganizationUnitIds,this.widgetData.filterOrganizationUnitMembersHierarchically=this.selectedHierarchical,this.widgetData.workplanIds=this.selectedWorkplanIds,this.widgetData.datepickerSelectedType=this.selectedDateSelection.type,this.setDateSelection(this.selectedDateSelection),this.drawerRef.close(),this.dataUpdated.emit({widgetId:this.widgetId,organizationUnitIds:this.selectedOrganizationUnitIds,workplanIds:this.selectedWorkplanIds,identityIds:this.selectedIdentityIds,userGroupIds:this.selectedUserGroupIds,filterOrganizationUnitMembersHierarchically:this.selectedHierarchical,datepickerSelectedType:this.selectedDateSelection.type}),this.subscriptionGetData&&this.subscriptionGetData.unsubscribe(),this.request.pagination.skip=0,this.getData()}selectedDateSelection;onDateSelectionChanged(e){this.selectedDateSelection=e}onIdentityClicked(e){this.modalService.open(Bt,{settings:{size:"xl",scrollable:!0,centered:!1},props:{item:e,request:this.request,type:this.type}}).result.then(t=>{this.getData()}).catch(t=>{})}static ctorParameters=()=>[{type:N},{type:E},{type:Se},{type:U},{type:G}];static propDecorators={drawerTemplate:[{type:P,args:["drawerTemplate"]}],widgetData:[{type:h}],widgetId:[{type:h}],type:[{type:h}],dataUpdated:[{type:v}],datePicker:[{type:P,args:["datePicker",{static:!1}]}]}};qt=lr([p({selector:"armon-widget-pacs-work-durations",template:Rn,animations:[pe],standalone:!0,imports:[u,S,K,Nt,He,kt,X,_,St,f],styles:[En]})],qt);var $n=`<div class="widget-data-container" *ngIf="visibleComponent">
  <ng-container [ngSwitch]="viewState">
    <ng-container *ngSwitchCase="1">
      <div class="h-100 d-flex flex-column align-items-center justify-content-center">
        <span class="spinner-grow spinner-grow-sm text-secondary"></span>
      </div>
    </ng-container>
    <!-- NO REGION -->
    <ng-container *ngSwitchCase="2">
      <div class="h-100 d-flex flex-column align-items-center justify-content-center">
        <cds-icon shape="info-standard" size="lg" class="mb-3 color-secondary"></cds-icon>
        <span class="text-sm my-3">
          {{'WIDGET.REGION_NONE' | translate}}
        </span>
        <button class="btn btn-warning btn-sm my-3"
          (click)="onHideClicked($event)">{{'BUTTON.REMOVE'|translate}}</button>
      </div>
    </ng-container>
    <!-- NO REGION -->

    <!-- SELECT REGION -->
    <ng-container *ngSwitchCase="3">
      <div class="h-100 d-flex flex-column align-items-center justify-content-center">
        <span class="text-lg fw-medium">{{'REPORT.REGION'|translate}}</span>
        <span class="text-sm my-3">{{'WIDGET.REGION_SELECT' | translate}}</span>
        <button class="btn btn-primary btn-sm my-4"
          (click)="onSettingsClicked($event)">{{'BUTTON.SELECT'|translate}}</button>
      </div>
    </ng-container>
    <!-- SELECT REGION -->

    <!-- SHOW REGION -->
    <ng-container *ngSwitchCase="4">
      <div class="widget-header-container">
        <span class="widget-title">
          <cds-icon shape="emergency" nz-tooltip nzTooltipTitle="{{'TERMINAL.EMERGENCY'| translate}}"
            *ngIf="regionState.detail.isEmergency" class="blink me-1 cds-icon-18">
          </cds-icon>
          {{regionState.detail.name}}</span>
        <span class="widget-sub-title"
          *ngIf="regionState.detail.accessControlPointCount && regionState.detail.accessControlPointCount>0">
          {{regionState.detail.accessControlPointCount}} {{'REPORT.ACCESS_CONTROL_POINT'|translate}}
        </span>
      </div>
      <div class="widget-button-container">
        <cds-icon shape="report" style="width: 18px; height: 18px;" (click)="onReportClicked()"
          class="cursor-pointer me-2" nz-tooltip nzTooltipTitle="{{'PAGES.REPORT_REGION' | translate}}">
        </cds-icon>
        <cds-icon shape="cog" style="width: 18px; height: 18px;" (click)="onSettingsClicked()" class="cursor-pointer"
          nz-tooltip nzTooltipTitle="{{'COMMON.SETTINGS' | translate}}">
        </cds-icon>
      </div>
      <ng-container *ngIf="visibleChart">
        <div class="d-flex justify-content-center">
          <div class="d-flex d-md-none d-lg-flex gap-1 gap-xl-5 pt-3 flex-grow-1 justify-content-start">
            <ng-container *ngFor="let chartData of stateRatioData.values; index as dataIndex">
              <ng-container *ngIf="chartData>0">
                <div class="d-flex flex-column align-items-start">
                  <span class="text-xxl line-height-xxl">{{chartData}}</span>
                  <span class="d-flex align-items-center text-sm">
                    <div class="status-badge" [ngStyle]="{background: stateRatioChartColors.colors[dataIndex]}"></div>
                    {{stateRatioChartLabels.labels[dataIndex] | translate}}
                  </span>
                </div>
              </ng-container>
            </ng-container>
          </div>
          <div class="chart-container">
            <d3-pie-chart [chartData]="stateRatioChartData" [chartLabels]="stateRatioChartLabels"
              [chartColors]="stateRatioChartColors" [chartOptions]="pieChartOptions"
              (valueClicked)="onValueClicked($event)"></d3-pie-chart>
          </div>
        </div>
        <span class="text-md">{{'REGION.STATE_LAST_UPDATES'|translate}} ({{regionLastUpdateDateText}})</span>
        <div *ngIf="regionState && regionState.users && regionState.users.length>0" class="pe-1 items-container"
          [attr.id]="widgetId">
          <ng-container *ngFor="let userState of regionState.users">
            <div class="d-flex my-2 mx-1 p-2 align-items-center item-container rnd-1">
              <armon-captionlines *ngIf="userState.user.userCaptions" [showBorder]="false"
                [captionlines]="userState.user.userCaptions">
              </armon-captionlines>
              <div class="d-flex flex-column align-items-end pe-2" style="min-width: 160px;">
                <span class="d-flex align-items-center text-sm">
                  <div class="status-badge" [ngStyle]="{background: userState.stateColor}"></div>
                  {{userState.stateDescription | translate}}
                </span>
                <ng-container *ngIf="userState.actionUtc">
                  <span class="text-sm mt-2">{{userState.lastActionUtcHourText}}</span>
                  <span class="text-xxs">{{userState.lastActionUtcText}}</span>
                </ng-container>
              </div>
            </div>
          </ng-container>
        </div>
      </ng-container>
    </ng-container>
    <!-- SHOW REGION -->
  </ng-container>
</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">{{'REPORT.REGION'|translate}}</span>
      <div class="row">
        <div class="col-12 mb-3">
          <label class="report-form-label">{{'REPORT.REGION'|translate}}</label>
          <armon-select-search query="region" [allowMulti]="false" [(ngModel)]="selectedRegionId">
          </armon-select-search>
        </div>
        <div class="col-12 mb-3">
          <label class="report-form-label">{{'REPORT.STATUS' | translate}}</label>
          <nz-select class="w-100" [(ngModel)]="selectedStates" nzMode="multiple"
            nzPlaceHolder="{{'COMMON.ALL'|translate}}" nzSize="small">
            <nz-option *ngFor="let option of stateTypes" [nzValue]="option.type" [nzLabel]="option.description |
              translate"></nz-option>
          </nz-select>
        </div>
        <div class="col-12 mb-3" *ngIf="permissionSearchOrganizationUnit">
          <label class="report-form-label">{{'REPORT.ORGANIZATION_UNITS' | translate}}</label>
          <armon-select-search query="unit" [allowMulti]="true" [(ngModel)]="selectedOrganizationUnitIds">
          </armon-select-search>
          <label class="report-checkbox-label" nz-checkbox
            *ngIf="selectedOrganizationUnitIds && selectedOrganizationUnitIds.length > 0"
            [(ngModel)]="selectedApplyOrganizationUnitFilterHierarchically">{{'REPORT.SHOW_HIERARCHICALLY' |
            translate}}</label>
        </div>
        <div class="col-12 mb-3" *ngIf="permissionSearchIdentity">
          <label class="report-form-label">{{'REPORT.IDENTITIES' | translate :
            languageService.userTranslate}}</label>
          <armon-select-search query="identity" [allowMulti]="true" [(ngModel)]="selectedUserIds">
          </armon-select-search>
        </div>
        <div class="col-12 mb-3" *ngIf="permissionSearchUserGroup">
          <label class="report-form-label">{{'REPORT.USER_GROUPS' | translate :
            languageService.userTranslate}}</label>
          <armon-select-search query="group" [allowMulti]="true" [(ngModel)]="selectedUserGroupIds">
          </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-2"
        (click)="onCancelClicked($event)">{{'BUTTON.CANCEL'|translate}}</button>
      <button class="btn btn-primary btn-sm" [disabled]="selectedRegionId === null"
        (click)="onConfirmClicked($event)">{{'BUTTON.OK'|translate}}</button>
    </div>
  </div>
</ng-template>`;var Un=`.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}.widget-host-container,:host{display:block;position:relative;padding:6px;width:100%;height:100%;color:#0a2a5a}.widget-data-container{width:100%;height:100%;padding:12px;position:relative}@media screen and (max-width: 768px){.widget-data-container{padding:6px}}.widget-data-container .widget-button-container{position:absolute;right:6px;top:6px;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex}.widget-data-container .widget-header-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;padding-right:48px}.widget-data-container .widget-header-container .widget-title{font-size:14px;line-height:14px;color:#0a2a5a;margin-bottom:6px;font-weight:500}.widget-data-container .widget-header-container .widget-sub-title{font-size:9px;line-height:10px;color:#999}.widget-data-container .widget-settings-container{position:absolute;inset:0;background-color:#fff;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;padding:12px}.widget-data-container .widget-settings-container .widget-settings-title{font-size:12px;line-height:12px;color:#0a2a5a;margin-bottom:12px}.widget-data-container .widget-settings-container .widget-settings-label{font-size:12px;line-height:12px;color:#999;margin-bottom:6px}:host .items-container{height:-webkit-calc(100% - 240px);height:-moz-calc(100% - 240px);height:calc(100% - 240px);overflow-y:auto}:host .item-container{-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem;box-shadow:0 0 2px #ccc}:host .chart-container{display:block;margin-top:6px;margin-bottom:6px;padding:6px;height:180px;width:180px}:host .status-badge{height:10px;width:10px;border-radius:50%;margin-right:4px}
`;var hr=function(r,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(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(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},Xt=class{translate;regionService;routingService;authService;socketService;languageService;drawerService;drawerTemplate;drawerRef;visibleComponent=!0;widgetData;widgetId;dataUpdated=new w;hideClicked=new w;viewState=1;regionState=null;regionLastUpdateDateText;refreshTimer;subscriptionRegionEmergencyState;selectedRegionId=null;selectedOrganizationUnitIds=null;selectedStates=null;selectedApplyOrganizationUnitFilterHierarchically;selectedUserIds=null;selectedUserGroupIds=null;permissionSearchOrganizationUnit;permissionSearchIdentity;permissionSearchUserGroup;pieChartOptions={type:j.PieChart,animationDuration:100,margin:0,innerRadiusRatio:.5,showLabels:!0,centerValueFontSize:24,clickable:!0};visibleChart=!1;translated;stateRatioData;stateRatioChartData;stateRatioChartColors;stateRatioChartLabels;constructor(e,t,i,s,n,o,a){this.translate=e,this.regionService=t,this.routingService=i,this.authService=s,this.socketService=n,this.languageService=o,this.drawerService=a}get stateTypes(){return Ys}ngOnInit(){this.subscriptionRegionEmergencyState=this.socketService.onRegionEmergencyStateReceived.subscribe(e=>{e&&this.regionState&&e.rid==this.regionState.detail.id&&(this.regionState.detail.emergencyState=e.s,this.regionState.detail.isEmergency=rs.getIsEmergency(this.regionState.detail.emergencyState))}),this.permissionSearchOrganizationUnit=this.authService.checkPermission(b.ORGANIZATIONUNIT.getReadBasic()),this.permissionSearchIdentity=this.authService.checkPermission(b.IDENTITY.getReadBasic()),this.permissionSearchUserGroup=this.authService.checkPermission(b.USERGROUP.getRead()),this.widgetData&&this.widgetData.regionId?this.widgetData.widgetId=this.widgetId:this.widgetData=this.getEmptyData()}ngOnDestroy(){this.subscriptionRegionEmergencyState&&this.subscriptionRegionEmergencyState.unsubscribe(),this.refreshTimer&&clearTimeout(this.refreshTimer)}ngAfterViewInit(){this.getTranslations()}getEmptyData(){return{widgetId:this.widgetId,regionId:null,organizationUnitIds:null,applyOrganizationUnitFilterHierarchically:!0,userIds:null,userGroupIds:null,states:null}}getStateSummary(){let e=ks.getEmptyModel();e.organizationUnitIds=this.widgetData.organizationUnitIds,e.applyOrganizationUnitFilterHierarchically=this.widgetData.applyOrganizationUnitFilterHierarchically,e.userIds=this.widgetData.userIds,e.userGroupIds=this.widgetData.userGroupIds,e.state=this.widgetData.states,this.regionService.getRegionStateSummary(this.widgetData.regionId,e,!1).subscribe({next:t=>{this.regionState=t,this.setChartData(this.regionState),this.regionLastUpdateDateText=d.now().toFormat("HH:mm"),this.viewState=4,this.refreshTimer=setTimeout(()=>{this.controlRegion()},6e4)},error:()=>{this.widgetData=this.getEmptyData(),this.regionState=null,this.dataUpdated.emit(this.widgetData),this.viewState=3}})}getTranslations(){this.translate.get([re.getStateDescription(T.In),re.getStateDescription(T.Out),re.getStateDescription(T.Unset),"REGION.STATE_IN_USERS","REGION.STATE_OUT_USERS","REGION.STATE_UNSET_USERS"]).subscribe(e=>{this.translated=e,this.controlRegion()})}controlRegion(){if(this.refreshTimer&&clearTimeout(this.refreshTimer),this.widgetData.regionId&&this.widgetData.regionId!="")this.getStateSummary();else{let e=new ts;e.skip=0,e.take=1,this.regionService.searchRegion(e).subscribe(t=>{t&&t.total>0?this.viewState=3:this.viewState=2})}}setChartData(e){var t={values:[e.states.some(i=>i.state==T.In)?e.states.find(i=>i.state==T.In).count:0,e.states.some(i=>i.state==T.Out)?e.states.find(i=>i.state==T.Out).count:0,e.states.some(i=>i.state==T.Unset)?e.states.find(i=>i.state==T.Unset).count:0],tooltips:[this.translated["REGION.STATE_IN_USERS"],this.translated["REGION.STATE_OUT_USERS"],this.translated["REGION.STATE_UNSET_USERS"]],eventItems:[{state:T.In},{state:T.Out},{state:T.Unset}]};this.stateRatioData=t,this.stateRatioChartData={values:t.values.slice(0,2),tooltips:t.tooltips.slice(0,2),eventItems:t.eventItems.slice(0,2)},this.stateRatioChartLabels={labels:[this.translated[re.getStateDescription(T.In)],this.translated[re.getStateDescription(T.Out)],this.translated[re.getStateDescription(T.Unset)]]},this.stateRatioChartColors={colors:[re.getStateColor(T.In),re.getStateColor(T.Out),re.getStateColor(T.Unset)]},this.pieChartOptions.centerValue=(e.states.some(i=>i.state==T.In)?e.states.find(i=>i.state==T.In).count:0).toString(),this.pieChartOptions.centerLabel=this.translated[re.getStateDescription(T.In)],this.visibleChart=!0}onConfirmClicked(e){Fi(this.selectedRegionId)||(this.drawerRef.close(),this.widgetData.widgetId=this.widgetId,this.widgetData.regionId=this.selectedRegionId,this.widgetData.organizationUnitIds=Ae(this.selectedOrganizationUnitIds)?null:this.selectedOrganizationUnitIds,this.widgetData.applyOrganizationUnitFilterHierarchically=Ae(this.selectedApplyOrganizationUnitFilterHierarchically)?!0:this.selectedApplyOrganizationUnitFilterHierarchically,this.widgetData.userIds=Ae(this.selectedUserIds)?null:this.selectedUserIds,this.widgetData.userGroupIds=Ae(this.selectedUserGroupIds)?null:this.selectedUserGroupIds,this.widgetData.states=Ae(this.selectedStates)?null:this.selectedStates,this.dataUpdated.emit(this.widgetData),this.controlRegion())}onHideClicked(e){this.hideClicked.emit()}onSettingsClicked(){this.selectedRegionId=this.widgetData.regionId,this.selectedOrganizationUnitIds=this.widgetData.organizationUnitIds,this.selectedApplyOrganizationUnitFilterHierarchically=this.widgetData.applyOrganizationUnitFilterHierarchically,this.selectedUserIds=this.widgetData.userIds,this.selectedUserGroupIds=this.widgetData.userGroupIds,this.selectedStates=this.widgetData.states,this.drawerRef=this.drawerService.create({nzContent:this.drawerTemplate,nzClosable:!1,nzWidth:$(!0),nzContentParams:{value:""}})}onReportClicked(){this.routingService.gotoReportRegion(this.widgetData.regionId)}onValueClicked(e){this.routingService.gotoReportRegion(this.widgetData.regionId,e.state)}onCancelClicked(){this.drawerRef.close()}static ctorParameters=()=>[{type:D},{type:Es},{type:R},{type:E},{type:Ve},{type:Se},{type:G}];static propDecorators={drawerTemplate:[{type:P,args:["drawerTemplate"]}],widgetData:[{type:h}],widgetId:[{type:h}],dataUpdated:[{type:v}],hideClicked:[{type:v}]}};Xt=hr([p({selector:"armon-widget-region",template:$n,standalone:!0,imports:[_,u,ce,he,q,S,V,hs,ie,K,X,f],styles:[Un]})],Xt);var Gn=`<div class="widget-data-container" *ngIf="visibleComponent">
    <div class="widget-header-container">
        <span class="widget-title">{{(isSelf ? 'WIDGET.PACS_PERSONNEL_STATE_CARD_SELF' :
            'WIDGET.PACS_PERSONNEL_STATE_CARD' ) | translate}}</span>
        <span class="widget-sub-title" *ngIf="updateDate">{{'WIDGET.LAST_UPDATE_DATE' | translate}}:
            {{updateDate|date:'HH:mm'}}</span>
    </div>
    <div class="widget-button-container">
        <cds-icon shape="report" style="width: 18px; height: 18px;" (click)="onReportClicked()" nz-tooltip
            class="cursor-pointer me-2"
            nzTooltipTitle="{{'BUTTON.SHOW_REPORT' | translate}} ({{'DATEPICKER.LABEL_LAST_MONTH'|translate}})">
        </cds-icon>
        <cds-icon shape="cog" style="width: 18px; height: 18px;" *ngIf="hasSearchIdentity" (click)="onSettingsClicked()"
            class="cursor-pointer" title="{{'COMMON.SETTINGS' | translate}}">
        </cds-icon>
    </div>
    <div>
        <div class="d-flex cursor-pointer mt-2" *ngIf="currentState" (click)="onTodayDetailClicked($event)">
            <armon-captionlines class="caption-lines" [captionlines]="currentState.userCaptions" showBorder="false">
            </armon-captionlines>
            <armon-pacs-user-score class="ms-auto" *ngIf="currentState.todayDetails.summary"
                [score]="currentState.todayDetails.summary.score?currentState.todayDetails.summary.score:0">
            </armon-pacs-user-score>

        </div>
        <div class="d-flex mt-2 b-t-1 pt-3 cursor-pointer" *ngIf="currentState && currentState.todayDetails.summary"
            (click)="onTodayDetailClicked($event)" style="height: 84px;">
            <div class="d-flex align-items-center p-2 b-r-1">
                <cds-icon shape="clock" solid class="cds-icon-30"
                    [ngStyle]="{'color': currentState.currentDetails.state.color}"></cds-icon>
            </div>
            <div class="d-flex flex-column justify-content-center px-3">
                <span class="text-sm fw-medium">{{currentState.currentDetails.stateUserTitle|translate}}</span>
                <span class="text-xs fw-medium text-danger mb-1"
                    *ngIf="currentState.todayDetails.summary.isLateStart || currentState.todayDetails.summary.isEarlyExit">
                    <cds-icon shape="exclamation-triangle" class="me-1" solid size="sm"></cds-icon>
                    <span class="comma"
                        *ngIf="currentState.todayDetails.summary.isLateStart">{{'WIDGET.DAILY_PERSONNEL_START_TITLE'|translate}}</span>
                    <span class="comma"
                        *ngIf="currentState.todayDetails.summary.isEarlyExit">{{'WIDGET.DAILY_PERSONNEL_EXIT_TITLE'|translate}}</span>
                </span>
                <span class="text-xs text-italic"
                    *ngIf="currentState.currentDetails.workplan && currentState.todayDetails.summary.waitingRecalculation==false">{{currentState.currentDetails.workplan.name}}</span>
                <!-- for vertical space added waitingRecalculation check -->
                <div
                    *ngIf="currentState.currentDetails.regionsUserIn && currentState.currentDetails.regionsUserIn.length>0">
                    <ng-container *ngFor="let region of currentState.currentDetails.regionsUserIn">
                        <span class="text-xs comma">{{region}}</span>
                    </ng-container>
                </div>
                <div *ngIf="currentState.todayDetails.summary.waitingRecalculation">
                    <span>
                        <span class="spinner-grow spinner-grow-sm text-secondary"></span>
                        <span
                            class="text-40rem text-italic color-gray ms-1">{{'PACS.WAITING_CALCULATION_WAIT'|translate}}&nbsp;(
                            <ng-container
                                *ngFor="let recalculationReasonText of currentState.todayDetails.summary.recalculationReasonTexts">
                                <span class="comma">{{recalculationReasonText|translate}}</span>
                            </ng-container>)
                        </span>
                    </span>
                </div>
            </div>
        </div>
        <div class="d-flex flex-column justify-content-center align-items-center mt-3 b-t-1 pt-3"
            *ngIf="currentState && !currentState.todayDetails.summary" style="height: 84px;">
            <cds-icon shape="exclamation-triangle" solid class="color-gray mb-2" size="md"></cds-icon>
            <span class="text-xs text-italic text-center">{{'PACS.WORKPLAN_ASSIGN_USER_NOT_DEFINED'|translate}}</span>
        </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">{{'WIDGET.PACS_PERSONNEL_STATE_CARD'|translate}}</span>
            <div class="row">
                <div class="col-12 mt-3">
                    <span class="text-xs text-italic">{{'WIDGET.PACS_PERSONNEL_STATE_CARD_INFO'|translate}}</span>
                </div>
                <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"
                        allowClear="true">
                    </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-2"
                (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 jn=`.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{position:relative;display:block;width:100%;height:100%;padding:6px}:host .form-layout{width:100%!important;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-box-pack:start;-moz-box-pack:start;-webkit-flex-pack:start;-ms-flex-pack:start;-moz-justify-content:flex-start;-webkit-justify-content:flex-start;justify-content:flex-start;-webkit-flex-wrap:wrap;-moz-flex-wrap:wrap;flex-wrap:wrap;padding-top:6px;padding-bottom:6px;padding:0!important}:host .form-layout>label:not(.custom-item){width:auto;margin-right:12px;min-width:120px}@media screen and (max-width: 576px){:host .form-layout>label:not(.custom-item){width:100%;margin-right:0;margin-bottom:0}}:host .form-layout>label[unit]{margin-left:3px}@media screen and (max-width: 576px){:host .form-layout>label[unit]{flex:0}}:host .form-layout input{flex:1}:host .form-layout .select{flex:1}:host .form-layout textarea{flex:1;margin-right:0}:host .form-layout .form-item{flex:1}:host .form-layout .checkbox{flex:1}:host .form-layout .custom-item{flex:1}:host .form-layout .radio-inline-container{position:relative}:host .form-layout .form-button{margin:0 0 0 12px}:host .data-container,:host .data-container[hassearch=true],:host [hassearch=true].data-container{padding:6px 6px 0;height:100%;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 .data-container .user-selection,:host .data-container[hassearch=true] .user-selection,:host [hassearch=true].data-container .user-selection{padding:6px 0 0}:host .data-container .identity-container,:host .data-container[hassearch=true] .identity-container,:host [hassearch=true].data-container .identity-container{display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center;margin-bottom:6px;margin-top:6px;cursor:pointer}:host .data-container .work-state-container[type="1"],:host .data-container[hassearch=true] .work-state-container[type="1"],:host [hassearch=true].data-container .work-state-container[type="1"]{-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem;background-color:#edf2de;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex}:host .data-container .work-state-container[type="1"] .icon-container,:host .data-container[hassearch=true] .work-state-container[type="1"] .icon-container{padding:3px 6px;color:#88a825;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-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-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center}:host .data-container .work-state-container[type="1"] .text-container,:host .data-container[hassearch=true] .work-state-container[type="1"] .text-container{-webkit-flex-grow:1;-webkit-box-flex:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1;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-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;padding:6px 0}:host .data-container .work-state-container[type="1"] .text-container .main-text{color:#88a825;font-size:.756rem}:host .data-container .work-state-container[type="1"] .text-container .sub-text,:host .data-container .work-state-container[type="1"] .text-container .sub-text-ppermission,:host .data-container .work-state-container[type="1"] .text-container .sub-text-alert{font-size:.588rem}:host .data-container .work-state-container[type="1"] .text-container .sub-text-alert{color:#cf4a30}:host .data-container .work-state-container[type="1"] .text-container .sub-text-ppermission{color:#4c2aa8}:host .data-container .work-state-container[type="1"] .text-container .region-container{padding:6px 0 0}:host .data-container .work-state-container[type="1"] .text-container .region-container armon-icon-label{margin-right:3px}:host .data-container .work-state-container[type="2"],:host .data-container[hassearch=true] .work-state-container[type="2"],:host [hassearch=true].data-container .work-state-container[type="2"]{-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem;background-color:#e4dff2;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex}:host .data-container .work-state-container[type="2"] .icon-container,:host .data-container[hassearch=true] .work-state-container[type="2"] .icon-container{padding:3px 6px;color:#4c2aa8;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-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-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center}:host .data-container .work-state-container[type="2"] .text-container,:host .data-container[hassearch=true] .work-state-container[type="2"] .text-container{-webkit-flex-grow:1;-webkit-box-flex:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1;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-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;padding:6px 0}:host .data-container .work-state-container[type="2"] .text-container .main-text{color:#4c2aa8;font-size:.756rem}:host .data-container .work-state-container[type="2"] .text-container .sub-text,:host .data-container .work-state-container[type="2"] .text-container .sub-text-ppermission,:host .data-container .work-state-container[type="2"] .text-container .sub-text-alert{font-size:.588rem}:host .data-container .work-state-container[type="2"] .text-container .sub-text-alert{color:#cf4a30}:host .data-container .work-state-container[type="2"] .text-container .sub-text-ppermission{color:#4c2aa8}:host .data-container .work-state-container[type="2"] .text-container .region-container{padding:6px 0 0}:host .data-container .work-state-container[type="2"] .text-container .region-container armon-icon-label{margin-right:3px}:host .data-container .work-state-container[type="3"],:host .data-container[hassearch=true] .work-state-container[type="3"],:host [hassearch=true].data-container .work-state-container[type="3"]{-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem;background-color:#f8e4e0;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex}:host .data-container .work-state-container[type="3"] .icon-container,:host .data-container[hassearch=true] .work-state-container[type="3"] .icon-container{padding:3px 6px;color:#cf4a30;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-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-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center}:host .data-container .work-state-container[type="3"] .text-container,:host .data-container[hassearch=true] .work-state-container[type="3"] .text-container{-webkit-flex-grow:1;-webkit-box-flex:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1;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-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;padding:6px 0}:host .data-container .work-state-container[type="3"] .text-container .main-text{color:#cf4a30;font-size:.756rem}:host .data-container .work-state-container[type="3"] .text-container .sub-text,:host .data-container .work-state-container[type="3"] .text-container .sub-text-ppermission,:host .data-container .work-state-container[type="3"] .text-container .sub-text-alert{font-size:.588rem}:host .data-container .work-state-container[type="3"] .text-container .sub-text-alert{color:#cf4a30}:host .data-container .work-state-container[type="3"] .text-container .sub-text-ppermission{color:#4c2aa8}:host .data-container .work-state-container[type="3"] .text-container .region-container{padding:6px 0 0}:host .data-container .work-state-container[type="3"] .text-container .region-container armon-icon-label{margin-right:3px}:host .data-container[hassearch=true],:host [hassearch=true].data-container{padding:0 6px}:host .navigation-container{margin-top:auto}:host .no-info-container{width:100%;height:100%;text-align:center;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items: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}:host .no-info-container .message{color:#0a2a5a;margin:24px 0}
`;var gr=function(r,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(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(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},Kt=class{pacsService;authService;sessionService;languageService;modalService;drawerService;drawerTemplate;drawerRef;widgetData;widgetId;currentState=null;visibleComponent=!1;isSelf=!0;hasSearchIdentity=!1;selectedIdentityId;updateDate;refreshTimer;dataUpdated=new w;constructor(e,t,i,s,n,o){this.pacsService=e,this.authService=t,this.sessionService=i,this.languageService=s,this.modalService=n,this.drawerService=o}ngOnInit(){this.hasSearchIdentity=this.authService.checkPermission(b.ATTENDANCEPLAN.getRead()&&b.IDENTITY.getReadBasic()),this.widgetData||(this.widgetData={widgetId:this.widgetId,identityId:null}),this.getUserData(this.widgetData.identityId)}ngOnDestroy(){this.refreshTimer&&clearTimeout(this.refreshTimer)}getUserData(e=null){this.refreshTimer&&clearTimeout(this.refreshTimer),e?this.isSelf=!1:(this.isSelf=!0,e=this.sessionService.currentUserId),this.pacsService.getCurrentStateUser(e,!1).subscribe(t=>{this.currentState=t,this.visibleComponent=!0,this.updateDate=new Date,this.refreshTimer=setTimeout(()=>{this.getUserData(this.widgetData.identityId)},18e4)})}onReportClicked(e){this.modalService.open(_t,{settings:{size:"lg"},props:{userId:this.isSelf?null:this.widgetData.identityId,userCaptions:this.currentState.userCaptions}}).result.then(t=>{}).catch(t=>{})}onTodayDetailClicked(e){this.modalService.open(Bs,{settings:{size:"xl"},props:{userId:this.widgetData.identityId,dayDateTime:d.fromJSDate(this.currentState.date),dailyRecord:this.currentState.todayDetails.summary?this.currentState.todayDetails.summary:null}}).result.then(t=>{}).catch(t=>{})}onSettingsClicked(){this.selectedIdentityId=this.widgetData.identityId||null,this.drawerRef=this.drawerService.create({nzContent:this.drawerTemplate,nzClosable:!1,nzWidth:$(!0),nzContentParams:{value:""}})}onCancelClicked(){this.drawerRef.close()}onSaveClicked(){this.currentState=null,this.widgetData.identityId=this.selectedIdentityId,this.drawerRef.close(),this.dataUpdated.emit({widgetId:this.widgetId,identityId:this.widgetData.identityId}),setTimeout(()=>{this.getUserData(this.widgetData.identityId)},500)}static ctorParameters=()=>[{type:N},{type:E},{type:B},{type:Se},{type:U},{type:G}];static propDecorators={drawerTemplate:[{type:P,args:["drawerTemplate"]}],widgetData:[{type:h}],widgetId:[{type:h}],dataUpdated:[{type:v}]}};Kt=gr([p({selector:"armon-widget-pacs-personnel",template:Gn,standalone:!0,imports:[u,q,K,zt,V,S,X,_,ft,f],styles:[jn]})],Kt);var Fn=`<div class="widget-data-container" *ngIf="visibleComponent && countsData">
    <div class="widget-header-container">
        <span
            class="widget-title">{{(widgetData?.registrationPointName?widgetData.registrationPointName:'VISITOR.REGISTRATION_ALL_POINTS_TITLE')|translate}}</span>
        <span class="widget-sub-title text-truncate">{{'WIDGET.VISIT_COUNT_CARD'|translate}}</span>
    </div>
    <div class="widget-button-container">
        <cds-icon shape="report" style="width: 18px; height: 18px;" (click)="onAccessLogClicked()" nz-tooltip
            class="cursor-pointer me-2" nzTooltipTitle="{{'BUTTON.SHOW_ALL' | translate}}">
        </cds-icon>
        <cds-icon shape="cog" style="width: 18px; height: 18px;" (click)="onSettingsClicked()" class="cursor-pointer"
            title="{{'COMMON.SETTINGS' | translate}}">
        </cds-icon>
    </div>
    <div class="data-container mt-4" *ngIf="visibleComponent && countsData">
        <div class="data-part-container">
            <div class="value-container">
                <span class="title">
                    {{'WIDGET.VISIT_ACTIVE_COUNT'|translate}}
                </span>
                <span class="value">
                    {{countsData.totalActiveVisit}}
                </span>
            </div>
            <div class="value-container border-left">
                <span class="title">
                    {{'WIDGET.VISIT_TERMINATED_COUNT'|translate}}
                </span>
                <span class="value">
                    {{countsData.totalTerminatedVisit}}
                </span>
            </div>
        </div>
        <div class="d-flex flex-column mt-3 py-2 b-t-1">
            <ng-container *ngFor="let listVisitor of listVisitors">
                <div class="d-flex flex-row my-2">
                    <div class="d-flex flex-column w-25">
                        <span class="text-sm fw-medium">{{listVisitor.visitStartUtcHourText}} -
                            {{listVisitor.visitEndUtcHourText}}</span>
                        <span class="text-xs">{{listVisitor.visitStartUtcText}}</span>
                    </div>
                    <div class="w-75 d-flex flex-row align-items-center">
                        <div class="visitor-icon d-flex justify-content-center align-items-end me-2" nz-tooltip
                            nzTooltipTitle="{{'AUTHENTICATORTYPE.VISITOR' | translate}}">
                            <span
                                class="text-uppercase text-bold text-sm">{{'AUTHENTICATORTYPE.VISITOR_CHAR'|translate}}</span>
                        </div>
                        <div class="d-flex flex-column justify-content-center">
                            <span class="text-sm">
                                {{listVisitor.visitorNameSurname}}
                            </span>
                            <span class="text-xs text-italic"
                                *ngIf="listVisitor.visitorFields">{{listVisitor.visitorFields}}</span>
                        </div>
                    </div>
                </div>
            </ng-container>
            <div *ngIf="listVisitors && listVisitors.length==0" class="mt-5">
                <nz-empty nzNotFoundImage="simple" [nzNotFoundContent]="null"></nz-empty>
            </div>
        </div>
    </div>
</div>
<div class="no-info-container" *ngIf="visibleComponent && countsData==null">
    <p class="p2 message">
        <cds-icon shape="info-standard"></cds-icon>
        {{'WIDGET.NO_WIDGET_DATA_INFO' | translate}}
    </p>
</div>

<ng-template #drawerTemplate let-data let-drawerRef="drawerRef">
    <div class="row">
        <div class="col-12 mb-3">
            <span class="text-lg mb-2">{{'WIDGET.VISIT_COUNT_CARD'|translate}}</span>
        </div>
        <div class="col-12 d-flex flex-column">
            <armon-date-picker [options]="datePickerOptions" (selectionChanged)="onDateSelectionChanged($event)">
            </armon-date-picker>
        </div>
        <div class="col-12 d-flex flex-column">
            <div class="w-100 mt-3">
                <label class="report-form-label">{{'VISITOR.REGISTRATION_POINT_TITLE' | translate}}</label>
                <armon-select-search query="registrationpoint" [allowMulti]="false" [allowClear]="true"
                    (onSelectedChanged)="onPointSelected($event)" [(ngModel)]="selectedRegistrationPointId">
                </armon-select-search>
            </div>
        </div>
        <div class="col-12 d-flex justify-content-end mt-3">
            <button class="btn btn-sm btn-outline-primary me-2"
                (click)="onCancelClicked($event)">{{'BUTTON.CANCEL'|translate}}</button>
            <button class="btn btn-sm btn-primary" (click)="onSaveClicked($event)">{{'BUTTON.SAVE'|translate}}</button>
        </div>
    </div>
</ng-template>`;var Vn=`.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{position:relative;display:block;width:100%;height:100%;padding:6px}:host .data-container{width:100%;height:90%;display:block;position:relative;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 .data-container .data-part-container{display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex}:host .data-container .data-part-container .value-container{-webkit-flex-basis:50%;-moz-flex-basis:50%;-ms-flex-preferred-size:50%;flex-basis:50%;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-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;-webkit-box-align:start;-ms-flex-align:start;-webkit-align-items:flex-start;-moz-align-items:flex-start;align-items:flex-start}:host .data-container .data-part-container .value-container .title{font-size:.714rem;line-height:.6rem}:host .data-container .data-part-container .value-container .value{font-size:1.4rem;line-height:1.5rem}:host .data-container .data-part-container .value-container .value[clickable=true]{cursor:pointer}:host .data-container .data-part-container .value-container .btn{margin-left:auto}:host .data-container .data-part-container .border-left{padding-left:12px;border-left:1px solid rgba(10,42,90,.2)}:host .data-container .data-part-container[myself=true]{background-color:#4c2aa80d;-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem}:host .data-container .data-part-container[myself=true] .value-container{color:#4c2aa8}:host .data-container .data-part-container[myself=true] .value-container .value{font-size:1.6rem;line-height:1.7rem}:host .no-info-container{width:100%;height:100%;text-align:center;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items: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}:host .no-info-container .message{color:#0a2a5a;margin:24px 0}:host .visitor-icon{-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;width:1.092rem;height:1.092rem;box-shadow:0 0 4px #aaa;background-color:#fc0}
`;var xr=function(r,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(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(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},Zt=class{router;drawerService;reportService;routingService;visitorService;drawerTemplate;drawerRef;datePickerOptions=new yt;countsData=null;updateTime=null;visibleComponent=!1;selectedRegistrationPointId=null;selectedRegistrationPointName=null;subscriptionGetData;dataRequest;datePickerSelection;listFilter;listVisitors;requestInterval;widgetData;widgetId;dataUpdated=new w;constructor(e,t,i,s,n){this.router=e,this.drawerService=t,this.reportService=i,this.routingService=s,this.visitorService=n}ngOnInit(){this.datePickerOptions.items=[{type:ee.Today,selected:!0},{type:ee.SelectDay}],this.dataRequest=new fi;let e=tt.getDateSelection(this.datePickerOptions.items[0]);this.setDateSelection(e),this.startSubscriptionInterval()}ngOnDestroy(){this.requestInterval&&clearInterval(this.requestInterval),this.subscriptionGetData&&this.subscriptionGetData.unsubscribe()}startSubscriptionInterval(){this.requestInterval&&clearInterval(this.requestInterval),this.subscriptionGetData&&this.subscriptionGetData.unsubscribe(),this.requestInterval=setInterval(()=>{this.getData()},6e4),this.getData()}onDateSelectionChanged(e){this.drawerRef&&this.drawerRef.close(),this.setDateSelection(e),this.startSubscriptionInterval()}setDateSelection(e){this.datePickerSelection=e,this.dataRequest||(this.dataRequest=new fi),this.dataRequest.date=d.fromJSDate(e.startDate).toFormat("yyyy-MM-dd"),this.startSubscriptionInterval()}getData(){this.subscriptionGetData&&this.subscriptionGetData.unsubscribe(),this.dataRequest.visitorRegistrationPointId=this.widgetData?.registrationPointId?this.widgetData?.registrationPointId:null,this.subscriptionGetData=this.visitorService.getDashboardVisitCounts(this.dataRequest).subscribe(e=>{this.countsData=e,this.updateTime=new Date,this.visibleComponent=!0,this.listFilter||this.createListFilter(),this.getVisitorList()})}createListFilter(){this.listFilter=new Cs,this.listFilter.skip=0,this.listFilter.take=10,this.listFilter.type=qs.All}getVisitorList(){this.listFilter.startUtc=this.datePickerSelection.startDate,this.listFilter.endUtc=this.datePickerSelection.endDate,this.listFilter.visitorRegistrationPointId=this.widgetData?.registrationPointId?this.widgetData.registrationPointId:null,this.reportService.getTerminatedVisitsReport(this.listFilter,!1,!1).subscribe(e=>{let t=[],i=e.fields.filter(s=>!(s.reportableInDetail&&s.reportableInDetail==!0));e.items.forEach(s=>{let n=[];i.forEach(o=>{o.name!=Qe.VISITOR.Name&&o.type!=5&&s.visitorProfileFields[o.name]&&n.push(s.visitorProfileFields[o.name])}),t.push({visitorNameSurname:s.visitorProfileFields[Qe.VISITOR.Name],visitEndUtcHourText:s.visitEndUtcHourText,visitStartUtcHourText:s.visitStartUtcHourText,visitStartUtcText:s.visitStartUtcText,visitorFields:n&&n.length>0?n.join(", "):null})}),this.listVisitors=t})}onAccessLogClicked(e){this.routingService.gotoVisitorReport(null,this.widgetData?.registrationPointId?this.widgetData.registrationPointId:null)}onSettingsClicked(){this.selectedRegistrationPointId=this.widgetData?.registrationPointId?this.widgetData.registrationPointId:null,this.drawerRef=this.drawerService.create({nzContent:this.drawerTemplate,nzClosable:!1,nzWidth:$(!1),nzContentParams:{value:""}})}onCancelClicked(){this.drawerRef.close()}onPointSelected(e){e&&(this.selectedRegistrationPointName=e.optionLabel)}onSaveClicked(){this.drawerRef.close(),this.widgetData={registrationPointId:this.selectedRegistrationPointId,registrationPointName:this.selectedRegistrationPointId?this.selectedRegistrationPointName:null},this.dataUpdated.emit({registrationPointId:this.widgetData.registrationPointId,registrationPointName:this.widgetData.registrationPointName,widgetId:this.widgetId}),this.subscriptionGetData&&this.subscriptionGetData.unsubscribe(),this.startSubscriptionInterval()}static ctorParameters=()=>[{type:me},{type:G},{type:Rt},{type:R},{type:te}];static propDecorators={drawerTemplate:[{type:P,args:["drawerTemplate"]}],widgetData:[{type:h}],widgetId:[{type:h}],dataUpdated:[{type:v}]}};Zt=xr([p({selector:"armon-widget-visit-counts",template:Fn,standalone:!0,imports:[u,q,S,cs,kt,X,_,f],styles:[Vn]})],Zt);var Hn=`<div class="widget-data-container pos-relative">

    <div class="widget-header-container">
        <span class="widget-title">{{'ANALYZE.VISITOR_PRE_REGISTRATION'|translate}}<div
                class="spinner-grow spinner-grow-sm text-secondary ms-2" role="status" *ngIf="visibleSpinner"></div>
        </span>
        <span class="widget-sub-title">{{'DATEPICKER.LABEL_LAST_MONTH'|translate}} ({{dates}})</span>
    </div>
    <div class="widget-button-container">
        <cds-icon shape="analysis_charts" style="width: 18px; height: 18px;" (click)="onDetailClicked()"
            title="{{'ANALYZE.DETAILED'|translate}} - {{'PAGES.ANALYSIS_VISITOR_REGISTRATION' | translate}}"></cds-icon>
    </div>
    <div class="chart-container" *ngIf="visibleChart">
        <div class="pie-chart-container">
            <div class="info-area">
                <span class="title"
                    style="color: #254A81;">{{'ANALYZE.VISITOR_PRE_REGISTRATION_RATIO'|translate}}</span>
                <span class="count">{{registrationRatioChartData.values[0]}}</span>
                <span class="count-label mb-3">{{'ANALYZE.VISITOR_PRE_REGISTRATION_COUNTS'|translate}}</span>
                <span class="count">{{registrationRatioChartData.values[1]}}</span>
                <span class="count-label">{{'ANALYZE.VISITOR_NO_PRE_REGISTRATION_COUNTS'|translate}}</span>
            </div>
            <div class="chart-area">
                <d3-pie-chart [chartData]="registrationRatioChartData" [chartLabels]="registrationRatioChartLabels"
                    [chartColors]="registrationRatioChartColors" [chartOptions]="pieChartOptions"
                    (valueClicked)="onValueClicked($event)"></d3-pie-chart>
            </div>
        </div>
        <div class="pie-chart-container">
            <div class="info-area">
                <span class="title"
                    style="color: #D97D0D;">{{'ANALYZE.VISITOR_PRE_REGISTRATION_COMPLETE_RATIO'|translate}}</span>
                <span class="count">{{preRegistrationRatioChartData.values[0]}}</span>
                <span class="count-label mb-3">{{'ANALYZE.VISITOR_PRE_REGISTRATION_COMPLETE_COUNTS'|translate}}</span>
                <span class="count">{{preRegistrationRatioChartData.values[1]}}</span>
                <span class="count-label">{{'ANALYZE.VISITOR_PRE_REGISTRATION_EXPIRED_COUNTS'|translate}}</span>
            </div>
            <div class="chart-area">
                <d3-pie-chart [chartData]="preRegistrationRatioChartData"
                    [chartLabels]="preRegistrationRatioChartLabels" [chartColors]="preRegistrationRatioChartColors"
                    [chartOptions]="pieChartOptions" (valueClicked)="onValueClicked($event)"></d3-pie-chart>
            </div>
        </div>
        <div class="pie-chart-container">
            <div class="info-area">
                <span class="title"
                    style="color: #025930;">{{'ANALYZE.VISITOR_PRE_REGISTRATION_OWNER_RATIO'|translate}}</span>
                <span class="count">{{ownerPreRegistrationRatioChartData.values[0]}}</span>
                <span class="count-label mb-3">{{'ANALYZE.VISITOR_PRE_REGISTRATION_PERSONNEL_COUNTS'|translate}}</span>
                <span class="count">{{ownerPreRegistrationRatioChartData.values[1]}}</span>
                <span class="count-label">{{'ANALYZE.VISITOR_PRE_REGISTRATION_SECURITY_COUNTS'|translate}}</span>
            </div>
            <div class="chart-area">
                <d3-pie-chart [chartData]="ownerPreRegistrationRatioChartData"
                    [chartLabels]="ownerPreRegistrationRatioChartLabels"
                    [chartColors]="ownerPreRegistrationRatioChartColors" [chartOptions]="pieChartOptions"
                    (valueClicked)="onValueClicked($event)"></d3-pie-chart>
            </div>
        </div>
    </div>
</div>`;var Yn=`.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}.widget-host-container,:host{display:block;position:relative;padding:6px;width:100%;height:100%;color:#0a2a5a}.widget-data-container{width:100%;height:100%;padding:12px;position:relative}@media screen and (max-width: 768px){.widget-data-container{padding:6px}}.widget-data-container .widget-button-container{position:absolute;right:6px;top:6px;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex}.widget-data-container .widget-header-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;padding-right:48px}.widget-data-container .widget-header-container .widget-title{font-size:14px;line-height:14px;color:#0a2a5a;margin-bottom:6px;font-weight:500}.widget-data-container .widget-header-container .widget-sub-title{font-size:9px;line-height:10px;color:#999}.widget-data-container .widget-settings-container{position:absolute;inset:0;background-color:#fff;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;padding:12px}.widget-data-container .widget-settings-container .widget-settings-title{font-size:12px;line-height:12px;color:#0a2a5a;margin-bottom:12px}.widget-data-container .widget-settings-container .widget-settings-label{font-size:12px;line-height:12px;color:#999;margin-bottom:6px}:host .widget-header{width:100%;height:70px;min-height:70px;padding:6px 0 6px 6px;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;color:#0a2a5a;border-bottom:1px solid #ddd}:host .widget-header .sub-title{margin-top:18px;font-size:.588rem;line-height:.5rem}:host .chart-container{display:block;margin-top:18px;padding:0;height:540px}:host .chart-container .pie-chart-container{height:182px;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-border-radius:.56rem;-moz-border-radius:.56rem;border-radius:.56rem;margin:6px 0;border:1px solid #eee}:host .chart-container .pie-chart-container .info-area{-webkit-flex-grow:1;-webkit-box-flex:1;-moz-flex-grow:1;-ms-flex-positive:1;flex-grow:1;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;padding:18px 6px 18px 18px}:host .chart-container .pie-chart-container .info-area .title{color:#666;font-size:14px;line-height:16px;margin-bottom:auto}:host .chart-container .pie-chart-container .info-area .count{color:#ccc;font-weight:500;font-size:24px;line-height:24px}:host .chart-container .pie-chart-container .info-area .count-label{color:#999;font-size:9px;line-height:9px}:host .chart-container .pie-chart-container .chart-area{width:180px;min-width:180px}:host .no-info-container{width:100%;height:100%;text-align:center;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items: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}:host .no-info-container .message{color:#0a2a5a;margin:24px 0}
`;var yr=function(r,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(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(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},Jt=class{translate;routingService;visitorService;visibleChart=!1;visibleSpinner=!0;subscriptionGetData;translated;dates;pieChartOptions={type:j.PieChart,animationDuration:300,drawAfterResize:!1,margin:18,centerLabelFontSize:11,innerRadiusRatio:.8};request;registrationRatioChartData;registrationRatioChartColors;registrationRatioChartLabels;preRegistrationRatioChartData;preRegistrationRatioChartColors;preRegistrationRatioChartLabels;ownerPreRegistrationRatioChartData;ownerPreRegistrationRatioChartColors;ownerPreRegistrationRatioChartLabels;constructor(e,t,i){this.translate=e,this.routingService=t,this.visitorService=i}ngOnInit(){this.request=Et.getEmptyModel(),this.request.startDate=d.local().minus({days:30}).startOf("day").toJSDate(),this.request.endDate=d.local().endOf("day").toJSDate(),this.dates=d.fromJSDate(this.request.startDate).toLocaleString(d.DATETIME_MED)+" / "+d.fromJSDate(this.request.endDate).toLocaleString(d.DATETIME_MED)}ngOnDestroy(){this.subscriptionGetData&&this.subscriptionGetData.unsubscribe()}ngAfterViewInit(){this.getTranslations()}getTranslations(){this.translate.get(["ANALYZE.VISITOR_PRE_REGISTRATION_COUNTS","ANALYZE.VISITOR_NO_PRE_REGISTRATION_COUNTS","ANALYZE.VISITOR_PRE_REGISTRATION_COMPLETE_COUNTS","ANALYZE.VISITOR_PRE_REGISTRATION_EXPIRED_COUNTS","ANALYZE.VISITOR_PRE_REGISTRATION_PERSONNEL_COUNTS","ANALYZE.VISITOR_PRE_REGISTRATION_SECURITY_COUNTS"]).subscribe(e=>{this.translated=e,this.getData()})}getData(){this.visitorService.getPreRegisterAnalysis(this.request,!1).subscribe(e=>{this.setChartData(e)})}setChartData(e){this.registrationRatioChartData={values:[e.periodTotalVisitFromPreregistration,e.periodTotalVisitWithoutPreregistration],tooltips:[this.translated["ANALYZE.VISITOR_PRE_REGISTRATION_COUNTS"],this.translated["ANALYZE.VISITOR_NO_PRE_REGISTRATION_COUNTS"]]},this.registrationRatioChartLabels={labels:[this.translated["ANALYZE.VISITOR_PRE_REGISTRATION_COUNTS"],this.translated["ANALYZE.VISITOR_NO_PRE_REGISTRATION_COUNTS"]]},this.registrationRatioChartColors={colors:["#254A81","#759AD1"]},this.preRegistrationRatioChartData={values:[e.periodTurnedIntoVisit,e.periodExpiredPreregistrations],tooltips:[this.translated["ANALYZE.VISITOR_PRE_REGISTRATION_COMPLETE_COUNTS"],this.translated["ANALYZE.VISITOR_PRE_REGISTRATION_EXPIRED_COUNTS"]]},this.preRegistrationRatioChartLabels={labels:[this.translated["ANALYZE.VISITOR_PRE_REGISTRATION_COMPLETE_COUNTS"],this.translated["ANALYZE.VISITOR_PRE_REGISTRATION_EXPIRED_COUNTS"]]},this.preRegistrationRatioChartColors={colors:["#D97D0D","#F2AB27"]},this.ownerPreRegistrationRatioChartData={values:[e.periodSelfPreregistered,e.periodSecurityPreregistered],tooltips:[this.translated["ANALYZE.VISITOR_PRE_REGISTRATION_PERSONNEL_COUNTS"],this.translated["ANALYZE.VISITOR_PRE_REGISTRATION_SECURITY_COUNTS"]]},this.ownerPreRegistrationRatioChartLabels={labels:[this.translated["ANALYZE.VISITOR_PRE_REGISTRATION_PERSONNEL_COUNTS"],this.translated["ANALYZE.VISITOR_PRE_REGISTRATION_SECURITY_COUNTS"]]},this.ownerPreRegistrationRatioChartColors={colors:["#025930","#04BF8A"]},this.visibleChart=!0,this.visibleSpinner=!1}onDetailClicked(e){this.routingService.gotoAnalysisVisitorPreRegistration()}static ctorParameters=()=>[{type:D},{type:R},{type:te}]};Jt=yr([p({selector:"armon-widget-visitor-preregistration",template:Hn,standalone:!0,imports:[u,ie,f],styles:[Yn]})],Jt);var Bn=`<div class="widget-data-container pos-relative">\r
    <div class="widget-header-container">\r
        <span class="widget-title">{{'ANALYZE.VISIT_COUNTS_VISITOR_POINT'|translate}}</span>\r
        <span class="widget-sub-title">{{'DATEPICKER.LABEL_LAST_MONTH'|translate}} ({{dates}})</span>\r
    </div>\r
    <div class="widget-button-container">\r
        <cds-icon shape="analysis_charts" style="width: 18px; height: 18px;" (click)="onDetailClicked()"\r
            title="{{'ANALYZE.DETAILED'|translate}} - {{'PAGES.ANALYSIS_VISITORS' | translate}}"></cds-icon>\r
    </div>\r
    <div class="chart-container" *ngIf="visibleChart">\r
        <d3-pie-chart [chartData]="chartData" [chartLabels]="chartLabels" [chartOptions]="pieChartOptions"\r
            (valueClicked)="onValueClicked($event)"></d3-pie-chart>\r
    </div>\r
    <div class="no-info-container" *ngIf="chartData==null">\r
        <p class="d-flex flex-column align-items-center row-gap-3">\r
            <cds-icon shape="info-standard" class="cds-icon-18"></cds-icon>\r
            <span class="text-sm">{{'WIDGET.NO_WIDGET_DATA_INFO' | translate}}</span>\r
        </p>\r
    </div>\r
</div>`;var qn=`.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}.widget-host-container,:host{display:block;position:relative;padding:6px;width:100%;height:100%;color:#0a2a5a}.widget-data-container{width:100%;height:100%;padding:12px;position:relative}@media screen and (max-width: 768px){.widget-data-container{padding:6px}}.widget-data-container .widget-button-container{position:absolute;right:6px;top:6px;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex}.widget-data-container .widget-header-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;padding-right:48px}.widget-data-container .widget-header-container .widget-title{font-size:14px;line-height:14px;color:#0a2a5a;margin-bottom:6px;font-weight:500}.widget-data-container .widget-header-container .widget-sub-title{font-size:9px;line-height:10px;color:#999}.widget-data-container .widget-settings-container{position:absolute;inset:0;background-color:#fff;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;padding:12px}.widget-data-container .widget-settings-container .widget-settings-title{font-size:12px;line-height:12px;color:#0a2a5a;margin-bottom:12px}.widget-data-container .widget-settings-container .widget-settings-label{font-size:12px;line-height:12px;color:#999;margin-bottom:6px}:host .widget-header{width:100%;height:70px;min-height:70px;padding:6px 0 6px 6px;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;color:#0a2a5a;border-bottom:1px solid #DDD}:host .widget-header .sub-title{margin-top:18px;font-size:.588rem;line-height:.5rem}:host .chart-container{display:block;margin-top:36px;padding:0;height:320px}:host .no-info-container{width:100%;height:100%;text-align:center;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items: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}:host .no-info-container .message{color:#0a2a5a;margin:24px 0}
`;var kr=function(r,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(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(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},Qt=class{translate;routingService;visitorService;userId;visibleChart=!1;subscriptionGetData;total;dates;pieChartOptions={type:j.PieChart,animationDuration:200,margin:0,innerRadiusRatio:.6,showLabels:!0,legendWidth:160};translated;chartData;chartColors;chartLabels;request;registrationPoints;constructor(e,t,i){this.translate=e,this.routingService=t,this.visitorService=i}ngOnInit(){this.request=Et.getEmptyModel(),this.request.startDate=d.local().minus({days:30}).startOf("day").toJSDate(),this.request.endDate=d.local().endOf("day").toJSDate(),this.dates=d.fromJSDate(this.request.startDate).toLocaleString(d.DATETIME_MED)+" / "+d.fromJSDate(this.request.endDate).toLocaleString(d.DATETIME_MED),this.registrationPoints=this.visitorService.availableRegistrationPoints}ngOnDestroy(){this.subscriptionGetData&&this.subscriptionGetData.unsubscribe()}ngAfterViewInit(){this.getTranslations()}getTranslations(){this.translate.get(["COMMON.TOTAL"]).subscribe(e=>{this.translated=e,this.getData()})}getData(){this.subscriptionGetData=this.visitorService.getCountByVisitorPointAnalysis(this.request,!1).subscribe(e=>{this.setChartData(e)})}setChartData(e){let t=[],i=0;this.registrationPoints.forEach((s,n)=>{t[n]={},t[n].total=0,e.items.forEach((o,a)=>{let l=o.data.find(g=>g.visitorRegistrationPointId==s.id);l&&(t[n].total+=l.count),t[n].label=s.name}),i+=t[n].total}),i>0?(this.total=i,t.sort((s,n)=>s.total<n.total?1:s.total>n.total?-1:0),this.chartData={values:t.map(s=>s.total),tooltips:t.map(s=>s.label)},this.chartLabels={labels:t.map(s=>s.label)},this.pieChartOptions.centerLabel=this.translated["COMMON.TOTAL"],this.pieChartOptions.centerValue=this.total.toString(),this.visibleChart=!0):this.chartData=null}onDetailClicked(e){this.routingService.gotoAnalysisVisitors()}static ctorParameters=()=>[{type:D},{type:R},{type:te}];static propDecorators={userId:[{type:h}]}};Qt=kr([p({selector:"armon-widget-visitor-point",template:Bn,standalone:!0,imports:[u,ie,f],styles:[qn]})],Qt);var Xn=`<div class="widget-data-container pos-relative">
    <div class="widget-header-container">
        <span class="widget-title">{{'ANALYZE.VISIT_COUNTS_VISITOR_REASON'|translate}}</span>
        <span class="widget-sub-title">{{'DATEPICKER.LABEL_LAST_MONTH'|translate}} ({{dates}})</span>
    </div>
    <div class="widget-button-container">
        <cds-icon shape="analysis_charts" style="width: 18px; height: 18px;" (click)="onDetailClicked()"
            title="{{'ANALYZE.DETAILED'|translate}} - {{'PAGES.ANALYSIS_VISITORS' | translate}}"></cds-icon>
    </div>
    <div class="chart-container" *ngIf="visibleChart">
        <d3-pie-chart [chartData]="chartData" [chartLabels]="chartLabels" [chartOptions]="pieChartOptions"
            (valueClicked)="onValueClicked($event)"></d3-pie-chart>
    </div>
    <div class="no-info-container" *ngIf="chartData==null">
        <p class="d-flex flex-column align-items-center row-gap-3">
            <cds-icon shape="info-standard" class="cds-icon-18"></cds-icon>
            <span class="text-sm">{{'WIDGET.NO_WIDGET_DATA_INFO' | translate}}</span>
        </p>
    </div>
</div>`;var Kn=`.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}.widget-host-container,:host{display:block;position:relative;padding:6px;width:100%;height:100%;color:#0a2a5a}.widget-data-container{width:100%;height:100%;padding:12px;position:relative}@media screen and (max-width: 768px){.widget-data-container{padding:6px}}.widget-data-container .widget-button-container{position:absolute;right:6px;top:6px;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex}.widget-data-container .widget-header-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;padding-right:48px}.widget-data-container .widget-header-container .widget-title{font-size:14px;line-height:14px;color:#0a2a5a;margin-bottom:6px;font-weight:500}.widget-data-container .widget-header-container .widget-sub-title{font-size:9px;line-height:10px;color:#999}.widget-data-container .widget-settings-container{position:absolute;inset:0;background-color:#fff;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;padding:12px}.widget-data-container .widget-settings-container .widget-settings-title{font-size:12px;line-height:12px;color:#0a2a5a;margin-bottom:12px}.widget-data-container .widget-settings-container .widget-settings-label{font-size:12px;line-height:12px;color:#999;margin-bottom:6px}:host .widget-header{width:100%;height:70px;min-height:70px;padding:6px 0 6px 6px;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;color:#0a2a5a;border-bottom:1px solid #DDD}:host .widget-header .sub-title{margin-top:18px;font-size:.588rem;line-height:.5rem}:host .chart-container{display:block;margin-top:36px;padding:0;height:320px}:host .no-info-container{width:100%;height:100%;text-align:center;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items: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}:host .no-info-container .message{color:#0a2a5a;margin:24px 0}
`;var Tr=function(r,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(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(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},ei=class{translate;routingService;sessionService;visitorService;visibleChart=!1;subscriptionGetData;total;dates;pieChartOptions={type:j.PieChart,animationDuration:200,margin:0,innerRadiusRatio:.6,showLabels:!0,legendWidth:160};translated;chartData;chartColors;chartLabels;request;reasons;constructor(e,t,i,s){this.translate=e,this.routingService=t,this.sessionService=i,this.visitorService=s}ngOnInit(){this.request=Ss.getEmptyModel(),this.request.startDate=d.local().minus({days:30}).startOf("day").toJSDate(),this.request.endDate=d.local().endOf("day").toJSDate(),this.dates=d.fromJSDate(this.request.startDate).toLocaleString(d.DATETIME_MED)+" / "+d.fromJSDate(this.request.endDate).toLocaleString(d.DATETIME_MED);let e=this.sessionService.currentOrganization.visitorModuleSettings.visitFormFields.filter(t=>t.name==Qe.VISIT.Reason)[0];this.reasons=e.options.options}ngOnDestroy(){this.subscriptionGetData&&this.subscriptionGetData.unsubscribe()}ngAfterViewInit(){this.getTranslations()}getTranslations(){this.translate.get(["COMMON.TOTAL"]).subscribe(e=>{this.translated=e,this.getData()})}getData(){this.subscriptionGetData=this.visitorService.getCountByReasonAnalysis(this.request,!1).subscribe(e=>{this.setChartData(e)})}setChartData(e){let t=[],i=0;this.reasons.forEach((s,n)=>{t[n]={},t[n].total=0,e.items.forEach((o,a)=>{let l=o.data.find(g=>g.reason==s.value);l&&(t[n].total+=l.count),t[n].label=s.captionLines[0]}),i+=t[n].total}),i>0?(this.total=i,t.sort((s,n)=>s.total<n.total?1:s.total>n.total?-1:0),this.chartData={values:t.map(s=>s.total),tooltips:t.map(s=>s.label)},this.chartLabels={labels:t.map(s=>s.label)},this.pieChartOptions.centerLabel=this.translated["COMMON.TOTAL"],this.pieChartOptions.centerValue=this.total.toString(),this.visibleChart=!0):this.chartData=null}onDetailClicked(e){this.routingService.gotoAnalysisVisitors()}static ctorParameters=()=>[{type:D},{type:R},{type:B},{type:te}]};ei=Tr([p({selector:"armon-widget-visitor-reason",template:Xn,standalone:!0,imports:[u,ie,f],styles:[Kn]})],ei);var Zn=`<div class="row">
    <div class="col-xl-12">
        <armon-visitor-search #searchVisitor [showActiveFilter]="false" [activeFilterSelected]="false"
            (itemSelected)="onVisitorSelected($event)" (itemRemoved)="onVisitorRemoved($event)"></armon-visitor-search>
    </div>
</div>
<div class="data-container" *ngIf="summary">
    <span class="name" *ngIf="summary.name && !summary.userCaptions">
        <cds-icon shape="user" class="cds-icon-18 me-2" solid></cds-icon>{{summary.name}}
    </span>
    <armon-captionlines *ngIf="summary.userCaptions" [showBorder]="false" [isVisitor]="true"
        [captionlines]="summary.userCaptions"></armon-captionlines>
    <span class="fields mt-2" *ngIf="summary.visitFieldValues">{{summary.visitFieldValues}}</span>
    <div *ngIf="summary.profile" class="mb-2 mt-2">
        <armon-icon-label [colorCode]="7" *ngIf="summary.profile.isBlacklisted">
            <ng-template icon-label-icon>
                <cds-icon shape="no-access" solid></cds-icon>
            </ng-template>
            <ng-template icon-label-content>
                <span>{{'VISITOR.BLACK_LIST_USER'|translate}}</span>
                <span
                    *ngIf="summary.profile.isBlacklistedFuture">&nbsp;({{'VISITOR.STATE_FUTURE_DATE'|translate}})</span>
            </ng-template>
        </armon-icon-label>
        <armon-icon-label [colorCode]="8" *ngIf="summary.profile.isTempPermitted">
            <ng-template icon-label-icon>
                <cds-icon shape="success-standard" solid></cds-icon>
            </ng-template>
            <ng-template icon-label-content>
                <span>{{'VISITOR.TEMPORARY_PERMITTED_USER'|translate}}</span>
                <span
                    *ngIf="summary.profile.isTempPermittedFuture">&nbsp;({{'VISITOR.STATE_FUTURE_DATE'|translate}})</span>
            </ng-template>
        </armon-icon-label>
    </div>
    <span class="fields mt-2"
        *ngIf="summary.lastVisitText">{{'WIDGET.VISIT_VISITOR_LAST'|translate}}&nbsp;{{summary.lastVisitText}}</span>
    <span class="fields"
        *ngIf="summary.totalVisitCount">{{'WIDGET.VISIT_VISITOR_TOTAL'|translate}}&nbsp;{{summary.totalVisitCount}}</span>
    <div class="button-container">
        <button class="btn btn-sm btn-outline-primary me-2"
            (click)="onRecordsClicked()">{{'WIDGET.VISIT_VISITOR_RECORDS'|translate}}</button>
        <button class="btn btn-sm btn-outline-primary me-0"
            (click)="onProfileClicked()">{{'WIDGET.VISIT_VISITOR_PROFILE'|translate}}</button>
    </div>
</div>
<div class="no-info-container" *ngIf="!summary">
    <div class="search-info">
        <cds-icon shape="search" size="lg"></cds-icon>
        <span class="title"><strong>{{'WIDGET.VISIT_VISITOR_DETAIL' | translate}}</strong></span>
        <span class="message">{{'WIDGET.VISIT_VISITOR_DETAIL_SEARCH' | translate}}</span>
    </div>
</div>`;var Jn=`.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{position:relative;display:block;width:100%;height:100%;padding:12px}:host .data-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-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;margin-top:12px;width:100%;height:80%}:host .data-container .name{font-size:.924rem;font-weight:500;color:#0a2a5a}:host .data-container .fields{font-size:.672rem;color:#0a2a5a}:host .data-container .button-container{-ms-flex-item-align:end;-webkit-align-self:flex-end;-moz-align-self:flex-end;align-self:flex-end;margin-top:auto;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:end;-ms-flex-align:end;-webkit-align-items:flex-end;-moz-align-items:flex-end;align-items:flex-end}:host .no-info-container{width:100%;height:80%;text-align:center;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items: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}:host .no-info-container .search-info{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-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items: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}:host .no-info-container .search-info .title{color:#0a2a5a;margin:.3rem 0;font-size:.672rem}:host .no-info-container .search-info .message{color:#0a2a5a;margin:.2rem 0;font-size:.588rem}
`;var Dr=function(r,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(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(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},ti=class{routingService;sessionService;visitorService;summary=null;searchVisitor;constructor(e,t,i){this.routingService=e,this.sessionService=t,this.visitorService=i}ngOnInit(){}ngOnDestroy(){}getVisitorSummary(e){this.visitorService.getVisitorSummary(e).subscribe(t=>{Ts.setVisitFieldNames(t,this.sessionService.currentOrganization.visitorModuleSettings.visitorProfileFormFields.filter(i=>i.reportable)),this.summary=t})}onVisitorSelected(e){this.getVisitorSummary(e.id)}onVisitorRemoved(e){this.summary=null}onRecordsClicked(e){this.routingService.gotoVisitorReport(this.summary.profile.id)}onProfileClicked(e){this.routingService.gotoVisitorProfile(this.summary.profile.id)}static ctorParameters=()=>[{type:R},{type:B},{type:te}];static propDecorators={searchVisitor:[{type:P,args:["searchVisitor",{static:!0}]}]}};ti=Dr([p({selector:"armon-widget-visitor-detail",template:Zn,standalone:!0,imports:[Xs,u,K,_s,Ps,zs,f],styles:[Jn]})],ti);var Qn=`<div class="data-container" *ngIf="visibleComponent && currentState">
    <div class="data-part-container">
        <div class="value-container">
            <span class="title">
                {{'WIDGET.PERSONNEL_NOT_CAME_WITH_PERMISSION'|translate}}
            </span>
            <span class="value" [attr.clickable]="currentState.hasPPermissionCount>0"
                (click)="onPPermissionListClicked($event)">
                {{currentState.hasPPermissionCount}}
            </span>
        </div>
        <div class="value-container border-left">
            <span class="title">
                {{'WIDGET.PPERMISSON_WAITING_APPROVE'|translate}}
            </span>
            <span class="value" [attr.clickable]="currentState.waitingApprovalPPermissionCount>0"
                (click)="onPPermissionWaitingApproveListClicked($event)">
                {{currentState.waitingApprovalPPermissionCount}}
            </span>
        </div>
    </div>
    <div class="data-part-container" [attr.myself]="true">
        <div class="value-container">
            <span class="title">
                {{'WIDGET.PPERMISSON_WAITING_APPROVE_MYSELF'|translate}}
            </span>
            <span class="value" [attr.clickable]="currentState.waitingMyApprovalPPermissionCount>0"
                (click)="onPPermissionWaitingMyApproveListClicked($event)">{{currentState.waitingMyApprovalPPermissionCount}}
            </span>
        </div>
        <div class="value-container">
            <button class="btn btn-sm"
                (click)="gotoPPermissionManagement($event)">{{'PAGES.PACS_PPERMISSIONS_MANAGEMENT'|translate}}</button>
        </div>
    </div>
</div>
<div class="no-info-container" *ngIf="visibleComponent && currentState==null">
    <p class="p2 message">
        <cds-icon shape="info-standard"></cds-icon>
        {{'WIDGET.NO_WIDGET_DATA_INFO' | translate}}
    </p>
</div>
<armon-widget-pacs-signpost [currentState]="currentState"></armon-widget-pacs-signpost>`;var eo=`.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{position:relative;display:block;width:100%;height:100%;padding:6px}:host .data-container{width:100%;height:100%;display:block;position:relative;padding:6px;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}@media screen and (max-width: 768px){:host .data-container{padding:3px}}:host .data-container .data-part-container{-webkit-flex-basis:50%;-moz-flex-basis:50%;-ms-flex-preferred-size:50%;flex-basis:50%;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex}:host .data-container .data-part-container .value-container{padding:3px;margin:6px;-webkit-flex-basis:50%;-moz-flex-basis:50%;-ms-flex-preferred-size:50%;flex-basis:50%;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-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;-webkit-box-align:start;-ms-flex-align:start;-webkit-align-items:flex-start;-moz-align-items:flex-start;align-items:flex-start}:host .data-container .data-part-container .value-container .title{font-size:.714rem;line-height:.6rem}:host .data-container .data-part-container .value-container .value{font-size:1.4rem;line-height:1.5rem}:host .data-container .data-part-container .value-container .btn{margin-left:auto}:host .data-container .data-part-container .border-left{padding-left:12px;border-left:1px solid rgba(10,42,90,.2)}:host .data-container .data-part-container[myself=true]{background-color:#4c2aa80d;-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem}:host .data-container .data-part-container[myself=true] .value-container{color:#4c2aa8}:host .data-container .data-part-container[myself=true] .value-container .value{font-size:1.6rem;line-height:1.7rem}:host .no-info-container{width:100%;height:100%;text-align:center;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items: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}:host .no-info-container .message{color:#0a2a5a;margin:24px 0}
`;var to;(function(r){r[r.currentUsers=1]="currentUsers",r[r.currentDailyUsers=2]="currentDailyUsers",r[r.currentPPermissionUsers=3]="currentPPermissionUsers"})(to||(to={}));var io;(function(r){r[r.WorkingInRegionCount=1]="WorkingInRegionCount",r[r.WorkingAtDutyCount=2]="WorkingAtDutyCount",r[r.WorkingOutOfWorkplanCount=3]="WorkingOutOfWorkplanCount",r[r.WorkingWithPermissionCount=4]="WorkingWithPermissionCount",r[r.NotWorkingWithPermission=5]="NotWorkingWithPermission",r[r.NotWorkingOutOfWorkplanCount=6]="NotWorkingOutOfWorkplanCount",r[r.NotWorkingWithoutPermissionCount=7]="NotWorkingWithoutPermissionCount"})(io||(io={}));var so;(function(r){r[r.lateStartCount=1]="lateStartCount",r[r.onTimeStartCount=2]="onTimeStartCount",r[r.earlyStopCount=3]="earlyStopCount",r[r.onTimeStopCount=4]="onTimeStopCount",r[r.workingInWorkplanCount=5]="workingInWorkplanCount",r[r.workingOutOfWorkplanCount=6]="workingOutOfWorkplanCount",r[r.workingWithPermissionCount=7]="workingWithPermissionCount",r[r.notWorkingOutOfWorkplanCount=8]="notWorkingOutOfWorkplanCount",r[r.notWorkingWithPermissionCount=9]="notWorkingWithPermissionCount",r[r.notWorkingWithoutPermissionCount=10]="notWorkingWithoutPermissionCount"})(so||(so={}));var Be;(function(r){r[r.WaitingApproval=1]="WaitingApproval",r[r.WaitingMyApproval=2]="WaitingMyApproval",r[r.HasPPermission=3]="HasPPermission"})(Be||(Be={}));var no=`<div class="signpost-item">
    <clr-signpost>
        <cds-icon shape="info-standard" class="icon" solid>
        </cds-icon>
        <clr-signpost-content [clrPosition]="'bottom-left'" *clrIfOpen>
            <div class="date">{{'WIDGET.LAST_UPDATE_DATE' | translate}} :
                {{currentState.updateDate | date:'HH:mm:ss'}}</div>
            <div class="organization-title" *ngIf="currentState.isOrganizationWide">
                {{'WIDGET.ORGANIZATION_ALL_UNITS'|translate}}</div>
            <div class="organization-title" *ngIf="!currentState.isOrganizationWide">
                {{'WIDGET.ORGANIZATION_UNITS'|translate}} :</div>
            <div class="organizations" *ngIf="!currentState.isOrganizationWide">{{currentState.organizations}}</div>
        </clr-signpost-content>
    </clr-signpost>
</div>`;var oo=`.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{position:absolute!important;top:.3rem;right:.3rem;font-size:.588rem;line-height:.55rem}:host .icon{color:#d9d9d9}:host .icon:hover{cursor:pointer;color:gray}:host .date{margin-bottom:6px}:host .organization-title{margin-top:6px;margin-bottom:6px;font-weight:500}
`;var Nr=function(r,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(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(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},ii=class{currentState;constructor(){}ngOnInit(){}ngOnDestroy(){}static ctorParameters=()=>[];static propDecorators={currentState:[{type:h}]}};ii=Nr([p({selector:"armon-widget-pacs-signpost",template:no,standalone:!0,imports:[u,ft,f],styles:[oo]})],ii);var Ar=function(r,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(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(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},si=class{router;pacsService;currentState=null;visibleComponent=!1;subscriptionGetData;constructor(e,t){this.router=e,this.pacsService=t}ngOnInit(){this.getData()}ngOnDestroy(){this.subscriptionGetData&&this.subscriptionGetData.unsubscribe()}getData(){this.subscriptionGetData=this.pacsService.getCurrentPPermissionSummary(new ws).subscribe(e=>{this.currentState=e,this.visibleComponent=!0})}gotoPPermissionManagement(e){this.router.navigate([Re.PACS_PPERMISSIONS_MANAGEMENT.fullPath])}showUserList(e,t){}onPPermissionListClicked(e){this.currentState.hasPPermissionCount>0&&this.showUserList(Be.HasPPermission,"WIDGET.PERSONNEL_NOT_CAME_WITH_PERMISSION")}onPPermissionWaitingApproveListClicked(e){this.currentState.waitingApprovalPPermissionCount>0&&this.showUserList(Be.WaitingApproval,"WIDGET.PPERMISSON_WAITING_APPROVE")}onPPermissionWaitingMyApproveListClicked(e){this.currentState.waitingMyApprovalPPermissionCount>0&&this.showUserList(Be.WaitingMyApproval,"WIDGET.PPERMISSON_WAITING_APPROVE_MYSELF")}static ctorParameters=()=>[{type:me},{type:N}]};si=Ar([p({selector:"armon-widget-pacs-ppermission-organization",template:Qn,standalone:!0,imports:[u,ii,f],styles:[eo]})],si);var ro=`<ng-container *ngIf="visibleComponent">
    <armon-widget-doughnut-used-chart [widgetData]="ppermissionWidgetData" *ngIf="ppermissionWidgetData"
        [showChart]="false"></armon-widget-doughnut-used-chart>
    <div class="w-100 h-100 d-flex flex-column align-items-center p-5 justify-content-center" *ngIf="errorMessage">
        <cds-icon shape="exclamation-triangle" solid class="color-gray mb-2" size="md"></cds-icon>
        <span class="text-xs text-italic text-center">{{errorMessage}}</span>
    </div>
</ng-container>`;var ao=`.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{position:relative;display:block;width:100%;height:100%;padding:6px}
`;var lo=`<div *ngIf="visibleComponent" class="base-container">\r
    <div class="data-container" [@basicFade]="animationState">\r
        <div class="legend-container me-2">\r
            <span class="text-md text-bold mb-3">{{widgetData.items[index].title | translate}}</span>\r
            <div class="legend-left">\r
                <span class="legend-title">{{widgetData.items[index].leftTitle | translate}}</span>\r
                <span class="legend-count">{{widgetData.items[index].leftCount}}\r
                    {{widgetData.items[index].unit | translate}}</span>\r
            </div>\r
            <div class="legend-used">\r
                <span class="legend-title">{{widgetData.items[index].usedTitle | translate}}</span>\r
                <span class="legend-count">{{widgetData.items[index].usedCount}}\r
                    {{widgetData.items[index].unit | translate}}</span>\r
            </div>\r
            <div class="legend-total">\r
                <span class="legend-title">{{widgetData.items[index].totalTitle | translate}}</span>\r
                <span class="legend-count">{{widgetData.items[index].usedCount + widgetData.items[index].leftCount}} {{widgetData.items[index].unit\r
                    | translate}}</span>\r
            </div>\r
            <div class="legend-info" *ngIf="widgetData.items[index].infoText">\r
                <span class="legend-title">{{widgetData.items[index].infoTitle | translate}}</span>\r
                <span class="legend-count">{{widgetData.items[index].infoText}}</span>\r
            </div>\r
        </div>\r
        <div class="widget-container ms-2 ps-3">\r
            <d3-pie-chart [chartData]="itemChartDataList[index].chartData"\r
                [chartLabels]="itemChartDataList[index].chartLabels"\r
                [chartColors]="itemChartDataList[index].chartColors" [chartOptions]="chartOptions"\r
                (valueClicked)="onValueClicked($event)"></d3-pie-chart>\r
        </div>\r
    </div>\r
    <div class="navigation-container" *ngIf="widgetData.items && widgetData.items.length > 1">\r
        <armon-widget-navigation [total]="widgetData.items.length" (indexChanged)="indexChanged($event)">\r
        </armon-widget-navigation>\r
    </div>\r
</div>`;var co=`.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{display:block;position:relative;padding:.7rem;width:100%;height:100%;color:#0a2a5a}@media screen and (max-width: 768px){:host{padding:3px}}:host .base-container{width:100%;height:100%;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 .base-container .data-container{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}:host .base-container .data-container .widget-container{position:relative;display:block;width:50%;height:100%;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;-ms-flex-line-pack:center;-webkit-align-content:center;-moz-align-content:center;align-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}:host .base-container .data-container .legend-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;width:50%}:host .base-container .data-container .legend-container .base-legend,:host .base-container .data-container .legend-container .legend-info,:host .base-container .data-container .legend-container .legend-total,:host .base-container .data-container .legend-container .legend-used,:host .base-container .data-container .legend-container .legend-left{text-align:left;font-size:.714rem;padding:.161rem .42rem;margin:.14rem 0;background-color:#f5f9fb}:host .base-container .data-container .legend-container .base-legend .legend-title,:host .base-container .data-container .legend-container .legend-info .legend-title,:host .base-container .data-container .legend-container .legend-total .legend-title,:host .base-container .data-container .legend-container .legend-used .legend-title,:host .base-container .data-container .legend-container .legend-left .legend-title{font-size:.714rem}:host .base-container .data-container .legend-container .base-legend .legend-count,:host .base-container .data-container .legend-container .legend-info .legend-count,:host .base-container .data-container .legend-container .legend-total .legend-count,:host .base-container .data-container .legend-container .legend-used .legend-count,:host .base-container .data-container .legend-container .legend-left .legend-count{float:right;font-weight:500;font-size:.714rem}:host .base-container .data-container .legend-container .legend-info{background-color:#f9fbf6}
`;var ho=`<div class="navigation-container">
    <span *ngFor="let item of items; let itemIndex = index" [attr.selected]="index == itemIndex" class="navigation-item"
        (click)="itemClicked(itemIndex)">&#9632;</span>
</div>`;var mo=`.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 .navigation-container{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-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-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center}:host .navigation-container .navigation-item{cursor:pointer;font-size:.98rem;padding:.21rem;margin:0 .14rem;color:#3b557b}:host .navigation-container .navigation-item[selected=true]{cursor:default;color:#b6bfce}
`;var jr=function(r,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(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(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},ni=class{total;indexChanged=new w;index=0;items=[];intervalSubscription;constructor(){}ngOnInit(){this.items=Array(this.total).fill(0).map((e,t)=>t),this.startInterval()}ngOnDestroy(){}startInterval(){this.intervalSubscription=Ni(2e4).pipe().subscribe(e=>{this.gotoNextItem()})}resetInterval(){this.intervalSubscription.unsubscribe(),this.startInterval()}gotoNextItem(){this.index==this.total-1?this.itemClicked(0):this.itemClicked(this.index+1)}itemClicked(e){this.index=e,this.resetInterval(),this.indexChanged.emit(e)}static ctorParameters=()=>[];static propDecorators={total:[{type:h}],indexChanged:[{type:v}]}};ni=jr([p({selector:"armon-widget-navigation",template:ho,standalone:!0,imports:[S],styles:[mo]})],ni);var Fr=function(r,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(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(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},oi=class{translate;widgetData;showChart=!0;chartOptions={type:j.PieChart,animationDuration:300,drawAfterResize:!1,margin:12,innerRadiusRatio:.9,centerValueFontSize:24,centerLabelFontSize:12};visibleComponent=!1;itemChartDataList=[];index=0;animationState="in";constructor(e){this.translate=e}ngOnInit(){this.widgetData.items.forEach(e=>{let t={};t.chartColors={colors:[this.getColorForPercentage(e.usedCount/(e.usedCount+e.leftCount)),"#d9d9d9"]},t.chartData={values:[e.leftCount<0?0:e.leftCount,e.usedCount],tooltips:[e.leftTitle,e.usedTitle]},t.chartLabels={labels:[e.leftTitle,e.usedTitle]},this.itemChartDataList.push(t)}),this.visibleComponent=!0}getColorForPercentage(e){return e<=.3?"#a2db3c":e<=.6?"#eb8d00":"#e80c00"}indexChanged(e){this.animationState="out",setTimeout(()=>{this.index=e,this.animationState="in"},200)}static ctorParameters=()=>[{type:D}];static propDecorators={widgetData:[{type:h}],showChart:[{type:h}]}};oi=Fr([p({selector:"armon-widget-doughnut-used-chart",template:lo,animations:Os,standalone:!0,imports:[u,ie,ni,f],styles:[co]})],oi);var Vr=function(r,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(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(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},ri=class{translate;reportService;selfMode=!0;ppermissionWidgetData=null;visibleComponent=!1;errorMessage;constructor(e,t){this.translate=e,this.reportService=t}ngOnInit(){this.getPPermissionSummary()}ngOnDestroy(){}getPPermissionSummary(){this.reportService.getPacsMonthlyPPermissionSelfInfo(new Date().getFullYear(),new Date().getMonth()+1,!1).subscribe({next:e=>{e.ppermissionClaimInfoList.length>0&&(this.ppermissionWidgetData=new ss,this.translate.get(["REPORT.PACS_USER_MONTH_INFO_LEFT","REPORT.PACS_USER_MONTH_INFO_USED","REPORT.PACS_USER_MONTH_INFO_TOTAL","REPORT.PACS_USER_MONTH_INFO_NEXT_PERIOD","REPORT.PACS_UNIT_DAY","REPORT.PACS_UNIT_HOUR"]).subscribe(t=>{e.ppermissionClaimInfoList.forEach(i=>{let s=new ns;s.title=i.ppermissionType.name,s.leftCount=i.left,s.usedCount=i.used,s.leftTitle=t["REPORT.PACS_USER_MONTH_INFO_LEFT"],s.usedTitle=t["REPORT.PACS_USER_MONTH_INFO_USED"],s.totalTitle=t["REPORT.PACS_USER_MONTH_INFO_TOTAL"],i.ppermissionType.type==as.Annual&&(s.infoText=i.dueDateText,s.infoTitle=t["REPORT.PACS_USER_MONTH_INFO_NEXT_PERIOD"]),s.unit=i.ppermissionType.isDailyScheduled?t["REPORT.PACS_UNIT_DAY"]:t["REPORT.PACS_UNIT_HOUR"],this.ppermissionWidgetData.items.push(s)}),this.visibleComponent=!0}))},error:e=>{this.errorMessage=e.error.message,this.visibleComponent=!0}})}static ctorParameters=()=>[{type:D},{type:Rt}]};ri=Vr([p({selector:"armon-widget-pacs-ppermission",template:ro,standalone:!0,imports:[u,oi],styles:[ao]})],ri);var Hr=function(r,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(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(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},po="compactUp",go=class{detector;authService;sessionService;visitorService;accessControlPointService;userService;interactionService;socketService;routingService;overlays;options={itemChangeCallback:this.onItemChanged.bind(this),itemResizeCallback:this.onItemResized.bind(this),gridType:"verticalFixed",keepFixedHeightInMobile:!0,fixedRowHeight:45,swap:!0,compactType:po,mobileBreakpoint:xi.Medium,outerMargin:!0,draggable:{enabled:!1},resizable:{enabled:!1},minCols:12,maxCols:12,pushItems:!0};subscriptionServerConnection;subscriptionWindowResized;addableItems;screens={};cloneScreens={};widgetScreens;cloneWidgetScreens;selectedScreenId;isMobileView=!1;isEditMode=!1;socketConnected=!1;onKeydownHandler(e){e.key==="Escape"&&this.isEditMode&&this.onCancelClicked()}constructor(e,t,i,s,n,o,a,l,g){this.detector=e,this.authService=t,this.sessionService=i,this.visitorService=s,this.accessControlPointService=n,this.userService=o,this.interactionService=a,this.socketService=l,this.routingService=g,this.checkMobileView(),this.subscriptionWindowResized=this.interactionService.onWindowResized.subscribe(()=>{this.checkMobileView()})}ngOnInit(){this.subscriptionServerConnection=this.socketService.onServerConnectionStateChanged.subscribe(e=>{this.socketService.isSocketConnected&&(this.socketConnected=!0,this.routingService.checkDashboardAvailability(!0,this.authService.checkPermission(b.ACTIVITY.get()))&&this.getClientProfile())}),this.socketService.isSocketConnected&&(this.socketConnected=!0,this.routingService.checkDashboardAvailability(!0,this.authService.checkPermission(b.ACTIVITY.get()))&&this.getClientProfile())}ngOnDestroy(){this.socketConnected=!1,this.subscriptionServerConnection&&this.subscriptionServerConnection.unsubscribe(),this.subscriptionWindowResized&&this.subscriptionWindowResized.unsubscribe()}checkMobileView(){this.isMobileView=window.innerWidth<xi.Medium}getClientProfile(){this.userService.getOrganizationClientProfile().subscribe({next:e=>{if(e&&e.widgets){let t=[];e.widgets.forEach(i=>{i.type==O.WidgetRemoteAccessGrantedAccessControlPoints&&i.data&&i.data.accessControlPointId&&t.push(i.data.accessControlPointId)}),this.accessControlPointService.getAccessControlPointPrivileges(t).subscribe({next:i=>{e.widgets.forEach(s=>{if(s.type==O.WidgetRemoteAccessGrantedAccessControlPoints&&s.data&&s.data.accessControlPointId){let n=i.items.find(o=>o.id==s.data.accessControlPointId);(!n||n.privilege.read==!1)&&(s.data.accessControlPointId=null)}}),this.parseClientProfile(e)},error:i=>{this.parseClientProfile()}})}else this.parseClientProfile()},error:e=>{}})}parseClientProfile(e=null){if(e){let t=e.widgetVersion;(!t||t==null||t!=gi)&&(e=null)}e||(e=Qi.getEmptyModel()),(!e.widgets||e.widgets.length==0)&&(e.widgets=this.getDefaultWidgets(e.widgetScreens[0].id)),this.selectedScreenId=null,this.screens={},this.initializeScreens(e),e&&e.widgets.forEach(t=>{t.screenId&&this.widgetScreens.findIndex(i=>i.id==t.screenId)>-1&&this.screens[t.screenId].widgets.push(t)}),this.initializeWidgets()}initializeScreens(e=null){this.widgetScreens=[],e&&e.widgetScreens.forEach(t=>{this.widgetScreens.push(We(t)),this.screens[t.id]={widgets:[]}})}initializeWidgets(e=null,t=!1){e||(e=this.widgetScreens.find(s=>s.isActive).id),this.selectedScreenId=e;let i;i=this.loadWidgets(),i==null&&(i=this.getDefaultWidgets()),this.screens[e]?this.screens[e].widgets=[]:this.screens[e]={widgets:[]},i.forEach(s=>{s.authenticated=this.getAuthenticated(s.type),s.authenticated&&this.screens[e].widgets.push(s)}),this.saveWidgets()}getAuthenticated(e){switch(e){case O.WidgetActivityTimeline:return this.authService.checkPermission(b.ACCESSLOG.getReportDetailed());case O.WidgetPacsPPermission:case O.WidgetPacsPersonnel:return this.sessionService.hasModule(et.PACS);case O.WidgetPacsPerformance:case O.WidgetPacsPersonnelCount:case O.WidgetPacsPersonnelCountNow:case O.WidgetPacsMissingWork:case O.WidgetPacsExtraWork:case O.WidgetPacsPPermissionOrganization:return this.sessionService.hasModule(et.PACS)&&this.authService.checkPermission(b.ATTENDANCECONTROL.getReport());case O.WidgetVisitCounts:return this.sessionService.hasModule(et.Visitor)&&this.authService.checkPermission([b.VISITOR.getRead(),b.VISITOR.getViewVisitors()])&&this.visitorService.availableRegistrationPoints.length>0;case O.WidgetVisitorDetail:case O.WidgetVisitorReason:case O.WidgetVisitorPoint:return this.sessionService.hasModule(et.Visitor)&&this.authService.checkPermission([b.VISITOR.getRead(),b.VISITOR.getViewVisitors()]);case O.WidgetVisitorPreregistration:return this.authService.checkPermission(b.VISITOR.getViewVisitors())&&this.sessionService.currentOrganization.visitorModuleSettings&&this.sessionService.currentOrganization.visitorModuleSettings.preRegistrationAvailable;case O.WidgetRegion:return this.authService.checkPermission([b.REGION.getRead(),b.ACCESSLOG.getReportSummary(),b.IDENTITY.getReadBasic()]);default:return!0}}getMulti(e,t=!1){switch(e){case O.WidgetPacsPersonnel:return this.authService.checkPermission(b.ATTENDANCEPLAN.getRead()&&b.IDENTITY.getReadBasic());default:return t}}getDefaultWidgets(e=null){let t=[];return Le(Ki).forEach(i=>{this.getAuthenticated(i.type)&&(i.authenticated=this.getAuthenticated(i.type),i.x=0,i.y=0,i.id=Yi(),i.screenId=e||this.selectedScreenId,i.multi=this.getMulti(i.type,i.multi),t.push(i))}),t}saveWidgets(){let e=[];Object.keys(this.screens).forEach(t=>{this.screens[t].widgets.forEach(i=>{e.push(i)})}),this.userService.getOrganizationClientProfile().subscribe(t=>{let i=Le(t);i.widgetVersion=gi,i.widgets=e,i.widgetScreens=this.widgetScreens,this.userService.saveOrganizationClientProfile(i,!1).subscribe(s=>{})})}loadWidgets(){let e=[];return e=this.screens[this.selectedScreenId]?this.screens[this.selectedScreenId].widgets:[],!e||e==null?null:(this.getDefaultWidgets().forEach(i=>{e.findIndex(n=>n.type===i.type)>=0&&e.filter(o=>o.type===i.type).forEach(o=>{o.cols!=i.cols&&(o.cols=i.cols),o.rows!=i.rows&&(o.rows=i.rows)})}),e)}changeActiveScreen(e,t=!1){this.widgetScreens.forEach(i=>{i.isActive=i.id==e}),this.initializeWidgets(e,t)}deleteScreen(e){let t=this.widgetScreens.findIndex(i=>i.id==e);t>=-1&&this.widgetScreens.splice(t,1),delete this.screens[e]}enableEditMode(){Array.from(document.getElementsByClassName("widget-item")).forEach(e=>{e.classList.add("edit-mode-filter")}),this.options.draggable.enabled=!0,this.isEditMode=!0,this.options.api&&this.options.api.optionsChanged&&this.options.api.optionsChanged()}disableEditMode(){Array.from(document.getElementsByClassName("widget-item")).forEach(e=>{e.classList.remove("edit-mode-filter")}),this.options.draggable.enabled=!1,this.isEditMode=!1,this.options.api&&this.options.api.optionsChanged&&this.options.api.optionsChanged()}updateAddableItems(){this.addableItems=[],this.getDefaultWidgets().forEach(t=>{let i;this.screens[this.selectedScreenId].widgets&&this.screens[this.selectedScreenId].widgets.length>0?i=this.screens[this.selectedScreenId].widgets.findIndex(s=>s.type===t.type):i=-1,t.authenticated=this.getAuthenticated(t.type),(i==-1||t.multi)&&t.authenticated&&this.addableItems.push(t)})}onItemChanged(e,t){}onItemResized(e,t){}onHideClicked(e){if(e){switch(e.type){case O.WidgetActivityTimeline:e.data&&this.socketService.leaveActivityRoom(e.data);break}this.screens[this.selectedScreenId].widgets.splice(this.screens[this.selectedScreenId].widgets.indexOf(e),1)}this.updateAddableItems()}moveItem(e,t){let i=this.screens[this.selectedScreenId].widgets.indexOf(e),s=this.screens[this.selectedScreenId].widgets[t?i-1:i+1],n=e;this.screens[this.selectedScreenId].widgets[i]=s,this.screens[this.selectedScreenId].widgets[t?i-1:i+1]=n,this.updateAddableItems()}onUpClicked(e){this.moveItem(e,!0),this.updateAddableItems()}onDownClicked(e){this.moveItem(e,!1),this.updateAddableItems()}onAddClicked(e){let t=new Zi;Object.assign(t,Le(e)),t.screenId=this.selectedScreenId,e.authenticated&&this.screens[this.selectedScreenId].widgets.push(t),this.interactionService.showMessage("WIDGET.ADDED_TO_DASHBOARD",null,Me.Success),this.updateAddableItems()}onEditClicked(e){this.cloneScreens=We(this.screens),this.cloneWidgetScreens=this.widgetScreens.map(t=>We(t)),this.updateAddableItems(),this.enableEditMode()}onAddWidgetScreenClicked(e){let t=Ji.getEmptyModel();this.widgetScreens.push(t),this.changeActiveScreen(t.id,!0)}onWidgetScreenClicked(e,t){t.isActive==!1&&this.changeActiveScreen(t.id)}onDeleteWidgetScreenClicked(e,t){t.isActive==!1&&this.deleteScreen(t.id)}onSaveClicked(e){this.disableEditMode(),this.saveWidgets()}onCancelClicked(e){this.options&&this.options.api&&(this.options.compactType="none",this.options.api.optionsChanged()),setTimeout(()=>{this.screens=We(this.cloneScreens),this.widgetScreens=this.cloneWidgetScreens.map(t=>We(t)),this.initializeWidgets(),this.options.api.optionsChanged(),setTimeout(()=>{this.options.compactType=po,this.options.api.optionsChanged()},100),this.disableEditMode()},100)}onResetClicked(e){this.disableEditMode(),this.initializeWidgets(),this.saveWidgets()}onActivityTimelineDataUpdated(e){try{let t=this.screens[this.selectedScreenId].widgets;if(t){let i=t.find(s=>s.id===e.widgetId);i.data=e,this.saveWidgets()}}catch{}}onRemoteControlsDataUpdated(e){try{let t=this.screens[this.selectedScreenId].widgets;if(t){let i=t.find(s=>s.id===e.widgetId);i.data=e,delete i.data.widgetId,this.saveWidgets()}}catch{}}onPersonnelCountDataUpdated(e){try{let t=this.screens[this.selectedScreenId].widgets;if(t){let i=t.find(s=>s.id===e.widgetId);i.data=e.organizationUnitIds,this.saveWidgets()}}catch{}}onPersonnelCountDailyDataUpdated(e){try{let t=this.screens[this.selectedScreenId].widgets;if(t){let i=t.find(s=>s.id===e.widgetId);i.data=e.organizationUnitIds,this.saveWidgets()}}catch{}}onVisitCountsDataUpdated(e){try{let t=this.screens[this.selectedScreenId].widgets;if(t){let i=t.find(s=>s.id===e.widgetId);i.data=e,this.saveWidgets()}}catch{}}onPacsPerformanceDataUpdated(e){try{let t=this.screens[this.selectedScreenId].widgets;if(t){let i=t.find(s=>s.id===e.widgetId);i.data=e.organizationUnitIds,this.saveWidgets()}}catch{}}onPacsMissingWorkDataUpdated(e){try{let t=this.screens[this.selectedScreenId].widgets;if(t){let i=t.find(s=>s.id===e.widgetId);i.data=e,delete i.data.widgetId,this.saveWidgets()}}catch{}}onRegionDataUpdated(e){try{let t=this.screens[this.selectedScreenId].widgets;if(t){let i=t.find(s=>s.id===e.widgetId);i.data=e,delete i.data.widgetId,this.saveWidgets()}}catch{}}onPacsPersonnelDataUpdated(e){try{let t=this.screens[this.selectedScreenId].widgets;if(t){let i=t.find(s=>s.id===e.widgetId);i.data=e,delete i.data.widgetId,this.saveWidgets()}}catch{}}static ctorParameters=()=>[{type:Te},{type:E},{type:B},{type:te},{type:Ce},{type:Ds},{type:Q},{type:Ve},{type:R}];static propDecorators={overlays:[{type:Wi,args:["overlay"]}],onKeydownHandler:[{type:$i,args:["document:keydown",["$event"]]}]}};go=Hr([p({selector:"armon-dashboard",template:Zs,animations:pe,standalone:!0,imports:[Ne,u,q,S,Ge,Ue,$e,qi,ae,xe,Ie,V,ce,he,Wt,Mt,Ks,ri,Ut,si,Kt,jt,Gt,Zt,ti,ei,Qt,Jt,qt,Xt,f],styles:[Js]})],go);export{go as DashboardComponent};
