import{a as R}from"./chunk-KCLQIV7M.js";import{Aa as d,Ab as V,Ba as u,pa as s,vb as _,xb as F}from"./chunk-YSQLW2JA.js";import{Aa as l,Te as S,bb as f,dd as v,mg as I,u as m,ya as h,zc as p}from"./chunk-SKPDQO4E.js";var C=`<div class="w-100">
  <armon-select #select [multiselect]="multiselect" [hideChips]="hideChips" [notStoreSelection]="notStoreSelection"
    [minSearchLength]="3"  uniqueField="id" descriptionField="description" moreInfoField="moreInfo" responseField="items"
    [searchFunction]="searchVisitor" [listFunction]="listVisitor" (itemSelected)="onItemSelected($event)" (itemRemoved)="onItemRemoved($event)"></armon-select>
  <div class="checkbox" *ngIf="showActiveFilter">
    <input id="activeFilterInput" customValue type="checkbox" [(ngModel)]="activeFilterSelected" name="activeFilterInput">
    <label for="activeFilterInput" class="report-form-label mt-0 mb-2">{{'VISITOR.FILTER_ACTIVE_SEARCH_VISITORS' | translate}}</label>
  </div>
</div>`;var T=`:host label{font-weight:initial}
`;var y=function(c,i,e,r){var t=arguments.length,o=t<3?i:r===null?r=Object.getOwnPropertyDescriptor(i,e):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(c,i,e,r);else for(var a=c.length-1;a>=0;a--)(n=c[a])&&(o=(t<3?n(o):t>3?n(i,e,o):n(i,e))||o);return t>3&&o&&Object.defineProperty(i,e,o),o},E=class extends F{visitorService;showActiveFilter=!1;activeFilterSelected=!1;visitStateType=s.All;constructor(i){super(),this.visitorService=i,this.searchVisitor=this.searchVisitor.bind(this),this.listVisitor=this.listVisitor.bind(this)}ngOnInit(){}ngOnChanges(i){i&&i.visitStateType&&this.triggerSearch()}listVisitor(i){let e=new u;return e.visitorProfileIds=i,e.state=this.showActiveFilter?this.activeFilterSelected?s.Active:s.All:this.visitStateType,e.skip=0,e.take=p.REQUEST_ITEM_LIMIT,this.visitorService.searchVisitorsByIds(e).pipe(m(r=>(r.items.forEach(t=>{t.matchItem&&t.matchItem!=""&&t.captionLines[0]!=t.matchItem&&(t.captionLines[0]=t.matchItem+" - "+t.captionLines[0])}),r)))}searchVisitor(i){let e=new d;return e.filter=i,e.state=this.showActiveFilter?this.activeFilterSelected?s.Active:s.All:this.visitStateType,e.skip=0,e.take=p.REQUEST_ITEM_LIMIT,this.visitorService.searchVisitorsWithState(e).pipe(m(r=>(r.items.forEach(t=>{t.matchItem&&t.matchItem!=""&&t.captionLines[0]!=t.matchItem&&(t.captionLines[0]=t.matchItem+" - "+t.captionLines[0])}),r)))}static ctorParameters=()=>[{type:_}];static propDecorators={showActiveFilter:[{type:l}],activeFilterSelected:[{type:l}],visitStateType:[{type:l}]}};E=y([h({selector:"armon-visitor-search",template:C,standalone:!0,imports:[V,f,R,S,I,v],styles:[T]})],E);export{E as a};
