import{Aa as e,De as y,G as m,Id as b,J as h,S as f,Te as C,_a as u,bb as x,dd as g,l as d,mg as T,ya as c}from"./chunk-SKPDQO4E.js";var I=`<div class="input-group">
    <!-- Input area -->
    <input #filterInput class="form-control form-control-sm w-100" type="text" id="{{inputId}}" [disabled]="disabled"
        [(ngModel)]="filterText" placeholder="{{placeholder | translate}}" (keyup)="onKeyUp($event)"
        (paste)="onPaste($event)" [ngClass]="{'is-invalid': isInvalid}">
    <!-- Tooltip message -->
    <div class="invalid-feedback" *ngIf="tooltipCode">
        {{tooltipCode | translate:tooltipData}}
    </div>
</div>`;var _=`.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 k=function(o,t,n,r){var s=arguments.length,i=s<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(o,t,n,r);else for(var a=o.length-1;a>=0;a--)(l=o[a])&&(i=(s<3?l(i):s>3?l(t,n,i):l(t,n))||i);return s>3&&i&&Object.defineProperty(t,n,i),i},E={provide:y,useExisting:f(()=>p),multi:!0},p=class{minLength;maxLength;placeholder;required;initialText;disabled;tooltipAtTop;onlyNumber=!1;onChange;filterText;tooltipCode;tooltipData;keyPress=new d;inputId="filter-input-"+b();constructor(){}writeValue(t){t&&(this.filterText=t)}registerOnChange(t){this.onChange=t}registerOnTouched(t){}setDisabledState(t){}ngOnInit(){this.placeholder=this.placeholder||"COMMON.FILTER",this.filterText=this.initialText||""}ngAfterViewInit(){this.keyPress.pipe(m(800),h()).subscribe(t=>{this.isInvalid?this.updateValue(null):this.updateValue(this.filterText.trim())})}get isInvalid(){let t=!1;return this.tooltipCode="",this.filterText?(this.minLength!==void 0&&this.minLength!==null&&this.filterText.trim().length<this.minLength&&(t=!0,this.tooltipCode="VALIDATION.MIN_LENGTH",this.tooltipData={min:this.minLength}),this.maxLength!==void 0&&this.maxLength!==null&&this.filterText.trim().length>this.maxLength&&(t=!0,this.tooltipCode="VALIDATION.MAX_LENGTH",this.tooltipData={max:this.maxLength})):this.required===!0&&(t=!0,this.tooltipCode="VALIDATION.REQUIRED"),t}onKeyUp(t){this.keyPress.next(t)}onPaste(t){this.isInvalid||this.keyPress.next(t)}updateValue(t){this.onChange&&this.onChange(this.onlyNumber?+t:t)}static ctorParameters=()=>[];static propDecorators={minLength:[{type:e}],maxLength:[{type:e}],placeholder:[{type:e}],required:[{type:e}],initialText:[{type:e}],disabled:[{type:e}],tooltipAtTop:[{type:e}],onlyNumber:[{type:e}]}};p=k([c({selector:"armon-search-text-input",providers:[E],template:I,standalone:!0,imports:[C,T,u,x,g],styles:[_]})],p);export{p as a};
